// 現在のコールスタックの取得 CALLSTACK_DATA *GetCallStack() { CALLSTACK_DATA *s; if (do_not_get_callstack) { // コールスタックは取得しない return NULL; } OSLock(cs_lock); { // コールスタックの取得 s = OSGetCallStack(); } OSUnlock(cs_lock); if (s == NULL) { return NULL; } // コールスタックを 3 つ分だけ下降する s = WalkDownCallStack(s, 3); return s; }
// Get the current call stack CALLSTACK_DATA *GetCallStack() { CALLSTACK_DATA *s; if (do_not_get_callstack) { // Not to get the call stack return NULL; } OSLock(cs_lock); { // Get the call stack s = OSGetCallStack(); } OSUnlock(cs_lock); if (s == NULL) { return NULL; } // Descend in the call stack for 3 steps s = WalkDownCallStack(s, 3); return s; }