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.

117 lines
5.3 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  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. BOOL WINAPI WbemTryEnterCriticalSection(CRITICAL_SECTION* pcs);
  55. HRESULT WINAPI WbemCoSwitchCallContext( IUnknown *pNewObject, IUnknown **ppOldObject );
  56. #ifndef _COMINIT_CPP_
  57. #define COMINITEXTRN extern
  58. #else
  59. #define COMINITEXTRN
  60. #endif
  61. // a couple of functions we need for DCOM that will not exist when
  62. // the OS is not DCOM enabled.
  63. // ===============================================================
  64. COMINITEXTRN HRESULT (STDAPICALLTYPE *g_pfnCoGetCallContext)(REFIID, void**);
  65. COMINITEXTRN HRESULT (STDAPICALLTYPE *g_pfnCoInitializeEx)(void*, DWORD);
  66. COMINITEXTRN HRESULT (STDAPICALLTYPE *g_pfnCoCreateInstanceEx)(REFCLSID,IUnknown*,DWORD,COSERVERINFO*,
  67. DWORD, MULTI_QI*);
  68. COMINITEXTRN HRESULT (STDAPICALLTYPE *g_pfnCoSwitchCallContext)(IUnknown *pNewObject, IUnknown **ppOldObject);
  69. SCODE WINAPI GetAuthImp(IUnknown * pFrom, DWORD * pdwAuthLevel, DWORD * pdwImpLevel);
  70. SCODE WINAPI DetermineLoginType(BSTR & AuthArg, BSTR & UserArg,BSTR & Authority,BSTR & User);
  71. SCODE WINAPI DetermineLoginTypeEx(BSTR & AuthArg, BSTR & UserArg,BSTR & PrincipalArg,BSTR & Authority,BSTR & User);
  72. HRESULT WINAPI SetInterfaceSecurity(IUnknown * pInterface, LPWSTR pDomain, LPWSTR pUser, LPWSTR pPassword, IUnknown * pFrom, bool bAuthArg=true);
  73. HRESULT WINAPI SetInterfaceSecurity(IUnknown * pInterface, COAUTHIDENTITY * pauthident, bool bAuthenticate = true);
  74. HRESULT WINAPI SetInterfaceSecurity(IUnknown * pInterface, LPWSTR pDomain, LPWSTR pUser, LPWSTR pPassword, DWORD dwAuthLevel, DWORD dwImpLevel, DWORD dwCapabilities = 0);
  75. // Extended functions that maintain credential and principal information
  76. HRESULT WINAPI SetInterfaceSecurityEx(IUnknown * pInterface, LPWSTR pDomain, LPWSTR pUser, LPWSTR pPassword, DWORD dwAuthLevel, DWORD dwImpLevel, DWORD dwCapabilities,
  77. COAUTHIDENTITY** ppAuthIdent, BSTR* ppPrinciple, bool GetInfoFirst=false );
  78. HRESULT WINAPI SetInterfaceSecurityEx(IUnknown * pInterface, COAUTHIDENTITY* pAuthIdent, BSTR pPrincipal,
  79. DWORD dwAuthLevel, DWORD dwImpLevel,
  80. DWORD dwCapabilities = 0, bool GetInfoFirst=false);
  81. HRESULT WINAPI WbemAllocAuthIdentity( LPCWSTR pUser, LPCWSTR pPassword, LPCWSTR pDomain, COAUTHIDENTITY** pAuthIdent );
  82. HRESULT WINAPI WbemFreeAuthIdentity( COAUTHIDENTITY* pAuthIdent );
  83. BOOL WINAPI DoesContainCredentials( COAUTHIDENTITY* pAuthIdent );
  84. void WINAPI CloseStuff();
  85. // Encryption/Decryption support
  86. HRESULT WINAPI SetInterfaceSecurityEncrypt(IUnknown * pInterface, LPWSTR pDomain, LPWSTR pUser, LPWSTR pPassword, DWORD dwAuthLevel, DWORD dwImpLevel, DWORD dwCapabilities,
  87. COAUTHIDENTITY** ppAuthIdent, BSTR* ppPrinciple, bool GetInfoFirst=false );
  88. HRESULT WINAPI SetInterfaceSecurityDecrypt(IUnknown * pInterface, COAUTHIDENTITY* pAuthIdent, BSTR pPrincipal,
  89. DWORD dwAuthLevel, DWORD dwImpLevel,
  90. DWORD dwCapabilities = 0, bool GetInfoFirst=false);
  91. HRESULT WINAPI EncryptCredentials( COAUTHIDENTITY* pAuthIdent );
  92. HRESULT WINAPI DecryptCredentials( COAUTHIDENTITY* pAuthIdent );
  93. #endif // _COMINIT_H_