Merge from amd64 branch:

36987:
- Fix user32 compilation errors. (Samuel Serapion)
36988:
- Make user32 compile and link by defining Get/SetClass/WindowLongPtrA/W (Stefan Ginsberg)
41480:
- Fix 64bit issues, add a wine compatibility hack (Timo Kreuzer)
41540:
- Make parameters for NtUserCallOneParam and NtUserCallTwoParam DWORD_PTR instead of DWORD (Timo Kreuzer)
43965:  (Samuel Serapion)
- Fix several user32 warnings.
- Sync GetWindow*A/W with wine and unify all versions, commenting out a wine hack.
- As a bonus implement GetWindowLongPtrA/W.
- Tested to work in trunk.
43992:
- Fix user32 build.  (Samuel Serapion)
45124:
- Fix user32 build. (Samuel Serapion)
47472:
- Remove wine hack and allow user32 to compile again. (Samuel Serapion)
47878: (Timo Kreuzer)
- Use UlongToHandle instead of LongToHandle
- case to ULONG_PTR instead of using HandleToUlong
- SetSysColorsTemp: don't truncate the pointer sized n value, remove a comment
- IntGetClsWndProc: fix a bug
- IntGetWindowLong: pass !unicode to IntGetWndProc
47882:
- Make the uiLo and uiHi members of the KMDDELPARAM structure UINT_PTRs (Timo Kreuzer)

svn path=/trunk/; revision=47884
This commit is contained in:
Timo Kreuzer 2010-06-27 22:19:17 +00:00
parent 66bec4f5b8
commit 9322109bcf
22 changed files with 284 additions and 193 deletions

View file

@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(listbox);
#define WS_EX_DRAGDETECT 0x00000002L #define WS_EX_DRAGDETECT 0x00000002L
#define WM_BEGINDRAG 0x022C #define WM_BEGINDRAG 0x022C
UINT WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC); UINT_PTR WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC);
BOOL WINAPI KillSystemTimer(HWND,UINT_PTR); BOOL WINAPI KillSystemTimer(HWND,UINT_PTR);
/* End of hack section -------------------------------- */ /* End of hack section -------------------------------- */

View file

