Commit 532df76a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

combase: Move StringFromGUID2().

parent f3e949c3
......@@ -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;
......
......@@ -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)
......
......@@ -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)
{
......
......@@ -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
......
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