diff --git a/reactos/dll/win32/comdlg32/colordlg.c b/reactos/dll/win32/comdlg32/colordlg.c index ff9067da9f1..88e8f9206a0 100644 --- a/reactos/dll/win32/comdlg32/colordlg.c +++ b/reactos/dll/win32/comdlg32/colordlg.c @@ -244,9 +244,9 @@ static void CC_DrawFocusRect(CCPRIV *lpp, HWND hwnd, int x, int y, int rows, int /*********************************************************************** * CC_MouseCheckPredefColorArray [internal] - * returns 1 if one of the predefined colors is clicked + * returns TRUE if one of the predefined colors is clicked */ -static int CC_MouseCheckPredefColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam) +static BOOL CC_MouseCheckPredefColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam) { HWND hwnd; POINT point; @@ -269,17 +269,17 @@ static int CC_MouseCheckPredefColorArray(CCPRIV *lpp, int rows, int cols, LPARAM y = point.y / dy; lpp->lpcc->rgbResult = predefcolors[y][x]; CC_DrawFocusRect(lpp, hwnd, x, y, rows, cols); - return 1; + return TRUE; } } - return 0; + return FALSE; } /*********************************************************************** * CC_MouseCheckUserColorArray [internal] - * return 1 if the user clicked a color + * return TRUE if the user clicked a color */ -static int CC_MouseCheckUserColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam) +static BOOL CC_MouseCheckUserColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam) { HWND hwnd; POINT point; @@ -303,10 +303,10 @@ static int CC_MouseCheckUserColorArray(CCPRIV *lpp, int rows, int cols, LPARAM l y = point.y / dy; lpp->lpcc->rgbResult = crarr[x + (cols * y) ]; CC_DrawFocusRect(lpp, hwnd, x, y, rows, cols); - return 1; + return TRUE; } } - return 0; + return FALSE; } #define MAXVERT 240 @@ -322,7 +322,7 @@ static int CC_MouseCheckUserColorArray(CCPRIV *lpp, int rows, int cols, LPARAM l /*********************************************************************** * CC_MouseCheckColorGraph [internal] */ -static int CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert, LPARAM lParam ) +static BOOL CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert, LPARAM lParam ) { HWND hwnd; POINT point; @@ -335,7 +335,7 @@ static int CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert GetWindowRect(hwnd, &rect); if (!PtInRect(&rect, point)) - return 0; + return FALSE; GetClientRect(hwnd, &rect); ScreenToClient(hwnd, &point); @@ -355,13 +355,13 @@ static int CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert if (vert) *vert = y; - return 1; + return TRUE; } /*********************************************************************** * CC_MouseCheckResultWindow [internal] * test if double click one of the result colors */ -static int CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam ) +static BOOL CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam ) { HWND hwnd; POINT point; @@ -374,9 +374,9 @@ static int CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam ) if (PtInRect(&rect, point)) { PostMessageA(hDlg, WM_COMMAND, IDC_COLOR_RES, 0); - return 1; + return TRUE; } - return 0; + return FALSE; } /*********************************************************************** diff --git a/reactos/dll/win32/comdlg32/comdlg32_classes.idl b/reactos/dll/win32/comdlg32/comdlg32_classes.idl index b45eeb55cd9..1cd2f3d90ff 100644 --- a/reactos/dll/win32/comdlg32/comdlg32_classes.idl +++ b/reactos/dll/win32/comdlg32/comdlg32_classes.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("File Open Dialog"), threading(apartment), diff --git a/reactos/dll/win32/comdlg32/comdlg32_ros.diff b/reactos/dll/win32/comdlg32/comdlg32_ros.diff index 7a310d01db6..dceaf5b2fdb 100644 --- a/reactos/dll/win32/comdlg32/comdlg32_ros.diff +++ b/reactos/dll/win32/comdlg32/comdlg32_ros.diff @@ -1,71 +1,66 @@ -Index: filedlg.c -=================================================================== ---- filedlg.c (Revision 56893) -+++ filedlg.c (Arbeitskopie) -@@ -260,6 +260,8 @@ - HRSRC hRes; - HANDLE hDlgTmpl = 0; - HRESULT hr; -+ DWORD dwSize; -+ LPDLGTEMPLATE hDialogTemplate; - - /* test for missing functionality */ - if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS) -@@ -276,12 +278,17 @@ - return FALSE; - } - if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hRes )) || -+ !(dwSize = SizeofResource(COMDLG32_hInstance, hRes )) || -+ !(hDialogTemplate = malloc(dwSize)) || - !(template = LockResource( hDlgTmpl ))) - { - COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); - return FALSE; - } - -+ /* Copy the read only resource */ -+ memcpy(hDialogTemplate, template, dwSize); -+ - /* msdn: explorer style dialogs permit sizing by default. - * The OFN_ENABLESIZING flag is only needed when a hook or - * custom tmeplate is provided */ -@@ -291,12 +298,12 @@ - - if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING) - { -- ((LPDLGTEMPLATEW)template)->style |= WS_SIZEBOX; -+ hDialogTemplate->style |= WS_SIZEBOX; - fodInfos->sizedlg.cx = fodInfos->sizedlg.cy = 0; - fodInfos->initial_size.x = fodInfos->initial_size.y = 0; - } - else -- ((LPDLGTEMPLATEW)template)->style &= ~WS_SIZEBOX; -+ hDialogTemplate->style &= ~WS_SIZEBOX; - - - /* old style hook messages */ -@@ -313,19 +320,21 @@ - - if (fodInfos->unicode) - lRes = DialogBoxIndirectParamW(COMDLG32_hInstance, -- template, -+ hDialogTemplate, - fodInfos->ofnInfos->hwndOwner, - FileOpenDlgProc95, - (LPARAM) fodInfos); - else - lRes = DialogBoxIndirectParamA(COMDLG32_hInstance, -- template, -+ hDialogTemplate, - fodInfos->ofnInfos->hwndOwner, - FileOpenDlgProc95, - (LPARAM) fodInfos); -- if (SUCCEEDED(hr)) -+ if (SUCCEEDED(hr)) - OleUninitialize(); - -+ free(hDialogTemplate); -+ - /* Unable to create the dialog */ - if( lRes == -1) - return FALSE; +diff -prudN e:\Wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32.c +--- e:\Wine\dlls\comdlg32/cdlg32.c 2013-10-26 22:24:27.508648000 +0100 ++++ e:\reactos\dll\win32\comdlg32/cdlg32.c 2014-03-05 11:46:06.260510700 +0100 +@@ -174,6 +157,8 @@ DWORD WINAPI CommDlgExtendedError(void) + return 0; /* we never set an error, so there isn't one */ + } + ++#ifndef __REACTOS__ /* Win 7 */ ++ + /************************************************************************* + * Implement the CommDlg32 class factory + * +@@ -283,7 +268,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSI + */ + HRESULT WINAPI DllRegisterServer(void) + { +- return __wine_register_resources(COMDLG32_hInstance); ++ return E_FAIL; // FIXME: __wine_register_resources(COMDLG32_hInstance); + } + + /*********************************************************************** +@@ -291,5 +276,7 @@ HRESULT WINAPI DllRegisterServer(void) + */ + HRESULT WINAPI DllUnregisterServer(void) + { +- return __wine_unregister_resources(COMDLG32_hInstance); ++ return E_FAIL; // FIXME: __wine_unregister_resources(COMDLG32_hInstance); + } ++ ++#endif /* Win 7 */ + +diff -prudN e:\Wine\dlls\comdlg32/comdlg32.spec e:\reactos\dll\win32\comdlg32/comdlg32.spec +--- e:\Wine\dlls\comdlg32/comdlg32.spec 2011-09-16 23:22:36.026770600 +0100 ++++ e:\reactos\dll\win32\comdlg32/comdlg32.spec 2012-02-15 22:32:22.456422900 +0100 +@@ -3,9 +3,9 @@ + @ stdcall ChooseFontA(ptr) + @ stdcall ChooseFontW(ptr) + @ stdcall CommDlgExtendedError() +-@ stdcall -private DllGetClassObject(ptr ptr ptr) +-@ stdcall -private DllRegisterServer() +-@ stdcall -private DllUnregisterServer() ++;@ stdcall -private DllGetClassObject(ptr ptr ptr) ; Win 7 ++;@ stdcall -private DllRegisterServer() ; Win 7 ++;@ stdcall -private DllUnregisterServer() ; Win 7 + @ stdcall FindTextA(ptr) + @ stdcall FindTextW(ptr) + @ stdcall GetFileTitleA(str ptr long) + +diff -prudN e:\Wine\dlls\comdlg32/itemdlg.c e:\reactos\dll\win32\comdlg32/itemdlg.c +--- e:\Wine\dlls\comdlg32/itemdlg.c 2013-10-26 22:24:27.515652700 +0100 ++++ e:\reactos\dll\win32\comdlg32/itemdlg.c 2013-10-15 19:32:27.803008200 +0100 +@@ -18,6 +18,8 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + ++#ifndef __REACTOS__ /* Win 7 */ ++ + #include + + #define COBJMACROS +@@ -3660,3 +3662,5 @@ HRESULT FileSaveDialog_Constructor(IUnkn + { + return FileDialog_constructor(pUnkOuter, riid, ppv, ITEMDLG_TYPE_SAVE); + } ++ ++#endif /* Win 7 */ diff --git a/reactos/dll/win32/comdlg32/filedlg.c b/reactos/dll/win32/comdlg32/filedlg.c index 631b2a6980a..3fa42552684 100644 --- a/reactos/dll/win32/comdlg32/filedlg.c +++ b/reactos/dll/win32/comdlg32/filedlg.c @@ -431,7 +431,7 @@ static BOOL GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType) ret = GetFileName95(&fodInfos); break; default : - ret = 0; + ret = FALSE; } if (lpstrSavDir) @@ -523,7 +523,7 @@ static BOOL GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) ret = GetFileName95(&fodInfos); break; default : - ret = 0; + ret = FALSE; } if (lpstrSavDir) @@ -1401,9 +1401,9 @@ static inline BOOL filename_is_edit( const FileOpenDlgInfos *info ) */ static LRESULT FILEDLG95_InitControls(HWND hwnd) { - int win2000plus = 0; - int win98plus = 0; - int handledPath = FALSE; + BOOL win2000plus = FALSE; + BOOL win98plus = FALSE; + BOOL handledPath = FALSE; OSVERSIONINFOW osVi; static const WCHAR szwSlash[] = { '\\', 0 }; static const WCHAR szwStar[] = { '*',0 }; @@ -1554,12 +1554,11 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) } /* 2. (All platforms) If initdir is not null, then use it */ - if ((handledPath == FALSE) && (fodInfos->initdir!=NULL) && - (*fodInfos->initdir!=0x00)) + if (!handledPath && fodInfos->initdir && *fodInfos->initdir) { /* Work out the proper path as supplied one might be relative */ /* (Here because supplying '.' as dir browses to My Computer) */ - if (handledPath==FALSE) { + if (!handledPath) { WCHAR tmpBuf[MAX_PATH]; WCHAR tmpBuf2[MAX_PATH]; WCHAR *nameBit; @@ -1594,8 +1593,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) } } - if ((handledPath == FALSE) && ((fodInfos->initdir==NULL) || - (*fodInfos->initdir==0x00))) + if (!handledPath && (!fodInfos->initdir || !*fodInfos->initdir)) { /* 3. All except w2k+: if filename contains a path use it */ if (!win2000plus && fodInfos->filename && @@ -1627,7 +1625,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) } /* 4. Win2000+: Recently used */ - if (handledPath == FALSE && win2000plus) { + if (!handledPath && win2000plus) { fodInfos->initdir = MemAlloc(MAX_PATH * sizeof(WCHAR)); fodInfos->initdir[0] = '\0'; @@ -1643,8 +1641,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) /* 5. win98+ and win2000+ if any files of specified filter types in current directory, use it */ - if ( win98plus && handledPath == FALSE && - fodInfos->filter && *fodInfos->filter) { + if (win98plus && !handledPath && fodInfos->filter && *fodInfos->filter) { LPCWSTR lpstrPos = fodInfos->filter; WIN32_FIND_DATAW FindFileData; @@ -1683,7 +1680,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) } /* 6. Win98+ and 2000+: Use personal files dir, others use current dir */ - if (handledPath == FALSE && (win2000plus || win98plus)) { + if (!handledPath && (win2000plus || win98plus)) { fodInfos->initdir = MemAlloc(MAX_PATH*sizeof(WCHAR)); if(!COMDLG32_SHGetFolderPathW(hwnd, CSIDL_PERSONAL, 0, 0, fodInfos->initdir)) @@ -1700,7 +1697,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) TRACE("No initial dir specified, using personal files dir of %s\n", debugstr_w(fodInfos->initdir)); } handledPath = TRUE; - } else if (handledPath==FALSE) { + } else if (!handledPath) { fodInfos->initdir = MemAlloc(MAX_PATH*sizeof(WCHAR)); GetCurrentDirectoryW(MAX_PATH, fodInfos->initdir); handledPath = TRUE; diff --git a/reactos/dll/win32/comdlg32/filedlg31.c b/reactos/dll/win32/comdlg32/filedlg31.c index fca7c592d73..846982441bd 100644 --- a/reactos/dll/win32/comdlg32/filedlg31.c +++ b/reactos/dll/win32/comdlg32/filedlg31.c @@ -58,7 +58,7 @@ typedef struct tagFD31_DATA */ static BOOL FD31_Init(void) { - static BOOL initialized = 0; + static BOOL initialized = FALSE; if (!initialized) { hFolder = LoadImageA( COMDLG32_hInstance, "FOLDER", IMAGE_ICON, 16, 16, LR_SHARED ); @@ -70,7 +70,7 @@ static BOOL FD31_Init(void) if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 || hHDisk == 0 || hCDRom == 0 || hNet == 0) { - ERR("Error loading icons !\n"); + ERR("Error loading icons!\n"); return FALSE; } initialized = TRUE; diff --git a/reactos/dll/win32/comdlg32/fontdlg.c b/reactos/dll/win32/comdlg32/fontdlg.c index 7f12c231c10..2d0cd2e7dae 100644 --- a/reactos/dll/win32/comdlg32/fontdlg.c +++ b/reactos/dll/win32/comdlg32/fontdlg.c @@ -345,7 +345,7 @@ static INT WINAPI FontFamilyEnumProc(const ENUMLOGFONTEXW *lpElfex, * * Fill font style information into combobox (without using font.c directly) */ -static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf) +static BOOL SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf) { #define FSTYLES 4 struct FONTSTYLE @@ -384,19 +384,19 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf) WCHAR name[64]; LoadStringW(COMDLG32_hInstance, fontstyles[i].resId, name, 64); j=SendMessageW(hwnd,CB_ADDSTRING,0,(LPARAM)name ); - if (j==CB_ERR) return 1; + if (j==CB_ERR) return TRUE; j=SendMessageW(hwnd, CB_SETITEMDATA, j, MAKELONG(tm.tmWeight,fontstyles[i].italic)); - if (j==CB_ERR) return 1; + if (j==CB_ERR) return TRUE; } } - return 0; + return FALSE; } /************************************************************************* * AddFontSizeToCombo3 [internal] */ -static int AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf) +static BOOL AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf) { int j; WCHAR buffer[20]; @@ -411,23 +411,23 @@ static int AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf) { j=SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer); if (j!=CB_ERR) j = SendMessageW(hwnd, CB_SETITEMDATA, j, h); - if (j==CB_ERR) return 1; + if (j==CB_ERR) return TRUE; } } - return 0; + return FALSE; } /************************************************************************* * SetFontSizesToCombo3 [internal] */ -static int SetFontSizesToCombo3(HWND hwnd, const CHOOSEFONTW *lpcf) +static BOOL SetFontSizesToCombo3(HWND hwnd, const CHOOSEFONTW *lpcf) { static const BYTE sizes[]={6,7,8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72}; unsigned int i; for (i = 0; i < sizeof(sizes)/sizeof(sizes[0]); i++) - if (AddFontSizeToCombo3(hwnd, sizes[i], lpcf)) return 1; - return 0; + if (AddFontSizeToCombo3(hwnd, sizes[i], lpcf)) return TRUE; + return FALSE; } /************************************************************************* @@ -490,16 +490,17 @@ static INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW * INT points; points = MulDiv( lpNTM->ntmTm.tmHeight - lpNTM->ntmTm.tmInternalLeading, 72, GetScreenDPI()); - i = AddFontSizeToCombo3(hcmb3, points, lpcf); - if(i) return 0; + if (AddFontSizeToCombo3(hcmb3, points, lpcf)) + return 0; } else if (SetFontSizesToCombo3(hcmb3, lpcf)) return 0; if (!SendMessageW(hcmb2, CB_GETCOUNT, 0, 0)) { + BOOL res; if(!(hdc = CFn_GetDC(lpcf))) return 0; - i=SetFontStylesToCombo2(hcmb2,hdc,lplf); + res = SetFontStylesToCombo2(hcmb2,hdc,lplf); CFn_ReleaseDC(lpcf, hdc); - if (i) + if (res) return 0; } if (!( hcmb5 = GetDlgItem(hDlg, cmb5))) return 1; @@ -514,10 +515,10 @@ static INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW * return 1 ; } -static INT CFn_FitFontSize( HWND hDlg, int points) +static BOOL CFn_FitFontSize( HWND hDlg, int points) { int i,n; - int ret = 0; + BOOL ret = FALSE; /* look for fitting font size in combobox3 */ n=SendDlgItemMessageW(hDlg, cmb3, CB_GETCOUNT, 0, 0); for (i=0;ilStructSize != sizeof(CHOOSEFONTW)) { - ERR("structure size failure !!!\n"); + ERR("structure size failure!!!\n"); EndDialog (hDlg, 0); return FALSE; } @@ -711,7 +714,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf) SendDlgItemMessageW(hDlg, cmb1, CB_SETCURSEL, j, 0); SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE), (LPARAM)GetDlgItem(hDlg,cmb1)); - init=1; + init = TRUE; /* look for fitting font style in combobox2 */ CFn_FitFontStyle(hDlg, pstyle); /* look for fitting font size in combobox3 */ diff --git a/reactos/dll/win32/comdlg32/printdlg.c b/reactos/dll/win32/comdlg32/printdlg.c index 237bb965fe0..a114d6d13c4 100644 --- a/reactos/dll/win32/comdlg32/printdlg.c +++ b/reactos/dll/win32/comdlg32/printdlg.c @@ -1473,7 +1473,7 @@ static LRESULT PRINTDLG_WMInitDialog(HWND hDlg, PrintStructures->hNoCollateIcon == 0 || PrintStructures->hPortraitIcon == 0 || PrintStructures->hLandscapeIcon == 0) { - ERR("no icon in resourcefile\n"); + ERR("no icon in resource file\n"); COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); EndDialog(hDlg, FALSE); } @@ -1581,7 +1581,7 @@ static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg, PrintStructures->hNoCollateIcon == 0 || PrintStructures->hPortraitIcon == 0 || PrintStructures->hLandscapeIcon == 0) { - ERR("no icon in resourcefile\n"); + ERR("no icon in resource file\n"); COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); EndDialog(hDlg, FALSE); } @@ -2241,7 +2241,7 @@ BOOL WINAPI PrintDlgA(LPPRINTDLGA lppd) } if(lppd->lStructSize != sizeof(PRINTDLGA)) { - WARN("structure size failure !!!\n"); + WARN("structure size failure!!!\n"); COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE); return FALSE; } @@ -2392,7 +2392,7 @@ BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd) } if(lppd->lStructSize != sizeof(PRINTDLGW)) { - WARN("structure size failure !!!\n"); + WARN("structure size failure!!!\n"); COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE); return FALSE; } diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 985a5b5c270..271a312e58d 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -61,7 +61,7 @@ reactos/dll/win32/cabinet # Synced to Wine-1.7.17 reactos/dll/win32/clusapi # Synced to Wine-1.7.1 reactos/dll/win32/comcat # Synced to Wine-1.7.1 reactos/dll/win32/comctl32 # Synced to Wine 1.7.17 -reactos/dll/win32/comdlg32 # Synced to Wine 1.7.1 +reactos/dll/win32/comdlg32 # Synced to Wine 1.7.17 reactos/dll/win32/compstui # Synced to Wine-1.7.1 reactos/dll/win32/credui # Synced to Wine-1.7.1 reactos/dll/win32/crypt32 # Synced to Wine-1.7.1