I'm trying to print the call-stack of my program, in case of an assert in the code. I'm using the following code: Win32 - Backtrace from C code (except that my stack size is 60, and the 1st parameter of CaptureStackBackTrace is 2).
Only in the minority of the cases the output looks like this:
0: MyFunction - 0x009DF4D0 1: main - 0x00A533E0 2: __tmainCRTStartup - 0x00A56AF0 3: mainCRTStart - 0x00A56AD0 4: BaseThreadInitThunk - 0x76603378 5: RtlInitializeExceptionChain - 0x77DC989F
But in most of the cases, the printStack's output looks something like that:
0: BaseThreadInitThunk - 0x74CB3358 1: BaseThreadInitThunk - 0x74CB3358 2: BaseThreadInitThunk - 0x74CB3358 3: BaseThreadInitThunk - 0x74CB3358 4: BaseThreadInitThunk - 0x74CB3358 5: BaseThreadInitThunk - 0x74CB3358 6: BaseThreadInitThunk - 0x74CB3358 7: BaseThreadInitThunk - 0x74CB3358 8: BaseThreadInitThunk - 0x74CB3358 9: BaseThreadInitThunk - 0x74CB3358 10: BaseThreadInitThunk - 0x74CB3358 11: BaseThreadInitThunk - 0x74CB3358 12: BaseThreadInitThunk - 0x74CB3358 13: BaseThreadInitThunk - 0x74CB3358 14: RtlInitializeExceptionChain - 0x773D989F
When I run the program from a computer that's not my own, I always get the latter case. When I run the program from my computer, in some cases I get the former case, and in some the latter case.
Any help?