#define WS_EX_DRAGDETECT 0x00000002L
#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);
/* End of hack section -------------------------------- */
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);
/*********************************************************************
}
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);
}
NtUserCallOneParam((DWORD_PTR)bShow, ONEPARAM_ROUTINE_SHOWCURSOR)
#define NtUserGetDesktopMapping(Ptr) \
- (PVOID)NtUserCallOneParam((DWORD)Ptr, ONEPARAM_ROUTINE_GETDESKTOPMAPPING)
+ (PVOID)NtUserCallOneParam((DWORD_PTR)Ptr, ONEPARAM_ROUTINE_GETDESKTOPMAPPING)
#define NtUserSetCursorPos(x, y) \
(BOOL)NtUserCallTwoParam((DWORD)x, (DWORD)y, TWOPARAM_ROUTINE_SETCURSORPOS)
BOOL Unicode);
HWND* WIN_ListChildren (HWND hWndparent);
-ULONG_PTR FASTCALL IntGetWndProc(PWND, BOOL);
+WNDPROC FASTCALL IntGetWndProc(PWND, BOOL);
DWORD WINAPI GetRealWindowOwner(HWND);
-/* $Id$
- *
+/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/exit.c
NTSTATUS Status;
CsrRequest = MAKE_CSR_API(REGISTER_SERVICES_PROCESS, CSR_GUI);
- Request.Data.RegisterServicesProcessRequest.ProcessId = (HANDLE)ServicesProcessId;
+ Request.Data.RegisterServicesProcessRequest.ProcessId = UlongToHandle(ServicesProcessId);
Status = CsrClientCallServer(&Request,
NULL,
return TRUE;
else
return (NtUserQueryWindow(Wnd->head.h, QUERY_WINDOW_UNIQUE_PROCESS_ID) ==
- (DWORD)NtCurrentTeb()->ClientId.UniqueProcess );
+ (DWORD_PTR)NtCurrentTeb()->ClientId.UniqueProcess );
}
BOOL
INT Index;
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)
return NULL;
if (!gHandleEntries[Index].type || !gHandleEntries[Index].ptr)
return NULL;
- generation = (UINT)handle >> 16;
+ generation = (UINT_PTR)handle >> 16;
if (generation == gHandleEntries[Index].generation || !generation || generation == 0xffff)
return &gHandleEntries[Index];
return FALSE;
}
- ConfigRet = UnRegNotify((ULONG) Handle );
+ ConfigRet = UnRegNotify((ULONG_PTR)Handle );
if (ConfigRet != CR_SUCCESS)
{
switch (ConfigRet)
}
if (!pPens && !pBrushes) /* "restore" call */
{
- LPVOID pOldCol = (LPVOID)n; /* FIXME: not 64-bit safe */
+ LPVOID pOldCol = (LPVOID)n;
LPVOID p = pOldCol;
DWORD nCount = *(DWORD *)p;
p = (char*)p + sizeof(DWORD);
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- *
+/*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/winhelp.c
* PURPOSE: WinHelp
*/
BOOL
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;
HWND hDest;
*/
BOOL
WINAPI
-WinHelpW(HWND hWnd, LPCWSTR lpszHelp, UINT uCommand, DWORD dwData)
+WinHelpW(HWND hWnd, LPCWSTR lpszHelp, UINT uCommand, DWORD_PTR dwData)
{
INT len;
LPSTR file;
//
// Based on IntGetClsWndProc
//
-ULONG_PTR FASTCALL
+WNDPROC FASTCALL
IntGetWndProc(PWND pWnd, BOOL Ansi)
{
INT i;
- ULONG_PTR gcpd, Ret = 0;
+ WNDPROC gcpd, Ret = 0;
PCLS Class = DesktopPtrToUser(pWnd->pcls);
if (!Class) return Ret;
if (GETPFNSERVER(i) == pWnd->lpfnWndProc)
{
if (Ansi)
- Ret = (ULONG_PTR)GETPFNCLIENTA(i);
+ Ret = GETPFNCLIENTA(i);
else
- Ret = (ULONG_PTR)GETPFNCLIENTW(i);
+ Ret = GETPFNCLIENTW(i);
}
}
return Ret;
is treated specially.
*/
if (Class->fnid == FNID_EDIT)
- Ret = (ULONG_PTR)pWnd->lpfnWndProc;
+ Ret = pWnd->lpfnWndProc;
else
{
// Set return proc.
- Ret = (ULONG_PTR)pWnd->lpfnWndProc;
+ Ret = pWnd->lpfnWndProc;
if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_BUTTON)
{
if (Ansi)
{
if (GETPFNCLIENTW(Class->fnid) == pWnd->lpfnWndProc)
- Ret = (ULONG_PTR)GETPFNCLIENTA(Class->fnid);
+ Ret = GETPFNCLIENTA(Class->fnid);
}
else
{
if (GETPFNCLIENTA(Class->fnid) == pWnd->lpfnWndProc)
- Ret = (ULONG_PTR)GETPFNCLIENTW(Class->fnid);
+ Ret = GETPFNCLIENTW(Class->fnid);
}
}
// Return on the change.
- if ( Ret != (ULONG_PTR)pWnd->lpfnWndProc)
+ if ( Ret != pWnd->lpfnWndProc)
return Ret;
}
if ( Ansi == !!(pWnd->state & WNDS_ANSIWINDOWPROC) )
return Ret;
- gcpd = NtUserGetCPD( UserHMGetHandle(pWnd),
- (Ansi ? UserGetCPDA2U : UserGetCPDU2A )|UserGetCPDWindow,
- Ret);
+ gcpd = (WNDPROC)NtUserGetCPD( UserHMGetHandle(pWnd),
+ (Ansi ? UserGetCPDA2U : UserGetCPDU2A )|UserGetCPDWindow,
+ (ULONG_PTR)Ret);
return (gcpd ? gcpd : 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
- */
-LONG
-WINAPI
-GetWindowLongA ( HWND hWnd, int nIndex )
+LONG_PTR IntGetWindowLong( HWND hwnd, INT offset, UINT size, BOOL unicode )
{
- PWND Wnd;
+ LONG_PTR retvalue = 0;
+ WND *wndPtr;
- Wnd = ValidateHwnd(hWnd);
- if (Wnd == NULL)
+ 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 (nIndex >= 0)
+ if (offset >= 0)
{
- if ((DWORD)nIndex + sizeof(LONG) > Wnd->cbwndExtra)
+ if (offset > (int)(wndPtr->cbwndExtra - size))
{
- SetLastError(ERROR_INVALID_PARAMETER);
+ WARN("Invalid offset %d\n", offset );
+ SetLastError( ERROR_INVALID_INDEX );
return 0;
}
- return *((LONG *)((PCHAR)(Wnd + 1) + nIndex));
+ 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;
}
- 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;
- }
+ 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
+ */
+LONG
+WINAPI
+GetWindowLongA ( HWND hWnd, int nIndex )
+{
+ return IntGetWindowLong( hWnd, nIndex, sizeof(LONG), FALSE );
+}
/*
* @implemented
WINAPI
GetWindowLongW(HWND hWnd, int nIndex)
{
- PWND Wnd;
-
- 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, FALSE);
+ return IntGetWindowLong( hWnd, nIndex, sizeof(LONG), TRUE );
+}
- default:
- SetLastError(ERROR_INVALID_PARAMETER);
- return 0;
- }
- }
+#ifdef _WIN64
+/*
+ * @implemented
+ */
+LONG_PTR
+WINAPI
+GetWindowLongPtrA(HWND hWnd,
+ INT nIndex)
+{
+ return IntGetWindowLong( hWnd, nIndex, sizeof(LONG_PTR), FALSE );
}
/*
* @implemented
*/
-WORD
+LONG_PTR
WINAPI
-GetWindowWord(HWND hWnd, int nIndex)
+GetWindowLongPtrW(HWND hWnd,
+ INT nIndex)
{
- return (WORD)GetWindowLongW(hWnd, nIndex);
+ return IntGetWindowLong( hWnd, nIndex, sizeof(LONG_PTR), TRUE );
+
}
+#endif // _WIN64
/*
* @implemented
*/
WORD
WINAPI
-SetWindowWord ( HWND hWnd,int nIndex,WORD wNewWord )
+GetWindowWord(HWND hWnd, int nIndex)
{
- return (WORD)NtUserSetWindowLong ( hWnd, nIndex, (LONG)wNewWord, TRUE );
+ 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 IntGetWindowLong( hWnd, nIndex, sizeof(WORD), FALSE );
}
/*
int nIndex,
LONG dwNewLong)
{
- PSTR lpStr = (PSTR)dwNewLong;
+ PSTR lpStr = (PSTR)(ULONG_PTR)dwNewLong;
UNICODE_STRING Value = {0};
BOOL Allocated = FALSE;
DWORD Ret;
else
Value.Buffer = (PWSTR)lpStr;
- dwNewLong = (LONG)&Value;
+ dwNewLong = (LONG_PTR)&Value;
}
else if (nIndex == GCW_ATOM && lpStr != NULL)
{
else
Value.Buffer = (PWSTR)lpStr;
- dwNewLong = (LONG)&Value;
+ dwNewLong = (LONG_PTR)&Value;
}
Ret = (DWORD)NtUserSetClassLong(hWnd,
int nIndex,
LONG dwNewLong)
{
- PWSTR lpStr = (PWSTR)dwNewLong;
+ PWSTR lpStr = (PWSTR)(ULONG_PTR)dwNewLong;
UNICODE_STRING Value = {0};
TRACE("%p %d %lx\n", hWnd, nIndex, dwNewLong);
else
Value.Buffer = lpStr;
- dwNewLong = (LONG)&Value;
+ dwNewLong = (LONG_PTR)&Value;
}
else if (nIndex == GCW_ATOM && lpStr != NULL)
{
else
Value.Buffer = lpStr;
- dwNewLong = (LONG)&Value;
+ dwNewLong = (LONG_PTR)&Value;
}
return (DWORD)NtUserSetClassLong(hWnd,
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
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
return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, TRUE);
}
-
/*
* @implemented
*/
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
{
HGLOBAL hGlobal = NULL;
PVOID pGlobal = NULL;
- DWORD size = 0;
+ DWORD_PTR size = 0;
/* dealing with bitmap object */
if (uFormat != CF_BITMAP)
{
- size = (DWORD)NtUserGetClipboardData(uFormat, NULL);
+ size = (DWORD_PTR)NtUserGetClipboardData(uFormat, NULL);
if (size)
{
hGlobal = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, size);
pGlobal = GlobalLock(hGlobal);
- size = (DWORD)NtUserGetClipboardData(uFormat, pGlobal);
+ size = (DWORD_PTR)NtUserGetClipboardData(uFormat, pGlobal);
GlobalUnlock(hGlobal);
}
SETDLGINFO( hWnd, dlgInfo );
- NtUserCallHwndParam( hWnd, (DWORD)dlgInfo, HWNDPARAM_ROUTINE_SETDIALOGPOINTER );
+ NtUserCallHwndParam( hWnd, (DWORD_PTR)dlgInfo, HWNDPARAM_ROUTINE_SETDIALOGPOINTER );
}
else
{
MulDiv(info.y, dlgInfo->yBaseUnit, 8),
MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
- hwnd, (HMENU)info.id,
+ hwnd, (HMENU)(ULONG_PTR)info.id,
hInst, (LPVOID)info.data );
}
else
MulDiv(info.y, dlgInfo->yBaseUnit, 8),
MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
- hwnd, (HMENU)info.id,
+ hwnd, (HMENU)(ULONG_PTR)info.id,
hInst, (LPVOID)info.data );
}
else
p++;
break;
case 0xffff:
- result->menuName = (LPCWSTR)(UINT)GET_WORD( p + 1 );
+ result->menuName = (LPCWSTR)(UINT_PTR)GET_WORD( p + 1 );
p += 2;
break;
default:
p++;
break;
case 0xffff:
- result->className = (LPCWSTR)(UINT)GET_WORD( p + 1 );
+ result->className = (LPCWSTR)(UINT_PTR)GET_WORD( p + 1 );
p += 2;
break;
default:
if (NULL != CbtCreatewndExtra->Cs.lpszName)
{
Csw.lpszName = (LPCWSTR)((PCHAR) CbtCreatewndExtra
- + (ULONG) CbtCreatewndExtra->Cs.lpszName);
+ + (ULONG_PTR) CbtCreatewndExtra->Cs.lpszName);
}
if (0 != HIWORD(CbtCreatewndExtra->Cs.lpszClass))
{
Csw.lpszClass = (LPCWSTR)((PCHAR) CbtCreatewndExtra
- + LOWORD((ULONG) CbtCreatewndExtra->Cs.lpszClass));
+ + LOWORD((ULONG_PTR) CbtCreatewndExtra->Cs.lpszClass));
}
wParam = Common->wParam;
if (Common->Ansi)
case WM_CREATE:
{
CREATESTRUCTA *cs = (CREATESTRUCTA *) lParam;
- SetWindowLongPtrA(Wnd, 0, (LONG) cs->lpCreateParams);
+ SetWindowLongPtrA(Wnd, 0, (LONG_PTR)cs->lpCreateParams);
return 0;
}
case WM_CREATE:
{
CREATESTRUCTW *cs = (CREATESTRUCTW *) lParam;
- SetWindowLongPtrW(Wnd, 0, (LONG) cs->lpCreateParams);
+ SetWindowLongPtrW(Wnd, 0, (LONG_PTR)cs->lpCreateParams);
return 0;
}
{
mii->fType |= MFT_OWNERDRAW;
mii->fMask |= MIIM_DATA;
- mii->dwItemData = (DWORD) NewItem;
+ mii->dwItemData = (DWORD_PTR) NewItem;
}
else if (Flags & MF_SEPARATOR)
{
if (!Wnd)
return NULL;
- return (HMENU)Wnd->IDMenu;
+ return UlongToHandle(Wnd->IDMenu);
}
if (0 != HIWORD(DdeLparam->Value.Packed.uiHi))
{
/* 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)
{
- GlobalFree((HGLOBAL) DdeLparam->Value.Packed.uiHi);
- DdeLparam->Value.Packed.uiHi = (UINT) h;
+ GlobalFree((HGLOBAL)(ULONG_PTR)DdeLparam->Value.Packed.uiHi);
+ DdeLparam->Value.Packed.uiHi = (UINT_PTR) h;
}
}
FreeDDElParam(UMMsg->message, UMMsg->lParam);
return FALSE;
}
CsA->lpszName = AnsiString.Buffer;
- if (HIWORD((ULONG)CsW->lpszClass) != 0)
+ if (HIWORD((ULONG_PTR)CsW->lpszClass) != 0)
{
RtlInitUnicodeString(&UnicodeString, CsW->lpszClass);
Status = RtlUnicodeStringToAnsiString(&AnsiString, &UnicodeString, TRUE);
Cs = (CREATESTRUCTA*) AnsiMsg->lParam;
RtlInitAnsiString(&AnsiString, Cs->lpszName);
RtlFreeAnsiString(&AnsiString);
- if (HIWORD((ULONG)Cs->lpszClass) != 0)
+ if (HIWORD((ULONG_PTR)Cs->lpszClass) != 0)
{
RtlInitAnsiString(&AnsiString, Cs->lpszClass);
RtlFreeAnsiString(&AnsiString);
MSG UnicodeMsg;
MSG AnsiMsg;
PMSG FinalMsg;
- ULONG LParamSize;
+ SIZE_T LParamSize;
} MSGCONVERSION, *PMSGCONVERSION;
static PMSGCONVERSION MsgConversions = NULL;
* @implemented
*/
BOOL WINAPI
-TranslateMessageEx(CONST MSG *lpMsg, DWORD unk)
+TranslateMessageEx(CONST MSG *lpMsg, UINT Flags)
{
switch (lpMsg->message)
{
case WM_KEYUP:
case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
- return(NtUserTranslateMessage((LPMSG)lpMsg, unk));
+ return(NtUserTranslateMessage((LPMSG)lpMsg, Flags));
default:
if ( lpMsg->message & ~WM_MAXIMUM )
}
/* create static for text */
- dest = (BYTE*)(((DWORD)dest + 3) & ~3);
+ dest = (BYTE*)(((UINT_PTR)dest + 3) & ~3);
itxt = (DLGITEMTEMPLATE *)dest;
itxt->style = WS_CHILD | WS_VISIBLE | SS_NOPREFIX;
if(lpMsgBoxParams->dwStyle & MB_RIGHT)
btnrect.left = btnrect.top = 0;
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]->style = WS_CHILD | WS_VISIBLE | WS_TABSTOP;
if(!defbtn && (i == ((lpMsgBoxParams->dwStyle & MB_DEFMASK) >> 8)))
UNICODE_STRING textW, captionW, iconW;
int ret;
- if (HIWORD((UINT)lpMsgBoxParams->lpszText))
+ if (HIWORD((UINT_PTR)lpMsgBoxParams->lpszText))
{
RtlCreateUnicodeStringFromAsciiz(&textW, (PCSZ)lpMsgBoxParams->lpszText);
/*
else
textW.Buffer = (LPWSTR)lpMsgBoxParams->lpszText;
- if (HIWORD((UINT)lpMsgBoxParams->lpszCaption))
+ if (HIWORD((UINT_PTR)lpMsgBoxParams->lpszCaption))
{
RtlCreateUnicodeStringFromAsciiz(&captionW, (PCSZ)lpMsgBoxParams->lpszCaption);
/*
if(lpMsgBoxParams->dwStyle & MB_USERICON)
{
- if (HIWORD((UINT)lpMsgBoxParams->lpszIcon))
+ if (HIWORD((UINT_PTR)lpMsgBoxParams->lpszIcon))
{
RtlCreateUnicodeStringFromAsciiz(&iconW, (PCSZ)lpMsgBoxParams->lpszIcon);
/*
ret = MessageBoxTimeoutIndirectW(&msgboxW, (UINT)-1);
- if (HIWORD((UINT)lpMsgBoxParams->lpszText))
+ if (HIWORD((UINT_PTR)lpMsgBoxParams->lpszText))
RtlFreeUnicodeString(&textW);
- if (HIWORD((UINT)lpMsgBoxParams->lpszCaption))
+ if (HIWORD((UINT_PTR)lpMsgBoxParams->lpszCaption))
RtlFreeUnicodeString(&captionW);
- if ((lpMsgBoxParams->dwStyle & MB_USERICON) && HIWORD((UINT)iconW.Buffer))
+ if ((lpMsgBoxParams->dwStyle & MB_USERICON) && HIWORD((UINT_PTR)iconW.Buffer))
RtlFreeUnicodeString(&iconW);
return ret;
UNICODE_STRING textW, captionW;
int ret;
- if (HIWORD((UINT)lpText))
+ if (HIWORD((UINT_PTR)lpText))
RtlCreateUnicodeStringFromAsciiz(&textW, (PCSZ)lpText);
else
textW.Buffer = (LPWSTR)lpText;
- if (HIWORD((UINT)lpCaption))
+ if (HIWORD((UINT_PTR)lpCaption))
RtlCreateUnicodeStringFromAsciiz(&captionW, (PCSZ)lpCaption);
else
captionW.Buffer = (LPWSTR)lpCaption;
{
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)
- 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)
- 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)
hIcon = (HICON)GetClassLongPtr(hwnd, GCL_HICONSM);
}
else
{
- Atom = LOWORD((DWORD)lpString);
+ Atom = LOWORD((DWORD_PTR)lpString);
}
Prop = IntGetProp(hWnd, Atom);
if (Prop != NULL) Data = Prop->Data;
}
else
{
- Atom = LOWORD((DWORD)lpString);
+ Atom = LOWORD((DWORD_PTR)lpString);
}
return(NtUserRemoveProp(hWnd, Atom));
}
}
else
{
- Atom = LOWORD((DWORD)lpString);
+ Atom = LOWORD((DWORD_PTR)lpString);
}
return(NtUserSetProp(hWnd, Atom, hData));
/* save and restore error code over the next call */
save_error = GetLastError();
/* 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))) {
strcpyW(sp_e->wnd_class, WC_PROPSHEETW);
}
{
SendMessageA(hWnd, WM_SYSCOMMAND, SC_CLOSE, 0);
- return (BOOL)(hWnd);
+ return HandleToUlong(hWnd);
}
VOID
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))
{
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))
{
* Once that's fixed, we shouldn't have to check for a NULL HWND
* here
*/
- if (!(ULONG)pHwnd[i]) /* don't enumerate a NULL HWND */
+ if (!pHwnd[i]) /* don't enumerate a NULL HWND */
continue;
if (!(*lpfn)(pHwnd[i], lParam))
{
{ // We are current.
//FIXME("Current!\n");
if (lpdwProcessId)
- *lpdwProcessId = (DWORD)NtCurrentTeb()->ClientId.UniqueProcess;
- Ret = (DWORD)NtCurrentTeb()->ClientId.UniqueThread;
+ *lpdwProcessId = (DWORD_PTR)NtCurrentTeb()->ClientId.UniqueProcess;
+ Ret = (DWORD_PTR)NtCurrentTeb()->ClientId.UniqueThread;
}
else
{ // Ask kernel for info.
{
struct
{
- UINT uiLo;
- UINT uiHi;
+ UINT_PTR uiLo;
+ UINT_PTR uiHi;
} Packed;
LPARAM Unpacked;
} Value;