Commit 137acffd authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

ole32: Use wide-char string literals.

parent 9faa5eed
...@@ -519,7 +519,7 @@ static HRESULT WINAPI ClassMoniker_GetDisplayName(IMoniker* iface, ...@@ -519,7 +519,7 @@ static HRESULT WINAPI ClassMoniker_GetDisplayName(IMoniker* iface,
LPOLESTR *ppszDisplayName) LPOLESTR *ppszDisplayName)
{ {
ClassMoniker *This = impl_from_IMoniker(iface); ClassMoniker *This = impl_from_IMoniker(iface);
static const WCHAR wszClsidPrefix[] = {'c','l','s','i','d',':',0}; static const WCHAR wszClsidPrefix[] = L"clsid:";
TRACE("(%p, %p, %p)\n", pbc, pmkToLeft, ppszDisplayName); TRACE("(%p, %p, %p)\n", pbc, pmkToLeft, ppszDisplayName);
......
...@@ -198,7 +198,7 @@ static inline HRESULT get_ole_clipbrd(ole_clipbrd **clipbrd) ...@@ -198,7 +198,7 @@ static inline HRESULT get_ole_clipbrd(ole_clipbrd **clipbrd)
/* /*
* Name of our registered OLE clipboard window class * Name of our registered OLE clipboard window class
*/ */
static const WCHAR clipbrd_wndclass[] = {'C','L','I','P','B','R','D','W','N','D','C','L','A','S','S',0}; static const WCHAR clipbrd_wndclass[] = L"CLIPBRDWNDCLASS";
UINT ownerlink_clipboard_format = 0; UINT ownerlink_clipboard_format = 0;
UINT filename_clipboard_format = 0; UINT filename_clipboard_format = 0;
...@@ -619,7 +619,6 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt) ...@@ -619,7 +619,6 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt)
if (mfp) if (mfp)
{ {
OLECHAR name[]={ 2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0};
IStream *pStream = 0; IStream *pStream = 0;
void *mfBits; void *mfBits;
PresentationDataHeader pdh; PresentationDataHeader pdh;
...@@ -644,7 +643,8 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt) ...@@ -644,7 +643,8 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt)
pdh.dwObjectExtentY = mfp->yExt; pdh.dwObjectExtentY = mfp->yExt;
pdh.dwSize = nSize; pdh.dwSize = nSize;
hr = IStorage_CreateStream(std.u.pstg, name, STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, 0, &pStream); hr = IStorage_CreateStream(std.u.pstg, L"\2OlePres000",
STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, 0, &pStream);
hr = IStream_Write(pStream, &pdh, sizeof(PresentationDataHeader), NULL); hr = IStream_Write(pStream, &pdh, sizeof(PresentationDataHeader), NULL);
......
...@@ -129,7 +129,7 @@ static HRESULT COMCAT_UnRegisterClassCategories( ...@@ -129,7 +129,7 @@ static HRESULT COMCAT_UnRegisterClassCategories(
ULONG cCategories, ULONG cCategories,
const CATID *rgcatid) const CATID *rgcatid)
{ {
WCHAR keyname[68] = { 'C', 'L', 'S', 'I', 'D', '\\' }; WCHAR keyname[68] = L"CLSID\\";
HRESULT res; HRESULT res;
HKEY type_key; HKEY type_key;
...@@ -501,9 +501,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_GetCategoryDesc( ...@@ -501,9 +501,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_GetCategoryDesc(
LCID lcid, LCID lcid,
PWCHAR *ppszDesc) PWCHAR *ppszDesc)
{ {
WCHAR keyname[60] = { 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', WCHAR keyname[60] = L"Component Categories\\";
't', ' ', 'C', 'a', 't', 'e', 'g', 'o',
'r', 'i', 'e', 's', '\\', 0 };
HKEY key; HKEY key;
HRESULT res; HRESULT res;
...@@ -584,7 +582,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_IsClassOfCategories( ...@@ -584,7 +582,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_IsClassOfCategories(
ULONG cRequired, ULONG cRequired,
CATID *rgcatidReq) CATID *rgcatidReq)
{ {
WCHAR keyname[45] = { 'C', 'L', 'S', 'I', 'D', '\\', 0 }; WCHAR keyname[45] = L"CLSID\\";
HRESULT res; HRESULT res;
struct class_categories *categories; struct class_categories *categories;
HKEY key; HKEY key;
......
...@@ -245,10 +245,6 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES ...@@ -245,10 +245,6 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES
return status; return status;
} }
static const WCHAR classes_rootW[] =
{'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e',
'\\','S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s',0};
static HKEY classes_root_hkey; static HKEY classes_root_hkey;
/* create the special HKEY_CLASSES_ROOT key */ /* create the special HKEY_CLASSES_ROOT key */
...@@ -264,7 +260,7 @@ static HKEY create_classes_root_hkey(DWORD access) ...@@ -264,7 +260,7 @@ static HKEY create_classes_root_hkey(DWORD access)
attr.Attributes = 0; attr.Attributes = 0;
attr.SecurityDescriptor = NULL; attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL; attr.SecurityQualityOfService = NULL;
RtlInitUnicodeString( &name, classes_rootW ); RtlInitUnicodeString( &name, L"\\Registry\\Machine\\Software\\Classes" );
if (create_key( &hkey, access, &attr )) return 0; if (create_key( &hkey, access, &attr )) return 0;
TRACE( "%s -> %p\n", debugstr_w(attr.ObjectName->Buffer), hkey ); TRACE( "%s -> %p\n", debugstr_w(attr.ObjectName->Buffer), hkey );
...@@ -292,9 +288,8 @@ static inline HKEY get_classes_root_hkey( HKEY hkey, REGSAM access ) ...@@ -292,9 +288,8 @@ static inline HKEY get_classes_root_hkey( HKEY hkey, REGSAM access )
ret = create_classes_root_hkey(MAXIMUM_ALLOWED | (access & KEY_WOW64_64KEY)); ret = create_classes_root_hkey(MAXIMUM_ALLOWED | (access & KEY_WOW64_64KEY));
if (force_wow32 && ret && ret == classes_root_hkey) if (force_wow32 && ret && ret == classes_root_hkey)
{ {
static const WCHAR wow6432nodeW[] = {'W','o','w','6','4','3','2','N','o','d','e',0};
access &= ~KEY_WOW64_32KEY; access &= ~KEY_WOW64_32KEY;
if (create_classes_key(classes_root_hkey, wow6432nodeW, access, &hkey)) if (create_classes_key(classes_root_hkey, L"Wow6432Node", access, &hkey))
return 0; return 0;
ret = hkey; ret = hkey;
} }
...@@ -530,13 +525,12 @@ HRESULT WINAPI CoInitialize(LPVOID lpReserved) ...@@ -530,13 +525,12 @@ HRESULT WINAPI CoInitialize(LPVOID lpReserved)
/* open HKCR\\CLSID\\{string form of clsid}\\{keyname} key */ /* open HKCR\\CLSID\\{string form of clsid}\\{keyname} key */
HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey) HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey)
{ {
static const WCHAR wszCLSIDSlash[] = {'C','L','S','I','D','\\',0}; WCHAR path[CHARS_IN_GUID + ARRAY_SIZE(L"CLSID\\") - 1];
WCHAR path[CHARS_IN_GUID + ARRAY_SIZE(wszCLSIDSlash) - 1];
LONG res; LONG res;
HKEY key; HKEY key;
lstrcpyW(path, wszCLSIDSlash); lstrcpyW(path, L"CLSID\\");
StringFromGUID2(clsid, path + lstrlenW(wszCLSIDSlash), CHARS_IN_GUID); StringFromGUID2(clsid, path + lstrlenW(L"CLSID\\"), CHARS_IN_GUID);
res = open_classes_key(HKEY_CLASSES_ROOT, path, keyname ? KEY_READ : access, &key); res = open_classes_key(HKEY_CLASSES_ROOT, path, keyname ? KEY_READ : access, &key);
if (res == ERROR_FILE_NOT_FOUND) if (res == ERROR_FILE_NOT_FOUND)
return REGDB_E_CLASSNOTREG; return REGDB_E_CLASSNOTREG;
...@@ -707,8 +701,6 @@ HRESULT WINAPI CoSetState(IUnknown * pv) ...@@ -707,8 +701,6 @@ HRESULT WINAPI CoSetState(IUnknown * pv)
*/ */
HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew) HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
{ {
static const WCHAR wszAutoTreatAs[] = {'A','u','t','o','T','r','e','a','t','A','s',0};
static const WCHAR wszTreatAs[] = {'T','r','e','a','t','A','s',0};
HKEY hkey = NULL; HKEY hkey = NULL;
WCHAR szClsidNew[CHARS_IN_GUID]; WCHAR szClsidNew[CHARS_IN_GUID];
HRESULT res = S_OK; HRESULT res = S_OK;
...@@ -722,10 +714,10 @@ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew) ...@@ -722,10 +714,10 @@ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
if (IsEqualGUID( clsidOld, clsidNew )) if (IsEqualGUID( clsidOld, clsidNew ))
{ {
if (!RegQueryValueW(hkey, wszAutoTreatAs, auto_treat_as, &auto_treat_as_size) && if (!RegQueryValueW(hkey, L"AutoTreatAs", auto_treat_as, &auto_treat_as_size) &&
CLSIDFromString(auto_treat_as, &id) == S_OK) CLSIDFromString(auto_treat_as, &id) == S_OK)
{ {
if (RegSetValueW(hkey, wszTreatAs, REG_SZ, auto_treat_as, sizeof(auto_treat_as))) if (RegSetValueW(hkey, L"TreatAs", REG_SZ, auto_treat_as, sizeof(auto_treat_as)))
{ {
res = REGDB_E_WRITEREGDB; res = REGDB_E_WRITEREGDB;
goto done; goto done;
...@@ -733,7 +725,7 @@ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew) ...@@ -733,7 +725,7 @@ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
} }
else else
{ {
if(RegDeleteKeyW(hkey, wszTreatAs)) if (RegDeleteKeyW(hkey, L"TreatAs"))
res = REGDB_E_WRITEREGDB; res = REGDB_E_WRITEREGDB;
goto done; goto done;
} }
...@@ -741,7 +733,7 @@ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew) ...@@ -741,7 +733,7 @@ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
else else
{ {
if(IsEqualGUID(clsidNew, &CLSID_NULL)){ if(IsEqualGUID(clsidNew, &CLSID_NULL)){
RegDeleteKeyW(hkey, wszTreatAs); RegDeleteKeyW(hkey, L"TreatAs");
}else{ }else{
if(!StringFromGUID2(clsidNew, szClsidNew, ARRAY_SIZE(szClsidNew))){ if(!StringFromGUID2(clsidNew, szClsidNew, ARRAY_SIZE(szClsidNew))){
WARN("StringFromGUID2 failed\n"); WARN("StringFromGUID2 failed\n");
...@@ -749,7 +741,7 @@ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew) ...@@ -749,7 +741,7 @@ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
goto done; goto done;
} }
if(RegSetValueW(hkey, wszTreatAs, REG_SZ, szClsidNew, sizeof(szClsidNew)) != ERROR_SUCCESS){ if (RegSetValueW(hkey, L"TreatAs", REG_SZ, szClsidNew, sizeof(szClsidNew)) != ERROR_SUCCESS){
WARN("RegSetValue failed\n"); WARN("RegSetValue failed\n");
res = REGDB_E_WRITEREGDB; res = REGDB_E_WRITEREGDB;
goto done; goto done;
...@@ -892,12 +884,11 @@ static BOOL get_object_dll_path(const struct class_reg_data *regdata, WCHAR *dst ...@@ -892,12 +884,11 @@ static BOOL get_object_dll_path(const struct class_reg_data *regdata, WCHAR *dst
} }
else else
{ {
static const WCHAR dllW[] = {'.','d','l','l',0};
ULONG_PTR cookie; ULONG_PTR cookie;
*dst = 0; *dst = 0;
ActivateActCtx(regdata->u.actctx.hactctx, &cookie); ActivateActCtx(regdata->u.actctx.hactctx, &cookie);
ret = SearchPathW(NULL, regdata->u.actctx.module_name, dllW, dstlen, dst, NULL); ret = SearchPathW(NULL, regdata->u.actctx.module_name, L".dll", dstlen, dst, NULL);
DeactivateActCtx(0, cookie); DeactivateActCtx(0, cookie);
return *dst != 0; return *dst != 0;
} }
...@@ -905,11 +896,10 @@ static BOOL get_object_dll_path(const struct class_reg_data *regdata, WCHAR *dst ...@@ -905,11 +896,10 @@ static BOOL get_object_dll_path(const struct class_reg_data *regdata, WCHAR *dst
HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{ {
static const WCHAR wszInprocHandler32[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',0};
HKEY hkey; HKEY hkey;
HRESULT hres; HRESULT hres;
hres = COM_OpenKeyForCLSID(rclsid, wszInprocHandler32, KEY_READ, &hkey); hres = COM_OpenKeyForCLSID(rclsid, L"InprocHandler32", KEY_READ, &hkey);
if (SUCCEEDED(hres)) if (SUCCEEDED(hres))
{ {
struct class_reg_data regdata; struct class_reg_data regdata;
...@@ -920,8 +910,7 @@ HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) ...@@ -920,8 +910,7 @@ HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
if (get_object_dll_path(&regdata, dllpath, ARRAY_SIZE(dllpath))) if (get_object_dll_path(&regdata, dllpath, ARRAY_SIZE(dllpath)))
{ {
static const WCHAR wszOle32[] = {'o','l','e','3','2','.','d','l','l',0}; if (!wcsicmp(dllpath, L"ole32.dll"))
if (!wcsicmp(dllpath, wszOle32))
{ {
RegCloseKey(hkey); RegCloseKey(hkey);
return HandlerCF_Create(rclsid, riid, ppv); return HandlerCF_Create(rclsid, riid, ppv);
......
...@@ -530,8 +530,6 @@ static HRESULT write_clipformat(IStream *stream, CLIPFORMAT clipformat) ...@@ -530,8 +530,6 @@ static HRESULT write_clipformat(IStream *stream, CLIPFORMAT clipformat)
return hr; return hr;
} }
static const WCHAR CONTENTS[] = {'C','O','N','T','E','N','T','S',0};
static HRESULT open_pres_stream( IStorage *stg, int stream_number, IStream **stm ) static HRESULT open_pres_stream( IStorage *stg, int stream_number, IStream **stm )
{ {
WCHAR pres[] = {2,'O','l','e','P','r','e','s', WCHAR pres[] = {2,'O','l','e','P','r','e','s',
...@@ -541,7 +539,7 @@ static HRESULT open_pres_stream( IStorage *stg, int stream_number, IStream **stm ...@@ -541,7 +539,7 @@ static HRESULT open_pres_stream( IStorage *stg, int stream_number, IStream **stm
const WCHAR *name = pres; const WCHAR *name = pres;
if (stream_number == STREAM_NUMBER_NOT_SET) return E_FAIL; if (stream_number == STREAM_NUMBER_NOT_SET) return E_FAIL;
if (stream_number == STREAM_NUMBER_CONTENTS) name = CONTENTS; if (stream_number == STREAM_NUMBER_CONTENTS) name = L"CONTENTS";
return IStorage_OpenStream( stg, name, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm ); return IStorage_OpenStream( stg, name, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm );
} }
...@@ -1089,7 +1087,7 @@ static HRESULT create_stream(DataCacheEntry *cache_entry, IStorage *storage, ...@@ -1089,7 +1087,7 @@ static HRESULT create_stream(DataCacheEntry *cache_entry, IStorage *storage,
const WCHAR *name; const WCHAR *name;
if (contents) if (contents)
name = CONTENTS; name = L"CONTENTS";
else else
name = pres; name = pres;
......
...@@ -1758,7 +1758,6 @@ static HRESULT WINAPI DefaultHandler_IPersistStorage_IsDirty( ...@@ -1758,7 +1758,6 @@ static HRESULT WINAPI DefaultHandler_IPersistStorage_IsDirty(
* BYTE data[] - moniker data for a link * BYTE data[] - moniker data for a link
*/ */
static const WCHAR OleStream[] = {1,'O','l','e',0};
typedef struct typedef struct
{ {
DWORD version; DWORD version;
...@@ -1774,7 +1773,7 @@ static HRESULT load_ole_stream(DefaultHandler *This, IStorage *storage) ...@@ -1774,7 +1773,7 @@ static HRESULT load_ole_stream(DefaultHandler *This, IStorage *storage)
IStream *stream; IStream *stream;
HRESULT hr; HRESULT hr;
hr = IStorage_OpenStream(storage, OleStream, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stream); hr = IStorage_OpenStream(storage, L"\1Ole", NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stream);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
......
...@@ -1055,7 +1055,6 @@ failed: ...@@ -1055,7 +1055,6 @@ failed:
HRESULT WINAPI ItemMoniker_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) HRESULT WINAPI ItemMoniker_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
{ {
static const WCHAR emptyW[] = { 0 };
IMoniker *moniker; IMoniker *moniker;
HRESULT hr; HRESULT hr;
...@@ -1066,7 +1065,7 @@ HRESULT WINAPI ItemMoniker_CreateInstance(IClassFactory *iface, IUnknown *outer, ...@@ -1066,7 +1065,7 @@ HRESULT WINAPI ItemMoniker_CreateInstance(IClassFactory *iface, IUnknown *outer,
if (outer) if (outer)
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
if (FAILED(hr = CreateItemMoniker(emptyW, emptyW, &moniker))) if (FAILED(hr = CreateItemMoniker(L"", L"", &moniker)))
return hr; return hr;
hr = IMoniker_QueryInterface(moniker, riid, ppv); hr = IMoniker_QueryInterface(moniker, riid, ppv);
......
...@@ -915,8 +915,6 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid) ...@@ -915,8 +915,6 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
LONG sizeProgId, ret; LONG sizeProgId, ret;
LPOLESTR *pathDec=0,absFile=0,progId=0; LPOLESTR *pathDec=0,absFile=0,progId=0;
LPWSTR extension; LPWSTR extension;
static const WCHAR bkslashW[] = {'\\',0};
static const WCHAR dotW[] = {'.',0};
TRACE("%s, %p\n", debugstr_w(filePathName), pclsid); TRACE("%s, %p\n", debugstr_w(filePathName), pclsid);
...@@ -962,7 +960,7 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid) ...@@ -962,7 +960,7 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
absFile=pathDec[nbElm-1]; absFile=pathDec[nbElm-1];
/* failed if the path represents a directory and not an absolute file name*/ /* failed if the path represents a directory and not an absolute file name*/
if (!wcscmp(absFile, bkslashW)) { if (!wcscmp(absFile, L"\\")) {
CoTaskMemFree(pathDec); CoTaskMemFree(pathDec);
return MK_E_INVALIDEXTENSION; return MK_E_INVALIDEXTENSION;
} }
...@@ -973,7 +971,7 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid) ...@@ -973,7 +971,7 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
for(i = length-1; (i >= 0) && *(extension = &absFile[i]) != '.'; i--) for(i = length-1; (i >= 0) && *(extension = &absFile[i]) != '.'; i--)
/* nothing */; /* nothing */;
if (!extension || !wcscmp(extension, dotW)) { if (!extension || !wcscmp(extension, L".")) {
CoTaskMemFree(pathDec); CoTaskMemFree(pathDec);
return MK_E_INVALIDEXTENSION; return MK_E_INVALIDEXTENSION;
} }
......
...@@ -101,24 +101,18 @@ static LONG OLE_moduleLockCount = 0; ...@@ -101,24 +101,18 @@ static LONG OLE_moduleLockCount = 0;
/* /*
* Name of our registered window class. * Name of our registered window class.
*/ */
static const WCHAR OLEDD_DRAGTRACKERCLASS[] = static const WCHAR OLEDD_DRAGTRACKERCLASS[] = L"WineDragDropTracker32";
{'W','i','n','e','D','r','a','g','D','r','o','p','T','r','a','c','k','e','r','3','2',0};
/* /*
* Name of menu descriptor property. * Name of menu descriptor property.
*/ */
static const WCHAR prop_olemenuW[] = static const WCHAR prop_olemenuW[] = L"PROP_OLEMenuDescriptor";
{'P','R','O','P','_','O','L','E','M','e','n','u','D','e','s','c','r','i','p','t','o','r',0};
/* property to store IDropTarget pointer */ /* property to store IDropTarget pointer */
static const WCHAR prop_oledroptarget[] = static const WCHAR prop_oledroptarget[] = L"OleDropTargetInterface";
{'O','l','e','D','r','o','p','T','a','r','g','e','t','I','n','t','e','r','f','a','c','e',0};
/* property to store Marshalled IDropTarget pointer */ /* property to store Marshalled IDropTarget pointer */
static const WCHAR prop_marshalleddroptarget[] = static const WCHAR prop_marshalleddroptarget[] = L"WineMarshalledDropTarget";
{'W','i','n','e','M','a','r','s','h','a','l','l','e','d','D','r','o','p','T','a','r','g','e','t',0};
static const WCHAR emptyW[] = { 0 };
/****************************************************************************** /******************************************************************************
* These are the prototypes of miscellaneous utility methods * These are the prototypes of miscellaneous utility methods
...@@ -669,7 +663,6 @@ HRESULT WINAPI RevokeDragDrop(HWND hwnd) ...@@ -669,7 +663,6 @@ HRESULT WINAPI RevokeDragDrop(HWND hwnd)
*/ */
HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype) HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype)
{ {
static const WCHAR auxusertypeW[] = {'A','u','x','U','s','e','r','T','y','p','e','\\','%','d',0};
DWORD valuetype, valuelen; DWORD valuetype, valuelen;
WCHAR auxkeynameW[16]; WCHAR auxkeynameW[16];
HKEY usertypekey; HKEY usertypekey;
...@@ -695,10 +688,10 @@ HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype) ...@@ -695,10 +688,10 @@ HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype)
{ {
HKEY auxkey; HKEY auxkey;
swprintf(auxkeynameW, ARRAY_SIZE(auxkeynameW), auxusertypeW, form); swprintf(auxkeynameW, ARRAY_SIZE(auxkeynameW), L"AuxUserType\\%d", form);
if (COM_OpenKeyForCLSID(clsid, auxkeynameW, KEY_READ, &auxkey) == S_OK) if (COM_OpenKeyForCLSID(clsid, auxkeynameW, KEY_READ, &auxkey) == S_OK)
{ {
if (!RegQueryValueExW(auxkey, emptyW, NULL, &valuetype, NULL, &valuelen) && valuelen) if (!RegQueryValueExW(auxkey, L"", NULL, &valuetype, NULL, &valuelen) && valuelen)
{ {
RegCloseKey(usertypekey); RegCloseKey(usertypekey);
usertypekey = auxkey; usertypekey = auxkey;
...@@ -709,7 +702,7 @@ HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype) ...@@ -709,7 +702,7 @@ HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype)
} }
valuelen = 0; valuelen = 0;
if (RegQueryValueExW(usertypekey, emptyW, NULL, &valuetype, NULL, &valuelen)) if (RegQueryValueExW(usertypekey, L"", NULL, &valuetype, NULL, &valuelen))
{ {
RegCloseKey(usertypekey); RegCloseKey(usertypekey);
return REGDB_E_READREGDB; return REGDB_E_READREGDB;
...@@ -722,12 +715,7 @@ HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype) ...@@ -722,12 +715,7 @@ HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
ret = RegQueryValueExW(usertypekey, ret = RegQueryValueExW(usertypekey, L"", NULL, &valuetype, (BYTE *)*usertype, &valuelen);
emptyW,
NULL,
&valuetype,
(LPBYTE)*usertype,
&valuelen);
RegCloseKey(usertypekey); RegCloseKey(usertypekey);
if (ret != ERROR_SUCCESS) if (ret != ERROR_SUCCESS)
{ {
...@@ -748,7 +736,6 @@ HRESULT WINAPI DoDragDrop ( ...@@ -748,7 +736,6 @@ HRESULT WINAPI DoDragDrop (
DWORD dwOKEffect, /* [in] effects allowed by the source */ DWORD dwOKEffect, /* [in] effects allowed by the source */
DWORD *pdwEffect) /* [out] ptr to effects of the source */ DWORD *pdwEffect) /* [out] ptr to effects of the source */
{ {
static const WCHAR trackerW[] = {'T','r','a','c','k','e','r','W','i','n','d','o','w',0};
TrackerWindowInfo trackerInfo; TrackerWindowInfo trackerInfo;
HWND hwndTrackWindow; HWND hwndTrackWindow;
MSG msg; MSG msg;
...@@ -772,7 +759,7 @@ HRESULT WINAPI DoDragDrop ( ...@@ -772,7 +759,7 @@ HRESULT WINAPI DoDragDrop (
trackerInfo.curTargetHWND = 0; trackerInfo.curTargetHWND = 0;
trackerInfo.curDragTarget = 0; trackerInfo.curDragTarget = 0;
hwndTrackWindow = CreateWindowW(OLEDD_DRAGTRACKERCLASS, trackerW, hwndTrackWindow = CreateWindowW(OLEDD_DRAGTRACKERCLASS, L"TrackerWindow",
WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0,
&trackerInfo); &trackerInfo);
...@@ -856,8 +843,6 @@ HRESULT WINAPI OleRegGetMiscStatus( ...@@ -856,8 +843,6 @@ HRESULT WINAPI OleRegGetMiscStatus(
DWORD dwAspect, DWORD dwAspect,
DWORD* pdwStatus) DWORD* pdwStatus)
{ {
static const WCHAR miscstatusW[] = {'M','i','s','c','S','t','a','t','u','s',0};
static const WCHAR dfmtW[] = {'%','d',0};
WCHAR keyName[16]; WCHAR keyName[16];
HKEY miscStatusKey; HKEY miscStatusKey;
HKEY aspectKey; HKEY aspectKey;
...@@ -872,7 +857,7 @@ HRESULT WINAPI OleRegGetMiscStatus( ...@@ -872,7 +857,7 @@ HRESULT WINAPI OleRegGetMiscStatus(
if (actctx_get_miscstatus(clsid, dwAspect, pdwStatus)) return S_OK; if (actctx_get_miscstatus(clsid, dwAspect, pdwStatus)) return S_OK;
hr = COM_OpenKeyForCLSID(clsid, miscstatusW, KEY_READ, &miscStatusKey); hr = COM_OpenKeyForCLSID(clsid, L"MiscStatus", KEY_READ, &miscStatusKey);
if (FAILED(hr)) if (FAILED(hr))
/* missing key is not a failure */ /* missing key is not a failure */
return hr == REGDB_E_KEYMISSING ? S_OK : hr; return hr == REGDB_E_KEYMISSING ? S_OK : hr;
...@@ -882,7 +867,7 @@ HRESULT WINAPI OleRegGetMiscStatus( ...@@ -882,7 +867,7 @@ HRESULT WINAPI OleRegGetMiscStatus(
/* /*
* Open the key specific to the requested aspect. * Open the key specific to the requested aspect.
*/ */
swprintf(keyName, ARRAY_SIZE(keyName), dfmtW, dwAspect); swprintf(keyName, ARRAY_SIZE(keyName), L"%d", dwAspect);
result = open_classes_key(miscStatusKey, keyName, KEY_READ, &aspectKey); result = open_classes_key(miscStatusKey, keyName, KEY_READ, &aspectKey);
if (result == ERROR_SUCCESS) if (result == ERROR_SUCCESS)
...@@ -1117,11 +1102,10 @@ HRESULT WINAPI OleRegEnumVerbs (REFCLSID clsid, LPENUMOLEVERB* ppenum) ...@@ -1117,11 +1102,10 @@ HRESULT WINAPI OleRegEnumVerbs (REFCLSID clsid, LPENUMOLEVERB* ppenum)
LONG res; LONG res;
HKEY hkeyVerb; HKEY hkeyVerb;
DWORD dwSubKeys; DWORD dwSubKeys;
static const WCHAR wszVerb[] = {'V','e','r','b',0};
TRACE("(%s, %p)\n", debugstr_guid(clsid), ppenum); TRACE("(%s, %p)\n", debugstr_guid(clsid), ppenum);
res = COM_OpenKeyForCLSID(clsid, wszVerb, KEY_READ, &hkeyVerb); res = COM_OpenKeyForCLSID(clsid, L"Verb", KEY_READ, &hkeyVerb);
if (FAILED(res)) if (FAILED(res))
{ {
if (res == REGDB_E_CLASSNOTREG) if (res == REGDB_E_CLASSNOTREG)
...@@ -2402,12 +2386,7 @@ static void OLEUTL_ReadRegistryDWORDValue( ...@@ -2402,12 +2386,7 @@ static void OLEUTL_ReadRegistryDWORDValue(
DWORD dwKeyType; DWORD dwKeyType;
LONG lres; LONG lres;
lres = RegQueryValueExW(regKey, lres = RegQueryValueExW(regKey, L"", NULL, &dwKeyType, (BYTE *)buffer, &cbData);
emptyW,
NULL,
&dwKeyType,
(LPBYTE)buffer,
&cbData);
if (lres==ERROR_SUCCESS) if (lres==ERROR_SUCCESS)
{ {
...@@ -2573,13 +2552,12 @@ HRESULT WINAPI OleCreate( ...@@ -2573,13 +2552,12 @@ HRESULT WINAPI OleCreate(
*/ */
HRESULT WINAPI OleGetAutoConvert(REFCLSID clsidOld, LPCLSID pClsidNew) HRESULT WINAPI OleGetAutoConvert(REFCLSID clsidOld, LPCLSID pClsidNew)
{ {
static const WCHAR wszAutoConvertTo[] = {'A','u','t','o','C','o','n','v','e','r','t','T','o',0};
HKEY hkey = NULL; HKEY hkey = NULL;
WCHAR buf[CHARS_IN_GUID]; WCHAR buf[CHARS_IN_GUID];
LONG len; LONG len;
HRESULT res = S_OK; HRESULT res = S_OK;
res = COM_OpenKeyForCLSID(clsidOld, wszAutoConvertTo, KEY_READ, &hkey); res = COM_OpenKeyForCLSID(clsidOld, L"AutoConvertTo", KEY_READ, &hkey);
if (FAILED(res)) if (FAILED(res))
goto done; goto done;
...@@ -2600,7 +2578,6 @@ done: ...@@ -2600,7 +2578,6 @@ done:
*/ */
HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew) HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew)
{ {
static const WCHAR wszAutoConvertTo[] = {'A','u','t','o','C','o','n','v','e','r','t','T','o',0};
HKEY hkey = NULL; HKEY hkey = NULL;
WCHAR szClsidNew[CHARS_IN_GUID]; WCHAR szClsidNew[CHARS_IN_GUID];
HRESULT res = S_OK; HRESULT res = S_OK;
...@@ -2611,7 +2588,7 @@ HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew) ...@@ -2611,7 +2588,7 @@ HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew)
if (FAILED(res)) if (FAILED(res))
goto done; goto done;
StringFromGUID2(clsidNew, szClsidNew, CHARS_IN_GUID); StringFromGUID2(clsidNew, szClsidNew, CHARS_IN_GUID);
if (RegSetValueW(hkey, wszAutoConvertTo, REG_SZ, szClsidNew, (lstrlenW(szClsidNew)+1) * sizeof(WCHAR))) if (RegSetValueW(hkey, L"AutoConvertTo", REG_SZ, szClsidNew, (lstrlenW(szClsidNew)+1) * sizeof(WCHAR)))
{ {
res = REGDB_E_WRITEREGDB; res = REGDB_E_WRITEREGDB;
goto done; goto done;
......
...@@ -2991,10 +2991,8 @@ static const IPropertyStorageVtbl IPropertyStorage_Vtbl = ...@@ -2991,10 +2991,8 @@ static const IPropertyStorageVtbl IPropertyStorage_Vtbl =
/*********************************************************************** /***********************************************************************
* Format ID <-> name conversion * Format ID <-> name conversion
*/ */
static const WCHAR szSummaryInfo[] = { 5,'S','u','m','m','a','r','y', static const WCHAR szSummaryInfo[] = L"\5SummaryInformation";
'I','n','f','o','r','m','a','t','i','o','n',0 }; static const WCHAR szDocSummaryInfo[] = L"\5DocumentSummaryInformation";
static const WCHAR szDocSummaryInfo[] = { 5,'D','o','c','u','m','e','n','t',
'S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0 };
#define BITS_PER_BYTE 8 #define BITS_PER_BYTE 8
#define CHARMASK 0x1f #define CHARMASK 0x1f
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment