Commit 2c163225 authored by Hermes Belusca-Maito's avatar Hermes Belusca-Maito Committed by Alexandre Julliard

shlwapi: Make SHCreateWorkerWindowA/W 64-bit compatible.

parent 694602ea
...@@ -2575,14 +2575,14 @@ HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite) ...@@ -2575,14 +2575,14 @@ HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite)
* Success: The window handle of the newly created window. * Success: The window handle of the newly created window.
* Failure: 0. * Failure: 0.
*/ */
HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle, HWND WINAPI SHCreateWorkerWindowA(WNDPROC wndProc, HWND hWndParent, DWORD dwExStyle,
DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra) DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra)
{ {
static const char szClass[] = "WorkerA"; static const char szClass[] = "WorkerA";
WNDCLASSA wc; WNDCLASSA wc;
HWND hWnd; HWND hWnd;
TRACE("(0x%08x, %p, 0x%08x, 0x%08x, %p, 0x%08lx)\n", TRACE("(%p, %p, 0x%08x, 0x%08x, %p, 0x%08lx)\n",
wndProc, hWndParent, dwExStyle, dwStyle, hMenu, wnd_extra); wndProc, hWndParent, dwExStyle, dwStyle, hMenu, wnd_extra);
/* Create Window class */ /* Create Window class */
...@@ -2604,8 +2604,7 @@ HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle ...@@ -2604,8 +2604,7 @@ HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle
if (hWnd) if (hWnd)
{ {
SetWindowLongPtrW(hWnd, 0, wnd_extra); SetWindowLongPtrW(hWnd, 0, wnd_extra);
if (wndProc) SetWindowLongPtrA(hWnd, GWLP_WNDPROC, (LONG_PTR)wndProc);
if (wndProc) SetWindowLongPtrA(hWnd, GWLP_WNDPROC, wndProc);
} }
return hWnd; return hWnd;
...@@ -2864,28 +2863,28 @@ DWORD WINAPI WhichPlatform(void) ...@@ -2864,28 +2863,28 @@ DWORD WINAPI WhichPlatform(void)
* *
* Unicode version of SHCreateWorkerWindowA. * Unicode version of SHCreateWorkerWindowA.
*/ */
HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle, HWND WINAPI SHCreateWorkerWindowW(WNDPROC wndProc, HWND hWndParent, DWORD dwExStyle,
DWORD dwStyle, HMENU hMenu, LONG msg_result) DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra)
{ {
static const WCHAR szClass[] = { 'W', 'o', 'r', 'k', 'e', 'r', 'W', 0 }; static const WCHAR szClass[] = { 'W', 'o', 'r', 'k', 'e', 'r', 'W', 0 };
WNDCLASSW wc; WNDCLASSW wc;
HWND hWnd; HWND hWnd;
TRACE("(0x%08x, %p, 0x%08x, 0x%08x, %p, 0x%08x)\n", TRACE("(%p, %p, 0x%08x, 0x%08x, %p, 0x%08lx)\n",
wndProc, hWndParent, dwExStyle, dwStyle, hMenu, msg_result); wndProc, hWndParent, dwExStyle, dwStyle, hMenu, wnd_extra);
/* If our OS is natively ANSI, use the ANSI version */ /* If our OS is natively ANSI, use the ANSI version */
if (GetVersion() & 0x80000000) /* not NT */ if (GetVersion() & 0x80000000) /* not NT */
{ {
TRACE("fallback to ANSI, ver 0x%08x\n", GetVersion()); TRACE("fallback to ANSI, ver 0x%08x\n", GetVersion());
return SHCreateWorkerWindowA(wndProc, hWndParent, dwExStyle, dwStyle, hMenu, msg_result); return SHCreateWorkerWindowA(wndProc, hWndParent, dwExStyle, dwStyle, hMenu, wnd_extra);
} }
/* Create Window class */ /* Create Window class */
wc.style = 0; wc.style = 0;
wc.lpfnWndProc = DefWindowProcW; wc.lpfnWndProc = DefWindowProcW;
wc.cbClsExtra = 0; wc.cbClsExtra = 0;
wc.cbWndExtra = 4; wc.cbWndExtra = sizeof(LONG_PTR);
wc.hInstance = shlwapi_hInstance; wc.hInstance = shlwapi_hInstance;
wc.hIcon = NULL; wc.hIcon = NULL;
wc.hCursor = LoadCursorW(NULL, (LPWSTR)IDC_ARROW); wc.hCursor = LoadCursorW(NULL, (LPWSTR)IDC_ARROW);
...@@ -2899,9 +2898,8 @@ HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle ...@@ -2899,9 +2898,8 @@ HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle
hWndParent, hMenu, shlwapi_hInstance, 0); hWndParent, hMenu, shlwapi_hInstance, 0);
if (hWnd) if (hWnd)
{ {
SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, msg_result); SetWindowLongPtrW(hWnd, 0, wnd_extra);
if (wndProc) SetWindowLongPtrW(hWnd, GWLP_WNDPROC, (LONG_PTR)wndProc);
if (wndProc) SetWindowLongPtrW(hWnd, GWLP_WNDPROC, wndProc);
} }
return hWnd; return hWnd;
......
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
254 stub -noname StopWatchExW 254 stub -noname StopWatchExW
255 stub -noname EventTraceHandler 255 stub -noname EventTraceHandler
256 stdcall -ordinal IUnknown_GetSite(ptr ptr ptr) 256 stdcall -ordinal IUnknown_GetSite(ptr ptr ptr)
257 stdcall -noname SHCreateWorkerWindowA(long ptr long long ptr long) 257 stdcall -noname SHCreateWorkerWindowA(ptr ptr long long ptr long)
258 stub -noname SHRegisterWaitForSingleObject 258 stub -noname SHRegisterWaitForSingleObject
259 stub -noname SHUnregisterWait 259 stub -noname SHUnregisterWait
260 stdcall -noname SHQueueUserWorkItem(long long long long long long long) 260 stdcall -noname SHQueueUserWorkItem(long long long long long long long)
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
275 stub -noname RegisterGlobalHotkeyA 275 stub -noname RegisterGlobalHotkeyA
276 stdcall -ordinal WhichPlatform() 276 stdcall -ordinal WhichPlatform()
277 stub -noname SHDialogBox 277 stub -noname SHDialogBox
278 stdcall -noname SHCreateWorkerWindowW(long long long long long long) 278 stdcall -noname SHCreateWorkerWindowW(ptr ptr long long ptr long)
279 stdcall -noname SHInvokeDefaultCommand(ptr ptr ptr) 279 stdcall -noname SHInvokeDefaultCommand(ptr ptr ptr)
280 stdcall -ordinal SHRegGetIntW(ptr wstr long) 280 stdcall -ordinal SHRegGetIntW(ptr wstr long)
281 stdcall -noname SHPackDispParamsV(ptr ptr long ptr) 281 stdcall -noname SHPackDispParamsV(ptr ptr long ptr)
......
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