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.

69 lines
2.1 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. GENUTILS.H
  5. Abstract:
  6. Declares various utilities.
  7. History:
  8. a-davj 21-June-97 Created.
  9. --*/
  10. #ifndef _genutils_H_
  11. #define _genutils_H_
  12. #include "corepol.h"
  13. #include "strutils.h"
  14. #include <wbemidl.h>
  15. #define HR_LAST_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, GetLastError() )
  16. // These are some generally useful routines
  17. // ========================================
  18. POLARITY BOOL IsW2KOrMore(void);
  19. POLARITY BOOL IsNT(void);
  20. POLARITY void RegisterDLL(HMODULE hModule, GUID guid, TCHAR * pDesc, TCHAR * pModel, TCHAR * progid);
  21. POLARITY void UnRegisterDLL(GUID guid, TCHAR * progid);
  22. POLARITY HRESULT RegisterDllAppid(HMODULE hModule,
  23. CLSID Clsid,
  24. WCHAR * pDescription,
  25. WCHAR * ThreadingModel,
  26. WCHAR * pLaunchPermission,
  27. WCHAR * pAccessPermission);
  28. POLARITY HRESULT UnregisterDllAppid(CLSID Clsid);
  29. POLARITY HRESULT WbemVariantChangeType(VARIANT* pvDest, VARIANT* pvSrc,
  30. VARTYPE vtNew);
  31. POLARITY BOOL ReadI64(LPCWSTR wsz, UNALIGNED __int64& i64);
  32. POLARITY BOOL ReadUI64(LPCWSTR wsz, UNALIGNED unsigned __int64& ui64);
  33. POLARITY HRESULT ChangeVariantToCIMTYPE(VARIANT* pvDest, VARIANT* pvSource,
  34. CIMTYPE ct);
  35. POLARITY void SecurityMutexRequest();
  36. POLARITY void SecurityMutexClear();
  37. POLARITY bool IsStandAloneWin9X();
  38. POLARITY BOOL bAreWeLocal(WCHAR * pServerMachine);
  39. POLARITY WCHAR *ExtractMachineName ( IN BSTR a_Path );
  40. POLARITY HRESULT WbemSetDynamicCloaking(IUnknown* pProxy,
  41. DWORD dwAuthnLevel, DWORD dwImpLevel);
  42. #define TOKEN_THREAD 0
  43. #define TOKEN_PROCESS 1
  44. POLARITY HRESULT EnableAllPrivileges(DWORD dwTokenType = TOKEN_THREAD);
  45. POLARITY BOOL EnablePrivilege(DWORD dwTokenType, LPCTSTR pName);
  46. POLARITY bool IsPrivilegePresent(HANDLE hToken, LPCTSTR pName);
  47. #define GLOBAL_WINMGMT_PREFIX L"Global\\WINMGMTCLIENTREQ"
  48. #endif