[SHLWAPI] Improvements for SHCreateWorkerWindowW/A() prototypes + fix x64-bit compati...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 12 Feb 2018 23:10:09 +0000 (00:10 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 12 Feb 2018 23:13:47 +0000 (00:13 +0100)
commit770bf93be372cfc78342e7bbf11fb2e251ae591d
tree01b7371585802b31a831becaf258f37556733111
parenta5e89014dc943b2cbddb16fc4d92e13b7e5068e1
[SHLWAPI] Improvements for SHCreateWorkerWindowW/A() prototypes + fix x64-bit compatibility. Sent upstream.

[SHLWAPI] Refactor the SHCreateWorkerWindowW() prototype to match its ANSI SHCreateWorkerWindowA() counterpart.

The last parameter is really to be understood as an extra window data, and not a "message result" (as it would be the case for dialog window procedure).
That is why I also remove the mention of "DWLP_MSGRESULT" in the SetWindowLongPtrW() call.
SHCreateWorkerWindowA() had it OK but SHCreateWorkerWindowW() did not.

------------------

[SHLWAPI] Make SHCreateWorkerWindowA() and SHCreateWorkerWindowW() x64-compatible.

The first parameter of these functions is a pointer to a window procedure, having a definite prototype, so employ a correct typedef WNDPROC,
which ensures both correct pointer size and parameter type enforcement.
This also ensures that we use instead a correct pointer size, since otherwise LONG remains 32-bits for Windows compatibility on x64 platforms.
The wndProc parameter is thus casted to LONG_PTR to comply with the SetWindowLongPtrA/W calls.

In SHCreateWorkerWindowW(), the last "wnd_extra" parameter should also be LONG_PTR to be able to pass 64-bit data pointer on x64 platforms.
Therefore fix also setting the wc.cbWndExtra size. One should note that the ANSI SHCreateWorkerWindowA() function had everything OK already.
dll/win32/shlwapi/ordinal.c
dll/win32/shlwapi/shlwapi.spec
sdk/include/reactos/shlwapi_undoc.h