DescriptionSuspendThread returns a DWORD value, so checking the return value with ">= 0" doesn't work. On failure, the return value is (DWORD) -1 (which is 0xFFFFFFFF). DWORD last_suspend_count = -1; ... last_suspend_count = SuspendThread(child_thread_handle); if (last_suspend_count >= 0) { ... } Patch Set 1 #Patch Set 2 : Using C++ cast instead of C-style #MessagesTotal messages: 3
|