Skip to content

Instantly share code, notes, and snippets.

@davispuh
Created December 4, 2023 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davispuh/6c0ae7e5a10500a5b7a759b817e66214 to your computer and use it in GitHub Desktop.
Save davispuh/6c0ae7e5a10500a5b7a759b817e66214 to your computer and use it in GitHub Desktop.
Deadlock Wine
#include <windows.h>
CRITICAL_SECTION criticalSection;
LONG ExceptionHandler(EXCEPTION_POINTERS *ExceptionInfo) {
asm("int $0x03");
return EXCEPTION_CONTINUE_SEARCH;
}
DWORD ThreadFunction(void*) {
EnterCriticalSection(&criticalSection);
LeaveCriticalSection(&criticalSection);
return 0;
}
int main() {
AddVectoredExceptionHandler(1, ExceptionHandler);
InitializeCriticalSection(&criticalSection);
EnterCriticalSection(&criticalSection);
CreateThread(NULL, 0, ThreadFunction, NULL, 0, NULL);
asm("int $0x03");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment