shlwapi: Make SHCreateWorkerWindowA/W 64-bit compatible.

Signed-off-by: Hermes Belusca-Maito <hermes.belusca@sfr.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hermes Belusca-Maito 2018-02-12 23:33:58 +01:00 committed by Alexandre Julliard
parent 694602eab1
commit 2c16322573
2 changed files with 13 additions and 15 deletions

View File

@ -2575,14 +2575,14 @@ HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite)
* Success: The window handle of the newly created window.
* 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)
{
static const char szClass[] = "WorkerA";
WNDCLASSA wc;
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);
/* Create Window class */
@ -2604,8 +2604,7 @@ HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle
if (hWnd)
{
SetWindowLongPtrW(hWnd, 0, wnd_extra);
if (wndProc) SetWindowLongPtrA(hWnd, GWLP_WNDPROC, wndProc);
if (wndProc) SetWindowLongPtrA(hWnd, GWLP_WNDPROC, (LONG_PTR)wndProc);
}
return hWnd;
@ -2864,28 +2863,28 @@ DWORD WINAPI WhichPlatform(void)
*
* Unicode version of SHCreateWorkerWindowA.
*/
HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle,
DWORD dwStyle, HMENU hMenu, LONG msg_result)
HWND WINAPI SHCreateWorkerWindowW(WNDPROC wndProc, HWND hWndParent, DWORD dwExStyle,
DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra)
{
static const WCHAR szClass[] = { 'W', 'o', 'r', 'k', 'e', 'r', 'W', 0 };
WNDCLASSW wc;
HWND hWnd;
TRACE("(0x%08x, %p, 0x%08x, 0x%08x, %p, 0x%08x)\n",
wndProc, hWndParent, dwExStyle, dwStyle, hMenu, msg_result);
TRACE("(%p, %p, 0x%08x, 0x%08x, %p, 0x%08lx)\n",
wndProc, hWndParent, dwExStyle, dwStyle, hMenu, wnd_extra);
/* If our OS is natively ANSI, use the ANSI version */
if (GetVersion() & 0x80000000) /* not NT */
{
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 */
wc.style = 0;
wc.lpfnWndProc = DefWindowProcW;
wc.cbClsExtra = 0;
wc.cbWndExtra = 4;
wc.cbWndExtra = sizeof(LONG_PTR);
wc.hInstance = shlwapi_hInstance;
wc.hIcon = NULL;
wc.hCursor = LoadCursorW(NULL, (LPWSTR)IDC_ARROW);
@ -2899,9 +2898,8 @@ HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle
hWndParent, hMenu, shlwapi_hInstance, 0);
if (hWnd)
{
SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, msg_result);
if (wndProc) SetWindowLongPtrW(hWnd, GWLP_WNDPROC, wndProc);
SetWindowLongPtrW(hWnd, 0, wnd_extra);
if (wndProc) SetWindowLongPtrW(hWnd, GWLP_WNDPROC, (LONG_PTR)wndProc);
}
return hWnd;

View File

@ -254,7 +254,7 @@
254 stub -noname StopWatchExW
255 stub -noname EventTraceHandler
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
259 stub -noname SHUnregisterWait
260 stdcall -noname SHQueueUserWorkItem(long long long long long long long)
@ -275,7 +275,7 @@
275 stub -noname RegisterGlobalHotkeyA
276 stdcall -ordinal WhichPlatform()
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)
280 stdcall -ordinal SHRegGetIntW(ptr wstr long)
281 stdcall -noname SHPackDispParamsV(ptr ptr long ptr)