GetWindowLong -> GetWindowLongPtr.

This commit is contained in:
Robert Shearman 2004-09-22 19:14:08 +00:00 committed by Alexandre Julliard
parent 0ee1407d3f
commit bbdac5e475
23 changed files with 95 additions and 97 deletions

View File

@ -463,7 +463,7 @@ BOOL16 WINAPI ChooseColor16( LPCHOOSECOLOR16 lpChCol )
}
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 8);
hInst = GetWindowLongA(HWND_32(lpChCol->hwndOwner), GWL_HINSTANCE);
hInst = GetWindowLongPtrA(HWND_32(lpChCol->hwndOwner), GWLP_HINSTANCE);
bRet = DialogBoxIndirectParam16(hInst, hDlgTmpl16, lpChCol->hwndOwner,
(DLGPROC16) ptr, (DWORD)lpChCol);
if (hResource16) FreeResource16(hDlgTmpl16);

View File

@ -3635,7 +3635,7 @@ static BOOL GetFileName31A(LPOPENFILENAMEA lpofn, /* addess of structure with da
lfs = FD31_AllocPrivate((LPARAM) lpofn, dlgType, &callbacks, (DWORD) FALSE);
if (lfs)
{
hInst = (HINSTANCE)GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
hInst = (HINSTANCE)GetWindowLongPtrA( lpofn->hwndOwner, GWLP_HINSTANCE );
bRet = DialogBoxIndirectParamA( hInst, lfs->template, lpofn->hwndOwner,
FD32_FileOpenDlgProc, (LPARAM)lfs);
FD31_DestroyPrivate(lfs);
@ -3665,7 +3665,7 @@ static BOOL GetFileName31W(LPOPENFILENAMEW lpofn, /* addess of structure with da
lfs = FD31_AllocPrivate((LPARAM) lpofn, dlgType, &callbacks, (DWORD) FALSE);
if (lfs)
{
hInst = (HINSTANCE)GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
hInst = (HINSTANCE)GetWindowLongPtrW( lpofn->hwndOwner, GWLP_HINSTANCE );
bRet = DialogBoxIndirectParamW( hInst, lfs->template, lpofn->hwndOwner,
FD32_FileOpenDlgProc, (LPARAM)lfs);
FD31_DestroyPrivate(lfs);

View File

@ -459,7 +459,7 @@ BOOL16 WINAPI GetOpenFileName16(
if (lfs)
{
priv = (PFD16_PRIVATE) lfs->private1632;
hInst = GetWindowWord( HWND_32(lpofn->hwndOwner), GWL_HINSTANCE );
hInst = GetWindowLongPtrA( HWND_32(lpofn->hwndOwner), GWLP_HINSTANCE );
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 6);
bRet = DialogBoxIndirectParam16( hInst, priv->hDlgTmpl16, lpofn->hwndOwner,
(DLGPROC16) ptr, (LPARAM) lfs);
@ -501,7 +501,7 @@ BOOL16 WINAPI GetSaveFileName16(
if (lfs)
{
priv = (PFD16_PRIVATE) lfs->private1632;
hInst = GetWindowWord( HWND_32(lpofn->hwndOwner), GWL_HINSTANCE );
hInst = GetWindowLongPtrA( HWND_32(lpofn->hwndOwner), GWLP_HINSTANCE );
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 7);
bRet = DialogBoxIndirectParam16( hInst, priv->hDlgTmpl16, lpofn->hwndOwner,
(DLGPROC16) ptr, (LPARAM) lfs);

View File

@ -182,7 +182,7 @@ HWND16 WINAPI FindText16( SEGPTR find )
lfr->find = TRUE;
if (FINDDLG_Get16BitsTemplate(lfr))
{
hInst = GetWindowLongA( HWND_32(lfr->fr16->hwndOwner), GWL_HINSTANCE);
hInst = GetWindowLongPtrA( HWND_32(lfr->fr16->hwndOwner), GWLP_HINSTANCE);
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 13);
ret = CreateDialogIndirectParam16( hInst, lfr->template,
lfr->fr16->hwndOwner, (DLGPROC16) ptr, find);
@ -212,7 +212,7 @@ HWND16 WINAPI ReplaceText16( SEGPTR find )
lfr->find = FALSE;
if (FINDDLG_Get16BitsTemplate(lfr))
{
hInst = GetWindowLongA( HWND_32(lfr->fr16->hwndOwner), GWL_HINSTANCE);
hInst = GetWindowLongPtrA( HWND_32(lfr->fr16->hwndOwner), GWLP_HINSTANCE);
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 14);
ret = CreateDialogIndirectParam16( hInst, lfr->template,
lfr->fr16->hwndOwner, (DLGPROC16) ptr, find);

View File

@ -231,7 +231,7 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
lpChFont->lpTemplateName=(SEGPTR)&cf32a;
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 16);
hInst = GetWindowLongA(HWND_32(lpChFont->hwndOwner), GWL_HINSTANCE);
hInst = GetWindowLongPtrA(HWND_32(lpChFont->hwndOwner), GWLP_HINSTANCE);
bRet = DialogBoxIndirectParam16(hInst, hDlgTmpl16, lpChFont->hwndOwner,
(DLGPROC16) ptr, (DWORD)lpChFont);
if (hResource16) FreeResource16(hDlgTmpl16);

View File

@ -1979,7 +1979,7 @@ BOOL WINAPI PrintDlgA(
{
BOOL bRet = FALSE;
LPVOID ptr;
HINSTANCE hInst = (HINSTANCE)GetWindowLongA( lppd->hwndOwner, GWL_HINSTANCE );
HINSTANCE hInst = (HINSTANCE)GetWindowLongPtrA( lppd->hwndOwner, GWLP_HINSTANCE );
if(TRACE_ON(commdlg)) {
char flagstr[1000] = "";
@ -2135,7 +2135,7 @@ BOOL WINAPI PrintDlgW(
{
BOOL bRet = FALSE;
LPVOID ptr;
HINSTANCE hInst = (HINSTANCE)GetWindowLongW( lppd->hwndOwner, GWL_HINSTANCE );
HINSTANCE hInst = (HINSTANCE)GetWindowLongPtrW( lppd->hwndOwner, GWLP_HINSTANCE );
if(TRACE_ON(commdlg)) {
char flagstr[1000] = "";

View File

@ -345,7 +345,7 @@ BOOL16 WINAPI PrintDlg16(
) {
BOOL bRet = FALSE;
LPVOID ptr;
HINSTANCE16 hInst = GetWindowWord( HWND_32(lppd->hwndOwner), GWL_HINSTANCE );
HINSTANCE16 hInst = GetWindowLongPtrW( HWND_32(lppd->hwndOwner), GWLP_HINSTANCE );
if(TRACE_ON(commdlg)) {
char flagstr[1000] = "";

View File

@ -260,7 +260,7 @@ static HRESULT WINAPI IAutoComplete_fnInit(
WS_BORDER | WS_CHILD | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
hwndParent, NULL,
(HINSTANCE)GetWindowLongA( hwndParent, GWL_HINSTANCE ), NULL);
(HINSTANCE)GetWindowLongPtrW( hwndParent, GWLP_HINSTANCE ), NULL);
if (This->hwndListBox) {
This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc);

View File

@ -109,8 +109,8 @@ void WINAPI RunFileDlg(
return;
}
DialogBoxIndirectParamA((HINSTANCE)GetWindowLongA( hwndOwner,
GWL_HINSTANCE ),
DialogBoxIndirectParamA((HINSTANCE)GetWindowLongPtrW( hwndOwner,
GWLP_HINSTANCE ),
template, hwndOwner, RunDlgProc, (LPARAM)&rfdp);
}

View File

@ -854,7 +854,7 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 );
info.hFont = CreateFontIndirectW( &logFont );
bRet = DialogBoxIndirectParamW((HINSTANCE)GetWindowLongW( hWnd, GWL_HINSTANCE ),
bRet = DialogBoxIndirectParamW((HINSTANCE)GetWindowLongPtrW( hWnd, GWLP_HINSTANCE ),
template, hWnd, AboutDlgProc, (LPARAM)&info );
DeleteObject(info.hFont);
return bRet;

View File

@ -1532,7 +1532,7 @@ static LRESULT ShellView_OnChange(IShellViewImpl * This, LPITEMIDLIST * Pidls, L
static LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
{
IShellViewImpl * pThis = (IShellViewImpl*)GetWindowLongA(hWnd, GWL_USERDATA);
IShellViewImpl * pThis = (IShellViewImpl*)GetWindowLongPtrW(hWnd, GWLP_USERDATA);
LPCREATESTRUCTA lpcs;
TRACE("(hwnd=%p msg=%x wparm=%x lparm=%lx)\n",hWnd, uMessage, wParam, lParam);
@ -1542,7 +1542,7 @@ static LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wPara
case WM_NCCREATE:
lpcs = (LPCREATESTRUCTA)lParam;
pThis = (IShellViewImpl*)(lpcs->lpCreateParams);
SetWindowLongA(hWnd, GWL_USERDATA, (LONG)pThis);
SetWindowLongPtrW(hWnd, GWLP_USERDATA, (ULONG_PTR)pThis);
pThis->hWnd = hWnd; /*set the window handle*/
break;

View File

@ -196,7 +196,7 @@ static BOOL DIALOG_CreateControls16( HWND hwnd, LPCSTR template,
SendMessageA( hwndDefButton, BM_SETSTYLE,
BS_PUSHBUTTON,FALSE );
hwndDefButton = hwndCtrl;
dlgInfo->idResult = GetWindowLongA( hwndCtrl, GWL_ID );
dlgInfo->idResult = GetWindowLongPtrA( hwndCtrl, GWLP_ID );
}
}
TRACE(" END\n" );