@ -68,7 +68,7 @@ static BOOL ScrollTrackVertical;
HBRUSH DefWndControlColor(HDC hDC, UINT ctlType); HBRUSH DefWndControlColor(HDC hDC, UINT ctlType);
UINT WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC); UINT_PTR WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC);
BOOL WINAPI KillSystemTimer(HWND,UINT_PTR); BOOL WINAPI KillSystemTimer(HWND,UINT_PTR);
/********************************************************************* /*********************************************************************

View file

@ -85,7 +85,7 @@ RegisterTasklist(DWORD x)
} }
EXTINLINE DWORD WINAPI EXTINLINE DWORD WINAPI
DragObject(HWND hwnd1, HWND hwnd2, UINT u1, DWORD dw1, HCURSOR hc1) DragObject(HWND hwnd1, HWND hwnd2, UINT u1, ULONG_PTR dw1, HCURSOR hc1)
{ {
return NtUserDragObject(hwnd1, hwnd2, u1, dw1, hc1); return NtUserDragObject(hwnd1, hwnd2, u1, dw1, hc1);
} }

View file

@ -93,7 +93,7 @@
NtUserCallOneParam((DWORD_PTR)bShow, ONEPARAM_ROUTINE_SHOWCURSOR) NtUserCallOneParam((DWORD_PTR)bShow, ONEPARAM_ROUTINE_SHOWCURSOR)
#define NtUserGetDesktopMapping(Ptr) \ #define NtUserGetDesktopMapping(Ptr) \
(PVOID)NtUserCallOneParam((DWORD)Ptr, ONEPARAM_ROUTINE_GETDESKTOPMAPPING) (PVOID)NtUserCallOneParam((DWORD_PTR)Ptr, ONEPARAM_ROUTINE_GETDESKTOPMAPPING)
#define NtUserSetCursorPos(x, y) \ #define NtUserSetCursorPos(x, y) \
(BOOL)NtUserCallTwoParam((DWORD)x, (DWORD)y, TWOPARAM_ROUTINE_SETCURSORPOS) (BOOL)NtUserCallTwoParam((DWORD)x, (DWORD)y, TWOPARAM_ROUTINE_SETCURSORPOS)

View file

@ -65,5 +65,5 @@ User32CreateWindowEx(DWORD dwExStyle,
BOOL Unicode); BOOL Unicode);
HWND* WIN_ListChildren (HWND hWndparent); HWND* WIN_ListChildren (HWND hWndparent);
ULONG_PTR FASTCALL IntGetWndProc(PWND, BOOL); WNDPROC FASTCALL IntGetWndProc(PWND, BOOL);
DWORD WINAPI GetRealWindowOwner(HWND); DWORD WINAPI GetRealWindowOwner(HWND);

View file

@ -1,5 +1,4 @@
/* $Id$ /*
*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/exit.c * FILE: lib/user32/misc/exit.c
@ -101,7 +100,7 @@ RegisterServicesProcess(DWORD ServicesProcessId)
NTSTATUS Status; NTSTATUS Status;
CsrRequest = MAKE_CSR_API(REGISTER_SERVICES_PROCESS, CSR_GUI); CsrRequest = MAKE_CSR_API(REGISTER_SERVICES_PROCESS, CSR_GUI);
Request.Data.RegisterServicesProcessRequest.ProcessId = (HANDLE)ServicesProcessId; Request.Data.RegisterServicesProcessRequest.ProcessId = UlongToHandle(ServicesProcessId);
Status = CsrClientCallServer(&Request, Status = CsrClientCallServer(&Request,
NULL, NULL,

View file

@ -267,7 +267,7 @@ TestWindowProcess(PWND Wnd)
return TRUE; return TRUE;
else else
return (NtUserQueryWindow(Wnd->head.h, QUERY_WINDOW_UNIQUE_PROCESS_ID) == return (NtUserQueryWindow(Wnd->head.h, QUERY_WINDOW_UNIQUE_PROCESS_ID) ==
(DWORD)NtCurrentTeb()->ClientId.UniqueProcess ); (DWORD_PTR)NtCurrentTeb()->ClientId.UniqueProcess );
} }
BOOL BOOL
@ -293,7 +293,7 @@ GetUser32Handle(HANDLE handle)
INT Index; INT Index;
USHORT generation; USHORT generation;
Index = (((UINT)handle & 0xffff) - FIRST_USER_HANDLE) >> 1; Index = (((UINT_PTR)handle & 0xffff) - FIRST_USER_HANDLE) >> 1;
if (Index < 0 || Index >= gHandleTable->nb_handles) if (Index < 0 || Index >= gHandleTable->nb_handles)
return NULL; return NULL;
@ -301,7 +301,7 @@ GetUser32Handle(HANDLE handle)
if (!gHandleEntries[Index].type || !gHandleEntries[Index].ptr) if (!gHandleEntries[Index].type || !gHandleEntries[Index].ptr)
return NULL; return NULL;
generation = (UINT)handle >> 16; generation = (UINT_PTR)handle >> 16;
if (generation == gHandleEntries[Index].generation || !generation || generation == 0xffff) if (generation == gHandleEntries[Index].generation || !generation || generation == 0xffff)
return &gHandleEntries[Index]; return &gHandleEntries[Index];

View file

@ -174,7 +174,7 @@ UnregisterDeviceNotification(HDEVNOTIFY Handle)
return FALSE; return FALSE;
} }
ConfigRet = UnRegNotify((ULONG) Handle ); ConfigRet = UnRegNotify((ULONG_PTR)Handle );
if (ConfigRet != CR_SUCCESS) if (ConfigRet != CR_SUCCESS)
{ {
switch (ConfigRet) switch (ConfigRet)

View file

@ -197,7 +197,7 @@ SetSysColorsTemp(const COLORREF *pPens,
} }
if (!pPens && !pBrushes) /* "restore" call */ if (!pPens && !pBrushes) /* "restore" call */
{ {
LPVOID pOldCol = (LPVOID)n; /* FIXME: not 64-bit safe */ LPVOID pOldCol = (LPVOID)n;
LPVOID p = pOldCol; LPVOID p = pOldCol;
DWORD nCount = *(DWORD *)p; DWORD nCount = *(DWORD *)p;
p = (char*)p + sizeof(DWORD); p = (char*)p + sizeof(DWORD);

View file

@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id$ /*
*
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/winhelp.c * FILE: lib/user32/misc/winhelp.c
* PURPOSE: WinHelp * PURPOSE: WinHelp
@ -51,7 +50,7 @@ typedef struct
*/ */
BOOL BOOL
WINAPI WINAPI
WinHelpA(HWND hWnd, LPCSTR lpszHelp, UINT uCommand, DWORD dwData) WinHelpA(HWND hWnd, LPCSTR lpszHelp, UINT uCommand, DWORD_PTR dwData)
{ {
static WORD WM_WINHELP = 0; static WORD WM_WINHELP = 0;
HWND hDest; HWND hDest;
@ -137,7 +136,7 @@ WinHelpA(HWND hWnd, LPCSTR lpszHelp, UINT uCommand, DWORD dwData)
*/ */
BOOL BOOL
WINAPI WINAPI
WinHelpW(HWND hWnd, LPCWSTR lpszHelp, UINT uCommand, DWORD dwData) WinHelpW(HWND hWnd, LPCWSTR lpszHelp, UINT uCommand, DWORD_PTR dwData)
{ {
INT len; INT len;
LPSTR file; LPSTR file;

View file

@ -266,11 +266,11 @@ IntGetClsWndProc(PWND pWnd, PCLS Class, BOOL Ansi)
// //
// Based on IntGetClsWndProc // Based on IntGetClsWndProc
// //
ULONG_PTR FASTCALL WNDPROC FASTCALL
IntGetWndProc(PWND pWnd, BOOL Ansi) IntGetWndProc(PWND pWnd, BOOL Ansi)
{ {
INT i; INT i;
ULONG_PTR gcpd, Ret = 0; WNDPROC gcpd, Ret = 0;
PCLS Class = DesktopPtrToUser(pWnd->pcls); PCLS Class = DesktopPtrToUser(pWnd->pcls);
if (!Class) return Ret; if (!Class) return Ret;
@ -282,9 +282,9 @@ IntGetWndProc(PWND pWnd, BOOL Ansi)
if (GETPFNSERVER(i) == pWnd->lpfnWndProc) if (GETPFNSERVER(i) == pWnd->lpfnWndProc)
{ {
if (Ansi) if (Ansi)
Ret = (ULONG_PTR)GETPFNCLIENTA(i); Ret = GETPFNCLIENTA(i);
else else
Ret = (ULONG_PTR)GETPFNCLIENTW(i); Ret = GETPFNCLIENTW(i);
} }
} }
return Ret; return Ret;
@ -296,36 +296,36 @@ IntGetWndProc(PWND pWnd, BOOL Ansi)
is treated specially. is treated specially.
*/ */
if (Class->fnid == FNID_EDIT) if (Class->fnid == FNID_EDIT)
Ret = (ULONG_PTR)pWnd->lpfnWndProc; Ret = pWnd->lpfnWndProc;
else else
{ {
// Set return proc. // Set return proc.
Ret = (ULONG_PTR)pWnd->lpfnWndProc; Ret = pWnd->lpfnWndProc;
if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_BUTTON) if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_BUTTON)
{ {
if (Ansi) if (Ansi)
{ {
if (GETPFNCLIENTW(Class->fnid) == pWnd->lpfnWndProc) if (GETPFNCLIENTW(Class->fnid) == pWnd->lpfnWndProc)
Ret = (ULONG_PTR)GETPFNCLIENTA(Class->fnid); Ret = GETPFNCLIENTA(Class->fnid);
} }
else else
{ {
if (GETPFNCLIENTA(Class->fnid) == pWnd->lpfnWndProc) if (GETPFNCLIENTA(Class->fnid) == pWnd->lpfnWndProc)
Ret = (ULONG_PTR)GETPFNCLIENTW(Class->fnid); Ret = GETPFNCLIENTW(Class->fnid);
} }
} }
// Return on the change. // Return on the change.
if ( Ret != (ULONG_PTR)pWnd->lpfnWndProc) if ( Ret != pWnd->lpfnWndProc)
return Ret; return Ret;
} }
if ( Ansi == !!(pWnd->state & WNDS_ANSIWINDOWPROC) ) if ( Ansi == !!(pWnd->state & WNDS_ANSIWINDOWPROC) )
return Ret; return Ret;
gcpd = NtUserGetCPD( UserHMGetHandle(pWnd), gcpd = (WNDPROC)NtUserGetCPD( UserHMGetHandle(pWnd),
(Ansi ? UserGetCPDA2U : UserGetCPDU2A )|UserGetCPDWindow, (Ansi ? UserGetCPDA2U : UserGetCPDU2A )|UserGetCPDWindow,
Ret); (ULONG_PTR)Ret);
return (gcpd ? gcpd : Ret); return (gcpd ? gcpd : Ret);
} }
@ -538,6 +538,32 @@ GetClassLongW ( HWND hWnd, int nIndex )
return Ret; return Ret;
} }
#ifdef _WIN64
/*
* @unimplemented
*/
ULONG_PTR
WINAPI
GetClassLongPtrA(HWND hWnd,
INT nIndex)
{
UNIMPLEMENTED;
return 0;
}
/*
* @unimplemented
*/
ULONG_PTR
WINAPI
GetClassLongPtrW(HWND hWnd,
INT nIndex)
{
UNIMPLEMENTED;
return 0;
}
#endif
/* /*
* @implemented * @implemented
@ -627,6 +653,65 @@ GetClassWord(
} }
LONG_PTR IntGetWindowLong( HWND hwnd, INT offset, UINT size, BOOL unicode )
{
LONG_PTR retvalue = 0;
WND *wndPtr;
if (offset == GWLP_HWNDPARENT)
{
HWND parent = GetAncestor( hwnd, GA_PARENT );
if (parent == GetDesktopWindow()) parent = GetWindow( hwnd, GW_OWNER );
return (ULONG_PTR)parent;
}
if (!(wndPtr = ValidateHwnd( hwnd )))
{
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
return 0;
}
if (offset >= 0)
{
if (offset > (int)(wndPtr->cbwndExtra - size))
{
WARN("Invalid offset %d\n", offset );
SetLastError( ERROR_INVALID_INDEX );
return 0;
}
retvalue = *((LONG_PTR *)((PCHAR)(wndPtr + 1) + offset));
/* WINE: special case for dialog window procedure */
//if ((offset == DWLP_DLGPROC) && (size == sizeof(LONG_PTR)) && (wndPtr->flags & WIN_ISDIALOG))
// retvalue = (LONG_PTR)IntGetWndProc( (WNDPROC)retvalue, unicode );
return retvalue;
}
switch(offset)
{
case GWLP_USERDATA: retvalue = wndPtr->dwUserData; break;
case GWL_STYLE: retvalue = wndPtr->style; break;
case GWL_EXSTYLE: retvalue = wndPtr->ExStyle; break;
case GWLP_ID: retvalue = wndPtr->IDMenu; break;
case GWLP_HINSTANCE: retvalue = (ULONG_PTR)wndPtr->hModule; break;
case GWLP_WNDPROC:
{
if (!TestWindowProcess(wndPtr))
{
SetLastError(ERROR_ACCESS_DENIED);
retvalue = 0;
}
retvalue = (ULONG_PTR)IntGetWndProc(wndPtr, !unicode);
break;
}
default:
WARN("Unknown offset %d\n", offset );
SetLastError( ERROR_INVALID_INDEX );
break;
}
return retvalue;
}
/* /*
* @implemented * @implemented
*/ */
@ -634,57 +719,8 @@ LONG
WINAPI WINAPI
GetWindowLongA ( HWND hWnd, int nIndex ) GetWindowLongA ( HWND hWnd, int nIndex )
{ {
PWND Wnd; return IntGetWindowLong( hWnd, nIndex, sizeof(LONG), FALSE );
Wnd = ValidateHwnd(hWnd);
if (Wnd == NULL)
return 0;
if (nIndex >= 0)
{
if ((DWORD)nIndex + sizeof(LONG) > Wnd->cbwndExtra)
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
} }
return *((LONG *)((PCHAR)(Wnd + 1) + nIndex));
}
else
{
switch (nIndex)
{
case GWL_EXSTYLE:
return Wnd->ExStyle;
case GWL_STYLE:
return Wnd->style;
case GWL_HINSTANCE:
return (LONG)Wnd->hModule;
case GWL_ID:
return Wnd->IDMenu;
case GWL_USERDATA:
return Wnd->dwUserData;
case GWL_HWNDPARENT:
{
HWND parent = GetAncestor( hWnd, GA_PARENT );
if (parent == GetDesktopWindow()) parent = GetWindow( hWnd, GW_OWNER );
return (LONG)parent;
}
case GWL_WNDPROC:
if (!TestWindowProcess(Wnd))
{
SetLastError(ERROR_ACCESS_DENIED);
return 0;
}
return IntGetWndProc(Wnd, TRUE);
default:
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
}
}
/* /*
* @implemented * @implemented
@ -693,56 +729,33 @@ LONG
WINAPI WINAPI
GetWindowLongW(HWND hWnd, int nIndex) GetWindowLongW(HWND hWnd, int nIndex)
{ {
PWND Wnd; return IntGetWindowLong( hWnd, nIndex, sizeof(LONG), TRUE );
}
Wnd = ValidateHwnd(hWnd); #ifdef _WIN64
if (Wnd == NULL) /*
return 0; * @implemented
*/
LONG_PTR
WINAPI
GetWindowLongPtrA(HWND hWnd,
INT nIndex)
{
return IntGetWindowLong( hWnd, nIndex, sizeof(LONG_PTR), FALSE );
}
if (nIndex >= 0) /*
* @implemented
*/
LONG_PTR
WINAPI
GetWindowLongPtrW(HWND hWnd,
INT nIndex)
{ {
if ((DWORD)nIndex + sizeof(LONG) > Wnd->cbwndExtra) return IntGetWindowLong( hWnd, nIndex, sizeof(LONG_PTR), TRUE );
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
return *((LONG *)((PCHAR)(Wnd + 1) + nIndex));
}
else
{
switch (nIndex)
{
case GWL_EXSTYLE:
return Wnd->ExStyle;
case GWL_STYLE:
return Wnd->style;
case GWL_HINSTANCE:
return (LONG)Wnd->hModule;
case GWL_ID:
return Wnd->IDMenu;
case GWL_USERDATA:
return Wnd->dwUserData;
case GWL_HWNDPARENT:
{
HWND parent = GetAncestor( hWnd, GA_PARENT );
if (parent == GetDesktopWindow()) parent = GetWindow( hWnd, GW_OWNER );
return (LONG)parent;
}
case GWL_WNDPROC:
if (!TestWindowProcess(Wnd))
{
SetLastError(ERROR_ACCESS_DENIED);
return 0;
}
return IntGetWndProc(Wnd, FALSE);
default:
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
}
} }
#endif // _WIN64
/* /*
* @implemented * @implemented
@ -751,17 +764,22 @@ WORD
WINAPI WINAPI
GetWindowWord(HWND hWnd, int nIndex) GetWindowWord(HWND hWnd, int nIndex)
{ {
return (WORD)GetWindowLongW(hWnd, nIndex); switch(nIndex)
}
/*
* @implemented
*/
WORD
WINAPI
SetWindowWord ( HWND hWnd,int nIndex,WORD wNewWord )
{ {
return (WORD)NtUserSetWindowLong ( hWnd, nIndex, (LONG)wNewWord, TRUE ); case GWLP_ID:
case GWLP_HINSTANCE:
case GWLP_HWNDPARENT:
break;
default:
if (nIndex < 0)
{
WARN("Invalid offset %d\n", nIndex );
SetLastError( ERROR_INVALID_INDEX );
return 0;
}
break;
}
return IntGetWindowLong( hWnd, nIndex, sizeof(WORD), FALSE );
} }
/* /*
@ -1167,7 +1185,7 @@ SetClassLongA (HWND hWnd,
int nIndex, int nIndex,
LONG dwNewLong) LONG dwNewLong)
{ {
PSTR lpStr = (PSTR)dwNewLong; PSTR lpStr = (PSTR)(ULONG_PTR)dwNewLong;
UNICODE_STRING Value = {0}; UNICODE_STRING Value = {0};
BOOL Allocated = FALSE; BOOL Allocated = FALSE;
DWORD Ret; DWORD Ret;
@ -1190,7 +1208,7 @@ SetClassLongA (HWND hWnd,
else else
Value.Buffer = (PWSTR)lpStr; Value.Buffer = (PWSTR)lpStr;
dwNewLong = (LONG)&Value; dwNewLong = (LONG_PTR)&Value;
} }
else if (nIndex == GCW_ATOM && lpStr != NULL) else if (nIndex == GCW_ATOM && lpStr != NULL)
{ {
@ -1208,7 +1226,7 @@ SetClassLongA (HWND hWnd,
else else
Value.Buffer = (PWSTR)lpStr; Value.Buffer = (PWSTR)lpStr;
dwNewLong = (LONG)&Value; dwNewLong = (LONG_PTR)&Value;
} }
Ret = (DWORD)NtUserSetClassLong(hWnd, Ret = (DWORD)NtUserSetClassLong(hWnd,
@ -1234,7 +1252,7 @@ SetClassLongW(HWND hWnd,
int nIndex, int nIndex,
LONG dwNewLong) LONG dwNewLong)
{ {
PWSTR lpStr = (PWSTR)dwNewLong; PWSTR lpStr = (PWSTR)(ULONG_PTR)dwNewLong;
UNICODE_STRING Value = {0}; UNICODE_STRING Value = {0};
TRACE("%p %d %lx\n", hWnd, nIndex, dwNewLong); TRACE("%p %d %lx\n", hWnd, nIndex, dwNewLong);
@ -1251,7 +1269,7 @@ SetClassLongW(HWND hWnd,
else else
Value.Buffer = lpStr; Value.Buffer = lpStr;
dwNewLong = (LONG)&Value; dwNewLong = (LONG_PTR)&Value;
} }
else if (nIndex == GCW_ATOM && lpStr != NULL) else if (nIndex == GCW_ATOM && lpStr != NULL)
{ {
@ -1263,7 +1281,7 @@ SetClassLongW(HWND hWnd,
else else
Value.Buffer = lpStr; Value.Buffer = lpStr;
dwNewLong = (LONG)&Value; dwNewLong = (LONG_PTR)&Value;
} }
return (DWORD)NtUserSetClassLong(hWnd, return (DWORD)NtUserSetClassLong(hWnd,
@ -1272,6 +1290,33 @@ SetClassLongW(HWND hWnd,
FALSE); FALSE);
} }
#ifdef _WIN64
/*
* @unimplemented
*/
ULONG_PTR
WINAPI
SetClassLongPtrA(HWND hWnd,
INT nIndex,
LONG_PTR dwNewLong)
{
UNIMPLEMENTED;
return 0;
}
/*
* @unimplemented
*/
ULONG_PTR
WINAPI
SetClassLongPtrW(HWND hWnd,
INT nIndex,
LONG_PTR dwNewLong)
{
UNIMPLEMENTED;
return 0;
}
#endif // _WIN64
/* /*
* @implemented * @implemented
@ -1292,6 +1337,30 @@ SetClassWord(
return (WORD) SetClassLongW ( hWnd, nIndex, wNewWord ); return (WORD) SetClassLongW ( hWnd, nIndex, wNewWord );
} }
/*
* @implemented
*/
WORD
WINAPI
SetWindowWord ( HWND hWnd,int nIndex,WORD wNewWord )
{
switch(nIndex)
{
case GWLP_ID:
case GWLP_HINSTANCE:
case GWLP_HWNDPARENT:
break;
default:
if (nIndex < 0)
{
WARN("Invalid offset %d\n", nIndex );
SetLastError( ERROR_INVALID_INDEX );
return 0;
}
break;
}
return NtUserSetWindowLong( hWnd, nIndex, wNewWord, FALSE );
}
/* /*
* @implemented * @implemented
@ -1306,7 +1375,6 @@ SetWindowLongA(
return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, TRUE); return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, TRUE);
} }
/* /*
* @implemented * @implemented
*/ */
@ -1320,6 +1388,31 @@ SetWindowLongW(
return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE); return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE);
} }
#ifdef _WIN64
/*
* @implemented
*/
LONG_PTR
WINAPI
SetWindowLongPtrA(HWND hWnd,
INT nIndex,
LONG_PTR dwNewLong)
{
return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE);
}
/*
* @implemented
*/
LONG_PTR
WINAPI
SetWindowLongPtrW(HWND hWnd,
INT nIndex,
LONG_PTR dwNewLong)
{
return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE);
}
#endif
/* /*
* @implemented * @implemented

View file

@ -54,19 +54,19 @@ GetClipboardData(UINT uFormat)
{ {
HGLOBAL hGlobal = NULL; HGLOBAL hGlobal = NULL;
PVOID pGlobal = NULL; PVOID pGlobal = NULL;
DWORD size = 0; DWORD_PTR size = 0;
/* dealing with bitmap object */ /* dealing with bitmap object */
if (uFormat != CF_BITMAP) if (uFormat != CF_BITMAP)
{ {
size = (DWORD)NtUserGetClipboardData(uFormat, NULL); size = (DWORD_PTR)NtUserGetClipboardData(uFormat, NULL);
if (size) if (size)
{ {
hGlobal = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, size); hGlobal = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, size);
pGlobal = GlobalLock(hGlobal); pGlobal = GlobalLock(hGlobal);
size = (DWORD)NtUserGetClipboardData(uFormat, pGlobal); size = (DWORD_PTR)NtUserGetClipboardData(uFormat, pGlobal);
GlobalUnlock(hGlobal); GlobalUnlock(hGlobal);
} }

