-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This patch should resolve bug 1150, compiling commdlg with -DSTRICT. Hope this is okay - this is my first time hacking on Wine. The patch is also attached to the bug. - -- Andrew :-) Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE92DtTSE/kMce1ABARAgXdAJ0RKUv3appMGjMo1+TgyhyujuMzGwCdHhNc dYlWgrnc+lCHhrdfM2cwYXY= =hum9 -----END PGP SIGNATURE-----
? patch-commdlg ? patch-commdlg2 ? tools/missing Index: dlls/commdlg/Makefile.in =================================================================== RCS file: /home/wine/wine/dlls/commdlg/Makefile.in,v retrieving revision 1.24 diff -u -3 -p -u -r1.24 Makefile.in --- dlls/commdlg/Makefile.in 18 Oct 2002 23:46:29 -0000 1.24 +++ dlls/commdlg/Makefile.in 18 Nov 2002 00:43:15 -0000 @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_STRICT +EXTRADEFS = TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ Index: dlls/commdlg/cdlg.h =================================================================== RCS file: /home/wine/wine/dlls/commdlg/cdlg.h,v retrieving revision 1.23 diff -u -3 -p -u -r1.23 cdlg.h --- dlls/commdlg/cdlg.h 17 Oct 2002 16:43:44 -0000 1.23 +++ dlls/commdlg/cdlg.h 18 Nov 2002 00:43:15 -0000 @@ -39,7 +39,8 @@ extern HINSTANCE COMDLG32_hInstance; void COMDLG32_SetCommDlgExtendedError(DWORD err); LPVOID COMDLG32_AllocMem(int size); - +/* handle<-handle16 conversion */ +#define HINST_32(h16) ((HINSTANCE)(ULONG_PTR)(h16)) /* Find/Replace local definitions */ Index: dlls/commdlg/cdlg32.c =================================================================== RCS file: /home/wine/wine/dlls/commdlg/cdlg32.c,v retrieving revision 1.25 diff -u -3 -p -u -r1.25 cdlg32.c --- dlls/commdlg/cdlg32.c 4 Nov 2002 23:53:46 -0000 1.25 +++ dlls/commdlg/cdlg32.c 18 Nov 2002 00:43:15 -0000 @@ -70,7 +70,7 @@ static char * GPA_string = "Failed to ge BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved) { - TRACE("(%08x, %08lx, %p)\n", hInstance, Reason, Reserved); + TRACE("(%p, %08lx, %p)\n", hInstance, Reason, Reserved); switch(Reason) { Index: dlls/commdlg/colordlg.c =================================================================== RCS file: /home/wine/wine/dlls/commdlg/colordlg.c,v retrieving revision 1.37 diff -u -3 -p -u -r1.37 colordlg.c --- dlls/commdlg/colordlg.c 1 Nov 2002 01:50:06 -0000 1.37 +++ dlls/commdlg/colordlg.c 18 Nov 2002 00:43:16 -0000 @@ -846,8 +846,8 @@ static LONG CC_WMInitDialog( HWND hDlg, } ch32->lStructSize = sizeof(CHOOSECOLORW); ch32->hwndOwner = HWND_32(ch16->hwndOwner); - /* Should be an HINSTANCE but MS made a typo */ - ch32->hInstance = HWND_32(ch16->hInstance); + /* Should be an HINSTANCE but MS made a typo */ /* changed for -DSTRICT */ + ch32->hInstance = HINST_32(ch16->hInstance); ch32->lpCustColors = MapSL(ch16->lpCustColors); ch32->lpfnHook = (LPCCHOOKPROC) ch16->lpfnHook; /* only used as flag */ ch32->Flags = ch16->Flags; Index: dlls/commdlg/filedlg.c =================================================================== RCS file: /home/wine/wine/dlls/commdlg/filedlg.c,v retrieving revision 1.57 diff -u -3 -p -u -r1.57 filedlg.c --- dlls/commdlg/filedlg.c 1 Nov 2002 01:50:06 -0000 1.57 +++ dlls/commdlg/filedlg.c 18 Nov 2002 00:43:17 -0000 @@ -1148,7 +1148,7 @@ void FILEDLG_MapOfnStruct16(LPOPENFILENA memset(&ofnA, 0, sizeof(OPENFILENAMEA)); ofnA.lStructSize = sizeof(OPENFILENAMEA); ofnA.hwndOwner = HWND_32(ofn16->hwndOwner); - ofnA.hInstance = ofn16->hInstance; + ofnA.hInstance = HINST_32(ofn16->hInstance); if (ofn16->lpstrFilter) ofnA.lpstrFilter = MapSL(ofn16->lpstrFilter); if (ofn16->lpstrCustomFilter) @@ -1299,7 +1299,7 @@ BOOL WINAPI GetFileName31A( lfs = FILEDLG_AllocPrivate((LPARAM) lpofn, LFS32A, dlgType); if (lfs) { - hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE ); + hInst = (HINSTANCE)GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE ); bRet = DialogBoxIndirectParamA( hInst, lfs->template, lpofn->hwndOwner, FileOpenDlgProc, (LPARAM)lfs); FILEDLG_DestroyPrivate(lfs); @@ -1329,7 +1329,7 @@ BOOL WINAPI GetFileName31W( lfs = FILEDLG_AllocPrivate((LPARAM) lpofn, LFS32W, dlgType); if (lfs) { - hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE ); + hInst = (HINSTANCE)GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE ); bRet = DialogBoxIndirectParamW( hInst, lfs->template, lpofn->hwndOwner, FileOpenDlgProc, (LPARAM)lfs); FILEDLG_DestroyPrivate(lfs); @@ -1508,7 +1508,7 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn /* [in/out] address of structure with data*/ ) { - HINSTANCE hInst; + HINSTANCE16 hInst; BOOL bRet = FALSE; LPOPENFILENAME16 lpofn = MapSL(ofn); LFSPRIVATE lfs; @@ -1519,7 +1519,7 @@ BOOL16 WINAPI GetOpenFileName16( lfs = FILEDLG_AllocPrivate((LPARAM) ofn, LFS16, OPEN_DIALOG); if (lfs) { - hInst = GetWindowLongA( HWND_32(lpofn->hwndOwner), GWL_HINSTANCE ); + hInst = (HINSTANCE16)GetWindowLongA( HWND_32(lpofn->hwndOwner), GWL_HINSTANCE ); ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 6); bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner, (DLGPROC16) ptr, (LPARAM) lfs); @@ -1546,7 +1546,7 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn /* [in/out] addess of structure with data*/ ) { - HINSTANCE hInst; + HINSTANCE16 hInst; BOOL bRet = FALSE; LPOPENFILENAME16 lpofn = MapSL(ofn); LFSPRIVATE lfs; @@ -1557,7 +1557,7 @@ BOOL16 WINAPI GetSaveFileName16( lfs = FILEDLG_AllocPrivate((LPARAM) ofn, LFS16, SAVE_DIALOG); if (lfs) { - hInst = GetWindowLongA( HWND_32(lpofn->hwndOwner), GWL_HINSTANCE ); + hInst = (HINSTANCE16)GetWindowLongA( HWND_32(lpofn->hwndOwner), GWL_HINSTANCE ); ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 7); bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner, (DLGPROC16) ptr, (LPARAM) lfs); Index: dlls/commdlg/filedlg95.c =================================================================== RCS file: /home/wine/wine/dlls/commdlg/filedlg95.c,v retrieving revision 1.83 diff -u -3 -p -u -r1.83 filedlg95.c --- dlls/commdlg/filedlg95.c 13 Nov 2002 21:21:41 -0000 1.83 +++ dlls/commdlg/filedlg95.c 18 Nov 2002 00:43:17 -0000 @@ -769,7 +769,7 @@ HRESULT SendCustomDlgNotificationMessage { FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwndParentDlg,FileOpenDlgInfosStr); - TRACE("0x%04x 0x%04x\n",hwndParentDlg, uCode); + TRACE("0x%p 0x%04x\n",hwndParentDlg, uCode); if(!fodInfos) return 0; @@ -1587,7 +1587,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) int nOpenAction; FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); - TRACE("hwnd=0x%04x\n", hwnd); + TRACE("hwnd=0x%p\n", hwnd); /* get the files from the edit control */ nFileCount = FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed); @@ -1974,7 +1974,7 @@ static BOOL FILEDLG95_SHELL_ExecuteComma FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); IContextMenu * pcm; - TRACE("(0x%08x,%p)\n", hwnd, lpVerb); + TRACE("(0x%p,%p)\n", hwnd, lpVerb); if(SUCCEEDED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, SVGIO_BACKGROUND, Index: dlls/commdlg/finddlg32.c =================================================================== RCS file: /home/wine/wine/dlls/commdlg/finddlg32.c,v retrieving revision 1.19 diff -u -3 -p -u -r1.19 finddlg32.c --- dlls/commdlg/finddlg32.c 31 Oct 2002 01:04:40 -0000 1.19 +++ dlls/commdlg/finddlg32.c 18 Nov 2002 00:43:17 -0000 @@ -373,7 +373,7 @@ static HWND COMDLG32_FR_DoFindReplace( DWORD error; LPDLGTEMPLATEW rcs; - TRACE("hInst=%08x, Flags=%08lx\n", pdata->fr.hInstance, pdata->fr.Flags); + TRACE("hInst=%p, Flags=%08lx\n", pdata->fr.hInstance, pdata->fr.Flags); if(!(pdata->fr.Flags & FR_ENABLETEMPLATEHANDLE)) { Index: dlls/commdlg/fontdlg.c =================================================================== RCS file: /home/wine/wine/dlls/commdlg/fontdlg.c,v retrieving revision 1.45 diff -u -3 -p -u -r1.45 fontdlg.c --- dlls/commdlg/fontdlg.c 13 Nov 2002 04:08:57 -0000 1.45 +++ dlls/commdlg/fontdlg.c 18 Nov 2002 00:43:18 -0000 @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg); #include "cdlg.h" -static HBITMAP16 hBitmapTT = 0; +static HBITMAP hBitmapTT = 0; INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, @@ -71,14 +71,14 @@ static void CFn_CHOOSEFONT16to32A(LPCHOO { chf32a->lStructSize=sizeof(CHOOSEFONTA); chf32a->hwndOwner=HWND_32(chf16->hwndOwner); - chf32a->hDC=chf16->hDC; + chf32a->hDC=HDC_32(chf16->hDC); chf32a->iPointSize=chf16->iPointSize; chf32a->Flags=chf16->Flags; chf32a->rgbColors=chf16->rgbColors; chf32a->lCustData=chf16->lCustData; chf32a->lpfnHook=NULL; chf32a->lpTemplateName=MapSL(chf16->lpTemplateName); - chf32a->hInstance=chf16->hInstance; + chf32a->hInstance=HINST_32(chf16->hInstance); chf32a->lpszStyle=MapSL(chf16->lpszStyle); chf32a->nFontType=chf16->nFontType; chf32a->nSizeMax=chf16->nSizeMax; Index: dlls/commdlg/printdlg.c =================================================================== RCS file: /home/wine/wine/dlls/commdlg/printdlg.c,v retrieving revision 1.58 diff -u -3 -p -u -r1.58 printdlg.c --- dlls/commdlg/printdlg.c 1 Nov 2002 01:50:06 -0000 1.58 +++ dlls/commdlg/printdlg.c 18 Nov 2002 00:43:19 -0000 @@ -2014,7 +2014,7 @@ INT_PTR CALLBACK PrintDlgProcA(HWND hDlg return FALSE; } else { PrintStructures = (PRINT_PTRA*) lParam; - SetPropA(hDlg,"__WINE_PRINTDLGDATA",lParam); + SetPropA(hDlg,"__WINE_PRINTDLGDATA",(HANDLE)lParam); res = PRINTDLG_WMInitDialog(hDlg, wParam, PrintStructures); if(PrintStructures->dlg.lpPrintDlg->Flags & PD_ENABLEPRINTHOOK) @@ -2352,8 +2352,8 @@ BOOL WINAPI PrintDlgA( if(lppd->Flags & pflag->flag) strcat(flagstr, pflag->name); } - TRACE("(%p): hwndOwner = %08x, hDevMode = %08x, hDevNames = %08x\n" - "pp. %d-%d, min p %d, max p %d, copies %d, hinst %08x\n" + TRACE("(%p): hwndOwner = %p, hDevMode = %p, hDevNames = %p\n" + "pp. %d-%d, min p %d, max p %d, copies %d, hinst %p\n" "flags %08lx (%s)\n", lppd, lppd->hwndOwner, lppd->hDevMode, lppd->hDevNames, lppd->nFromPage, lppd->nToPage, lppd->nMinPage, lppd->nMaxPage, @@ -2508,8 +2508,8 @@ BOOL WINAPI PrintDlgW( if(lppd->Flags & pflag->flag) strcat(flagstr, pflag->name); } - TRACE("(%p): hwndOwner = %08x, hDevMode = %08x, hDevNames = %08x\n" - "pp. %d-%d, min p %d, max p %d, copies %d, hinst %08x\n" + TRACE("(%p): hwndOwner = %p, hDevMode = %p, hDevNames = %p\n" + "pp. %d-%d, min p %d, max p %d, copies %d, hinst %p\n" "flags %08lx (%s)\n", lppd, lppd->hwndOwner, lppd->hDevMode, lppd->hDevNames, lppd->nFromPage, lppd->nToPage, lppd->nMinPage, lppd->nMaxPage, @@ -2666,7 +2666,7 @@ BOOL16 WINAPI PrintDlg16( ) { BOOL bRet = FALSE; LPVOID ptr; - HINSTANCE hInst = (HINSTANCE)GetWindowLongA( HWND_32(lppd->hwndOwner), GWL_HINSTANCE ); + HINSTANCE16 hInst = (HINSTANCE16)GetWindowLongA( HWND_32(lppd->hwndOwner), GWL_HINSTANCE ); if(TRACE_ON(commdlg)) { char flagstr[1000] = ""; @@ -2732,7 +2732,7 @@ BOOL16 WINAPI PrintDlg16( HeapFree(GetProcessHeap(), 0, dbuf); bRet = TRUE; } else { - HGLOBAL hDlgTmpl; + HGLOBAL16 hDlgTmpl; PRINT_PTRA *PrintStructures; /* load Dialog resources, @@ -2751,9 +2751,11 @@ BOOL16 WINAPI PrintDlg16( #define MVAL(x) PrintStructures->dlg.lpPrintDlg->x = MapSL(lppd->x); CVAL(Flags); PrintStructures->dlg.lpPrintDlg->hwndOwner = HWND_32(lppd->hwndOwner); - CVAL(hDC); + PrintStructures->dlg.lpPrintDlg->hDC = HDC_32(lppd->hDC); CVAL(nFromPage);CVAL(nToPage);CVAL(nMinPage);CVAL(nMaxPage); - CVAL(nCopies);CVAL(hInstance);CVAL(lCustData); + CVAL(nCopies); + PrintStructures->dlg.lpPrintDlg->hInstance = HINST_32(lppd->hInstance); + CVAL(lCustData); MVAL(lpPrintTemplateName);MVAL(lpSetupTemplateName); /* Don't copy rest, it is 16 bit specific */ #undef MVAL @@ -3172,7 +3174,7 @@ PageDlgProcA(HWND hDlg, UINT uMsg, WPARA if (uMsg==WM_INITDIALOG) { res = TRUE; pda = (PageSetupDataA*)lParam; - SetPropA(hDlg,"__WINE_PAGESETUPDLGDATA",lParam); + SetPropA(hDlg,"__WINE_PAGESETUPDLGDATA",(HANDLE)lParam); if (pda->dlga->Flags & PSD_ENABLEPAGESETUPHOOK) { res = pda->dlga->lpfnPageSetupHook(hDlg,uMsg,wParam,lParam); if (!res) { @@ -3254,7 +3256,7 @@ PageDlgProcW(HWND hDlg, UINT uMsg, WPARA if (uMsg==WM_INITDIALOG) { res = TRUE; pda = (PageSetupDataW*)lParam; - SetPropA(hDlg,"__WINE_PAGESETUPDLGDATA",lParam); + SetPropA(hDlg,"__WINE_PAGESETUPDLGDATA",(HANDLE)lParam); if (pda->dlga->Flags & PSD_ENABLEPAGESETUPHOOK) { res = pda->dlga->lpfnPageSetupHook(hDlg,uMsg,wParam,lParam); if (!res) { @@ -3346,8 +3348,8 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLG strcat(flagstr, "|"); } } - TRACE("(%p): hwndOwner = %08x, hDevMode = %08x, hDevNames = %08x\n" - "hinst %08x, flags %08lx (%s)\n", + TRACE("(%p): hwndOwner = %p, hDevMode = %p, hDevNames = %p\n" + "hinst %p, flags %08lx (%s)\n", setupdlg, setupdlg->hwndOwner, setupdlg->hDevMode, setupdlg->hDevNames, setupdlg->hInstance, setupdlg->Flags, flagstr); @@ -3412,8 +3414,8 @@ BOOL WINAPI PageSetupDlgW(LPPAGESETUPDLG strcat(flagstr, "|"); } } - TRACE("(%p): hwndOwner = %08x, hDevMode = %08x, hDevNames = %08x\n" - "hinst %08x, flags %08lx (%s)\n", + TRACE("(%p): hwndOwner = %p, hDevMode = %p, hDevNames = %p\n" + "hinst %p, flags %08lx (%s)\n", setupdlg, setupdlg->hwndOwner, setupdlg->hDevMode, setupdlg->hDevNames, setupdlg->hInstance, setupdlg->Flags, flagstr); @@ -3482,7 +3484,7 @@ BOOL16 CALLBACK PrintDlgProc16(HWND16 hD return FALSE; } else { PrintStructures = (PRINT_PTRA*) lParam; - SetPropA(hDlg,"__WINE_PRINTDLGDATA",lParam); + SetPropA(hDlg,"__WINE_PRINTDLGDATA",(HANDLE)lParam); res = PRINTDLG_WMInitDialog16(hDlg, wParam, PrintStructures); if(PrintStructures->dlg.lpPrintDlg16->Flags & PD_ENABLEPRINTHOOK) { Index: include/commdlg.h =================================================================== RCS file: /home/wine/wine/include/commdlg.h,v retrieving revision 1.38 diff -u -3 -p -u -r1.38 commdlg.h --- include/commdlg.h 30 Sep 2002 18:51:33 -0000 1.38 +++ include/commdlg.h 18 Nov 2002 00:43:19 -0000 @@ -143,7 +143,7 @@ typedef UINT (CALLBACK *LPCCHOOKPROC) (H typedef struct { DWORD lStructSize; HWND hwndOwner; - HWND hInstance; /* Should be an HINSTANCE but MS made a typo */ + HINSTANCE hInstance; /* Should be an HINSTANCE but MS made a typo */ /* changed for -DSTRICT */ DWORD rgbResult; LPDWORD lpCustColors; DWORD Flags; @@ -156,7 +156,7 @@ typedef CHOOSECOLORA *LPCHOOSECOLORA; typedef struct { DWORD lStructSize; HWND hwndOwner; - HWND hInstance; /* Should be an HINSTANCE but MS made a typo */ + HINSTANCE hInstance; /* Should be an HINSTANCE but MS made a typo */ /* changed for -DSTRICT */ DWORD rgbResult; LPDWORD lpCustColors; DWORD Flags;