View File

@ -1452,12 +1452,12 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
/* now call the window procedure */
if (unicode)
{
if (!(winproc = (WNDPROC)GetWindowLongW( hwnd, GWL_WNDPROC ))) goto done;
if (!(winproc = (WNDPROC)GetWindowLongPtrW( hwnd, GWLP_WNDPROC ))) goto done;
result = CallWindowProcW( winproc, hwnd, msg, wparam, lparam );
}
else
{
if (!(winproc = (WNDPROC)GetWindowLongA( hwnd, GWL_WNDPROC ))) goto done;
if (!(winproc = (WNDPROC)GetWindowLongPtrA( hwnd, GWLP_WNDPROC ))) goto done;
result = CallWindowProcA( winproc, hwnd, msg, wparam, lparam );
}

View File

@ -64,7 +64,7 @@ LRESULT WINAPI SendMessage16( HWND16 hwnd16, UINT16 msg, WPARAM16 wparam, LPARAM
}
}
if (!(winproc = (WNDPROC16)GetWindowLong16( hwnd16, GWL_WNDPROC ))) return 0;
if (!(winproc = (WNDPROC16)GetWindowLong16( hwnd16, GWLP_WNDPROC ))) return 0;
SPY_EnterMessage( SPY_SENDMESSAGE16, hwnd, msg, wparam, lparam );
result = CallWindowProc16( (WNDPROC16)winproc, hwnd16, msg, wparam, lparam );

