Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.c | 12 ++++++++++++ dlls/combase/combase.spec | 2 +- dlls/ole32/compobj.c | 28 ---------------------------- dlls/ole32/ole32.spec | 2 +- 4 files changed, 14 insertions(+), 30 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index 7c6eaec7fa3..d5f4fad75c4 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -1108,6 +1108,18 @@ HRESULT WINAPI StringFromCLSID(REFCLSID clsid, LPOLESTR *str) return S_OK; }
+/****************************************************************************** + * StringFromGUID2 (combase.@) + */ +INT WINAPI StringFromGUID2(REFGUID guid, LPOLESTR str, INT cmax) +{ + if (!guid || cmax < CHARS_IN_GUID) return 0; + swprintf(str, CHARS_IN_GUID, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", guid->Data1, + guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], + guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); + return CHARS_IN_GUID; +} + static void init_multi_qi(DWORD count, MULTI_QI *mqi, HRESULT hr) { ULONG i; diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index d56294af4d9..0b3b32206a5 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -319,7 +319,7 @@ @ stdcall SetErrorInfo(long ptr) ole32.SetErrorInfo @ stub SetRestrictedErrorInfo @ stdcall StringFromCLSID(ptr ptr) -@ stdcall StringFromGUID2(ptr ptr long) ole32.StringFromGUID2 +@ stdcall StringFromGUID2(ptr ptr long) @ stdcall StringFromIID(ptr ptr) StringFromCLSID @ stub UpdateDCOMSettings @ stdcall WdtpInterfacePointer_UserFree(ptr) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index ebcce6d390d..e820e82c8a8 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -2186,34 +2186,6 @@ HRESULT WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved ) return S_OK; }
-/****************************************************************************** - * StringFromGUID2 [OLE32.@] - * - * Modified version of StringFromCLSID that allows you to specify max - * buffer size. - * - * PARAMS - * id [I] GUID to convert to string. - * str [O] Buffer where the result will be stored. - * cmax [I] Size of the buffer in characters. - * - * RETURNS - * Success: The length of the resulting string in characters. - * Failure: 0. - */ -INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax) -{ - static const WCHAR formatW[] = { '{','%','0','8','X','-','%','0','4','X','-', - '%','0','4','X','-','%','0','2','X','%','0','2','X','-', - '%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X', - '%','0','2','X','%','0','2','X','}',0 }; - if (!id || cmax < CHARS_IN_GUID) return 0; - swprintf( str, CHARS_IN_GUID, formatW, id->Data1, id->Data2, id->Data3, - id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3], - id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] ); - return CHARS_IN_GUID; -} - /* open HKCR\CLSID\{string form of clsid}\{keyname} key */ HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey) { diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 232ec8d87e7..b25d710a55b 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -280,7 +280,7 @@ @ stdcall StgOpenStorageOnILockBytes(ptr ptr long ptr long ptr) @ stdcall StgSetTimes(wstr ptr ptr ptr ) @ stdcall StringFromCLSID(ptr ptr) combase.StringFromCLSID -@ stdcall StringFromGUID2(ptr ptr long) +@ stdcall StringFromGUID2(ptr ptr long) combase.StringFromGUID2 @ stdcall StringFromIID(ptr ptr) combase.StringFromIID @ stub UpdateDCOMSettings @ stub UtConvertDvtd16toDvtd32