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.

126 lines
5.6 KiB

  1. /*++
  2. Copyright Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. COMINIT.H
  5. Abstract:
  6. WMI COM helpers
  7. History:
  8. --*/
  9. #ifndef _COMINIT_H_
  10. #define _COMINIT_H_
  11. HRESULT WINAPI InitializeCom();
  12. #ifdef _WIN32_WINNT
  13. HRESULT WINAPI InitializeSecurity(
  14. PSECURITY_DESCRIPTOR pSecDesc,
  15. LONG cAuthSvc,
  16. SOLE_AUTHENTICATION_SERVICE *asAuthSvc,
  17. void *pReserved1,
  18. DWORD dwAuthnLevel,
  19. DWORD dwImpLevel,
  20. void *pReserved2,
  21. DWORD dwCapabilities,
  22. void *pReserved3);
  23. #endif /* _WIN32_WINNT */
  24. BOOL WINAPI IsDcomEnabled();
  25. BOOL WINAPI IsKerberosAvailable(void);
  26. DWORD WINAPI WbemWaitForSingleObject(HANDLE hHandle, DWORD dwMilli);
  27. DWORD WINAPI WbemWaitForMultipleObjects(DWORD nCount, HANDLE* ahHandles,DWORD dwMilli);
  28. HRESULT WINAPI WbemCoCreateInstance(REFCLSID rclsid, IUnknown* pUnkOuter,
  29. DWORD dwClsContext, REFIID riid, void** ppv);
  30. HRESULT WINAPI WbemCoGetClassObject(REFCLSID rclsid, DWORD dwClsContext,
  31. COSERVERINFO* pServerInfo, REFIID riid, void** ppv);
  32. HRESULT WINAPI WbemCoGetCallContext(REFIID riid, void** ppv);
  33. HRESULT WINAPI WbemCoQueryClientBlanket(
  34. /* [out] */ DWORD __RPC_FAR *pAuthnSvc,
  35. /* [out] */ DWORD __RPC_FAR *pAuthzSvc,
  36. /* [out] */ OLECHAR __RPC_FAR *__RPC_FAR *pServerPrincName,
  37. /* [out] */ DWORD __RPC_FAR *pAuthnLevel,
  38. /* [out] */ DWORD __RPC_FAR *pImpLevel,
  39. /* [out] */ void __RPC_FAR *__RPC_FAR *pPrivs,
  40. /* [out] */ DWORD __RPC_FAR *pCapabilities);
  41. HRESULT WINAPI WbemCoImpersonateClient( void);
  42. bool WINAPI WbemIsImpersonating(void);
  43. HRESULT WINAPI WbemCoRevertToSelf( void);
  44. HRESULT WINAPI WbemSetProxyBlanket(
  45. IUnknown *pInterface,
  46. DWORD dwAuthnSvc,
  47. DWORD dwAuthzSvc,
  48. OLECHAR *pServerPrincName,
  49. DWORD dwAuthLevel,
  50. DWORD dwImpLevel,
  51. RPC_AUTH_IDENTITY_HANDLE pAuthInfo,
  52. DWORD dwCapabilities,
  53. bool fIgnoreUnk = false );
  54. HRESULT WINAPI WbemCoSwitchCallContext( IUnknown *pNewObject, IUnknown **ppOldObject );
  55. #ifndef _COMINIT_CPP_
  56. #define COMINITEXTRN extern
  57. #else
  58. #define COMINITEXTRN
  59. #endif
  60. // a couple of functions we need for DCOM that will not exist when
  61. // the OS is not DCOM enabled.
  62. // ===============================================================
  63. SCODE WINAPI GetAuthImp(IUnknown * pFrom, DWORD * pdwAuthLevel, DWORD * pdwImpLevel);
  64. void GetCurrentValue(IUnknown * pFrom,DWORD & dwAuthenticationArg, DWORD & dwAuthorizationArg);
  65. SCODE WINAPI DetermineLoginType(BSTR & AuthArg, BSTR & UserArg,
  66. BSTR Authority,BSTR User);
  67. SCODE WINAPI DetermineLoginTypeEx(BSTR & AuthArg, BSTR & UserArg,BSTR & PrincipalArg,
  68. BSTR Authority,BSTR User);
  69. HRESULT WINAPI SetInterfaceSecurity(IUnknown * pInterface, LPWSTR pDomain, LPWSTR pUser, LPWSTR pPassword, IUnknown * pFrom, bool bAuthArg=true);
  70. HRESULT WINAPI SetInterfaceSecurityAuth(IUnknown * pInterface, COAUTHIDENTITY * pauthident, bool bAuthenticate = true);
  71. HRESULT WINAPI SetInterfaceSecurity(IUnknown * pInterface, LPWSTR pDomain, LPWSTR pUser, LPWSTR pPassword, DWORD dwAuthLevel, DWORD dwImpLevel, DWORD dwCapabilities = 0);
  72. // Extended functions that maintain credential and principal information
  73. HRESULT WINAPI SetInterfaceSecurityEx(IUnknown * pInterface,
  74. LPWSTR pDomain,
  75. LPWSTR pUser,
  76. LPWSTR pPassword,
  77. DWORD dwAuthLevel,
  78. DWORD dwImpLevel,
  79. DWORD dwCapabilities,
  80. COAUTHIDENTITY** ppAuthIdent,
  81. BSTR* ppPrinciple,
  82. bool GetInfoFirst = true );
  83. HRESULT WINAPI SetInterfaceSecurityEx(IUnknown * pInterface,
  84. COAUTHIDENTITY* pAuthIdent,
  85. BSTR pPrincipal,
  86. DWORD dwAuthLevel,
  87. DWORD dwImpLevel,
  88. DWORD dwCapabilities = 0,
  89. bool GetInfoFirst = true);
  90. HRESULT WINAPI WbemAllocAuthIdentity( LPCWSTR pUser, LPCWSTR pPassword, LPCWSTR pDomain, COAUTHIDENTITY** pAuthIdent );
  91. HRESULT WINAPI WbemFreeAuthIdentity( COAUTHIDENTITY* pAuthIdent );
  92. BOOL WINAPI DoesContainCredentials( COAUTHIDENTITY* pAuthIdent );
  93. // NOP functions
  94. HRESULT WINAPI SetInterfaceSecurityEncrypt(IUnknown * pInterface, LPWSTR pDomain, LPWSTR pUser, LPWSTR pPassword, DWORD dwAuthLevel, DWORD dwImpLevel, DWORD dwCapabilities,
  95. COAUTHIDENTITY** ppAuthIdent, BSTR* ppPrinciple, bool GetInfoFirst=false );
  96. HRESULT WINAPI SetInterfaceSecurityDecrypt(IUnknown * pInterface, COAUTHIDENTITY* pAuthIdent, BSTR pPrincipal,
  97. DWORD dwAuthLevel, DWORD dwImpLevel,
  98. DWORD dwCapabilities = 0, bool GetInfoFirst=true);
  99. HRESULT WINAPI EncryptCredentials( COAUTHIDENTITY* pAuthIdent );
  100. HRESULT WINAPI DecryptCredentials( COAUTHIDENTITY* pAuthIdent );
  101. #endif // _COMINIT_H_