mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Sync to Wine-20050419:
Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. - SBSP_ABSOLUTE is 0 so we cannot do (wFlags & SBSP_ABSOLUTE). - Add COMDLG32_DumpSBSPFlags(). Eric Pouech <pouech-eric@wanadoo.fr> - Added proper definition for PRINTDLGEX[AW] structures. Jakob Eriksson <jakov@vmlinux.org> - Get rid of HeapAlloc casts. Juan Lang <juan_lang@yahoo.com> - Change a fixme to a warn, and use W version of call. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. - Janitorial: Get rid of strncpy/strncpyW. svn path=/trunk/; revision=14821
This commit is contained in:
parent
c292d7ed88
commit
6119adfe22
7 changed files with 74 additions and 24 deletions
|
@ -65,7 +65,7 @@ static const COLORREF predefcolors[6][8]=
|
||||||
/* Chose Color PRIVATE Structure:
|
/* Chose Color PRIVATE Structure:
|
||||||
*
|
*
|
||||||
* This structure is duplicated in the 16 bit code with
|
* This structure is duplicated in the 16 bit code with
|
||||||
* a extra member
|
* an extra member
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct CCPRIVATE
|
typedef struct CCPRIVATE
|
||||||
|
|
|
@ -46,7 +46,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
|
||||||
/* Chose Color PRIVATE Structure:
|
/* Chose Color PRIVATE Structure:
|
||||||
*
|
*
|
||||||
* This is a duplicate of the 32bit code with
|
* This is a duplicate of the 32bit code with
|
||||||
* a extra member
|
* an extra member
|
||||||
*/
|
*/
|
||||||
typedef struct CCPRIVATE
|
typedef struct CCPRIVATE
|
||||||
{
|
{
|
||||||
|
|
|
@ -462,16 +462,17 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
|
||||||
if(ofn->lpstrFile)
|
if(ofn->lpstrFile)
|
||||||
{
|
{
|
||||||
fodInfos.filename = MemAlloc(ofn->nMaxFile*sizeof(WCHAR));
|
fodInfos.filename = MemAlloc(ofn->nMaxFile*sizeof(WCHAR));
|
||||||
strncpyW(fodInfos.filename,ofn->lpstrFile,ofn->nMaxFile);
|
lstrcpynW(fodInfos.filename,ofn->lpstrFile,ofn->nMaxFile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fodInfos.filename = NULL;
|
fodInfos.filename = NULL;
|
||||||
|
|
||||||
if(ofn->lpstrInitialDir)
|
if(ofn->lpstrInitialDir)
|
||||||
{
|
{
|
||||||
DWORD len = strlenW(ofn->lpstrInitialDir);
|
/* fodInfos.initdir = strdupW(ofn->lpstrInitialDir); */
|
||||||
fodInfos.initdir = MemAlloc((len+1)*sizeof(WCHAR));
|
DWORD len = strlenW(ofn->lpstrInitialDir)+1;
|
||||||
strcpyW(fodInfos.initdir,ofn->lpstrInitialDir);
|
fodInfos.initdir = MemAlloc(len*sizeof(WCHAR));
|
||||||
|
memcpy(fodInfos.initdir,ofn->lpstrInitialDir,len*sizeof(WCHAR));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fodInfos.initdir = NULL;
|
fodInfos.initdir = NULL;
|
||||||
|
@ -853,7 +854,7 @@ HRESULT FILEDLG95_Handle_GetFilePath(HWND hwnd, DWORD size, LPVOID buffer)
|
||||||
|
|
||||||
/* Prepend the current path */
|
/* Prepend the current path */
|
||||||
n = strlenW(lpstrCurrentDir) + 1;
|
n = strlenW(lpstrCurrentDir) + 1;
|
||||||
strncpyW( bufW, lpstrCurrentDir, size );
|
memcpy( bufW, lpstrCurrentDir, min(n,size) * sizeof(WCHAR));
|
||||||
if(n<size)
|
if(n<size)
|
||||||
{
|
{
|
||||||
/* 'n' includes trailing \0 */
|
/* 'n' includes trailing \0 */
|
||||||
|
@ -2034,7 +2035,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
{
|
{
|
||||||
LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
|
LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
|
||||||
|
|
||||||
strncpyW(ofn->lpstrFile, lpstrPathAndFile, ofn->nMaxFile);
|
lstrcpynW(ofn->lpstrFile, lpstrPathAndFile, ofn->nMaxFile);
|
||||||
if (ofn->Flags & OFN_ALLOWMULTISELECT)
|
if (ofn->Flags & OFN_ALLOWMULTISELECT)
|
||||||
ofn->lpstrFile[lstrlenW(ofn->lpstrFile) + 1] = '\0';
|
ofn->lpstrFile[lstrlenW(ofn->lpstrFile) + 1] = '\0';
|
||||||
}
|
}
|
||||||
|
@ -2064,7 +2065,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
if(fodInfos->unicode)
|
if(fodInfos->unicode)
|
||||||
{
|
{
|
||||||
LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
|
LPOPENFILENAMEW ofn = fodInfos->ofnInfos;
|
||||||
strncpyW(ofn->lpstrFileTitle, lpstrFileTitle, ofn->nMaxFileTitle);
|
lstrcpynW(ofn->lpstrFileTitle, lpstrFileTitle, ofn->nMaxFileTitle);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2406,7 +2407,7 @@ static BOOL FILEDLG95_FILETYPE_OnCommand(HWND hwnd, WORD wNotifyCode)
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* FILEDLG95_FILETYPE_SearchExt
|
* FILEDLG95_FILETYPE_SearchExt
|
||||||
*
|
*
|
||||||
* searches for a extension in the filetype box
|
* searches for an extension in the filetype box
|
||||||
*/
|
*/
|
||||||
static int FILEDLG95_FILETYPE_SearchExt(HWND hwnd,LPCWSTR lpstrExt)
|
static int FILEDLG95_FILETYPE_SearchExt(HWND hwnd,LPCWSTR lpstrExt)
|
||||||
{
|
{
|
||||||
|
@ -2958,7 +2959,7 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
|
||||||
|
|
||||||
/* allocate the buffer */
|
/* allocate the buffer */
|
||||||
if (nFiles <= 1) nLength = MAX_PATH;
|
if (nFiles <= 1) nLength = MAX_PATH;
|
||||||
lpstrAllFile = (LPSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength);
|
lpstrAllFile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength);
|
||||||
lpstrAllFile[0] = '\0';
|
lpstrAllFile[0] = '\0';
|
||||||
|
|
||||||
/* Generate the string for the edit control */
|
/* Generate the string for the edit control */
|
||||||
|
|
|
@ -95,6 +95,49 @@ extern HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode);
|
||||||
* Helper functions
|
* Helper functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define add_flag(a) if (flags & a) {strcat(str, #a );strcat(str," ");}
|
||||||
|
static void COMDLG32_DumpSBSPFlags(UINT uflags)
|
||||||
|
{
|
||||||
|
if (TRACE_ON(commdlg))
|
||||||
|
{
|
||||||
|
unsigned int i;
|
||||||
|
static const struct {
|
||||||
|
DWORD mask;
|
||||||
|
const char *name;
|
||||||
|
} flags[] = {
|
||||||
|
#define FE(x) { x, #x}
|
||||||
|
/* SBSP_DEFBROWSER == 0 */
|
||||||
|
FE(SBSP_SAMEBROWSER),
|
||||||
|
FE(SBSP_NEWBROWSER),
|
||||||
|
|
||||||
|
/* SBSP_DEFMODE == 0 */
|
||||||
|
FE(SBSP_OPENMODE),
|
||||||
|
FE(SBSP_EXPLOREMODE),
|
||||||
|
FE(SBSP_HELPMODE),
|
||||||
|
FE(SBSP_NOTRANSFERHIST),
|
||||||
|
|
||||||
|
/* SBSP_ABSOLUTE == 0 */
|
||||||
|
FE(SBSP_RELATIVE),
|
||||||
|
FE(SBSP_PARENT),
|
||||||
|
FE(SBSP_NAVIGATEBACK),
|
||||||
|
FE(SBSP_NAVIGATEFORWARD),
|
||||||
|
FE(SBSP_ALLOW_AUTONAVIGATE),
|
||||||
|
|
||||||
|
FE(SBSP_NOAUTOSELECT),
|
||||||
|
FE(SBSP_WRITENOHISTORY),
|
||||||
|
|
||||||
|
FE(SBSP_REDIRECT),
|
||||||
|
FE(SBSP_INITIATEDBYHLINKFRAME),
|
||||||
|
};
|
||||||
|
#undef FE
|
||||||
|
DPRINTF("SBSP Flags: %08x =", uflags);
|
||||||
|
for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++)
|
||||||
|
if (flags[i].mask & uflags)
|
||||||
|
DPRINTF("%s ", flags[i].name);
|
||||||
|
DPRINTF("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos)
|
static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos)
|
||||||
{
|
{
|
||||||
char lpstrPath[MAX_PATH];
|
char lpstrPath[MAX_PATH];
|
||||||
|
@ -314,10 +357,8 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
|
||||||
|
|
||||||
IShellBrowserImpl *This = (IShellBrowserImpl *)iface;
|
IShellBrowserImpl *This = (IShellBrowserImpl *)iface;
|
||||||
|
|
||||||
TRACE("(%p)(pidl=%p,flags=0x%08x(%s))\n", This, pidl, wFlags,
|
TRACE("(%p)(pidl=%p,flags=0x%08x)\n", This, pidl, wFlags);
|
||||||
(wFlags & SBSP_RELATIVE) ? "SBSP_RELATIVE" :
|
COMDLG32_DumpSBSPFlags(wFlags);
|
||||||
(wFlags & SBSP_PARENT) ? "SBSP_PARENT" :
|
|
||||||
(wFlags & SBSP_ABSOLUTE) ? "SBSP_ABSOLUTE" : "SBPS_????");
|
|
||||||
|
|
||||||
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
||||||
|
|
||||||
|
@ -720,7 +761,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowse
|
||||||
|
|
||||||
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
||||||
|
|
||||||
/* If the selected object is not a folder, send a IDOK command to parent window */
|
/* If the selected object is not a folder, send an IDOK command to parent window */
|
||||||
if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1)))
|
if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1)))
|
||||||
{
|
{
|
||||||
HRESULT hRes;
|
HRESULT hRes;
|
||||||
|
|
|
@ -86,14 +86,14 @@ static WCHAR wszFakeDocumentText[1024];
|
||||||
*/
|
*/
|
||||||
BOOL PRINTDLG_OpenDefaultPrinter(HANDLE *hprn)
|
BOOL PRINTDLG_OpenDefaultPrinter(HANDLE *hprn)
|
||||||
{
|
{
|
||||||
char buf[260];
|
WCHAR buf[260];
|
||||||
DWORD dwBufLen = sizeof(buf);
|
DWORD dwBufLen = sizeof(buf) / sizeof(buf[0]);
|
||||||
BOOL res;
|
BOOL res;
|
||||||
if(!GetDefaultPrinterA(buf, &dwBufLen))
|
if(!GetDefaultPrinterW(buf, &dwBufLen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
res = OpenPrinterA(buf, hprn, NULL);
|
res = OpenPrinterW(buf, hprn, NULL);
|
||||||
if (!res)
|
if (!res)
|
||||||
FIXME("Could not open printer %s?!\n",buf);
|
WARN("Could not open printer %s\n", debugstr_w(buf));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,7 +459,7 @@ static BOOL PRINTDLG_PaperSizeA(
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
Names = (char*)HeapAlloc(GetProcessHeap(),0,NrOfEntries*64);
|
Names = HeapAlloc(GetProcessHeap(),0,NrOfEntries*64);
|
||||||
if (NrOfEntries != (ret=DeviceCapabilitiesA(devname,portname,DC_PAPERNAMES,Names,dm))) {
|
if (NrOfEntries != (ret=DeviceCapabilitiesA(devname,portname,DC_PAPERNAMES,Names,dm))) {
|
||||||
FIXME("Number of returned vals %d is not %d\n",NrOfEntries,ret);
|
FIXME("Number of returned vals %d is not %d\n",NrOfEntries,ret);
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -517,7 +517,7 @@ static BOOL PRINTDLG_PaperSizeW(
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
Names = (WCHAR*)HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*NrOfEntries*64);
|
Names = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*NrOfEntries*64);
|
||||||
if (NrOfEntries != (ret=DeviceCapabilitiesW(devname,portname,DC_PAPERNAMES,Names,dm))) {
|
if (NrOfEntries != (ret=DeviceCapabilitiesW(devname,portname,DC_PAPERNAMES,Names,dm))) {
|
||||||
FIXME("Number of returned vals %d is not %d\n",NrOfEntries,ret);
|
FIXME("Number of returned vals %d is not %d\n",NrOfEntries,ret);
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -3026,6 +3026,7 @@ HRESULT WINAPI PrintDlgExA(LPPRINTDLGEXA lpPrintDlgExA)
|
||||||
FIXME("stub\n");
|
FIXME("stub\n");
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* PrintDlgExW (COMDLG32.@)
|
* PrintDlgExW (COMDLG32.@)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -427,7 +427,7 @@ BOOL16 WINAPI PrintDlg16(
|
||||||
ptr16 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PRINT_PTRA16));
|
ptr16 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PRINT_PTRA16));
|
||||||
ptr16->lpPrintDlg16 = lppd;
|
ptr16->lpPrintDlg16 = lppd;
|
||||||
PrintStructures = &ptr16->print32;
|
PrintStructures = &ptr16->print32;
|
||||||
PrintStructures->lpPrintDlg = (LPPRINTDLGA)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(PRINTDLGA));
|
PrintStructures->lpPrintDlg = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(PRINTDLGA));
|
||||||
#define CVAL(x) PrintStructures->lpPrintDlg->x = lppd->x;
|
#define CVAL(x) PrintStructures->lpPrintDlg->x = lppd->x;
|
||||||
#define MVAL(x) PrintStructures->lpPrintDlg->x = MapSL(lppd->x);
|
#define MVAL(x) PrintStructures->lpPrintDlg->x = MapSL(lppd->x);
|
||||||
CVAL(Flags);
|
CVAL(Flags);
|
||||||
|
|
|
@ -315,8 +315,15 @@ extern "C" {
|
||||||
#define SBSP_OPENMODE 16
|
#define SBSP_OPENMODE 16
|
||||||
#define SBSP_EXPLOREMODE 32
|
#define SBSP_EXPLOREMODE 32
|
||||||
#define SBSP_ABSOLUTE 0
|
#define SBSP_ABSOLUTE 0
|
||||||
|
#define SBSP_HELPMODE 0x40
|
||||||
|
#define SBSP_NOTRANSFERHIST 0x80
|
||||||
#define SBSP_RELATIVE 0x1000
|
#define SBSP_RELATIVE 0x1000
|
||||||
#define SBSP_PARENT 0x2000
|
#define SBSP_PARENT 0x2000
|
||||||
|
#define SBSP_NAVIGATEBACK 0x4000
|
||||||
|
#define SBSP_NAVIGATEFORWARD 0x8000
|
||||||
|
#define SBSP_ALLOW_AUTONAVIGATE 0x10000
|
||||||
|
#define SBSP_NOAUTOSELECT 0x4000000
|
||||||
|
#define SBSP_WRITENOHISTORY 0x8000000
|
||||||
#define SBSP_INITIATEDBYHLINKFRAME 0x80000000
|
#define SBSP_INITIATEDBYHLINKFRAME 0x80000000
|
||||||
#define SBSP_REDIRECT 0x40000000
|
#define SBSP_REDIRECT 0x40000000
|
||||||
#define FCW_STATUS 1
|
#define FCW_STATUS 1
|
||||||
|
|
Loading…
Reference in a new issue