View File

@ -80,7 +80,7 @@ static DWORD CALLBACK desktop_thread( LPVOID driver_data )
X11DRV_register_window( display, hwnd, win->pDriverData );
WIN_ReleasePtr( win );
SetWindowLongW( hwnd, GWL_WNDPROC, (LONG)desktop_winproc );
SetWindowLongPtrW( hwnd, GWLP_WNDPROC, (LONG_PTR)desktop_winproc );
wine_tsx11_lock();
XChangeProperty ( display, root_window, x11drv_atom(WM_PROTOCOLS),
XA_ATOM, 32, PropModeReplace, (char *)&atom, 1 );

View File

@ -1282,7 +1282,7 @@ HWND X11DRV_SetParent( HWND hwnd, HWND parent )
{
if (!(wndPtr->dwStyle & WS_CHILD))
{
HMENU menu = (HMENU)SetWindowLongW( hwnd, GWL_ID, 0 );
HMENU menu = (HMENU)SetWindowLongPtrW( hwnd, GWLP_ID, 0 );
if (menu) DestroyMenu( menu );
}
}

View File

@ -108,15 +108,13 @@ static void GrabPointer(BOOL grab)
if(!X11DRV_DD_GrabMessage)
X11DRV_DD_GrabMessage = RegisterWindowMessageA("WINE_X11DRV_GRABPOINTER");
/* FIXME: Replace with SetWindowLongPtrA when available */
X11DRV_DD_GrabOldProcedure = (WNDPROC)SetWindowLongA(X11DRV_DD_PrimaryWnd,
GWL_WNDPROC, (LONG)GrabWndProc);
X11DRV_DD_GrabOldProcedure = (WNDPROC)SetWindowLongPtrA(X11DRV_DD_PrimaryWnd,
GWLP_WNDPROC, (LONG_PTR)GrabWndProc);
SendMessageA(X11DRV_DD_PrimaryWnd, X11DRV_DD_GrabMessage, grab ? 1 : 0, 0);
/* FIXME: Replace with SetWindowLongPtrA when available */
if(SetWindowLongA(X11DRV_DD_PrimaryWnd, GWL_WNDPROC,
(LONG)X11DRV_DD_GrabOldProcedure) != (LONG)GrabWndProc)
if(SetWindowLongPtrA(X11DRV_DD_PrimaryWnd, GWLP_WNDPROC,
(LONG_PTR)X11DRV_DD_GrabOldProcedure) != (LONG_PTR)GrabWndProc)
ERR("Window procedure has been changed!\n");
}

