Source code of Windows XP (NT5)
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

  1. #include "str.h"
  2. #include "sfstr.h"
  3. #include "dbg.h"
  4. ///////////////////////////////////////////////////////////////////////////////
  5. //
  6. HRESULT _StringFromGUID(const GUID* pguid, LPWSTR psz, DWORD cch)
  7. {
  8. LPOLESTR pstr;
  9. HRESULT hres = StringFromCLSID(*pguid, &pstr);
  10. if (SUCCEEDED(hres))
  11. {
  12. // check size of string
  13. hres = SafeStrCpyN(psz, pstr, cch);
  14. CoTaskMemFree(pstr);
  15. }
  16. return hres;
  17. }
  18. HRESULT _GUIDFromString(LPCWSTR psz, GUID* pguid)
  19. {
  20. return CLSIDFromString((LPOLESTR)psz, pguid);
  21. }