windows-nt/Source/XPSP1/NT/shell/services/hdsrv/lib/str.cpp
2020-09-26 16:20:57 +08:00

29 lines
547 B
C++

#include "str.h"
#include "sfstr.h"
#include "dbg.h"
///////////////////////////////////////////////////////////////////////////////
//
HRESULT _StringFromGUID(const GUID* pguid, LPWSTR psz, DWORD cch)
{
LPOLESTR pstr;
HRESULT hres = StringFromCLSID(*pguid, &pstr);
if (SUCCEEDED(hres))
{
// check size of string
hres = SafeStrCpyN(psz, pstr, cch);
CoTaskMemFree(pstr);
}
return hres;
}
HRESULT _GUIDFromString(LPCWSTR psz, GUID* pguid)
{
return CLSIDFromString((LPOLESTR)psz, pguid);
}