View File

@ -621,7 +621,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
UINT len;
HICON hIcon = (HICON)GetClassLongW( hwnd, GCL_HICON );
HINSTANCE instance = (HINSTANCE)GetWindowLongW( hwnd, GWL_HINSTANCE );
HINSTANCE instance = (HINSTANCE)GetWindowLongPtrW( hwnd, GWLP_HINSTANCE );
if (hIcon) return (LRESULT)hIcon;
for(len=1; len<64; len++)
if((hIcon = LoadIconW(instance, MAKEINTRESOURCEW(len))))

View File

@ -360,7 +360,7 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
if (hwndDefButton)
SendMessageA( hwndDefButton, BM_SETSTYLE, BS_PUSHBUTTON, FALSE );
hwndDefButton = hwndCtrl;
dlgInfo->idResult = GetWindowLongA( hwndCtrl, GWL_ID );
dlgInfo->idResult = GetWindowLongPtrA( hwndCtrl, GWLP_ID );
}
}
TRACE(" END\n" );
@ -1219,7 +1219,7 @@ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg )
*/
INT WINAPI GetDlgCtrlID( HWND hwnd )
{
return GetWindowLongW( hwnd, GWL_ID );
return GetWindowLongPtrW( hwnd, GWLP_ID );
}
@ -1234,7 +1234,7 @@ HWND WINAPI GetDlgItem( HWND hwndDlg, INT id )
if (!list) return 0;
for (i = 0; list[i]; i++) if (GetWindowLongW( list[i], GWL_ID ) == id) break;
for (i = 0; list[i]; i++) if (GetWindowLongPtrW( list[i], GWLP_ID ) == id) break;
ret = list[i];
HeapFree( GetProcessHeap(), 0, list );
return ret;
@ -1378,7 +1378,7 @@ UINT WINAPI IsDlgButtonChecked( HWND hwnd, UINT id )
*/
static BOOL CALLBACK CheckRB(HWND hwndChild, LPARAM lParam)
{
LONG lChildID = GetWindowLongA(hwndChild, GWL_ID);
LONG lChildID = GetWindowLongPtrW(hwndChild, GWLP_ID);
RADIOGROUP *lpRadioGroup = (RADIOGROUP *) lParam;
if ((lChildID >= lpRadioGroup->firstID) &&
@ -1386,11 +1386,11 @@ static BOOL CALLBACK CheckRB(HWND hwndChild, LPARAM lParam)
{
if (lChildID == lpRadioGroup->checkID)
{
SendMessageA(hwndChild, BM_SETCHECK, BST_CHECKED, 0);
SendMessageW(hwndChild, BM_SETCHECK, BST_CHECKED, 0);
}
else
{
SendMessageA(hwndChild, BM_SETCHECK, BST_UNCHECKED, 0);
SendMessageW(hwndChild, BM_SETCHECK, BST_UNCHECKED, 0);
}
}

View File

@ -152,7 +152,7 @@ static HWND MDI_GetChildByID(HWND hwnd, UINT id, MDICLIENTINFO *ci)
for (i = 0; ci->nActiveChildren; i++)
{
if (GetWindowLongW( ci->child[i], GWL_ID ) == id)
if (GetWindowLongPtrW( ci->child[i], GWLP_ID ) == id)
return ci->child[i];
}
return 0;
@ -430,7 +430,7 @@ static LRESULT MDI_RefreshMenu(MDICLIENTINFO *ci)
visible++;
SetWindowLongW(ci->child[i], GWL_ID, id);
SetWindowLongPtrW(ci->child[i], GWLP_ID, id);
buf[0] = '&';
buf[1] = '0' + visible;

View File

@ -288,7 +288,7 @@ static BOOL process_cooked_keyboard_message( MSG *msg, BOOL remove )
HELPINFO hi;
hi.cbSize = sizeof(HELPINFO);
hi.iContextType = HELPINFO_WINDOW;
hi.iCtrlId = GetWindowLongA( msg->hwnd, GWL_ID );
hi.iCtrlId = GetWindowLongPtrA( msg->hwnd, GWLP_ID );
hi.hItemHandle = msg->hwnd;
hi.dwContextId = GetWindowContextHelpId( msg->hwnd );
hi.MousePos = msg->pt;
@ -499,7 +499,7 @@ static BOOL process_cooked_mouse_message( MSG *msg, ULONG_PTR extra_info, BOOL r
/***********************************************************************
* process_hardware_message
* MSG_process_raw_hardware_message
*
* returns TRUE if the contents of 'msg' should be passed to the application
*/

View File

@ -201,7 +201,7 @@ static void send_parent_notify( HWND hwnd, UINT msg )
if ((GetWindowLongW( hwnd, GWL_STYLE ) & (WS_CHILD | WS_POPUP)) == WS_CHILD &&
!(GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_NOPARENTNOTIFY))
SendMessageW( GetParent(hwnd), WM_PARENTNOTIFY,
MAKEWPARAM( msg, GetWindowLongW( hwnd, GWL_ID )), (LPARAM)hwnd );
MAKEWPARAM( msg, GetWindowLongPtrW( hwnd, GWLP_ID )), (LPARAM)hwnd );
}
@ -640,7 +640,7 @@ LRESULT WIN_DestroyWindow( HWND hwnd )
if (!(wndPtr->dwStyle & WS_CHILD))
{
HMENU menu = (HMENU)SetWindowLongW( hwnd, GWL_ID, 0 );
HMENU menu = (HMENU)SetWindowLongPtrW( hwnd, GWLP_ID, 0 );
if (menu) DestroyMenu( menu );
}
if (wndPtr->hSysMenu)
@ -1165,7 +1165,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
}
}
}
else SetWindowLongW( hwnd, GWL_ID, (UINT)cs->hMenu );
else SetWindowLongPtrW( hwnd, GWLP_ID, (ULONG_PTR)cs->hMenu );
WIN_ReleaseWndPtr( wndPtr );
if (!USER_Driver.pCreateWindow( hwnd, cs, unicode))
@ -1797,12 +1797,12 @@ WORD WINAPI GetWindowWord( HWND hwnd, INT offset )
switch(offset)
{
case GWL_HWNDPARENT:
return GetWindowLongW( hwnd, offset );
case GWL_ID:
case GWL_HINSTANCE:
case GWLP_HWNDPARENT:
return GetWindowLongPtrW( hwnd, offset );
case GWLP_ID:
case GWLP_HINSTANCE:
{
LONG ret = GetWindowLongW( hwnd, offset );
LONG_PTR ret = GetWindowLongPtrW( hwnd, offset );
if (HIWORD(ret))
WARN("%d: discards high bits of 0x%08lx!\n", offset, ret );
return LOWORD(ret);
@ -1824,10 +1824,10 @@ WORD WINAPI SetWindowWord( HWND hwnd, INT offset, WORD newval )
switch(offset)
{
case GWL_ID:
case GWL_HINSTANCE:
case GWL_HWNDPARENT:
return SetWindowLongW( hwnd, offset, (UINT)newval );
case GWLP_ID:
case GWLP_HINSTANCE:
case GWLP_HWNDPARENT:
return SetWindowLongPtrW( hwnd, offset, (ULONG_PTR)newval );
default:
if (offset < 0)
{
@ -1884,16 +1884,16 @@ WORD WINAPI SetWindowWord( HWND hwnd, INT offset, WORD newval )
*
* Helper function for GetWindowLong().
*/
static LONG WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
{
LONG retvalue = 0;
LONG_PTR retvalue = 0;
WND *wndPtr;
if (offset == GWL_HWNDPARENT)
if (offset == GWLP_HWNDPARENT)
{
HWND parent = GetAncestor( hwnd, GA_PARENT );
if (parent == GetDesktopWindow()) parent = GetWindow( hwnd, GW_OWNER );
return (LONG)parent;
return (ULONG_PTR)parent;
}
if (!(wndPtr = WIN_GetPtr( hwnd )))
@ -1904,7 +1904,7 @@ static LONG WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
if (wndPtr == WND_OTHER_PROCESS)
{
if (offset == GWL_WNDPROC)
if (offset == GWLP_WNDPROC)
{
SetLastError( ERROR_ACCESS_DENIED );
return 0;
@ -1919,11 +1919,11 @@ static LONG WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
{
switch(offset)
{
case GWL_STYLE: retvalue = reply->old_style; break;
case GWL_EXSTYLE: retvalue = reply->old_ex_style; break;
case GWL_ID: retvalue = reply->old_id; break;
case GWL_HINSTANCE: retvalue = (ULONG_PTR)reply->old_instance; break;
case GWL_USERDATA: retvalue = (ULONG_PTR)reply->old_user_data; break;
case GWL_STYLE: retvalue = reply->old_style; break;
case GWL_EXSTYLE: retvalue = reply->old_ex_style; break;
case GWLP_ID: retvalue = reply->old_id; break;
case GWLP_HINSTANCE: retvalue = (ULONG_PTR)reply->old_instance; break;
case GWLP_USERDATA: retvalue = (ULONG_PTR)reply->old_user_data; break;
default:
if (offset >= 0) retvalue = reply->old_extra_value;
else SetLastError( ERROR_INVALID_INDEX );
@ -1974,12 +1974,12 @@ static LONG WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
switch(offset)
{
case GWL_USERDATA: retvalue = wndPtr->userdata; break;
case GWLP_USERDATA: retvalue = wndPtr->userdata; break;
case GWL_STYLE: retvalue = wndPtr->dwStyle; break;
case GWL_EXSTYLE: retvalue = wndPtr->dwExStyle; break;
case GWL_ID: retvalue = (LONG)wndPtr->wIDmenu; break;
case GWL_WNDPROC: retvalue = (LONG)WINPROC_GetProc( wndPtr->winproc, type ); break;
case GWL_HINSTANCE: retvalue = (LONG)wndPtr->hInstance; break;
case GWLP_ID: retvalue = (ULONG_PTR)wndPtr->wIDmenu; break;
case GWLP_WNDPROC: retvalue = (ULONG_PTR)WINPROC_GetProc( wndPtr->winproc, type ); break;
case GWLP_HINSTANCE: retvalue = (ULONG_PTR)wndPtr->hInstance; break;
default:
WARN("Unknown offset %d\n", offset );
SetLastError( ERROR_INVALID_INDEX );
@ -1998,8 +1998,8 @@ static LONG WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
* 0 is the failure code. However, in the case of failure SetLastError
* must be set to distinguish between a 0 return value and a failure.
*/
static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
WINDOWPROCTYPE type )
static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval,
WINDOWPROCTYPE type )
{
STYLESTRUCT style;
BOOL ok;
@ -2015,7 +2015,7 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
}
if (!WIN_IsCurrentProcess( hwnd ))
{
if (offset == GWL_WNDPROC)
if (offset == GWLP_WNDPROC)
{
SetLastError( ERROR_ACCESS_DENIED );
return 0;
@ -2045,31 +2045,31 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) return 0;
newval = style.styleNew;
break;
case GWL_HWNDPARENT:
case GWLP_HWNDPARENT:
if (wndPtr->parent == GetDesktopWindow())
{
WIN_ReleasePtr( wndPtr );
return (LONG)WIN_SetOwner( hwnd, (HWND)newval );
return (ULONG_PTR)WIN_SetOwner( hwnd, (HWND)newval );
}
else
{
WIN_ReleasePtr( wndPtr );
return (LONG)SetParent( hwnd, (HWND)newval );
return (ULONG_PTR)SetParent( hwnd, (HWND)newval );
}
case GWL_WNDPROC:
retval = (LONG)WINPROC_GetProc( wndPtr->winproc, type );
case GWLP_WNDPROC:
retval = (ULONG_PTR)WINPROC_GetProc( wndPtr->winproc, type );
WINPROC_SetProc( &wndPtr->winproc, (WNDPROC)newval, type, WIN_PROC_WINDOW );
WIN_ReleasePtr( wndPtr );
return retval;
case GWL_ID:
case GWL_HINSTANCE:
case GWL_USERDATA:
case GWLP_ID:
case GWLP_HINSTANCE:
case GWLP_USERDATA:
break;
case DWL_DLGPROC:
if ((wndPtr->cbWndExtra + sizeof(LONG) >= DWL_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG))
case DWLP_DLGPROC:
if ((wndPtr->cbWndExtra + sizeof(LONG) >= DWLP_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG))
{
WNDPROC *ptr = (WNDPROC *)((char *)wndPtr->wExtra + DWL_DLGPROC);
retval = (LONG)WINPROC_GetProc( *ptr, type );
WNDPROC *ptr = (WNDPROC *)((char *)wndPtr->wExtra + DWLP_DLGPROC);
retval = (ULONG_PTR)WINPROC_GetProc( *ptr, type );
WINPROC_SetProc( ptr, (WNDPROC)newval, type, WIN_PROC_WINDOW );
WIN_ReleasePtr( wndPtr );
return retval;
@ -2085,7 +2085,7 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
}
else
{
LONG *ptr = (LONG *)((char *)wndPtr->wExtra + offset);
LONG_PTR *ptr = (LONG_PTR *)((char *)wndPtr->wExtra + offset);
if (*ptr == newval) /* already set to the same value */
{
WIN_ReleasePtr( wndPtr );
@ -2109,15 +2109,15 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
req->flags = SET_WIN_EXSTYLE;
req->ex_style = newval;
break;
case GWL_ID:
case GWLP_ID:
req->flags = SET_WIN_ID;
req->id = newval;
break;
case GWL_HINSTANCE:
case GWLP_HINSTANCE:
req->flags = SET_WIN_INSTANCE;
req->instance = (void *)newval;
break;
case GWL_USERDATA:
case GWLP_USERDATA:
req->flags = SET_WIN_USERDATA;
req->user_data = (void *)newval;
break;
@ -2139,15 +2139,15 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
wndPtr->dwExStyle = newval;
retval = reply->old_ex_style;
break;
case GWL_ID:
case GWLP_ID:
wndPtr->wIDmenu = newval;
retval = reply->old_id;
break;
case GWL_HINSTANCE:
case GWLP_HINSTANCE:
wndPtr->hInstance = (HINSTANCE)newval;
retval = (ULONG_PTR)reply->old_instance;
break;
case GWL_USERDATA:
case GWLP_USERDATA:
wndPtr->userdata = newval;
retval = (ULONG_PTR)reply->old_user_data;
break;
@ -2238,23 +2238,23 @@ LONG WINAPI SetWindowLongA( HWND hwnd, INT offset, LONG newval )
*
* GWL_STYLE The window's window style.
*
* GWL_WNDPROC Pointer to the window's window procedure.
* GWLP_WNDPROC Pointer to the window's window procedure.
*
* GWL_HINSTANCE The window's pplication instance handle.
* GWLP_HINSTANCE The window's pplication instance handle.
*
* GWL_ID The window's identifier.
* GWLP_ID The window's identifier.
*
* GWL_USERDATA The window's user-specified data.
* GWLP_USERDATA The window's user-specified data.
*
* If the window is a dialog box, the _offset_ parameter can be one of
* the following values:
*
* DWL_DLGPROC The address of the window's dialog box procedure.
* DWLP_DLGPROC The address of the window's dialog box procedure.
*
* DWL_MSGRESULT The return value of a message
* DWLP_MSGRESULT The return value of a message
* that the dialog box procedure processed.
*
* DWL_USER Application specific information.
* DWLP_USER Application specific information.
*
* RETURNS
*
@ -2625,7 +2625,7 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent )
{
if (!(wndPtr->dwStyle & WS_CHILD))
{
HMENU menu = (HMENU)SetWindowLongW( hwnd, GWL_ID, 0 );
HMENU menu = (HMENU)SetWindowLongPtrW( hwnd, GWLP_ID, 0 );
if (menu) DestroyMenu( menu );
}
}

View File

@ -361,7 +361,7 @@ static LRESULT WINAPI WINPROC_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
context.SegDs = context.SegEs = SELECTOROF(teb->cur_stack);
context.SegFs = wine_get_fs();
context.SegGs = wine_get_gs();
if (!(context.Eax = GetWindowWord( HWND_32(hwnd), GWL_HINSTANCE ))) context.Eax = context.SegDs;
if (!(context.Eax = GetWindowWord( HWND_32(hwnd), GWLP_HINSTANCE ))) context.Eax = context.SegDs;
context.SegCs = SELECTOROF(proc);
context.Eip = OFFSETOF(proc);
context.Ebp = OFFSETOF(teb->cur_stack)