From 99e0cf8b4adb4a423b0f1fb873bd077ce439b266 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Fri, 24 May 2024 22:16:32 +0200 Subject: [PATCH] log CreateWindowExA calls --- inc/debug.h | 1 + src/debug.c | 139 +++++++++++++++++++++++++++++++++++++++++++++ src/winapi_hooks.c | 20 +++++++ 3 files changed, 160 insertions(+) diff --git a/inc/debug.h b/inc/debug.h index f7c81d18c1..f16a9444eb 100644 --- a/inc/debug.h +++ b/inc/debug.h @@ -13,6 +13,7 @@ void dbg_draw_frame_info_start(); void dbg_draw_frame_info_end(); void dbg_printf(const char* fmt, ...); void dbg_init(); +void dbg_dump_wnd_styles(DWORD style, DWORD exstyle); void dbg_dump_swp_flags(DWORD flags); void dbg_dump_ddp_flags(DWORD flags); void dbg_dump_scl_flags(DWORD flags); diff --git a/src/debug.c b/src/debug.c index a25916a5ef..12f9ca3f13 100644 --- a/src/debug.c +++ b/src/debug.c @@ -278,6 +278,145 @@ void dbg_draw_frame_info_end() g_dbg_frame_time = dbg_counter_stop(); } +void dbg_dump_wnd_styles(DWORD style, DWORD exstyle) +{ +#ifdef _DEBUG + if (style & WS_BORDER) { + TRACE(" WS_BORDER\n"); + } + if (style & WS_CAPTION) { + TRACE(" WS_CAPTION\n"); + } + if (style & WS_CHILD) { + TRACE(" WS_CHILD\n"); + } + if (style & WS_CHILDWINDOW) { + TRACE(" WS_CHILDWINDOW\n"); + } + if (style & WS_CLIPCHILDREN) { + TRACE(" WS_CLIPCHILDREN\n"); + } + if (style & WS_CLIPSIBLINGS) { + TRACE(" WS_CLIPSIBLINGS\n"); + } + if (style & WS_DISABLED) { + TRACE(" WS_DISABLED\n"); + } + if (style & WS_DLGFRAME) { + TRACE(" WS_DLGFRAME\n"); + } + if (style & WS_GROUP) { + TRACE(" WS_GROUP\n"); + } + if (style & WS_HSCROLL) { + TRACE(" WS_HSCROLL\n"); + } + if (style & WS_ICONIC) { + TRACE(" WS_ICONIC\n"); + } + if (style & WS_MAXIMIZE) { + TRACE(" WS_MAXIMIZE\n"); + } + if (style & WS_MAXIMIZEBOX) { + TRACE(" WS_MAXIMIZEBOX\n"); + } + if (style & WS_MINIMIZE) { + TRACE(" WS_MINIMIZE\n"); + } + if (style & WS_MINIMIZEBOX) { + TRACE(" WS_MINIMIZEBOX\n"); + } + if (style & WS_POPUP) { + TRACE(" WS_POPUP\n"); + } + if (style & WS_SIZEBOX) { + TRACE(" WS_SIZEBOX\n"); + } + if (style & WS_SYSMENU) { + TRACE(" WS_SYSMENU\n"); + } + if (style & WS_TABSTOP) { + TRACE(" WS_TABSTOP\n"); + } + if (style & WS_THICKFRAME) { + TRACE(" WS_THICKFRAME\n"); + } + if (style & WS_VISIBLE) { + TRACE(" WS_VISIBLE\n"); + } + if (style & WS_VSCROLL) { + TRACE(" WS_VSCROLL\n"); + } + + if (exstyle & WS_EX_ACCEPTFILES) { + TRACE(" WS_EX_ACCEPTFILES\n"); + } + if (exstyle & WS_EX_APPWINDOW) { + TRACE(" WS_EX_APPWINDOW\n"); + } + if (exstyle & WS_EX_CLIENTEDGE) { + TRACE(" WS_EX_CLIENTEDGE\n"); + } + if (exstyle & WS_EX_COMPOSITED) { + TRACE(" WS_EX_COMPOSITED\n"); + } + if (exstyle & WS_EX_CONTEXTHELP) { + TRACE(" WS_EX_CONTEXTHELP\n"); + } + if (exstyle & WS_EX_CONTROLPARENT) { + TRACE(" WS_EX_CONTROLPARENT\n"); + } + if (exstyle & WS_EX_DLGMODALFRAME) { + TRACE(" WS_EX_DLGMODALFRAME\n"); + } + if (exstyle & WS_EX_LAYERED) { + TRACE(" WS_EX_LAYERED\n"); + } + if (exstyle & WS_EX_LAYOUTRTL) { + TRACE(" WS_EX_LAYOUTRTL\n"); + } + if (exstyle & WS_EX_LEFTSCROLLBAR) { + TRACE(" WS_EX_LEFTSCROLLBAR\n"); + } + if (exstyle & WS_EX_MDICHILD) { + TRACE(" WS_EX_MDICHILD\n"); + } + if (exstyle & WS_EX_NOACTIVATE) { + TRACE(" WS_EX_NOACTIVATE\n"); + } + if (exstyle & WS_EX_NOINHERITLAYOUT) { + TRACE(" WS_EX_NOINHERITLAYOUT\n"); + } + if (exstyle & WS_EX_NOPARENTNOTIFY) { + TRACE(" WS_EX_NOPARENTNOTIFY\n"); + } + //if (exstyle & WS_EX_NOREDIRECTIONBITMAP) { + // TRACE(" WS_EX_NOREDIRECTIONBITMAP\n"); + //} + if (exstyle & WS_EX_RIGHT) { + TRACE(" WS_EX_RIGHT\n"); + } + if (exstyle & WS_EX_RTLREADING) { + TRACE(" WS_EX_RTLREADING\n"); + } + if (exstyle & WS_EX_STATICEDGE) { + TRACE(" WS_EX_STATICEDGE\n"); + } + if (exstyle & WS_EX_TOOLWINDOW) { + TRACE(" WS_EX_TOOLWINDOW\n"); + } + if (exstyle & WS_EX_TOPMOST) { + TRACE(" WS_EX_TOPMOST\n"); + } + if (exstyle & WS_EX_TRANSPARENT) { + TRACE(" WS_EX_TRANSPARENT\n"); + } + if (exstyle & WS_EX_WINDOWEDGE) { + TRACE(" WS_EX_WINDOWEDGE\n"); + } +#endif +} + void dbg_dump_swp_flags(DWORD flags) { #ifdef _DEBUG diff --git a/src/winapi_hooks.c b/src/winapi_hooks.c index b2c4a5fb7b..737b95b905 100644 --- a/src/winapi_hooks.c +++ b/src/winapi_hooks.c @@ -1285,6 +1285,26 @@ HWND WINAPI fake_CreateWindowExA( DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam) { + TRACE("CreateWindowExA(" + "dwExStyle=%08X, lpClassName=%p, lpWindowName=%p, dwStyle=%08X, X=%d, Y=%d, nWidth=%d, " + "nHeight=%d, hWndParent=%p, hMenu=%p, hInstance=%p, lpParam=%p)\n", + dwExStyle, + lpClassName, + lpWindowName, + dwStyle, + X, + Y, + nWidth, + nHeight, + hWndParent, + hMenu, + hInstance, + lpParam); + + TRACE(" WindowName=%s, ClassName=%s, g_ddraw.hwnd=%p\n", lpWindowName, HIWORD(lpClassName) ? lpClassName : "", g_ddraw.hwnd); + + dbg_dump_wnd_styles(dwStyle, dwExStyle); + /* Center Claw DVD movies */ if (HIWORD(lpClassName) && _strcmpi(lpClassName, "Afx:400000:3") == 0 &&