Commit 76419389 by Maxime Grégoire

Removal of the WaitForDebugger methods and calls in dllmain.cpp

Change-Id: Ic521bfa7a738fb3030efc394c38f0e7f2123f45c Reviewed-on: https://swiftshader-review.googlesource.com/3702Reviewed-by: 's avatarMaxime Grégoire <mgregoire@google.com> Tested-by: 's avatarMaxime Grégoire <mgregoire@google.com>
parent 7a50147b
...@@ -64,52 +64,11 @@ static void clDetachProcess() ...@@ -64,52 +64,11 @@ static void clDetachProcess()
TlsFree(currentTLS); TlsFree(currentTLS);
} }
static INT_PTR CALLBACK DebuggerWaitDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
RECT rect;
switch(uMsg)
{
case WM_INITDIALOG:
GetWindowRect(GetDesktopWindow(), &rect);
SetWindowPos(hwnd, HWND_TOP, rect.right / 2, rect.bottom / 2, 0, 0, SWP_NOSIZE);
SetTimer(hwnd, 1, 100, NULL);
return TRUE;
case WM_COMMAND:
if(LOWORD(wParam) == IDCANCEL)
{
EndDialog(hwnd, 0);
}
break;
case WM_TIMER:
if(IsDebuggerPresent())
{
EndDialog(hwnd, 0);
}
}
return FALSE;
}
static void WaitForDebugger(HINSTANCE instance)
{
if(!IsDebuggerPresent())
{
HRSRC dialog = FindResource(instance, MAKEINTRESOURCE(IDD_DIALOG1), RT_DIALOG);
DLGTEMPLATE *dialogTemplate = (DLGTEMPLATE*)LoadResource(instance, dialog);
DialogBoxIndirect(instance, dialogTemplate, NULL, DebuggerWaitDialogProc);
}
}
extern "C" BOOL APIENTRY DllMain(HINSTANCE instance, DWORD ul_reason_for_call, LPVOID lpReserved) extern "C" BOOL APIENTRY DllMain(HINSTANCE instance, DWORD ul_reason_for_call, LPVOID lpReserved)
{ {
//UNIMPLEMENTED();
switch (ul_reason_for_call) switch (ul_reason_for_call)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
/*#ifdef NDEBUG
WaitForDebugger(instance);
#endif*/
return clAttachProcess(); return clAttachProcess();
break; break;
case DLL_THREAD_ATTACH: case DLL_THREAD_ATTACH:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment