mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
547 B
28 lines
547 B
#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);
|
|
}
|