From 39f960bdfa69146fb6c91dea242c5825ee1edfe5 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Tue, 15 Feb 2005 21:51:06 +0000 Subject: [PATCH] - Fix prototypes of GetClassLongA/W, GetClassLongPtrA/W and SetClassLongA/W according to SDK definitions. - Add prototypes for SetClassLongPtrA/W, protect some GWL_ and GCL_ constants from using in Wine or in _WIN64 mode. - Fix all places in Wine affected by the above changes. --- dlls/comctl32/listview.c | 2 +- dlls/commdlg/colordlg.c | 42 ++++++------ dlls/commdlg/colordlg16.c | 8 +-- dlls/commdlg/filedlg.c | 6 +- dlls/commdlg/finddlg.c | 32 ++++----- dlls/commdlg/fontdlg16.c | 6 +- dlls/serialui/confdlg.c | 4 +- dlls/shell32/dialogs.c | 6 +- dlls/shlwapi/msgbox.c | 4 +- dlls/shlwapi/ordinal.c | 4 +- dlls/user/controls.h | 2 +- dlls/user/desktop.c | 2 +- dlls/user/dialog16.c | 4 +- dlls/user/icontitle.c | 2 +- dlls/wineps/driver.c | 8 +-- dlls/x11drv/window.c | 2 +- dlls/x11drv/winpos.c | 4 +- include/windowsx.h | 8 +-- include/winuser.h | 47 ++++++++----- programs/taskmgr/applpage.c | 4 +- programs/taskmgr/proclist.c | 2 +- programs/winecfg/appdefaults.c | 2 +- programs/winecfg/audio.c | 4 +- programs/winecfg/driveui.c | 4 +- programs/winecfg/x11drvdlg.c | 4 +- programs/wineconsole/dialog.c | 12 ++-- windows/class.c | 120 ++++++++++++++++----------------- windows/defdlg.c | 20 +++--- windows/defwnd.c | 8 +-- windows/dialog.c | 4 +- windows/mdi.c | 4 +- windows/nonclient.c | 28 ++++---- windows/win.c | 18 ++--- windows/winproc.c | 4 +- 34 files changed, 221 insertions(+), 210 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index b33d18ec687..a2cbcbeb2fa 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -6274,7 +6274,7 @@ static BOOL LISTVIEW_SetBkColor(LISTVIEW_INFO *infoPtr, COLORREF clrBk) if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush); infoPtr->clrBk = clrBk; if (clrBk == CLR_NONE) - infoPtr->hBkBrush = (HBRUSH)GetClassLongW(infoPtr->hwndSelf, GCL_HBRBACKGROUND); + infoPtr->hBkBrush = (HBRUSH)GetClassLongPtrW(infoPtr->hwndSelf, GCLP_HBRBACKGROUND); else infoPtr->hBkBrush = CreateSolidBrush(clrBk); LISTVIEW_InvalidateList(infoPtr); diff --git a/dlls/commdlg/colordlg.c b/dlls/commdlg/colordlg.c index 367e2f44c34..b507c948152 100644 --- a/dlls/commdlg/colordlg.c +++ b/dlls/commdlg/colordlg.c @@ -461,7 +461,7 @@ void CC_PaintTriangle( HWND hDlg, int y) int oben; RECT rect; HWND hwnd = GetDlgItem(hDlg, 0x2be); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW( hDlg, DWLP_USER); if (IsWindowVisible( GetDlgItem(hDlg, 0x2c6))) /* if full size */ { @@ -480,7 +480,7 @@ void CC_PaintTriangle( HWND hDlg, int y) points[2].y = points[0].y - w; points[2].x = points[1].x = points[0].x + w; - FillRect(hDC, &lpp->old3angle, (HBRUSH)GetClassLongA( hwnd, GCL_HBRBACKGROUND)); + FillRect(hDC, &lpp->old3angle, (HBRUSH)GetClassLongPtrW( hwnd, GCLP_HBRBACKGROUND)); lpp->old3angle.left = points[0].x; lpp->old3angle.right = points[1].x + 1; lpp->old3angle.top = points[2].y - 1; @@ -499,7 +499,7 @@ void CC_PaintCross( HWND hDlg, int x, int y) HDC hDC; int w = GetDialogBaseUnits(); HWND hwnd = GetDlgItem(hDlg, 0x2c6); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER ); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW( hDlg, DWLP_USER ); RECT rect; POINT point, p; HPEN hPen; @@ -544,11 +544,11 @@ static void CC_PrepareColorGraph( HWND hDlg ) { int sdif, hdif, xdif, ydif, r, g, b, hue, sat; HWND hwnd = GetDlgItem(hDlg, 0x2c6); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); HBRUSH hbrush; HDC hdc ; RECT rect, client; - HCURSOR hcursor = SetCursor( LoadCursorA(0, (LPSTR)IDC_WAIT) ); + HCURSOR hcursor = SetCursor( LoadCursorW(0, (LPCWSTR)IDC_WAIT) ); GetClientRect(hwnd, &client); hdc = GetDC(hwnd); @@ -587,7 +587,7 @@ static void CC_PrepareColorGraph( HWND hDlg ) static void CC_PaintColorGraph( HWND hDlg ) { HWND hwnd = GetDlgItem( hDlg, 0x2c6 ); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); HDC hDC; RECT rect; if (IsWindowVisible(hwnd)) /* if full size */ @@ -647,7 +647,7 @@ static void CC_PaintLumBar( HWND hDlg, int hue, int sat ) void CC_EditSetRGB( HWND hDlg, COLORREF cr ) { char buffer[10]; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); int r = GetRValue(cr); int g = GetGValue(cr); int b = GetBValue(cr); @@ -670,7 +670,7 @@ void CC_EditSetRGB( HWND hDlg, COLORREF cr ) void CC_EditSetHSL( HWND hDlg, int h, int s, int l ) { char buffer[10]; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); lpp->updating = TRUE; if (IsWindowVisible( GetDlgItem(hDlg, 0x2c6) )) /* if full size */ { @@ -692,7 +692,7 @@ void CC_EditSetHSL( HWND hDlg, int h, int s, int l ) void CC_SwitchToFullSize( HWND hDlg, COLORREF result, LPRECT lprect ) { int i; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); EnableWindow( GetDlgItem(hDlg, 0x2cf), FALSE); CC_PrepareColorGraph(hDlg); @@ -728,7 +728,7 @@ static void CC_PaintPredefColorArray( HWND hDlg, int rows, int cols) HDC hdc; HBRUSH hBrush; int dx, dy, i, j, k; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); GetClientRect(hwnd, &rect); dx = rect.right / cols; @@ -737,7 +737,7 @@ static void CC_PaintPredefColorArray( HWND hDlg, int rows, int cols) hdc = GetDC(hwnd); GetClientRect(hwnd, &rect); - FillRect(hdc, &rect, (HBRUSH)GetClassLongA(hwnd, GCL_HBRBACKGROUND)); + FillRect(hdc, &rect, (HBRUSH)GetClassLongPtrW(hwnd, GCLP_HBRBACKGROUND)); for ( j = 0; j < rows; j++ ) { for ( i = 0; i < cols; i++ ) @@ -770,7 +770,7 @@ void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, COLORREF* lpcr ) HDC hdc; HBRUSH hBrush; int dx, dy, i, j, k; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); GetClientRect(hwnd, &rect); @@ -781,7 +781,7 @@ void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, COLORREF* lpcr ) hdc = GetDC(hwnd); if (hdc) { - FillRect(hdc, &rect, (HBRUSH)GetClassLongA(hwnd, GCL_HBRBACKGROUND) ); + FillRect(hdc, &rect, (HBRUSH)GetClassLongPtrW(hwnd, GCLP_HBRBACKGROUND) ); for (j = 0; j < rows; j++) { for (i = 0; i < cols; i++) @@ -842,7 +842,7 @@ LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam ) return FALSE; } - SetWindowLongA(hDlg, DWL_USER, (LONG)lpp); + SetWindowLongPtrW(hDlg, DWLP_USER, (LONG_PTR)lpp); if (!(lpp->lpcc->Flags & CC_SHOWHELP)) ShowWindow( GetDlgItem(hDlg,0x40e), SW_HIDE); @@ -936,7 +936,7 @@ LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notifyCode, UINT cokmsg; HDC hdc; COLORREF *cr; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); TRACE("CC_WMCommand wParam=%x lParam=%lx\n", wParam, lParam); switch (wParam) { @@ -1058,7 +1058,7 @@ LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notifyCode, LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam ) { PAINTSTRUCT ps; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); BeginPaint(hDlg, &ps); /* we have to paint dialog children except text and buttons */ @@ -1079,7 +1079,7 @@ LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam ) */ LRESULT CC_WMLButtonUp( HWND hDlg, WPARAM wParam, LPARAM lParam ) { - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); if (lpp->capturedGraph) { lpp->capturedGraph = 0; @@ -1095,7 +1095,7 @@ LRESULT CC_WMLButtonUp( HWND hDlg, WPARAM wParam, LPARAM lParam ) */ LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam ) { - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); int r, g, b; if (lpp->capturedGraph) @@ -1133,7 +1133,7 @@ LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam ) */ LRESULT CC_WMLButtonDown( HWND hDlg, WPARAM wParam, LPARAM lParam ) { - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); int r, g, b, i; i = 0; @@ -1192,7 +1192,7 @@ static INT_PTR CALLBACK ColorDlgProc( HWND hDlg, UINT message, { int res; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); if (message != WM_INITDIALOG) { if (!lpp) @@ -1217,7 +1217,7 @@ static INT_PTR CALLBACK ColorDlgProc( HWND hDlg, UINT message, DeleteDC(lpp->hdcMem); DeleteObject(lpp->hbmMem); HeapFree(GetProcessHeap(), 0, lpp); - SetWindowLongA(hDlg, DWL_USER, 0L); /* we don't need it anymore */ + SetWindowLongPtrW(hDlg, DWLP_USER, 0); /* we don't need it anymore */ break; case WM_COMMAND: if (CC_WMCommand( hDlg, wParam, lParam, HIWORD(wParam), (HWND) lParam)) diff --git a/dlls/commdlg/colordlg16.c b/dlls/commdlg/colordlg16.c index aa359a875f3..1ebde84d597 100644 --- a/dlls/commdlg/colordlg16.c +++ b/dlls/commdlg/colordlg16.c @@ -102,7 +102,7 @@ LONG CC_WMInitDialog16( HWND hDlg, WPARAM wParam, LPARAM lParam ) ch32->lpfnHook = (LPCCHOOKPROC) ch16->lpfnHook; /* only used as flag */ ch32->Flags = ch16->Flags; - SetWindowLongA(hDlg, DWL_USER, (LONG)lpp); + SetWindowLongPtrW(hDlg, DWLP_USER, (LONG_PTR)lpp); if (!(lpp->lpcc->Flags & CC_SHOWHELP)) ShowWindow( GetDlgItem(hDlg,0x40e), SW_HIDE); @@ -196,7 +196,7 @@ LRESULT CC_WMCommand16( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notifyCode UINT cokmsg; HDC hdc; COLORREF *cr; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); TRACE("CC_WMCommand wParam=%x lParam=%lx\n", wParam, lParam); switch (wParam) { @@ -334,7 +334,7 @@ BOOL16 CALLBACK ColorDlgProc16( HWND16 hDlg16, UINT16 message, BOOL16 res; HWND hDlg = HWND_32(hDlg16); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); if (message != WM_INITDIALOG) { if (!lpp) @@ -360,7 +360,7 @@ BOOL16 CALLBACK ColorDlgProc16( HWND16 hDlg16, UINT16 message, DeleteObject(lpp->hbmMem); HeapFree(GetProcessHeap(), 0, lpp->lpcc); HeapFree(GetProcessHeap(), 0, lpp); - SetWindowLongA(hDlg, DWL_USER, 0L); /* we don't need it anymore */ + SetWindowLongPtrW(hDlg, DWLP_USER, 0); /* we don't need it anymore */ break; case WM_COMMAND: if (CC_WMCommand16(hDlg, wParam, lParam, diff --git a/dlls/commdlg/filedlg.c b/dlls/commdlg/filedlg.c index 0064152884f..2e521c33c7b 100644 --- a/dlls/commdlg/filedlg.c +++ b/dlls/commdlg/filedlg.c @@ -1528,7 +1528,7 @@ static LRESULT FILEDLG95_OnWMGetIShellBrowser(HWND hwnd) TRACE("\n"); - SetWindowLongA(hwnd,DWL_MSGRESULT,(LONG)fodInfos->Shell.FOIShellBrowser); + SetWindowLongPtrW(hwnd,DWLP_MSGRESULT,(LONG_PTR)fodInfos->Shell.FOIShellBrowser); return TRUE; } @@ -1551,7 +1551,7 @@ static BOOL FILEDLG95_SendFileOK( HWND hwnd, FileOpenDlgInfos *fodInfos ) TRACE("---\n"); /* First send CDN_FILEOK as MSDN doc says */ SendCustomDlgNotificationMessage(hwnd,CDN_FILEOK); - if (GetWindowLongW(fodInfos->DlgInfos.hwndCustomDlg, DWL_MSGRESULT)) + if (GetWindowLongPtrW(fodInfos->DlgInfos.hwndCustomDlg, DWLP_MSGRESULT)) { TRACE("canceled\n"); return FALSE; @@ -1560,7 +1560,7 @@ static BOOL FILEDLG95_SendFileOK( HWND hwnd, FileOpenDlgInfos *fodInfos ) /* fodInfos->ofnInfos points to an ASCII or UNICODE structure as appropriate */ SendMessageW(fodInfos->DlgInfos.hwndCustomDlg, fodInfos->HookMsg.fileokstring, 0, (LPARAM)fodInfos->ofnInfos); - if (GetWindowLongW(fodInfos->DlgInfos.hwndCustomDlg, DWL_MSGRESULT)) + if (GetWindowLongPtrW(fodInfos->DlgInfos.hwndCustomDlg, DWLP_MSGRESULT)) { TRACE("canceled\n"); return FALSE; diff --git a/dlls/commdlg/finddlg.c b/dlls/commdlg/finddlg.c index f564d0d2d41..712b051ed36 100644 --- a/dlls/commdlg/finddlg.c +++ b/dlls/commdlg/finddlg.c @@ -230,7 +230,7 @@ HWND16 WINAPI ReplaceText16( SEGPTR find ) static LRESULT FINDDLG_WMInitDialog(HWND hWnd, LPARAM lParam, LPDWORD lpFlags, LPSTR lpstrFindWhat, BOOL fUnicode) { - SetWindowLongA(hWnd, DWL_USER, lParam); + SetWindowLongPtrW(hWnd, DWLP_USER, lParam); *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); /* * FIXME : If the initial FindWhat string is empty, we should disable the @@ -295,14 +295,14 @@ static LRESULT FINDDLG_WMCommand(HWND hWnd, WPARAM wParam, else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); *lpFlags |= FR_FINDNEXT; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); return TRUE; case IDCANCEL: *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL); *lpFlags |= FR_DIALOGTERM; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); DestroyWindow(hWnd); return TRUE; case pshHelp: @@ -328,7 +328,7 @@ BOOL16 CALLBACK FindTextDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam, return FINDDLG_WMInitDialog(hWnd, lParam, &(lpfr->Flags), MapSL(lpfr->lpstrFindWhat), FALSE); case WM_COMMAND: - lpfr=MapSL(GetWindowLongA(hWnd, DWL_USER)); + lpfr=MapSL(GetWindowLongPtrW(hWnd, DWLP_USER)); return FINDDLG_WMCommand(hWnd, wParam, HWND_32(lpfr->hwndOwner), &lpfr->Flags, MapSL(lpfr->lpstrFindWhat), lpfr->wFindWhatLen, FALSE); @@ -344,7 +344,7 @@ static LRESULT REPLACEDLG_WMInitDialog(HWND hWnd, LPARAM lParam, LPDWORD lpFlags, LPSTR lpstrFindWhat, LPSTR lpstrReplaceWith, BOOL fUnicode) { - SetWindowLongA(hWnd, DWL_USER, lParam); + SetWindowLongPtrW(hWnd, DWLP_USER, lParam); *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); /* * FIXME : If the initial FindWhat string is empty, we should disable the FinNext / @@ -410,14 +410,14 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam, else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); *lpFlags |= FR_FINDNEXT; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); return TRUE; case IDCANCEL: *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL); *lpFlags |= FR_DIALOGTERM; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); DestroyWindow(hWnd); return TRUE; case psh1: @@ -438,8 +438,8 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam, else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_FINDNEXT | FR_REPLACEALL | FR_DIALOGTERM); *lpFlags |= FR_REPLACE; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); return TRUE; case psh2: if (fUnicode) @@ -459,8 +459,8 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam, else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_DIALOGTERM); *lpFlags |= FR_REPLACEALL; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); return TRUE; case pshHelp: /* FIXME : should lpfr structure be passed as an argument ??? */ @@ -486,7 +486,7 @@ BOOL16 CALLBACK ReplaceTextDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam MapSL(lpfr->lpstrFindWhat), MapSL(lpfr->lpstrReplaceWith), FALSE); case WM_COMMAND: - lpfr=MapSL(GetWindowLongA(hWnd, DWL_USER)); + lpfr=MapSL(GetWindowLongPtrW(hWnd, DWLP_USER)); return REPLACEDLG_WMCommand(hWnd, wParam, HWND_32(lpfr->hwndOwner), &lpfr->Flags, MapSL(lpfr->lpstrFindWhat), lpfr->wFindWhatLen, MapSL(lpfr->lpstrReplaceWith), diff --git a/dlls/commdlg/fontdlg16.c b/dlls/commdlg/fontdlg16.c index 18bb83edad4..84a51e929b4 100644 --- a/dlls/commdlg/fontdlg16.c +++ b/dlls/commdlg/fontdlg16.c @@ -122,7 +122,7 @@ INT16 WINAPI FontFamilyEnumProc16( SEGPTR logfont, SEGPTR metrics, { HWND hwnd=HWND_32(LOWORD(lParam)); HWND hDlg=GetParent(hwnd); - LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); + LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongPtrW(hDlg, DWLP_USER); LOGFONT16 *lplf = MapSL( logfont ); TEXTMETRIC16 *lpmtrx16 = MapSL(metrics); ENUMLOGFONTEXW elf32w; @@ -142,7 +142,7 @@ INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics, HWND hcmb2=HWND_32(LOWORD(lParam)); HWND hcmb3=HWND_32(HIWORD(lParam)); HWND hDlg=GetParent(hcmb3); - LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); + LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongPtrW(hDlg, DWLP_USER); LOGFONT16 *lplf = MapSL(logfont); TEXTMETRIC16 *lpmtrx16 = MapSL(metrics); ENUMLOGFONTEXW elf32w; @@ -300,7 +300,7 @@ BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg16, UINT16 message, BOOL16 res=0; if (message!=WM_INITDIALOG) { - lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); + lpcf=(LPCHOOSEFONT16)GetWindowLongPtrW(hDlg, DWLP_USER); if (!lpcf && message != WM_MEASUREITEM) return FALSE; if (CFn_HookCallChk(lpcf)) diff --git a/dlls/serialui/confdlg.c b/dlls/serialui/confdlg.c index 203eb73b709..e7f232e07d0 100644 --- a/dlls/serialui/confdlg.c +++ b/dlls/serialui/confdlg.c @@ -356,7 +356,7 @@ INT_PTR CALLBACK SERIALUI_ConfigDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, info = (SERIALUI_DialogInfo*) lParam; if(!info) return FALSE; - SetWindowLongW(hWnd, DWL_USER, lParam); + SetWindowLongPtrW(hWnd, DWLP_USER, lParam); strcpyW( szTitle, szSettings ); strcatW( szTitle, info->lpszDevice ); SetWindowTextW(hWnd, szTitle); @@ -367,7 +367,7 @@ INT_PTR CALLBACK SERIALUI_ConfigDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, { WORD wID = LOWORD(wParam); - info = (SERIALUI_DialogInfo *) GetWindowLongW(hWnd, DWL_USER); + info = (SERIALUI_DialogInfo *) GetWindowLongPtrW(hWnd, DWLP_USER); if(!info) EndDialog(hWnd,0); switch (wID) diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index 522e005819d..c00c155427b 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -127,9 +127,9 @@ INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar case WM_INITDIALOG : prfdp = (RUNFILEDLGPARAMS *)lParam ; SetWindowTextA (hwnd, prfdp->lpstrTitle) ; - SetClassLongA (hwnd, GCL_HICON, (LPARAM)prfdp->hIcon) ; - SendMessageA (GetDlgItem (hwnd, 12297), STM_SETICON, - (WPARAM)LoadIconA (NULL, (LPSTR)IDI_WINLOGO), 0); + SetClassLongPtrW (hwnd, GCLP_HICON, (LPARAM)prfdp->hIcon) ; + SendMessageW (GetDlgItem (hwnd, 12297), STM_SETICON, + (WPARAM)LoadIconW (NULL, (LPCWSTR)IDI_WINLOGO), 0); FillList (GetDlgItem (hwnd, 12298), NULL) ; SetFocus (GetDlgItem (hwnd, 12298)) ; return TRUE ; diff --git a/dlls/shlwapi/msgbox.c b/dlls/shlwapi/msgbox.c index 1f5957cfef4..dbf3f70d1da 100644 --- a/dlls/shlwapi/msgbox.c +++ b/dlls/shlwapi/msgbox.c @@ -62,7 +62,7 @@ typedef struct tagDLGDATAEX /* Dialogue procedure for general message boxes */ static INT_PTR CALLBACK SHDlgProcEx(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - DLGDATAEX *d = (DLGDATAEX *)GetWindowLongW(hDlg, DWL_USER); + DLGDATAEX *d = (DLGDATAEX *)GetWindowLongPtrW(hDlg, DWLP_USER); TRACE("(%p,%u,%d,%ld) data %p\n", hDlg, uMsg, wParam, lParam, d); @@ -71,7 +71,7 @@ static INT_PTR CALLBACK SHDlgProcEx(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM case WM_INITDIALOG: { /* FIXME: Not sure where native stores its lParam */ - SetWindowLongW(hDlg, DWL_USER, lParam); + SetWindowLongPtrW(hDlg, DWLP_USER, lParam); d = (DLGDATAEX *)lParam; TRACE("WM_INITDIALOG: %p, %s,%p,%p\n", hDlg, debugstr_w(d->lpszId), d->dlgProc, (void*)d->lParam); diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 7cac49b3929..59db4b4adc1 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -2452,7 +2452,7 @@ HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle hWndParent, hMenu, shlwapi_hInstance, 0); if (hWnd) { - SetWindowLongA(hWnd, DWL_MSGRESULT, z); + SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, z); if (wndProc) SetWindowLongPtrA(hWnd, GWLP_WNDPROC, wndProc); @@ -2739,7 +2739,7 @@ HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle hWndParent, hMenu, shlwapi_hInstance, 0); if (hWnd) { - SetWindowLongW(hWnd, DWL_MSGRESULT, z); + SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, z); if (wndProc) SetWindowLongPtrW(hWnd, GWLP_WNDPROC, wndProc); diff --git a/dlls/user/controls.h b/dlls/user/controls.h index 6a529384a6a..5fd43dc1cab 100644 --- a/dlls/user/controls.h +++ b/dlls/user/controls.h @@ -148,7 +148,7 @@ typedef struct #define DF_OWNERENABLED 0x0002 /* offset of DIALOGINFO ptr in dialog extra bytes */ -#define DWL_WINE_DIALOGINFO (DWL_USER+sizeof(ULONG_PTR)) +#define DWLP_WINE_DIALOGINFO (DWLP_USER+sizeof(ULONG_PTR)) extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ); extern BOOL DIALOG_GetCharSize( HDC hdc, HFONT hFont, SIZE * pSize ); diff --git a/dlls/user/desktop.c b/dlls/user/desktop.c index 81e6ff6428b..02525125f9c 100644 --- a/dlls/user/desktop.c +++ b/dlls/user/desktop.c @@ -142,7 +142,7 @@ BOOL WINAPI PaintDesktop(HDC hdc) (!fTileWallPaper && ((bitmapSize.cx < rect.right) || (bitmapSize.cy < rect.bottom)))) { HBRUSH brush = hbrushPattern; - if (!brush) brush = (HBRUSH)GetClassLongA( hwnd, GCL_HBRBACKGROUND ); + if (!brush) brush = (HBRUSH)GetClassLongPtrW( hwnd, GCLP_HBRBACKGROUND ); /* Set colors in case pattern is a monochrome bitmap */ SetBkColor( hdc, RGB(0,0,0) ); SetTextColor( hdc, GetSysColor(COLOR_BACKGROUND) ); diff --git a/dlls/user/dialog16.c b/dlls/user/dialog16.c index 669f14fa243..d506c1bedb3 100644 --- a/dlls/user/dialog16.c +++ b/dlls/user/dialog16.c @@ -410,8 +410,8 @@ static HWND DIALOG_CreateIndirect16( HINSTANCE16 hInst, LPCVOID dlgTemplate, wndPtr->flags |= WIN_ISDIALOG; WIN_ReleasePtr( wndPtr ); - SetWindowLongW( hwnd, DWL_WINE_DIALOGINFO, (LONG)dlgInfo ); - SetWindowLong16( HWND_16(hwnd), DWL_DLGPROC, (LONG)dlgProc ); + SetWindowLongPtrW( hwnd, DWLP_WINE_DIALOGINFO, (LONG_PTR)dlgInfo ); + SetWindowLong16( HWND_16(hwnd), DWLP_DLGPROC, (LONG)dlgProc ); if (dlgInfo->hUserFont) SendMessageA( hwnd, WM_SETFONT, (WPARAM)dlgInfo->hUserFont, 0 ); diff --git a/dlls/user/icontitle.c b/dlls/user/icontitle.c index c8d2c20d515..b4aafe2aaed 100644 --- a/dlls/user/icontitle.c +++ b/dlls/user/icontitle.c @@ -150,7 +150,7 @@ static BOOL ICONTITLE_Paint( HWND hwnd, HWND owner, HDC hDC, BOOL bActive ) { if( GetWindowLongA( hwnd, GWL_STYLE ) & WS_CHILD ) { - hBrush = (HBRUSH) GetClassLongA(hwnd, GCL_HBRBACKGROUND); + hBrush = (HBRUSH) GetClassLongPtrW(hwnd, GCLP_HBRBACKGROUND); if( hBrush ) { INT level; diff --git a/dlls/wineps/driver.c b/dlls/wineps/driver.c index e3f81898733..0bab3d0e5d9 100644 --- a/dlls/wineps/driver.c +++ b/dlls/wineps/driver.c @@ -206,7 +206,7 @@ INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM switch(msg) { case WM_INITDIALOG: di = (PSDRV_DLGINFO*)((PROPSHEETPAGEA*)lParam)->lParam; - SetWindowLongA(hwnd, DWL_USER, (LONG)di); + SetWindowLongPtrW(hwnd, DWLP_USER, (LONG_PTR)di); for(ps = di->pi->ppd->PageSizes, i = 0; ps; ps = ps->next, i++) { SendDlgItemMessageA(hwnd, IDD_PAPERS, LB_INSERTSTRING, i, @@ -237,7 +237,7 @@ INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; case WM_COMMAND: - di = (PSDRV_DLGINFO *)GetWindowLongA(hwnd, DWL_USER); + di = (PSDRV_DLGINFO *)GetWindowLongPtrW(hwnd, DWLP_USER); switch(LOWORD(wParam)) { case IDD_PAPERS: if(HIWORD(wParam) == LBN_SELCHANGE) { @@ -272,11 +272,11 @@ INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_NOTIFY: { NMHDR *nmhdr = (NMHDR *)lParam; - di = (PSDRV_DLGINFO *)GetWindowLongA(hwnd, DWL_USER); + di = (PSDRV_DLGINFO *)GetWindowLongPtrW(hwnd, DWLP_USER); switch(nmhdr->code) { case PSN_APPLY: memcpy(di->pi->Devmode, di->dlgdm, sizeof(PSDRV_DEVMODEA)); - SetWindowLongA(hwnd, DWL_MSGRESULT, PSNRET_NOERROR); + SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, PSNRET_NOERROR); return TRUE; default: diff --git a/dlls/x11drv/window.c b/dlls/x11drv/window.c index 3d2273815fd..d46ae598761 100644 --- a/dlls/x11drv/window.c +++ b/dlls/x11drv/window.c @@ -484,7 +484,7 @@ void X11DRV_set_wm_hints( Display *display, struct x11drv_win_data *data ) wm_hints->input = !(style & WS_DISABLED); set_icon_hints( display, data, wm_hints, - (HICON)GetClassLongW( data->hwnd, GCL_HICON ) ); + (HICON)GetClassLongPtrW( data->hwnd, GCLP_HICON ) ); wm_hints->initial_state = (style & WS_MINIMIZE) ? IconicState : NormalState; wm_hints->window_group = group_leader; diff --git a/dlls/x11drv/winpos.c b/dlls/x11drv/winpos.c index 9ab7ee4f808..1a9469c5c9a 100644 --- a/dlls/x11drv/winpos.c +++ b/dlls/x11drv/winpos.c @@ -1866,8 +1866,8 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam ) if( iconic ) /* create a cursor for dragging */ { - hDragCursor = (HCURSOR)GetClassLongA( hwnd, GCL_HICON); - if( !hDragCursor ) hDragCursor = (HCURSOR)SendMessageA( hwnd, WM_QUERYDRAGICON, 0, 0L); + hDragCursor = (HCURSOR)GetClassLongPtrW( hwnd, GCLP_HICON); + if( !hDragCursor ) hDragCursor = (HCURSOR)SendMessageW( hwnd, WM_QUERYDRAGICON, 0, 0L); if( !hDragCursor ) iconic = FALSE; } diff --git a/include/windowsx.h b/include/windowsx.h index dc7c01f733d..23f268c8108 100644 --- a/include/windowsx.h +++ b/include/windowsx.h @@ -118,7 +118,7 @@ extern "C" { /****** USER Macro APIs ******************************************************/ -#define GetWindowInstance(hwnd) ((HMODULE)GetWindowLong(hwnd, GWL_HINSTANCE)) +#define GetWindowInstance(hwnd) ((HMODULE)GetWindowLongPtr(hwnd, GWLP_HINSTANCE)) #define GetWindowStyle(hwnd) ((DWORD)GetWindowLong(hwnd, GWL_STYLE)) #define GetWindowExStyle(hwnd) ((DWORD)GetWindowLong(hwnd, GWL_EXSTYLE)) @@ -136,7 +136,7 @@ extern "C" { #define SetWindowRedraw(hwnd, fRedraw) \ ((void)SendMessage(hwnd, WM_SETREDRAW, (WPARAM)(BOOL)(fRedraw), 0L)) #define SubclassWindow(hwnd, lpfn) \ - ((WNDPROC)SetWindowLong((hwnd), GWL_WNDPROC, (LPARAM)(WNDPROC)(lpfn))) + ((WNDPROC)SetWindowLongPtr((hwnd), GWLP_WNDPROC, (LPARAM)(WNDPROC)(lpfn))) #define IsMinimized(hwnd) IsIconic(hwnd) #define IsMaximized(hwnd) IsZoomed(hwnd) @@ -166,7 +166,7 @@ extern "C" { (msg) == WM_CHARTOITEM || \ (msg) == WM_QUERYDRAGICON || \ (msg) == WM_INITDIALOG \ - ) ? (BOOL)(result) : (SetWindowLong((hwnd), DWL_MSGRESULT, (LPARAM)(LRESULT)(result)), TRUE)) + ) ? (BOOL)(result) : (SetWindowLongPtr((hwnd), DWLP_MSGRESULT, (LPARAM)(LRESULT)(result)), TRUE)) #define DefDlgProcEx(hwnd, msg, wParam, lParam, pfRecursion) \ (*(pfRecursion) = TRUE, DefDlgProc(hwnd, msg, wParam, lParam)) @@ -175,7 +175,7 @@ extern "C" { if (*(pfRecursion)) { *(pfRecursion) = FALSE; return FALSE; } #define SubclassDialog(hwndDlg, lpfn) \ - ((DLGPROC)SetWindowLong(hwndDlg, DWL_DLGPROC, (LPARAM)(DLGPROC)(lpfn))) + ((DLGPROC)SetWindowLongPtr(hwndDlg, DWLP_DLGPROC, (LPARAM)(DLGPROC)(lpfn))) #define DeletePen(hpen) DeleteObject((HGDIOBJ)(HPEN)(hpen)) #define SelectPen(hdc, hpen) ((HPEN)SelectObject((hdc), (HGDIOBJ)(HPEN)(hpen))) diff --git a/include/winuser.h b/include/winuser.h index 60063ef9bed..cc7b72f35b7 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -1351,16 +1351,16 @@ typedef struct tagSTYLESTRUCT { /* Offsets for GetWindowLong() and GetWindowWord() */ #define GWL_EXSTYLE (-20) #define GWL_STYLE (-16) -#ifndef __WINESRC__ +#if !defined _WIN64 && !defined __WINESRC__ # define GWL_USERDATA (-21) # define GWL_ID (-12) # define GWL_HWNDPARENT (-8) # define GWL_HINSTANCE (-6) # define GWL_WNDPROC (-4) -#endif /* __WINESRC__ */ -#define DWL_MSGRESULT 0 -#define DWL_DLGPROC 4 -#define DWL_USER 8 +# define DWL_MSGRESULT 0 +# define DWL_DLGPROC 4 +# define DWL_USER 8 +#endif /* _WIN64 && __WINESRC__ */ /* Offsets for GetWindowLongPtr() and SetWindowLongPtr() */ #define GWLP_USERDATA (-21) @@ -1555,17 +1555,20 @@ typedef struct #define PRF_OWNED 0x00000020L /* Offsets for GetClassLong() and GetClassWord() */ -#define GCL_MENUNAME (-8) -#define GCL_HBRBACKGROUND (-10) -#define GCL_HCURSOR (-12) -#define GCL_HICON (-14) -#define GCL_HMODULE (-16) +#if !defined _WIN64 && !defined __WINESRC__ +# define GCL_MENUNAME (-8) +# define GCL_HBRBACKGROUND (-10) +# define GCL_HCURSOR (-12) +# define GCL_HICON (-14) +# define GCL_HMODULE (-16) +# define GCL_WNDPROC (-24) +# define GCL_HICONSM (-34) +#endif /* _WIN64 && __WINESRC__ */ + #define GCL_CBWNDEXTRA (-18) #define GCL_CBCLSEXTRA (-20) -#define GCL_WNDPROC (-24) #define GCL_STYLE (-26) #define GCW_ATOM (-32) -#define GCL_HICONSM (-34) #define GCLP_MENUNAME (-8) #define GCLP_HBRBACKGROUND (-10) @@ -4181,12 +4184,12 @@ BOOL WINAPI GetClassInfoW(HINSTANCE,LPCWSTR,WNDCLASSW *); BOOL WINAPI GetClassInfoExA(HINSTANCE,LPCSTR,WNDCLASSEXA *); BOOL WINAPI GetClassInfoExW(HINSTANCE,LPCWSTR,WNDCLASSEXW *); #define GetClassInfoEx WINELIB_NAME_AW(GetClassInfoEx) -LONG WINAPI GetClassLongA(HWND,INT); -LONG WINAPI GetClassLongW(HWND,INT); +DWORD WINAPI GetClassLongA(HWND,INT); +DWORD WINAPI GetClassLongW(HWND,INT); #define GetClassLong WINELIB_NAME_AW(GetClassLong) #ifdef _WIN64 -LONG_PTR WINAPI GetClassLongPtrA(HWND,INT); -LONG_PTR WINAPI GetClassLongPtrW(HWND,INT); +ULONG_PTR WINAPI GetClassLongPtrA(HWND,INT); +ULONG_PTR WINAPI GetClassLongPtrW(HWND,INT); #else #define GetClassLongPtrA GetClassLongA #define GetClassLongPtrW GetClassLongW @@ -4470,9 +4473,17 @@ HWND WINAPI SetActiveWindow(HWND); HWND WINAPI SetCapture(HWND); BOOL WINAPI SetCaretBlinkTime(UINT); BOOL WINAPI SetCaretPos(INT,INT); -LONG WINAPI SetClassLongA(HWND,INT,LONG); -LONG WINAPI SetClassLongW(HWND,INT,LONG); +DWORD WINAPI SetClassLongA(HWND,INT,LONG); +DWORD WINAPI SetClassLongW(HWND,INT,LONG); #define SetClassLong WINELIB_NAME_AW(SetClassLong) +#ifdef _WIN64 +ULONG_PTR WINAPI SetClassLongPtrA(HWND,INT,LONG_PTR); +ULONG_PTR WINAPI SetClassLongPtrW(HWND,INT,LONG_PTR); +#else +#define SetClassLongPtrA SetClassLongA +#define SetClassLongPtrW SetClassLongW +#endif +#define SetClassLongPtr WINELIB_NAME_AW(SetClassLongPtr) WORD WINAPI SetClassWord(HWND,INT,WORD); HANDLE WINAPI SetClipboardData(UINT,HANDLE); HWND WINAPI SetClipboardViewer(HWND); diff --git a/programs/taskmgr/applpage.c b/programs/taskmgr/applpage.c index f4b1538fa01..81187ce94ed 100644 --- a/programs/taskmgr/applpage.c +++ b/programs/taskmgr/applpage.c @@ -286,8 +286,8 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) if (!hIcon) { - hIcon = (HICON)GetClassLong(hWnd, bLargeIcon ? GCL_HICON : GCL_HICONSM); - if (!hIcon) hIcon = (HICON)GetClassLong(hWnd, bLargeIcon ? GCL_HICONSM : GCL_HICON); + hIcon = (HICON)GetClassLongPtr(hWnd, bLargeIcon ? GCLP_HICON : GCLP_HICONSM); + if (!hIcon) hIcon = (HICON)GetClassLongPtr(hWnd, bLargeIcon ? GCLP_HICONSM : GCLP_HICON); if (!hIcon) SendMessageTimeout(hWnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (unsigned long*)&hIcon); if (!hIcon) SendMessageTimeout(hWnd, WM_GETICON, bLargeIcon ? ICON_SMALL /*0*/ : ICON_BIG /*1*/, 0, 0, 1000, (unsigned long*)&hIcon); } diff --git a/programs/taskmgr/proclist.c b/programs/taskmgr/proclist.c index 70ad04187de..485d735e0f3 100644 --- a/programs/taskmgr/proclist.c +++ b/programs/taskmgr/proclist.c @@ -72,7 +72,7 @@ LRESULT CALLBACK ProcessListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR /* * Get the background brush */ - hbrBackground = (HBRUSH) GetClassLong(hWnd, GCL_HBRBACKGROUND); + hbrBackground = (HBRUSH) GetClassLongPtr(hWnd, GCLP_HBRBACKGROUND); /* * Calculate the clip rect by getting the RECT diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c index 722d1bca7d5..6a082e250b7 100644 --- a/programs/winecfg/appdefaults.c +++ b/programs/winecfg/appdefaults.c @@ -372,7 +372,7 @@ AppDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case PSN_APPLY: apply(); - SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_NOERROR); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); break; } diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c index d6aa64219c4..d89d2eba32f 100644 --- a/programs/winecfg/audio.c +++ b/programs/winecfg/audio.c @@ -183,11 +183,11 @@ AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NOTIFY: switch(((LPNMHDR)lParam)->code) { case PSN_KILLACTIVE: - SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); break; case PSN_APPLY: apply(); - SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_NOERROR); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); break; case PSN_SETACTIVE: break; diff --git a/programs/winecfg/driveui.c b/programs/winecfg/driveui.c index bba2e48a029..52f7e1bc35f 100644 --- a/programs/winecfg/driveui.c +++ b/programs/winecfg/driveui.c @@ -642,11 +642,11 @@ DriveDlgProc (HWND dialog, UINT msg, WPARAM wParam, LPARAM lParam) { case PSN_KILLACTIVE: WINE_TRACE("PSN_KILLACTIVE\n"); - SetWindowLong(dialog, DWL_MSGRESULT, FALSE); + SetWindowLongPtr(dialog, DWLP_MSGRESULT, FALSE); break; case PSN_APPLY: apply_drive_changes(); - SetWindowLong(dialog, DWL_MSGRESULT, PSNRET_NOERROR); + SetWindowLongPtr(dialog, DWLP_MSGRESULT, PSNRET_NOERROR); break; case PSN_SETACTIVE: break; diff --git a/programs/winecfg/x11drvdlg.c b/programs/winecfg/x11drvdlg.c index e558a38134f..9756968f9f8 100644 --- a/programs/winecfg/x11drvdlg.c +++ b/programs/winecfg/x11drvdlg.c @@ -245,12 +245,12 @@ GraphDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { case PSN_KILLACTIVE: { - SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); break; } case PSN_APPLY: { apply(); - SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_NOERROR); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); break; } case PSN_SETACTIVE: { diff --git a/programs/wineconsole/dialog.c b/programs/wineconsole/dialog.c index fc54d101fb2..c292cb88223 100644 --- a/programs/wineconsole/dialog.c +++ b/programs/wineconsole/dialog.c @@ -127,7 +127,7 @@ static BOOL WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR val = (IsDlgButtonChecked(hDlg, IDC_OPT_QUICK_EDIT) & BST_CHECKED) ? TRUE : FALSE; di->config.quick_edit = val; - SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_NOERROR); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); return TRUE; default: return FALSE; @@ -573,7 +573,7 @@ static BOOL WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0); di->config.def_attr = val; - SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_NOERROR); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); return TRUE; default: return FALSE; @@ -643,14 +643,14 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR sb_h = GetDlgItemInt(hDlg, IDC_CNF_SB_HEIGHT, &st2, FALSE); if (!st1 || ! st2) { - SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_INVALID); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_INVALID); return TRUE; } win_w = GetDlgItemInt(hDlg, IDC_CNF_WIN_WIDTH, &st1, FALSE); win_h = GetDlgItemInt(hDlg, IDC_CNF_WIN_HEIGHT, &st2, FALSE); if (!st1 || !st2) { - SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_INVALID); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_INVALID); return TRUE; } if (win_w > sb_w || win_h > sb_h) @@ -664,7 +664,7 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR txt, sizeof(txt) / sizeof(WCHAR)); MessageBox(hDlg, txt, cap, MB_OK); - SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_INVALID); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_INVALID); return TRUE; } di->config.win_width = win_w; @@ -675,7 +675,7 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR di->config.exit_on_die = IsDlgButtonChecked(hDlg, IDC_CNF_CLOSE_EXIT) ? 1 : 0; di->config.edition_mode = SendDlgItemMessage(hDlg, IDC_CNF_EDITION_MODE, CB_GETCURSEL, 0, 0); - SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_NOERROR); + SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); return TRUE; default: return FALSE; diff --git a/windows/class.c b/windows/class.c index b2cfe214e12..9b7ba67e2d3 100644 --- a/windows/class.c +++ b/windows/class.c @@ -127,7 +127,7 @@ static BOOL set_server_info( HWND hwnd, INT offset, LONG newval ) req->flags = SET_CLASS_WINEXTRA; req->win_extra = newval; break; - case GCL_HMODULE: + case GCLP_HMODULE: req->flags = SET_CLASS_INSTANCE; req->instance = (void *)newval; break; @@ -726,13 +726,13 @@ LONG WINAPI GetClassLong16( HWND16 hwnd16, INT16 offset ) switch( offset ) { - case GCL_WNDPROC: + case GCLP_WNDPROC: if (!(class = get_class_ptr( hwnd, FALSE ))) return 0; if (class == CLASS_OTHER_PROCESS) break; ret = (LONG)CLASS_GetProc( class, WIN_PROC_16 ); release_class_ptr( class ); return ret; - case GCL_MENUNAME: + case GCLP_MENUNAME: if (!(class = get_class_ptr( hwnd, FALSE ))) return 0; if (class == CLASS_OTHER_PROCESS) break; ret = (LONG)CLASS_GetMenuName16( class ); @@ -750,10 +750,10 @@ LONG WINAPI GetClassLong16( HWND16 hwnd16, INT16 offset ) /*********************************************************************** * GetClassLongW (USER32.@) */ -LONG WINAPI GetClassLongW( HWND hwnd, INT offset ) +DWORD WINAPI GetClassLongW( HWND hwnd, INT offset ) { CLASS *class; - LONG retvalue = 0; + DWORD retvalue = 0; TRACE("%p %d\n", hwnd, offset); @@ -771,12 +771,12 @@ LONG WINAPI GetClassLongW( HWND hwnd, INT offset ) { switch(offset) { - case GCL_HBRBACKGROUND: - case GCL_HCURSOR: - case GCL_HICON: - case GCL_HICONSM: - case GCL_WNDPROC: - case GCL_MENUNAME: + case GCLP_HBRBACKGROUND: + case GCLP_HCURSOR: + case GCLP_HICON: + case GCLP_HICONSM: + case GCLP_WNDPROC: + case GCLP_MENUNAME: FIXME( "offset %d not supported on other process window %p\n", offset, hwnd ); SetLastError( ERROR_INVALID_HANDLE ); break; @@ -789,8 +789,8 @@ LONG WINAPI GetClassLongW( HWND hwnd, INT offset ) case GCL_CBCLSEXTRA: retvalue = reply->old_extra; break; - case GCL_HMODULE: - retvalue = (LONG)reply->old_instance; + case GCLP_HMODULE: + retvalue = (DWORD)reply->old_instance; break; case GCW_ATOM: retvalue = reply->old_atom; @@ -818,35 +818,35 @@ LONG WINAPI GetClassLongW( HWND hwnd, INT offset ) switch(offset) { - case GCL_HBRBACKGROUND: - retvalue = (LONG)class->hbrBackground; + case GCLP_HBRBACKGROUND: + retvalue = (DWORD)class->hbrBackground; break; - case GCL_HCURSOR: - retvalue = (LONG)class->hCursor; + case GCLP_HCURSOR: + retvalue = (DWORD)class->hCursor; break; - case GCL_HICON: - retvalue = (LONG)class->hIcon; + case GCLP_HICON: + retvalue = (DWORD)class->hIcon; break; - case GCL_HICONSM: - retvalue = (LONG)class->hIconSm; + case GCLP_HICONSM: + retvalue = (DWORD)class->hIconSm; break; case GCL_STYLE: - retvalue = (LONG)class->style; + retvalue = (DWORD)class->style; break; case GCL_CBWNDEXTRA: - retvalue = (LONG)class->cbWndExtra; + retvalue = (DWORD)class->cbWndExtra; break; case GCL_CBCLSEXTRA: - retvalue = (LONG)class->cbClsExtra; + retvalue = (DWORD)class->cbClsExtra; break; - case GCL_HMODULE: - retvalue = (LONG)class->hInstance; + case GCLP_HMODULE: + retvalue = (DWORD)class->hInstance; break; - case GCL_WNDPROC: - retvalue = (LONG)CLASS_GetProc( class, WIN_PROC_32W ); + case GCLP_WNDPROC: + retvalue = (DWORD)CLASS_GetProc( class, WIN_PROC_32W ); break; - case GCL_MENUNAME: - retvalue = (LONG)CLASS_GetMenuNameW( class ); + case GCLP_MENUNAME: + retvalue = (DWORD)CLASS_GetMenuNameW( class ); break; case GCW_ATOM: retvalue = (DWORD)class->atomName; @@ -863,12 +863,12 @@ LONG WINAPI GetClassLongW( HWND hwnd, INT offset ) /*********************************************************************** * GetClassLongA (USER32.@) */ -LONG WINAPI GetClassLongA( HWND hwnd, INT offset ) +DWORD WINAPI GetClassLongA( HWND hwnd, INT offset ) { CLASS *class; - LONG retvalue; + DWORD retvalue; - if (offset != GCL_WNDPROC && offset != GCL_MENUNAME) + if (offset != GCLP_WNDPROC && offset != GCLP_MENUNAME) return GetClassLongW( hwnd, offset ); TRACE("%p %d\n", hwnd, offset); @@ -882,10 +882,10 @@ LONG WINAPI GetClassLongA( HWND hwnd, INT offset ) return 0; } - if (offset == GCL_WNDPROC) - retvalue = (LONG)CLASS_GetProc( class, WIN_PROC_32A ); + if (offset == GCLP_WNDPROC) + retvalue = (DWORD)CLASS_GetProc( class, WIN_PROC_32A ); else /* GCL_MENUNAME */ - retvalue = (LONG)CLASS_GetMenuNameA( class ); + retvalue = (DWORD)CLASS_GetMenuNameA( class ); release_class_ptr( class ); return retvalue; @@ -939,12 +939,12 @@ LONG WINAPI SetClassLong16( HWND16 hwnd16, INT16 offset, LONG newval ) switch(offset) { - case GCL_WNDPROC: + case GCLP_WNDPROC: if (!(class = get_class_ptr( hwnd, TRUE ))) return 0; retval = (LONG)CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_16 ); release_class_ptr( class ); return retval; - case GCL_MENUNAME: + case GCLP_MENUNAME: newval = (LONG)MapSL( newval ); /* fall through */ default: @@ -956,10 +956,10 @@ LONG WINAPI SetClassLong16( HWND16 hwnd16, INT16 offset, LONG newval ) /*********************************************************************** * SetClassLongW (USER32.@) */ -LONG WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval ) +DWORD WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval ) { CLASS *class; - LONG retval = 0; + DWORD retval = 0; TRACE("%p %d %lx\n", hwnd, offset, newval); @@ -976,42 +976,42 @@ LONG WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval ) } else switch(offset) { - case GCL_MENUNAME: + case GCLP_MENUNAME: CLASS_SetMenuNameW( class, (LPCWSTR)newval ); retval = 0; /* Old value is now meaningless anyway */ break; - case GCL_WNDPROC: - retval = (LONG)CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_32W ); + case GCLP_WNDPROC: + retval = (DWORD)CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_32W ); break; - case GCL_HBRBACKGROUND: - retval = (LONG)class->hbrBackground; + case GCLP_HBRBACKGROUND: + retval = (DWORD)class->hbrBackground; class->hbrBackground = (HBRUSH)newval; break; - case GCL_HCURSOR: - retval = (LONG)class->hCursor; + case GCLP_HCURSOR: + retval = (DWORD)class->hCursor; class->hCursor = (HCURSOR)newval; break; - case GCL_HICON: - retval = (LONG)class->hIcon; + case GCLP_HICON: + retval = (DWORD)class->hIcon; class->hIcon = (HICON)newval; break; - case GCL_HICONSM: - retval = (LONG)class->hIconSm; + case GCLP_HICONSM: + retval = (DWORD)class->hIconSm; class->hIconSm = (HICON)newval; break; case GCL_STYLE: if (!set_server_info( hwnd, offset, newval )) break; - retval = (LONG)class->style; + retval = (DWORD)class->style; class->style = newval; break; case GCL_CBWNDEXTRA: if (!set_server_info( hwnd, offset, newval )) break; - retval = (LONG)class->cbWndExtra; + retval = (DWORD)class->cbWndExtra; class->cbWndExtra = newval; break; - case GCL_HMODULE: + case GCLP_HMODULE: if (!set_server_info( hwnd, offset, newval )) break; - retval = (LONG)class->hInstance; + retval = (DWORD)class->hInstance; class->hInstance = (HINSTANCE)newval; break; case GCW_ATOM: @@ -1034,20 +1034,20 @@ LONG WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval ) /*********************************************************************** * SetClassLongA (USER32.@) */ -LONG WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval ) +DWORD WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval ) { CLASS *class; - LONG retval; + DWORD retval; - if (offset != GCL_WNDPROC && offset != GCL_MENUNAME) + if (offset != GCLP_WNDPROC && offset != GCLP_MENUNAME) return SetClassLongW( hwnd, offset, newval ); TRACE("%p %d %lx\n", hwnd, offset, newval); if (!(class = get_class_ptr( hwnd, TRUE ))) return 0; - if (offset == GCL_WNDPROC) - retval = (LONG)CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_32A ); + if (offset == GCLP_WNDPROC) + retval = (DWORD)CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_32A ); else /* GCL_MENUNAME */ { CLASS_SetMenuNameA( class, (LPCSTR)newval ); diff --git a/windows/defdlg.c b/windows/defdlg.c index 5ed5b9e75ef..902f7776f85 100644 --- a/windows/defdlg.c +++ b/windows/defdlg.c @@ -46,7 +46,7 @@ static WNDPROC DEFDLG_GetDlgProc( HWND hwnd ) ERR( "cannot get dlg proc %p from other process\n", hwnd ); return 0; } - ret = *(WNDPROC *)((char *)wndPtr->wExtra + DWL_DLGPROC); + ret = *(WNDPROC *)((char *)wndPtr->wExtra + DWLP_DLGPROC); WIN_ReleasePtr( wndPtr ); return ret; } @@ -127,9 +127,9 @@ static HWND DEFDLG_FindDefButton( HWND hwndDlg ) break; /* Recurse into WS_EX_CONTROLPARENT controls */ - if (GetWindowLongA( hwndChild, GWL_EXSTYLE ) & WS_EX_CONTROLPARENT) + if (GetWindowLongW( hwndChild, GWL_EXSTYLE ) & WS_EX_CONTROLPARENT) { - LONG dsStyle = GetWindowLongA( hwndChild, GWL_STYLE ); + LONG dsStyle = GetWindowLongW( hwndChild, GWL_STYLE ); if ((dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED) && (hwndTmp = DEFDLG_FindDefButton(hwndChild)) != NULL) return hwndTmp; @@ -237,7 +237,7 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam, return 1; } case WM_NCDESTROY: - if ((dlgInfo = (DIALOGINFO *)SetWindowLongW( hwnd, DWL_WINE_DIALOGINFO, 0 ))) + if ((dlgInfo = (DIALOGINFO *)SetWindowLongPtrW( hwnd, DWLP_WINE_DIALOGINFO, 0 ))) { /* Free dialog heap (if created) */ if (dlgInfo->hDialogHeap) @@ -333,7 +333,7 @@ static LRESULT DEFDLG_Epilog(HWND hwnd, UINT msg, BOOL fResult) msg == WM_QUERYDRAGICON || msg == WM_INITDIALOG) return fResult; - return GetWindowLongA( hwnd, DWL_MSGRESULT ); + return GetWindowLongPtrW( hwnd, DWLP_MSGRESULT ); } /*********************************************************************** @@ -345,7 +345,7 @@ static LRESULT DEFDLG_Epilog(HWND hwnd, UINT msg, BOOL fResult) DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) { WND* wndPtr; - DIALOGINFO* dlgInfo = (DIALOGINFO *)GetWindowLongW( hwnd, DWL_WINE_DIALOGINFO ); + DIALOGINFO* dlgInfo = (DIALOGINFO *)GetWindowLongPtrW( hwnd, DWLP_WINE_DIALOGINFO ); if(!dlgInfo && create) { @@ -363,7 +363,7 @@ DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) { wndPtr->flags |= WIN_ISDIALOG; WIN_ReleasePtr( wndPtr ); - SetWindowLongW( hwnd, DWL_WINE_DIALOGINFO, (LONG)dlgInfo ); + SetWindowLongPtrW( hwnd, DWLP_WINE_DIALOGINFO, (ULONG_PTR)dlgInfo ); } else { @@ -388,7 +388,7 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, /* Perform DIALOGINFO intialization if not done */ if(!(dlgInfo = DIALOG_get_info(hwnd32, TRUE))) return -1; - SetWindowLongW( hwnd32, DWL_MSGRESULT, 0 ); + SetWindowLongPtrW( hwnd32, DWLP_MSGRESULT, 0 ); if ((dlgproc = (WNDPROC16)DEFDLG_GetDlgProc( hwnd32 ))) { @@ -445,7 +445,7 @@ LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) /* Perform DIALOGINFO initialization if not done */ if(!(dlgInfo = DIALOG_get_info( hwnd, TRUE ))) return -1; - SetWindowLongW( hwnd, DWL_MSGRESULT, 0 ); + SetWindowLongPtrW( hwnd, DWLP_MSGRESULT, 0 ); if ((dlgproc = DEFDLG_GetDlgProc( hwnd ))) { @@ -502,7 +502,7 @@ LRESULT WINAPI DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) /* Perform DIALOGINFO intialization if not done */ if(!(dlgInfo = DIALOG_get_info( hwnd, TRUE ))) return -1; - SetWindowLongW( hwnd, DWL_MSGRESULT, 0 ); + SetWindowLongPtrW( hwnd, DWLP_MSGRESULT, 0 ); if ((dlgproc = DEFDLG_GetDlgProc( hwnd ))) { diff --git a/windows/defwnd.c b/windows/defwnd.c index 2f76dc5e78b..5c8b19aad58 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -413,7 +413,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa if( hdc ) { HICON hIcon; - if (IsIconic(hwnd) && ((hIcon = (HICON)GetClassLongW( hwnd, GCL_HICON))) ) + if (IsIconic(hwnd) && ((hIcon = (HICON)GetClassLongPtrW( hwnd, GCLP_HICON))) ) { RECT rc; int x, y; @@ -475,7 +475,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa { RECT rect; HDC hdc = (HDC)wParam; - HBRUSH hbr = (HBRUSH)GetClassLongW( hwnd, GCL_HBRBACKGROUND ); + HBRUSH hbr = (HBRUSH)GetClassLongPtrW( hwnd, GCLP_HBRBACKGROUND ); if (!hbr) return 0; if (GetClassLongW( hwnd, GCL_STYLE ) & CS_PARENTDC) @@ -609,7 +609,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa { UINT len; - HICON hIcon = (HICON)GetClassLongW( hwnd, GCL_HICON ); + HICON hIcon = (HICON)GetClassLongPtrW( hwnd, GCLP_HICON ); HINSTANCE instance = (HINSTANCE)GetWindowLongPtrW( hwnd, GWLP_HINSTANCE ); if (hIcon) return (LRESULT)hIcon; for(len=1; len<64; len++) @@ -680,7 +680,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa break; case ICON_SMALL2: ret = wndPtr->hIconSmall; - if (!ret) ret = (HICON)GetClassLongA( hwnd, GCL_HICONSM ); + if (!ret) ret = (HICON)GetClassLongPtrW( hwnd, GCLP_HICONSM ); /* FIXME: should have a default here if class icon is null */ break; default: diff --git a/windows/dialog.c b/windows/dialog.c index e363287b173..3027d9d3f4f 100644 --- a/windows/dialog.c +++ b/windows/dialog.c @@ -652,8 +652,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, if (template.helpId) SetWindowContextHelpId( hwnd, template.helpId ); - if (unicode) SetWindowLongW( hwnd, DWL_DLGPROC, (LONG)dlgProc ); - else SetWindowLongA( hwnd, DWL_DLGPROC, (LONG)dlgProc ); + if (unicode) SetWindowLongPtrW( hwnd, DWLP_DLGPROC, (ULONG_PTR)dlgProc ); + else SetWindowLongPtrA( hwnd, DWLP_DLGPROC, (ULONG_PTR)dlgProc ); if (dlgInfo->hUserFont) SendMessageW( hwnd, WM_SETFONT, (WPARAM)dlgInfo->hUserFont, 0 ); diff --git a/windows/mdi.c b/windows/mdi.c index c4b9e4c259d..1dfb9599306 100644 --- a/windows/mdi.c +++ b/windows/mdi.c @@ -820,9 +820,9 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) SC_CLOSE, (LPSTR)(DWORD)HBMMENU_MBAR_CLOSE ); /* The system menu is replaced by the child icon */ - hIcon = (HICON)GetClassLongW(hChild, GCL_HICONSM); + hIcon = (HICON)GetClassLongPtrW(hChild, GCLP_HICONSM); if (!hIcon) - hIcon = (HICON)GetClassLongW(hChild, GCL_HICON); + hIcon = (HICON)GetClassLongPtrW(hChild, GCLP_HICON); if (!hIcon) hIcon = LoadImageW(0, MAKEINTRESOURCEW(IDI_WINLOGO), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); if (hIcon) diff --git a/windows/nonclient.c b/windows/nonclient.c index a3af69b04c6..6351d3d4a3a 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -188,14 +188,14 @@ static HICON NC_IconForWindow( HWND hwnd ) if (!hIcon) hIcon = wndPtr->hIcon; WIN_ReleasePtr( wndPtr ); } - if (!hIcon) hIcon = (HICON) GetClassLongA( hwnd, GCL_HICONSM ); - if (!hIcon) hIcon = (HICON) GetClassLongA( hwnd, GCL_HICON ); + if (!hIcon) hIcon = (HICON) GetClassLongPtrW( hwnd, GCLP_HICONSM ); + if (!hIcon) hIcon = (HICON) GetClassLongPtrW( hwnd, GCLP_HICON ); /* If there is no hIcon specified and this is a modal dialog, * get the default one. */ - if (!hIcon && (GetWindowLongA( hwnd, GWL_STYLE ) & DS_MODALFRAME)) - hIcon = LoadImageA(0, (LPSTR)IDI_WINLOGO, IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); + if (!hIcon && (GetWindowLongW( hwnd, GWL_STYLE ) & DS_MODALFRAME)) + hIcon = LoadImageW(0, (LPCWSTR)IDI_WINLOGO, IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); return hIcon; } @@ -375,9 +375,9 @@ LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) { RECT tmpRect = { 0, 0, 0, 0 }; LONG result = 0; - LONG cls_style = GetClassLongA(hwnd, GCL_STYLE); - LONG style = GetWindowLongA( hwnd, GWL_STYLE ); - LONG exStyle = GetWindowLongA( hwnd, GWL_EXSTYLE ); + LONG cls_style = GetClassLongW(hwnd, GCL_STYLE); + LONG style = GetWindowLongW( hwnd, GWL_STYLE ); + LONG exStyle = GetWindowLongW( hwnd, GWL_EXSTYLE ); if (cls_style & CS_VREDRAW) result |= WVR_VREDRAW; if (cls_style & CS_HREDRAW) result |= WVR_HREDRAW; @@ -679,7 +679,7 @@ static void NC_DrawCloseButton (HWND hwnd, HDC hdc, BOOL down, BOOL bGrayed) NC_GetInsideRect( hwnd, &rect ); /* A tool window has a smaller Close button */ - if (GetWindowLongA( hwnd, GWL_EXSTYLE ) & WS_EX_TOOLWINDOW) + if (GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_TOOLWINDOW) { INT iBmpHeight = 11; /* Windows does not use SM_CXSMSIZE and SM_CYSMSIZE */ INT iBmpWidth = 11; /* it uses 11x11 for the close button in tool window */ @@ -721,7 +721,7 @@ static void NC_DrawMaxButton(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed) flags = IsZoomed(hwnd) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX; NC_GetInsideRect( hwnd, &rect ); - if (GetWindowLongA( hwnd, GWL_STYLE) & WS_SYSMENU) + if (GetWindowLongW( hwnd, GWL_STYLE) & WS_SYSMENU) rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; rect.left = rect.right - GetSystemMetrics(SM_CXSIZE); rect.bottom = rect.top + GetSystemMetrics(SM_CYSIZE) - 1; @@ -742,7 +742,7 @@ static void NC_DrawMinButton(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed) { RECT rect; UINT flags = DFCS_CAPTIONMIN; - DWORD style = GetWindowLongA( hwnd, GWL_STYLE ); + DWORD style = GetWindowLongW( hwnd, GWL_STYLE ); /* never draw minimize box when window has WS_EX_TOOLWINDOW style */ if (GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_TOOLWINDOW) @@ -1136,7 +1136,7 @@ LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) case HTCLIENT: { - HCURSOR hCursor = (HCURSOR)GetClassLongA(hwnd, GCL_HCURSOR); + HCURSOR hCursor = (HCURSOR)GetClassLongPtrW(hwnd, GCLP_HCURSOR); if(hCursor) { SetCursor(hCursor); return TRUE; @@ -1202,7 +1202,7 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam ) HDC hdc = GetWindowDC( hwnd ); BOOL pressed = TRUE; UINT state; - DWORD wndStyle = GetWindowLongA( hwnd, GWL_STYLE); + DWORD wndStyle = GetWindowLongW( hwnd, GWL_STYLE); HMENU hSysMenu = GetSystemMenu(hwnd, FALSE); void (*paintButton)(HWND, HDC, BOOL, BOOL); @@ -1357,7 +1357,7 @@ static void NC_TrackScrollBar( HWND hwnd, WPARAM wParam, POINT pt ) */ LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) { - LONG style = GetWindowLongA( hwnd, GWL_STYLE ); + LONG style = GetWindowLongW( hwnd, GWL_STYLE ); switch(wParam) /* Hit test */ { @@ -1451,7 +1451,7 @@ LONG NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam ) { case HTCAPTION: /* stop processing if WS_MAXIMIZEBOX is missing */ - if (GetWindowLongA( hwnd, GWL_STYLE ) & WS_MAXIMIZEBOX) + if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_MAXIMIZEBOX) SendMessageW( hwnd, WM_SYSCOMMAND, IsZoomed(hwnd) ? SC_RESTORE : SC_MAXIMIZE, lParam ); break; diff --git a/windows/win.c b/windows/win.c index b1de4a4ed1a..7b7a028824a 100644 --- a/windows/win.c +++ b/windows/win.c @@ -1184,7 +1184,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, if (cs->hMenu) MENU_SetMenu(hwnd, cs->hMenu); else { - LPCSTR menuName = (LPCSTR)GetClassLongA( hwnd, GCL_MENUNAME ); + LPCSTR menuName = (LPCSTR)GetClassLongPtrA( hwnd, GCLP_MENUNAME ); if (menuName) { if (HIWORD(cs->hInstance)) @@ -1981,7 +1981,7 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type ) ERR( "- replaced invalid offset %d with %d\n", offset, offset2 ); - retvalue = *(LONG *)(((char *)wndPtr->wExtra) + offset2); + retvalue = *(LONG_PTR *)(((char *)wndPtr->wExtra) + offset2); WIN_ReleasePtr( wndPtr ); return retvalue; } @@ -1990,10 +1990,10 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type ) SetLastError( ERROR_INVALID_INDEX ); return 0; } - retvalue = *(LONG *)(((char *)wndPtr->wExtra) + offset); + retvalue = *(LONG_PTR *)(((char *)wndPtr->wExtra) + offset); /* Special case for dialog window procedure */ - if ((offset == DWL_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG)) - retvalue = (LONG)WINPROC_GetProc( (WNDPROC)retvalue, type ); + if ((offset == DWLP_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG)) + retvalue = (LONG_PTR)WINPROC_GetProc( (WNDPROC)retvalue, type ); WIN_ReleasePtr( wndPtr ); return retvalue; } @@ -2029,7 +2029,7 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval, { STYLESTRUCT style; BOOL ok; - LONG retval = 0; + LONG_PTR retval = 0; WND *wndPtr; TRACE( "%p %d %lx %x\n", hwnd, offset, newval, type ); @@ -2092,7 +2092,7 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval, case GWLP_USERDATA: break; case DWLP_DLGPROC: - if ((wndPtr->cbWndExtra + sizeof(LONG) >= DWLP_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG)) + if ((wndPtr->cbWndExtra + sizeof(LONG_PTR) >= DWLP_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG)) { WNDPROC *ptr = (WNDPROC *)((char *)wndPtr->wExtra + DWLP_DLGPROC); retval = (ULONG_PTR)WINPROC_GetProc( *ptr, type ); @@ -2102,7 +2102,7 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval, } /* fall through */ default: - if (offset < 0 || offset > (int)(wndPtr->cbWndExtra - sizeof(LONG))) + if (offset < 0 || offset > (int)(wndPtr->cbWndExtra - sizeof(LONG_PTR))) { WARN("Invalid offset %d\n", offset ); WIN_ReleasePtr( wndPtr ); @@ -2722,7 +2722,7 @@ BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL icon ) LONG style = GetWindowLongW( hwnd, GWL_STYLE ); if (!(style & WS_VISIBLE)) return FALSE; - if ((style & WS_MINIMIZE) && icon && GetClassLongA( hwnd, GCL_HICON )) return FALSE; + if ((style & WS_MINIMIZE) && icon && GetClassLongPtrW( hwnd, GCLP_HICON )) return FALSE; if (!(list = list_window_parents( hwnd ))) return TRUE; for (i = 0; list[i]; i++) diff --git a/windows/winproc.c b/windows/winproc.c index e2880b58ee3..0af0a67afb7 100644 --- a/windows/winproc.c +++ b/windows/winproc.c @@ -2406,14 +2406,14 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, return 1; } case WM_PAINT: - if (IsIconic( hwnd ) && GetClassLongW( hwnd, GCL_HICON )) + if (IsIconic( hwnd ) && GetClassLongPtrW( hwnd, GCLP_HICON )) { *pmsg16 = WM_PAINTICON; *pwparam16 = 1; } return 0; case WM_ERASEBKGND: - if (IsIconic( hwnd ) && GetClassLongW( hwnd, GCL_HICON )) + if (IsIconic( hwnd ) && GetClassLongPtrW( hwnd, GCLP_HICON )) *pmsg16 = WM_ICONERASEBKGND; return 0; case WM_PAINTCLIPBOARD: