Use Get/SetWindowLongPtr when accessing pointers in the window extra
bytes.
This commit is contained in:
parent
5b7da80911
commit
5c37785881
|
@ -469,7 +469,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
|
|||
default:
|
||||
return 0;
|
||||
}
|
||||
oldHbitmap = (HBITMAP)SetWindowLongW( hWnd, HIMAGE_GWL_OFFSET, lParam );
|
||||
oldHbitmap = (HBITMAP)SetWindowLongPtrW( hWnd, HIMAGE_GWL_OFFSET, lParam );
|
||||
InvalidateRect( hWnd, NULL, FALSE );
|
||||
return (LRESULT)oldHbitmap;
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
|
|||
if (COMBO_Init() && (lphc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HEADCOMBO))) )
|
||||
{
|
||||
lphc->self = hwnd;
|
||||
SetWindowLongW( hwnd, 0, (LONG)lphc );
|
||||
SetWindowLongPtrW( hwnd, 0, (LONG_PTR)lphc );
|
||||
|
||||
/* some braindead apps do try to use scrollbar/border flags */
|
||||
|
||||
|
@ -190,7 +190,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
|
|||
if( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox )
|
||||
DestroyWindow( lphc->hWndLBox );
|
||||
|
||||
SetWindowLongW( lphc->self, 0, 0 );
|
||||
SetWindowLongPtrW( lphc->self, 0, 0 );
|
||||
HeapFree( GetProcessHeap(), 0, lphc );
|
||||
}
|
||||
return 0;
|
||||
|
@ -1865,7 +1865,7 @@ static char *strdupA(LPCSTR str)
|
|||
static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam, BOOL unicode )
|
||||
{
|
||||
LPHEADCOMBO lphc = (LPHEADCOMBO)GetWindowLongW( hwnd, 0 );
|
||||
LPHEADCOMBO lphc = (LPHEADCOMBO)GetWindowLongPtrW( hwnd, 0 );
|
||||
|
||||
TRACE("[%p]: msg %s wp %08x lp %08lx\n",
|
||||
hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam );
|
||||
|
|
|
@ -424,7 +424,7 @@ static inline LRESULT DefWindowProcT(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
|||
static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam, BOOL unicode )
|
||||
{
|
||||
EDITSTATE *es = (EDITSTATE *)GetWindowLongW( hwnd, 0 );
|
||||
EDITSTATE *es = (EDITSTATE *)GetWindowLongPtrW( hwnd, 0 );
|
||||
LRESULT result = 0;
|
||||
|
||||
TRACE("hwnd=%p msg=%x (%s) wparam=%x lparam=%lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), wParam, lParam);
|
||||
|
@ -4116,7 +4116,7 @@ static LRESULT EDIT_WM_Destroy(EDITSTATE *es)
|
|||
pc = pp;
|
||||
}
|
||||
|
||||
SetWindowLongW( es->hwndSelf, 0, 0 );
|
||||
SetWindowLongPtrW( es->hwndSelf, 0, 0 );
|
||||
HeapFree(GetProcessHeap(), 0, es);
|
||||
|
||||
return 0;
|
||||
|
@ -4615,7 +4615,7 @@ static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs, BOOL unicode)
|
|||
|
||||
if (!(es = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*es))))
|
||||
return FALSE;
|
||||
SetWindowLongW( hwnd, 0, (LONG)es );
|
||||
SetWindowLongPtrW( hwnd, 0, (LONG_PTR)es );
|
||||
|
||||
/*
|
||||
* Note: since the EDITSTATE has not been fully initialized yet,
|
||||
|
|
|
@ -2489,7 +2489,7 @@ static BOOL LISTBOX_Create( HWND hwnd, LPHEADCOMBO lphc )
|
|||
descr->owner = lphc->self;
|
||||
}
|
||||
|
||||
SetWindowLongW( descr->self, 0, (LONG)descr );
|
||||
SetWindowLongPtrW( descr->self, 0, (LONG_PTR)descr );
|
||||
|
||||
/* if (wnd->dwExStyle & WS_EX_NOPARENTNOTIFY) descr->style &= ~LBS_NOTIFY;
|
||||
*/
|
||||
|
@ -2530,7 +2530,7 @@ static BOOL LISTBOX_Create( HWND hwnd, LPHEADCOMBO lphc )
|
|||
static BOOL LISTBOX_Destroy( LB_DESCR *descr )
|
||||
{
|
||||
LISTBOX_ResetContent( descr );
|
||||
SetWindowLongW( descr->self, 0, 0 );
|
||||
SetWindowLongPtrW( descr->self, 0, 0 );
|
||||
HeapFree( GetProcessHeap(), 0, descr );
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -2542,7 +2542,7 @@ static BOOL LISTBOX_Destroy( LB_DESCR *descr )
|
|||
static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam, BOOL unicode )
|
||||
{
|
||||
LB_DESCR *descr = (LB_DESCR *)GetWindowLongW( hwnd, 0 );
|
||||
LB_DESCR *descr = (LB_DESCR *)GetWindowLongPtrW( hwnd, 0 );
|
||||
LPHEADCOMBO lphc = 0;
|
||||
LRESULT ret;
|
||||
|
||||
|
@ -2555,7 +2555,7 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,
|
|||
CREATESTRUCTW *lpcs = (CREATESTRUCTW *)lParam;
|
||||
if (lpcs->style & LBS_COMBOBOX) lphc = (LPHEADCOMBO)lpcs->lpCreateParams;
|
||||
if (!LISTBOX_Create( hwnd, lphc )) return -1;
|
||||
TRACE("creating wnd=%p descr=%lx\n", hwnd, GetWindowLongW( hwnd, 0 ) );
|
||||
TRACE("creating wnd=%p descr=%lx\n", hwnd, GetWindowLongPtrW( hwnd, 0 ) );
|
||||
return 0;
|
||||
}
|
||||
/* Ignore all other messages before we get a WM_CREATE */
|
||||
|
|
|
@ -3129,7 +3129,7 @@ static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
case WM_CREATE:
|
||||
{
|
||||
CREATESTRUCTW *cs = (CREATESTRUCTW*)lParam;
|
||||
SetWindowLongW( hwnd, 0, (LONG)cs->lpCreateParams );
|
||||
SetWindowLongPtrW( hwnd, 0, (LONG_PTR)cs->lpCreateParams );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3141,7 +3141,7 @@ static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
PAINTSTRUCT ps;
|
||||
BeginPaint( hwnd, &ps );
|
||||
MENU_DrawPopupMenu( hwnd, ps.hdc,
|
||||
(HMENU)GetWindowLongW( hwnd, 0 ) );
|
||||
(HMENU)GetWindowLongPtrW( hwnd, 0 ) );
|
||||
EndPaint( hwnd, &ps );
|
||||
return 0;
|
||||
}
|
||||
|
@ -3157,18 +3157,18 @@ static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
|
||||
if( wParam )
|
||||
{
|
||||
if (!GetWindowLongW( hwnd, 0 )) ERR("no menu to display\n");
|
||||
if (!GetWindowLongPtrW( hwnd, 0 )) ERR("no menu to display\n");
|
||||
}
|
||||
else
|
||||
SetWindowLongW( hwnd, 0, 0 );
|
||||
SetWindowLongPtrW( hwnd, 0, 0 );
|
||||
break;
|
||||
|
||||
case MM_SETMENUHANDLE:
|
||||
SetWindowLongW( hwnd, 0, wParam );
|
||||
SetWindowLongPtrW( hwnd, 0, wParam );
|
||||
break;
|
||||
|
||||
case MM_GETMENUHANDLE:
|
||||
return GetWindowLongW( hwnd, 0 );
|
||||
return GetWindowLongPtrW( hwnd, 0 );
|
||||
|
||||
default:
|
||||
return DefWindowProcW( hwnd, message, wParam, lParam );
|
||||
|
|
Loading…
Reference in New Issue