View file

@ -159,7 +159,7 @@ DIALOGINFO * DIALOG_get_info( HWND hWnd, BOOL create )
SETDLGINFO( hWnd, dlgInfo ); SETDLGINFO( hWnd, dlgInfo );
NtUserCallHwndParam( hWnd, (DWORD)dlgInfo, HWNDPARAM_ROUTINE_SETDIALOGPOINTER ); NtUserCallHwndParam( hWnd, (DWORD_PTR)dlgInfo, HWNDPARAM_ROUTINE_SETDIALOGPOINTER );
} }
else else
{ {
@ -342,7 +342,7 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
MulDiv(info.y, dlgInfo->yBaseUnit, 8), MulDiv(info.y, dlgInfo->yBaseUnit, 8),
MulDiv(info.cx, dlgInfo->xBaseUnit, 4), MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
MulDiv(info.cy, dlgInfo->yBaseUnit, 8), MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
hwnd, (HMENU)info.id, hwnd, (HMENU)(ULONG_PTR)info.id,
hInst, (LPVOID)info.data ); hInst, (LPVOID)info.data );
} }
else else
@ -373,7 +373,7 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
MulDiv(info.y, dlgInfo->yBaseUnit, 8), MulDiv(info.y, dlgInfo->yBaseUnit, 8),
MulDiv(info.cx, dlgInfo->xBaseUnit, 4), MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
MulDiv(info.cy, dlgInfo->yBaseUnit, 8), MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
hwnd, (HMENU)info.id, hwnd, (HMENU)(ULONG_PTR)info.id,
hInst, (LPVOID)info.data ); hInst, (LPVOID)info.data );
} }
else else
@ -618,7 +618,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
p++; p++;
break; break;
case 0xffff: case 0xffff:
result->menuName = (LPCWSTR)(UINT)GET_WORD( p + 1 ); result->menuName = (LPCWSTR)(UINT_PTR)GET_WORD( p + 1 );
p += 2; p += 2;
break; break;
default: default:
@ -636,7 +636,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
p++; p++;
break; break;
case 0xffff: case 0xffff:
result->className = (LPCWSTR)(UINT)GET_WORD( p + 1 ); result->className = (LPCWSTR)(UINT_PTR)GET_WORD( p + 1 );
p += 2; p += 2;
break; break;
default: default:

