From f2276f5a493c8e2d1f07901781e38304e9b9c4c1 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Wed, 18 Jun 2008 08:04:46 -0700 Subject: [PATCH] include: Provide wide char definitions for CFSTR_*. --- dlls/comdlg32/filedlg.c | 4 +- dlls/shell32/dataobject.c | 4 +- dlls/shell32/pidl.c | 2 +- dlls/shell32/shfldr_fs.c | 2 +- dlls/shell32/shfldr_unixfs.c | 2 +- dlls/shell32/shlview.c | 2 +- dlls/shell32/shv_bg_cmenu.c | 2 +- include/shlobj.h | 179 +++++++++++++++++++++++++++++------ programs/winefile/winefile.c | 4 - 9 files changed, 161 insertions(+), 40 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index f64fca71c07..57c76f831f3 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -3268,7 +3268,7 @@ LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex) return NULL; /* Set the FORMATETC structure*/ - SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); + SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLISTA), TYMED_HGLOBAL); /* Get the pidls from IDataObject */ if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium))) @@ -3300,7 +3300,7 @@ UINT GetNumSelected( IDataObject *doSelected ) if (!doSelected) return 0; /* Set the FORMATETC structure*/ - SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); + SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLISTA), TYMED_HGLOBAL); /* Get the pidls from IDataObject */ if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium))) diff --git a/dlls/shell32/dataobject.c b/dlls/shell32/dataobject.c index 743904b42c8..1c5826081af 100644 --- a/dlls/shell32/dataobject.c +++ b/dlls/shell32/dataobject.c @@ -439,9 +439,9 @@ LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, dto->apidl = _ILCopyaPidl(apidl, cidl); dto->cidl = cidl; - dto->cfShellIDList = RegisterClipboardFormatA(CFSTR_SHELLIDLIST); + dto->cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW); dto->cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA); - dto->cfFileNameW = RegisterClipboardFormatA(CFSTR_FILENAMEW); + dto->cfFileNameW = RegisterClipboardFormatW(CFSTR_FILENAMEW); InitFormatEtc(dto->pFormatEtc[0], dto->cfShellIDList, TYMED_HGLOBAL); InitFormatEtc(dto->pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL); InitFormatEtc(dto->pFormatEtc[2], dto->cfFileNameA, TYMED_HGLOBAL); diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index cfab61f9c8b..a97106733e9 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -712,7 +712,7 @@ HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEM STGMEDIUM medium; FORMATETC fmt; - fmt.cfFormat = RegisterClipboardFormatA(CFSTR_SHELLIDLIST); + fmt.cfFormat = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW); fmt.ptd = NULL; fmt.dwAspect = DVASPECT_CONTENT; fmt.lindex = -1; diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c index 94080d0b6e1..df68feb443d 100644 --- a/dlls/shell32/shfldr_fs.c +++ b/dlls/shell32/shfldr_fs.c @@ -128,7 +128,7 @@ static void SF_RegisterClipFmt (IGenericSFImpl * This) TRACE ("(%p)\n", This); if (!This->cfShellIDList) { - This->cfShellIDList = RegisterClipboardFormatA (CFSTR_SHELLIDLIST); + This->cfShellIDList = RegisterClipboardFormatW (CFSTR_SHELLIDLISTW); } } diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 6bc47faaf56..87975f126f6 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -834,7 +834,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_QueryInterface(IShellFolder2 *ifa } else if (IsEqualIID(&IID_IDropTarget, riid)) { *ppv = STATIC_CAST(IDropTarget, This); if (!cfShellIDList) - cfShellIDList = RegisterClipboardFormatA(CFSTR_SHELLIDLIST); + cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW); } else { *ppv = NULL; return E_NOINTERFACE; diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index e7b6f02d2dc..832d49787c5 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -889,7 +889,7 @@ static HRESULT ShellView_OpenSelectedItems(IShellViewImpl * This) if (0 == CF_IDLIST) { - CF_IDLIST = RegisterClipboardFormatA(CFSTR_SHELLIDLIST); + CF_IDLIST = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW); } fetc.cfFormat = CF_IDLIST; fetc.ptd = NULL; diff --git a/dlls/shell32/shv_bg_cmenu.c b/dlls/shell32/shv_bg_cmenu.c index 73bdee1747b..b4bc6e15fb3 100644 --- a/dlls/shell32/shv_bg_cmenu.c +++ b/dlls/shell32/shv_bg_cmenu.c @@ -234,7 +234,7 @@ static BOOL DoPaste( TRACE("pda=%p\n", pda); /* Set the FORMATETC structure*/ - InitFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); + InitFormatEtc(formatetc, RegisterClipboardFormatW(CFSTR_SHELLIDLISTW), TYMED_HGLOBAL); /* Get the pidls from IDataObject */ if(SUCCEEDED(IDataObject_GetData(pda,&formatetc,&medium))) diff --git a/include/shlobj.h b/include/shlobj.h index b32cfcf93c2..3e6e7a5bf8b 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -115,39 +115,164 @@ int WINAPI PathCleanupSpec(LPCWSTR,LPWSTR); /* DATAOBJECT_InitShellIDList*/ -#define CFSTR_SHELLIDLIST "Shell IDList Array" /* CF_IDLIST */ +#define CFSTR_SHELLIDLISTA "Shell IDList Array" /* CF_IDLIST */ +#define CFSTR_SHELLIDLISTOFFSETA "Shell Object Offsets" /* CF_OBJECTPOSITIONS */ +#define CFSTR_NETRESOURCESA "Net Resource" /* CF_NETRESOURCE */ +/* DATAOBJECT_InitFileGroupDesc */ +#define CFSTR_FILEDESCRIPTORA "FileGroupDescriptor" /* CF_FILEGROUPDESCRIPTORA */ +/* DATAOBJECT_InitFileContents*/ +#define CFSTR_FILECONTENTSA "FileContents" /* CF_FILECONTENTS */ +#define CFSTR_FILENAMEA "FileName" /* CF_FILENAMEA */ +#define CFSTR_FILENAMEMAPA "FileNameMap" /* CF_FILENAMEMAPA */ +#define CFSTR_PRINTERGROUPA "PrinterFriendlyName" /* CF_PRINTERS */ +#define CFSTR_SHELLURLA "UniformResourceLocator" +#define CFSTR_INETURLA CFSTR_SHELLURLA +#define CFSTR_PREFERREDDROPEFFECTA "Preferred DropEffect" +#define CFSTR_PERFORMEDDROPEFFECTA "Performed DropEffect" +#define CFSTR_PASTESUCCEEDEDA "Paste Succeeded" +#define CFSTR_INDRAGLOOPA "InShellDragLoop" +#define CFSTR_DRAGCONTEXTA "DragContext" +#define CFSTR_MOUNTEDVOLUMEA "MountedVolume" +#define CFSTR_PERSISTEDDATAOBJECTA "PersistedDataObject" +#define CFSTR_TARGETCLSIDA "TargetCLSID" +#define CFSTR_AUTOPLAY_SHELLIDLISTSA "Autoplay Enumerated IDList Array" +#define CFSTR_LOGICALPERFORMEDDROPEFFECTA "Logical Performed DropEffect" + +#if defined(__GNUC__) +# define CFSTR_SHELLIDLISTW \ + (const WCHAR []){ 'S','h','e','l','l',' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 } +# define CFSTR_SHELLIDLISTOFFSETW \ + (const WCHAR []){ 'S','h','e','l','l',' ','O','b','j','e','c','t',' ','O','f','f','s','e','t','s',0 } +# define CFSTR_NETRESOURCESW \ + (const WCHAR []){ 'N','e','t',' ','R','e','s','o','u','r','c','e',0 } +# define CFSTR_FILEDESCRIPTORW \ + (const WCHAR []){ 'F','i','l','e','G','r','o','u','p','D','e','s','c','r','i','p','t','o','r','W',0 } +# define CFSTR_FILECONTENTSW \ + (const WCHAR []){ 'F','i','l','e','C','o','n','t','e','n','t','s',0 } +# define CFSTR_FILENAMEW \ + (const WCHAR []){ 'F','i','l','e','N','a','m','e','W',0 } +# define CFSTR_FILENAMEMAPW \ + (const WCHAR []){ 'F','i','l','e','N','a','m','e','M','a','p','W',0 } +# define CFSTR_PRINTERGROUPW \ + (const WCHAR []){ 'P','r','i','n','t','e','r','F','r','i','e','n','d','l','y','N','a','m','e',0 } +# define CFSTR_SHELLURLW \ + (const WCHAR []){ 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r',0 } +# define CFSTR_INETURLW \ + (const WCHAR []){ 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r','W',0 } +# define CFSTR_PREFERREDDROPEFFECTW \ + (const WCHAR []){ 'P','r','e','f','e','r','r','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 } +# define CFSTR_PERFORMEDDROPEFFECTW \ + (const WCHAR []){ 'P','e','r','f','o','r','m','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 } +# define CFSTR_PASTESUCCEEDEDW \ + (const WCHAR []){ 'P','a','s','t','e',' ','S','u','c','c','e','e','d','e','d',0 } +# define CFSTR_INDRAGLOOPW \ + (const WCHAR []){ 'I','n','S','h','e','l','l','D','r','a','g','L','o','o','p',0 } +# define CFSTR_DRAGCONTEXTW \ + (const WCHAR []){ 'D','r','a','g','C','o','n','t','e','x','t',0 } +# define CFSTR_MOUNTEDVOLUMEW \ + (const WCHAR []){ 'M','o','u','n','t','e','d','V','o','l','u','m','e',0 } +# define CFSTR_PERSISTEDDATAOBJECTW \ + (const WCHAR []){ 'P','e','r','s','i','s','t','e','d','D','a','t','a','O','b','j','e','c','t',0 } +# define CFSTR_TARGETCLSIDW \ + (const WCHAR []){ 'T','a','r','g','e','t','C','L','S','I','D',0 } +# define CFSTR_AUTOPLAY_SHELLIDLISTSW \ + (const WCHAR []){ 'A','u','t','o','p','l','a','y',' ','E','n','u','m','e','r','a','t','e','d',\ + ' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 } +# define CFSTR_LOGICALPERFORMEDDROPEFFECTW \ + (const WCHAR []){ 'L','o','g','i','c','a','l',' ','P','e','r','f','o','r','m','e','d',\ + ' ','D','r','o','p','E','f','f','e','c','t',0 } +#elif defined(_MSC_VER) +# define CFSTR_SHELLIDLISTW L"Shell IDList Array" +# define CFSTR_SHELLIDLISTOFFSETW L"Shell Object Offsets" +# define CFSTR_NETRESOURCESW L"Net Resource" +# define CFSTR_FILEDESCRIPTORW L"FileGroupDescriptorW" +# define CFSTR_FILECONTENTSW L"FileContents" +# define CFSTR_FILENAMEW L"FileNameW" +# define CFSTR_FILENAMEMAPW L"FileNameMapW" +# define CFSTR_PRINTERGROUPW L"PrinterFriendlyName" +# define CFSTR_SHELLURLW L"UniformResourceLocator" +# define CFSTR_INETURLW L"UniformResourceLocatorW" +# define CFSTR_PREFERREDDROPEFFECTW L"Preferred DropEffect" +# define CFSTR_PERFORMEDDROPEFFECTW L"Performed DropEffect" +# define CFSTR_PASTESUCCEEDEDW L"Paste Succeeded" +# define CFSTR_INDRAGLOOPW L"InShellDragLoop" +# define CFSTR_DRAGCONTEXTW L"DragContext" +# define CFSTR_MOUNTEDVOLUMEW L"MountedVolume" +# define CFSTR_PERSISTEDDATAOBJECTW L"PersistedDataObject" +# define CFSTR_TARGETCLSIDW L"TargetCLSID" +# define CFSTR_AUTOPLAY_SHELLIDLISTSW L"Autoplay Enumerated IDList Array" +# define CFSTR_LOGICALPERFORMEDDROPEFFECTW L"Logical Performed DropEffect" +#else +static const WCHAR CFSTR_SHELLIDLISTW[] = + { 'S','h','e','l','l',' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 }; +static const WCHAR CFSTR_SHELLIDLISTOFFSETW[] = + { 'S','h','e','l','l',' ','O','b','j','e','c','t',' ','O','f','f','s','e','t','s',0 }; +static const WCHAR CFSTR_NETRESOURCESW[] = + { 'N','e','t',' ','R','e','s','o','u','r','c','e',0 }; +static const WCHAR CFSTR_FILEDESCRIPTORW[] = + { 'F','i','l','e','G','r','o','u','p','D','e','s','c','r','i','p','t','o','r','W',0 }; +static const WCHAR CFSTR_FILECONTENTSW[] = + { 'F','i','l','e','C','o','n','t','e','n','t','s',0 }; +static const WCHAR CFSTR_FILENAMEW[] = + { 'F','i','l','e','N','a','m','e','W',0 } +static const WCHAR CFSTR_FILENAMEMAPW[] = + { 'F','i','l','e','N','a','m','e','M','a','p','W',0 }; +static const WCHAR CFSTR_PRINTERGROUPW[] = + { 'P','r','i','n','t','e','r','F','r','i','e','n','d','l','y','N','a','m','e',0 }; +static const WCHAR CFSTR_SHELLURLW[] = + { 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r',0 }; +static const WCHAR CFSTR_INETURLW[] = + { 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r','W',0 }; +static const WCHAR CFSTR_PREFERREDDROPEFFECTW[] = + { 'P','r','e','f','e','r','r','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 }; +static const WCHAR CFSTR_PERFORMEDDROPEFFECTW[] = + { 'P','e','r','f','o','r','m','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 }; +static const WCHAR CFSTR_PASTESUCCEEDEDW[] = + { 'P','a','s','t','e',' ','S','u','c','c','e','e','d','e','d',0 }; +static const WCHAR CFSTR_INDRAGLOOPW[] = + { 'I','n','S','h','e','l','l','D','r','a','g','L','o','o','p',0 }; +static const WCHAR CFSTR_DRAGCONTEXTW[] = + { 'D','r','a','g','C','o','n','t','e','x','t',0 }; +static const WCHAR CFSTR_MOUNTEDVOLUMEW[] = + { 'M','o','u','n','t','e','d','V','o','l','u','m','e',0 }; +static const WCHAR CFSTR_PERSISTEDDATAOBJECTW[] = + { 'P','e','r','s','i','s','t','e','d','D','a','t','a','O','b','j','e','c','t',0 }; +static const WCHAR CFSTR_TARGETCLSIDW[] = + { 'T','a','r','g','e','t','C','L','S','I','D',0 }; +static const WCHAR CFSTR_AUTOPLAY_SHELLIDLISTSW[] = + { 'A','u','t','o','p','l','a','y',' ','E','n','u','m','e','r','a','t','e','d', + ' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 }; +static const WCHAR CFSTR_LOGICALPERFORMEDDROPEFFECTW[] = + { 'L','o','g','i','c','a','l',' ','P','e','r','f','o','r','m','e','d', + ' ','D','r','o','p','E','f','f','e','c','t',0 }; +#endif + +#define CFSTR_SHELLIDLIST WINELIB_NAME_AW(CFSTR_SHELLIDLIST) +#define CFSTR_SHELLIDLISTOFFSET WINELIB_NAME_AW(CFSTR_SHELLIDLISTOFFSET) +#define CFSTR_NETRESOURCES WINELIB_NAME_AW(CFSTR_NETRESOURCES) +#define CFSTR_FILEDESCRIPTOR WINELIB_NAME_AW(CFSTR_FILEDESCRIPTOR) +#define CFSTR_FILECONTENTS WINELIB_NAME_AW(CFSTR_FILECONTENTS) +#define CFSTR_FILENAME WINELIB_NAME_AW(CFSTR_FILENAME) +#define CFSTR_FILENAMEMAP WINELIB_NAME_AW(CFSTR_FILENAMEMAP) +#define CFSTR_PRINTERGROUP WINELIB_NAME_AW(CFSTR_PRINTERGROUP) +#define CFSTR_SHELLURL WINELIB_NAME_AW(CFSTR_SHELLURL) +#define CFSTR_INETURL WINELIB_NAME_AW(CFSTR_INETURL) +#define CFSTR_PREFERREDDROPEFFECT WINELIB_NAME_AW(CFSTR_PREFERREDDROPEFFECT) +#define CFSTR_PERFORMEDDROPEFFECT WINELIB_NAME_AW(CFSTR_PERFORMEDDROPEFFECT) +#define CFSTR_PASTESUCCEEDED WINELIB_NAME_AW(CFSTR_PASTESUCCEEDED) +#define CFSTR_INDRAGLOOP WINELIB_NAME_AW(CFSTR_INDRAGLOOP) +#define CFSTR_DRAGCONTEXT WINELIB_NAME_AW(CFSTR_DRAGCONTEXT) +#define CFSTR_MOUNTEDVOLUME WINELIB_NAME_AW(CFSTR_MOUNTEDVOLUME) +#define CFSTR_PERSISTEDDATAOBJECT WINELIB_NAME_AW(CFSTR_PERSISTEDDATAOBJECT) +#define CFSTR_TARGETCLSID WINELIB_NAME_AW(CFSTR_TARGETCLSID) +#define CFSTR_AUTOPLAY_SHELLIDLISTS WINELIB_NAME_AW(CFSTR_AUTOPLAY_SHELLIDLISTS) +#define CFSTR_LOGICALPERFORMEDDROPEFFECT WINELIB_NAME_AW(CFSTR_LOGICALPERFORMEDDROPEFFECT) typedef struct { UINT cidl; UINT aoffset[1]; } CIDA, *LPIDA; -#define CFSTR_SHELLIDLISTOFFSET "Shell Object Offsets" /* CF_OBJECTPOSITIONS */ -#define CFSTR_NETRESOURCES "Net Resource" /* CF_NETRESOURCE */ - -/* DATAOBJECT_InitFileGroupDesc */ -#define CFSTR_FILEDESCRIPTORA "FileGroupDescriptor" /* CF_FILEGROUPDESCRIPTORA */ - -#define CFSTR_FILEDESCRIPTORW "FileGroupDescriptorW" /* CF_FILEGROUPDESCRIPTORW */ - -/* DATAOBJECT_InitFileContents*/ -#define CFSTR_FILECONTENTS "FileContents" /* CF_FILECONTENTS */ - -#define CFSTR_FILENAMEA "FileName" /* CF_FILENAMEA */ -#define CFSTR_FILENAMEW "FileNameW" /* CF_FILENAMEW */ -#define CFSTR_PRINTERGROUP "PrinterFriendlyName" /* CF_PRINTERS */ -#define CFSTR_FILENAMEMAPA "FileNameMap" /* CF_FILENAMEMAPA */ -#define CFSTR_FILENAMEMAPW "FileNameMapW" /* CF_FILENAMEMAPW */ -#define CFSTR_SHELLURL "UniformResourceLocator" -#define CFSTR_PREFERREDDROPEFFECT "Preferred DropEffect" -#define CFSTR_PERFORMEDDROPEFFECT "Performed DropEffect" -#define CFSTR_PASTESUCCEEDED "Paste Succeeded" -#define CFSTR_INDRAGLOOP "InShellDragLoop" - -#define CFSTR_FILEDESCRIPTOR WINELIB_NAME_AW(CFSTR_FILEDESCRIPTOR) -#define CFSTR_FILENAME WINELIB_NAME_AW(CFSTR_FILENAME) - - /************************************************************************ * IShellView interface */ diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c index 9b41aa182c9..79ccbd4ab7e 100644 --- a/programs/winefile/winefile.c +++ b/programs/winefile/winefile.c @@ -4720,11 +4720,7 @@ static void InitInstance(HINSTANCE hinstance) CoInitialize(NULL); CoGetMalloc(MEMCTX_TASK, &Globals.iMalloc); SHGetDesktopFolder(&Globals.iDesktop); -#ifdef __WINE__ - Globals.cfStrFName = RegisterClipboardFormatA(CFSTR_FILENAME); -#else Globals.cfStrFName = RegisterClipboardFormat(CFSTR_FILENAME); -#endif #endif /* load column strings */