include: Provide wide char definitions for CFSTR_*.

This commit is contained in:
Jon Griffiths 2008-06-18 08:04:46 -07:00 committed by Alexandre Julliard
parent fc3377d08b
commit f2276f5a49
9 changed files with 161 additions and 40 deletions

View File

@ -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)))

View File

@ -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);

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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)))

View File

@ -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
*/

View File

@ -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 */