From 86860cc976558d8318b90f0918dbd18e7318f21b Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 2 Apr 2010 15:05:58 +0200 Subject: [PATCH] shlwapi: Fix SHCreateWorkerWindowA for 64-bit. --- dlls/shlwapi/ordinal.c | 12 ++++++------ dlls/shlwapi/tests/ordinal.c | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index a72dba36d51..332bdb67f79 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -2595,27 +2595,27 @@ HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite) * dwExStyle [I] Extra style flags * dwStyle [I] Style flags * hMenu [I] Window menu - * msg_result [I] New DWLP_MSGRESULT value + * wnd_extra [I] Window extra bytes value * * RETURNS * Success: The window handle of the newly created window. * Failure: 0. */ HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle, - DWORD dwStyle, HMENU hMenu, LONG msg_result) + DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra) { static const char szClass[] = "WorkerA"; WNDCLASSA wc; HWND hWnd; - TRACE("(0x%08x, %p, 0x%08x, 0x%08x, %p, 0x%08x)\n", - wndProc, hWndParent, dwExStyle, dwStyle, hMenu, msg_result); + TRACE("(0x%08x, %p, 0x%08x, 0x%08x, %p, 0x%08lx)\n", + wndProc, hWndParent, dwExStyle, dwStyle, hMenu, wnd_extra); /* Create Window class */ wc.style = 0; wc.lpfnWndProc = DefWindowProcA; wc.cbClsExtra = 0; - wc.cbWndExtra = 4; + wc.cbWndExtra = sizeof(LONG_PTR); wc.hInstance = shlwapi_hInstance; wc.hIcon = NULL; wc.hCursor = LoadCursorA(NULL, (LPSTR)IDC_ARROW); @@ -2629,7 +2629,7 @@ HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle hWndParent, hMenu, shlwapi_hInstance, 0); if (hWnd) { - SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, msg_result); + SetWindowLongPtrW(hWnd, 0, wnd_extra); if (wndProc) SetWindowLongPtrA(hWnd, GWLP_WNDPROC, wndProc); } diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c index 1c25f1249f2..0d6e165c7a2 100644 --- a/dlls/shlwapi/tests/ordinal.c +++ b/dlls/shlwapi/tests/ordinal.c @@ -55,7 +55,7 @@ static DWORD (WINAPI *pSHGetObjectCompatFlags)(IUnknown*, const CLSID*); static BOOL (WINAPI *pGUIDFromStringA)(LPSTR, CLSID *); static HRESULT (WINAPI *pIUnknown_QueryServiceExec)(IUnknown*, REFIID, const GUID*, DWORD, DWORD, VARIANT*, VARIANT*); static HRESULT (WINAPI *pIUnknown_ProfferService)(IUnknown*, REFGUID, IServiceProvider*, DWORD*); -static HWND (WINAPI *pSHCreateWorkerWindowA)(LONG, HWND, DWORD, DWORD, HMENU, LONG); +static HWND (WINAPI *pSHCreateWorkerWindowA)(LONG, HWND, DWORD, DWORD, HMENU, LONG_PTR); static HMODULE hmlang; static HRESULT (WINAPI *pLcidToRfc1766A)(LCID, LPSTR, INT); @@ -2318,7 +2318,7 @@ static void test_SHCreateWorkerWindowA(void) WNDCLASSA cliA; char classA[20]; HWND hwnd; - LONG ret; + LONG_PTR ret; BOOL res; if (is_win2k_and_lower) @@ -2333,8 +2333,8 @@ static void test_SHCreateWorkerWindowA(void) GetClassName(hwnd, classA, 20); ok(lstrcmpA(classA, "WorkerA") == 0, "expected WorkerA class, got %s\n", classA); - ret = GetWindowLongA(hwnd, DWLP_MSGRESULT); - ok(ret == 0, "got %d\n", ret); + ret = GetWindowLongPtrA(hwnd, 0); + ok(ret == 0, "got %ld\n", ret); /* class info */ memset(&cliA, 0, sizeof(cliA)); @@ -2342,30 +2342,30 @@ static void test_SHCreateWorkerWindowA(void) ok(res, "failed to get class info\n"); ok(cliA.style == 0, "got 0x%08x\n", cliA.style); ok(cliA.cbClsExtra == 0, "got %d\n", cliA.cbClsExtra); - ok(cliA.cbWndExtra == 4, "got %d\n", cliA.cbWndExtra); + ok(cliA.cbWndExtra == sizeof(LONG_PTR), "got %d\n", cliA.cbWndExtra); ok(cliA.lpszMenuName == 0, "got %s\n", cliA.lpszMenuName); DestroyWindow(hwnd); - /* set DWLP_MSGRESULT */ + /* set extra bytes */ hwnd = pSHCreateWorkerWindowA(0, NULL, 0, 0, 0, 0xdeadbeef); ok(hwnd != 0, "expected window\n"); GetClassName(hwnd, classA, 20); ok(lstrcmpA(classA, "WorkerA") == 0, "expected WorkerA class, got %s\n", classA); - ret = GetWindowLongA(hwnd, DWLP_MSGRESULT); - ok(ret == 0xdeadbeef, "got %d\n", ret); + ret = GetWindowLongPtrA(hwnd, 0); + ok(ret == 0xdeadbeef, "got %ld\n", ret); /* test exstyle */ ret = GetWindowLongA(hwnd, GWL_EXSTYLE); - ok(ret == WS_EX_WINDOWEDGE, "0x%08x\n", ret); + ok(ret == WS_EX_WINDOWEDGE, "0x%08lx\n", ret); DestroyWindow(hwnd); hwnd = pSHCreateWorkerWindowA(0, NULL, WS_EX_TOOLWINDOW, 0, 0, 0); ret = GetWindowLongA(hwnd, GWL_EXSTYLE); - ok(ret == (WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW), "0x%08x\n", ret); + ok(ret == (WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW), "0x%08lx\n", ret); DestroyWindow(hwnd); }