View file

@ -441,12 +441,12 @@ User32CallHookProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
if (NULL != CbtCreatewndExtra->Cs.lpszName) if (NULL != CbtCreatewndExtra->Cs.lpszName)
{ {
Csw.lpszName = (LPCWSTR)((PCHAR) CbtCreatewndExtra Csw.lpszName = (LPCWSTR)((PCHAR) CbtCreatewndExtra
+ (ULONG) CbtCreatewndExtra->Cs.lpszName); + (ULONG_PTR) CbtCreatewndExtra->Cs.lpszName);
} }
if (0 != HIWORD(CbtCreatewndExtra->Cs.lpszClass)) if (0 != HIWORD(CbtCreatewndExtra->Cs.lpszClass))
{ {
Csw.lpszClass = (LPCWSTR)((PCHAR) CbtCreatewndExtra Csw.lpszClass = (LPCWSTR)((PCHAR) CbtCreatewndExtra
+ LOWORD((ULONG) CbtCreatewndExtra->Cs.lpszClass)); + LOWORD((ULONG_PTR) CbtCreatewndExtra->Cs.lpszClass));
} }
wParam = Common->wParam; wParam = Common->wParam;
if (Common->Ansi) if (Common->Ansi)

View file

@ -1804,7 +1804,7 @@ LRESULT WINAPI PopupMenuWndProcA(HWND Wnd, UINT Message, WPARAM wParam, LPARAM l
case WM_CREATE: case WM_CREATE:
{ {
CREATESTRUCTA *cs = (CREATESTRUCTA *) lParam; CREATESTRUCTA *cs = (CREATESTRUCTA *) lParam;
SetWindowLongPtrA(Wnd, 0, (LONG) cs->lpCreateParams); SetWindowLongPtrA(Wnd, 0, (LONG_PTR)cs->lpCreateParams);
return 0; return 0;
} }
@ -1877,7 +1877,7 @@ PopupMenuWndProcW(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam)
case WM_CREATE: case WM_CREATE:
{ {
CREATESTRUCTW *cs = (CREATESTRUCTW *) lParam; CREATESTRUCTW *cs = (CREATESTRUCTW *) lParam;
SetWindowLongPtrW(Wnd, 0, (LONG) cs->lpCreateParams); SetWindowLongPtrW(Wnd, 0, (LONG_PTR)cs->lpCreateParams);
return 0; return 0;
} }
@ -3722,7 +3722,7 @@ MenuSetItemData(
{ {
mii->fType |= MFT_OWNERDRAW; mii->fType |= MFT_OWNERDRAW;
mii->fMask |= MIIM_DATA; mii->fMask |= MIIM_DATA;
mii->dwItemData = (DWORD) NewItem; mii->dwItemData = (DWORD_PTR) NewItem;
} }
else if (Flags & MF_SEPARATOR) else if (Flags & MF_SEPARATOR)
{ {
@ -4140,7 +4140,7 @@ GetMenu(HWND hWnd)
if (!Wnd) if (!Wnd)
return NULL; return NULL;
return (HMENU)Wnd->IDMenu; return UlongToHandle(Wnd->IDMenu);
} }

View file

@ -172,11 +172,11 @@ MsgiUMToKMMessage(PMSG UMMsg, PMSG KMMsg, BOOL Posted)
if (0 != HIWORD(DdeLparam->Value.Packed.uiHi)) if (0 != HIWORD(DdeLparam->Value.Packed.uiHi))
{ {
/* uiHi should contain a hMem from WM_DDE_EXECUTE */ /* uiHi should contain a hMem from WM_DDE_EXECUTE */
HGLOBAL h = DdeGetPair((HGLOBAL) DdeLparam->Value.Packed.uiHi); HGLOBAL h = DdeGetPair((HGLOBAL)(ULONG_PTR)DdeLparam->Value.Packed.uiHi);
if (NULL != h) if (NULL != h)
{ {
GlobalFree((HGLOBAL) DdeLparam->Value.Packed.uiHi); GlobalFree((HGLOBAL)(ULONG_PTR)DdeLparam->Value.Packed.uiHi);
DdeLparam->Value.Packed.uiHi = (UINT) h; DdeLparam->Value.Packed.uiHi = (UINT_PTR) h;
} }
} }
FreeDDElParam(UMMsg->message, UMMsg->lParam); FreeDDElParam(UMMsg->message, UMMsg->lParam);
@ -686,7 +686,7 @@ MsgiUnicodeToAnsiMessage(LPMSG AnsiMsg, LPMSG UnicodeMsg)
return FALSE; return FALSE;
} }
CsA->lpszName = AnsiString.Buffer; CsA->lpszName = AnsiString.Buffer;
if (HIWORD((ULONG)CsW->lpszClass) != 0) if (HIWORD((ULONG_PTR)CsW->lpszClass) != 0)
{ {
RtlInitUnicodeString(&UnicodeString, CsW->lpszClass); RtlInitUnicodeString(&UnicodeString, CsW->lpszClass);
Status = RtlUnicodeStringToAnsiString(&AnsiString, &UnicodeString, TRUE); Status = RtlUnicodeStringToAnsiString(&AnsiString, &UnicodeString, TRUE);
@ -850,7 +850,7 @@ MsgiUnicodeToAnsiCleanup(LPMSG AnsiMsg, LPMSG UnicodeMsg)
Cs = (CREATESTRUCTA*) AnsiMsg->lParam; Cs = (CREATESTRUCTA*) AnsiMsg->lParam;
RtlInitAnsiString(&AnsiString, Cs->lpszName); RtlInitAnsiString(&AnsiString, Cs->lpszName);
RtlFreeAnsiString(&AnsiString); RtlFreeAnsiString(&AnsiString);
if (HIWORD((ULONG)Cs->lpszClass) != 0) if (HIWORD((ULONG_PTR)Cs->lpszClass) != 0)
{ {
RtlInitAnsiString(&AnsiString, Cs->lpszClass); RtlInitAnsiString(&AnsiString, Cs->lpszClass);
RtlFreeAnsiString(&AnsiString); RtlFreeAnsiString(&AnsiString);
@ -947,7 +947,7 @@ typedef struct tagMSGCONVERSION
MSG UnicodeMsg; MSG UnicodeMsg;
MSG AnsiMsg; MSG AnsiMsg;
PMSG FinalMsg; PMSG FinalMsg;
ULONG LParamSize; SIZE_T LParamSize;
} MSGCONVERSION, *PMSGCONVERSION; } MSGCONVERSION, *PMSGCONVERSION;
static PMSGCONVERSION MsgConversions = NULL; static PMSGCONVERSION MsgConversions = NULL;
@ -2452,7 +2452,7 @@ SendNotifyMessageW(
* @implemented * @implemented
*/ */
BOOL WINAPI BOOL WINAPI
TranslateMessageEx(CONST MSG *lpMsg, DWORD unk) TranslateMessageEx(CONST MSG *lpMsg, UINT Flags)
{ {
switch (lpMsg->message) switch (lpMsg->message)
{ {
@ -2460,7 +2460,7 @@ TranslateMessageEx(CONST MSG *lpMsg, DWORD unk)
case WM_KEYUP: case WM_KEYUP:
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
case WM_SYSKEYUP: case WM_SYSKEYUP:
return(NtUserTranslateMessage((LPMSG)lpMsg, unk)); return(NtUserTranslateMessage((LPMSG)lpMsg, Flags));
default: default:
if ( lpMsg->message & ~WM_MAXIMUM ) if ( lpMsg->message & ~WM_MAXIMUM )

View file

@ -423,7 +423,7 @@ MessageBoxTimeoutIndirectW(
} }
/* create static for text */ /* create static for text */
dest = (BYTE*)(((DWORD)dest + 3) & ~3); dest = (BYTE*)(((UINT_PTR)dest + 3) & ~3);
itxt = (DLGITEMTEMPLATE *)dest; itxt = (DLGITEMTEMPLATE *)dest;
itxt->style = WS_CHILD | WS_VISIBLE | SS_NOPREFIX; itxt->style = WS_CHILD | WS_VISIBLE | SS_NOPREFIX;
if(lpMsgBoxParams->dwStyle & MB_RIGHT) if(lpMsgBoxParams->dwStyle & MB_RIGHT)
@ -450,7 +450,7 @@ MessageBoxTimeoutIndirectW(
btnrect.left = btnrect.top = 0; btnrect.left = btnrect.top = 0;
for(i = 0; i < nButtons; i++) for(i = 0; i < nButtons; i++)
{ {
dest = (BYTE*)(((DWORD)dest + 3) & ~3); dest = (BYTE*)(((UINT_PTR)dest + 3) & ~3);
ibtn[i] = (DLGITEMTEMPLATE *)dest; ibtn[i] = (DLGITEMTEMPLATE *)dest;
ibtn[i]->style = WS_CHILD | WS_VISIBLE | WS_TABSTOP; ibtn[i]->style = WS_CHILD | WS_VISIBLE | WS_TABSTOP;
if(!defbtn && (i == ((lpMsgBoxParams->dwStyle & MB_DEFMASK) >> 8))) if(!defbtn && (i == ((lpMsgBoxParams->dwStyle & MB_DEFMASK) >> 8)))
@ -699,7 +699,7 @@ MessageBoxIndirectA(
UNICODE_STRING textW, captionW, iconW; UNICODE_STRING textW, captionW, iconW;
int ret; int ret;
if (HIWORD((UINT)lpMsgBoxParams->lpszText)) if (HIWORD((UINT_PTR)lpMsgBoxParams->lpszText))
{ {
RtlCreateUnicodeStringFromAsciiz(&textW, (PCSZ)lpMsgBoxParams->lpszText); RtlCreateUnicodeStringFromAsciiz(&textW, (PCSZ)lpMsgBoxParams->lpszText);
/* /*
@ -711,7 +711,7 @@ MessageBoxIndirectA(
else else
textW.Buffer = (LPWSTR)lpMsgBoxParams->lpszText; textW.Buffer = (LPWSTR)lpMsgBoxParams->lpszText;
if (HIWORD((UINT)lpMsgBoxParams->lpszCaption)) if (HIWORD((UINT_PTR)lpMsgBoxParams->lpszCaption))
{ {
RtlCreateUnicodeStringFromAsciiz(&captionW, (PCSZ)lpMsgBoxParams->lpszCaption); RtlCreateUnicodeStringFromAsciiz(&captionW, (PCSZ)lpMsgBoxParams->lpszCaption);
/* /*
@ -725,7 +725,7 @@ MessageBoxIndirectA(
if(lpMsgBoxParams->dwStyle & MB_USERICON) if(lpMsgBoxParams->dwStyle & MB_USERICON)
{ {
if (HIWORD((UINT)lpMsgBoxParams->lpszIcon)) if (HIWORD((UINT_PTR)lpMsgBoxParams->lpszIcon))
{ {
RtlCreateUnicodeStringFromAsciiz(&iconW, (PCSZ)lpMsgBoxParams->lpszIcon); RtlCreateUnicodeStringFromAsciiz(&iconW, (PCSZ)lpMsgBoxParams->lpszIcon);
/* /*
@ -753,13 +753,13 @@ MessageBoxIndirectA(
ret = MessageBoxTimeoutIndirectW(&msgboxW, (UINT)-1); ret = MessageBoxTimeoutIndirectW(&msgboxW, (UINT)-1);
if (HIWORD((UINT)lpMsgBoxParams->lpszText)) if (HIWORD((UINT_PTR)lpMsgBoxParams->lpszText))
RtlFreeUnicodeString(&textW); RtlFreeUnicodeString(&textW);
if (HIWORD((UINT)lpMsgBoxParams->lpszCaption)) if (HIWORD((UINT_PTR)lpMsgBoxParams->lpszCaption))
RtlFreeUnicodeString(&captionW); RtlFreeUnicodeString(&captionW);
if ((lpMsgBoxParams->dwStyle & MB_USERICON) && HIWORD((UINT)iconW.Buffer)) if ((lpMsgBoxParams->dwStyle & MB_USERICON) && HIWORD((UINT_PTR)iconW.Buffer))
RtlFreeUnicodeString(&iconW); RtlFreeUnicodeString(&iconW);
return ret; return ret;
@ -809,12 +809,12 @@ MessageBoxTimeoutA(
UNICODE_STRING textW, captionW; UNICODE_STRING textW, captionW;
int ret; int ret;
if (HIWORD((UINT)lpText)) if (HIWORD((UINT_PTR)lpText))
RtlCreateUnicodeStringFromAsciiz(&textW, (PCSZ)lpText); RtlCreateUnicodeStringFromAsciiz(&textW, (PCSZ)lpText);
else else
textW.Buffer = (LPWSTR)lpText; textW.Buffer = (LPWSTR)lpText;
if (HIWORD((UINT)lpCaption)) if (HIWORD((UINT_PTR)lpCaption))
RtlCreateUnicodeStringFromAsciiz(&captionW, (PCSZ)lpCaption); RtlCreateUnicodeStringFromAsciiz(&captionW, (PCSZ)lpCaption);
else else
captionW.Buffer = (LPWSTR)lpCaption; captionW.Buffer = (LPWSTR)lpCaption;

View file

@ -122,13 +122,13 @@ UserGetWindowIcon(HWND hwnd)
{ {
HICON hIcon = 0; HICON hIcon = 0;
SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon); SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
if (!hIcon) if (!hIcon)
SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon); SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
if (!hIcon) if (!hIcon)
SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon); SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
if (!hIcon) if (!hIcon)
hIcon = (HICON)GetClassLongPtr(hwnd, GCL_HICONSM); hIcon = (HICON)GetClassLongPtr(hwnd, GCL_HICONSM);

View file

@ -377,7 +377,7 @@ GetPropW(HWND hWnd, LPCWSTR lpString)
} }
else else
{ {
Atom = LOWORD((DWORD)lpString); Atom = LOWORD((DWORD_PTR)lpString);
} }
Prop = IntGetProp(hWnd, Atom); Prop = IntGetProp(hWnd, Atom);
if (Prop != NULL) Data = Prop->Data; if (Prop != NULL) Data = Prop->Data;
@ -428,7 +428,7 @@ RemovePropW(HWND hWnd,
} }
else else
{ {
Atom = LOWORD((DWORD)lpString); Atom = LOWORD((DWORD_PTR)lpString);
} }
return(NtUserRemoveProp(hWnd, Atom)); return(NtUserRemoveProp(hWnd, Atom));
} }
@ -476,7 +476,7 @@ SetPropW(HWND hWnd, LPCWSTR lpString, HANDLE hData)
} }
else else
{ {
Atom = LOWORD((DWORD)lpString); Atom = LOWORD((DWORD_PTR)lpString);
} }
return(NtUserSetProp(hWnd, Atom, hData)); return(NtUserSetProp(hWnd, Atom, hData));

View file

@ -2117,7 +2117,7 @@ static void SPY_GetClassName( SPY_INSTANCE *sp_e )
/* save and restore error code over the next call */ /* save and restore error code over the next call */
save_error = GetLastError(); save_error = GetLastError();
/* special code to detect a property sheet dialog */ /* special code to detect a property sheet dialog */
if ((GetClassLongPtrW(sp_e->msg_hwnd, GCW_ATOM) == (LONG)WC_DIALOG) && if ((GetClassLongPtrW(sp_e->msg_hwnd, GCW_ATOM) == (ULONG_PTR)WC_DIALOG) &&
(GetPropW(sp_e->msg_hwnd, PropSheetInfoStr))) { (GetPropW(sp_e->msg_hwnd, PropSheetInfoStr))) {
strcpyW(sp_e->wnd_class, WC_PROPSHEETW); strcpyW(sp_e->wnd_class, WC_PROPSHEETW);
} }

View file

@ -135,7 +135,7 @@ CloseWindow(HWND hWnd)
{ {
SendMessageA(hWnd, WM_SYSCOMMAND, SC_CLOSE, 0); SendMessageA(hWnd, WM_SYSCOMMAND, SC_CLOSE, 0);
return (BOOL)(hWnd); return HandleToUlong(hWnd);
} }
VOID VOID
@ -402,7 +402,7 @@ CreateWindowExA(DWORD dwExStyle,
MDI_CalcDefaultChildPos(hWndParent, -1, mPos, 0, &id); MDI_CalcDefaultChildPos(hWndParent, -1, mPos, 0, &id);
if (!(dwStyle & WS_POPUP)) hMenu = (HMENU)id; if (!(dwStyle & WS_POPUP)) hMenu = UlongToHandle(id);
if (dwStyle & (WS_CHILD | WS_POPUP)) if (dwStyle & (WS_CHILD | WS_POPUP))
{ {
@ -532,7 +532,7 @@ CreateWindowExW(DWORD dwExStyle,
MDI_CalcDefaultChildPos(hWndParent, -1, mPos, 0, &id); MDI_CalcDefaultChildPos(hWndParent, -1, mPos, 0, &id);
if (!(dwStyle & WS_POPUP)) hMenu = (HMENU)id; if (!(dwStyle & WS_POPUP)) hMenu = UlongToHandle(id);
if (dwStyle & (WS_CHILD | WS_POPUP)) if (dwStyle & (WS_CHILD | WS_POPUP))
{ {
@ -692,7 +692,7 @@ User32EnumWindows(HDESK hDesktop,
* Once that's fixed, we shouldn't have to check for a NULL HWND * Once that's fixed, we shouldn't have to check for a NULL HWND
* here * here
*/ */
if (!(ULONG)pHwnd[i]) /* don't enumerate a NULL HWND */ if (!pHwnd[i]) /* don't enumerate a NULL HWND */
continue; continue;
if (!(*lpfn)(pHwnd[i], lParam)) if (!(*lpfn)(pHwnd[i], lParam))
{ {
@ -1442,8 +1442,8 @@ GetWindowThreadProcessId(HWND hWnd,
{ // We are current. { // We are current.
//FIXME("Current!\n"); //FIXME("Current!\n");
if (lpdwProcessId) if (lpdwProcessId)
*lpdwProcessId = (DWORD)NtCurrentTeb()->ClientId.UniqueProcess; *lpdwProcessId = (DWORD_PTR)NtCurrentTeb()->ClientId.UniqueProcess;
Ret = (DWORD)NtCurrentTeb()->ClientId.UniqueThread; Ret = (DWORD_PTR)NtCurrentTeb()->ClientId.UniqueThread;
} }
else else
{ // Ask kernel for info. { // Ask kernel for info.

View file

@ -3118,8 +3118,8 @@ typedef struct tagKMDDELPARAM
{ {
struct struct
{ {
UINT uiLo; UINT_PTR uiLo;
UINT uiHi; UINT_PTR uiHi;
} Packed; } Packed;
LPARAM Unpacked; LPARAM Unpacked;
} Value; } Value;