diff --git a/dlls/compobj.dll16/compobj.c b/dlls/compobj.dll16/compobj.c index 6261c13dc33..b934a064c9e 100644 --- a/dlls/compobj.dll16/compobj.c +++ b/dlls/compobj.dll16/compobj.c @@ -54,6 +54,7 @@ typedef LPCSTR LPCOLESTR16; #define STDMETHOD16(m) HRESULT (STDMETHOD16CALLTYPE *m) #define STDMETHOD16_(t,m) t (STDMETHOD16CALLTYPE *m) +#define CHARS_IN_GUID 39 /*********************************************************************** * IMalloc16 interface @@ -689,9 +690,14 @@ HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid) /****************************************************************************** * StringFromGUID2 [COMPOBJ.76] */ -INT WINAPI StringFromGUID216(REFGUID id, LPOLESTR str, INT cmax) +INT16 WINAPI StringFromGUID216(REFGUID id, LPOLESTR16 str, INT16 cmax) { - return StringFromGUID2( id, str, cmax ); + static const char format[] = "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"; + if (!id || cmax < CHARS_IN_GUID) return 0; + sprintf( str, format, 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; } diff --git a/dlls/compobj.dll16/compobj.dll16.spec b/dlls/compobj.dll16/compobj.dll16.spec index d3022ae767d..03cf9258373 100644 --- a/dlls/compobj.dll16/compobj.dll16.spec +++ b/dlls/compobj.dll16/compobj.dll16.spec @@ -72,7 +72,7 @@ 72 stub _IID_IEXTERNALCONNECTION 73 pascal CoCreateGuid(ptr) CoCreateGuid16 75 stub FNASSERT -76 pascal StringFromGUID2(ptr ptr word) StringFromGUID216 +76 pascal -ret16 StringFromGUID2(ptr ptr word) StringFromGUID216 77 stub COGETCLASSEXT 78 stub OLE1CLASSFROMCLSID2 79 stub CLSIDFROMOLE1CLASS