Leaked source code of windows server 2003
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.

40 lines
1.1 KiB

  1. #ifndef __HELPERS_HPP__
  2. #define __HELPERS_HPP__
  3. #include <delaydll.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. // String type conversion routines
  8. HRESULT Ansi2Unicode(const char *, wchar_t **);
  9. HRESULT Unicode2Ansi(const wchar_t *src, char ** dest);
  10. // String->CLSID conversion routines
  11. HRESULT ConvertANSItoCLSID(const char *pszCLSID, CLSID * clsid);
  12. HRESULT ConvertANSIProgIDtoCLSID(const char *progid, CLSID *pCLSID);
  13. HRESULT ConvertFriendlyANSItoCLSID(char *pszCLSID, CLSID * clsid);
  14. HRESULT RemoveDirectoryAndChildren(LPCSTR szDir);
  15. HRESULT SetSize(SIZE *, long cx, long cy);
  16. HRESULT CDLDupWStr( LPWSTR *pszwstrDst, LPCWSTR szwSrc );
  17. #undef SAFERELEASE
  18. #define SAFERELEASE(p) if ((p) != NULL) { (p)->Release(); (p) = NULL; };
  19. #undef SAFEDELETE
  20. #define SAFEDELETE(p) if ((p) != NULL) { delete (p); (p) = NULL; };
  21. #undef SAFEREGCLOSEKEY
  22. #define SAFEREGCLOSEKEY(p) if ((p) != NULL) { ::RegCloseKey(p); (p) = NULL; };
  23. #undef SAFESYSFREESTRING
  24. #define SAFESYSFREESTRING(p) if ((p) != NULL) { SysFreeString(p); (p) = NULL; };
  25. #ifdef __cplusplus
  26. }
  27. #endif
  28. #endif