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.

137 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. extcom.cxx
  5. Abstract:
  6. IIS Services IISADMIN Extension
  7. Main COM interface.
  8. Class CadmExt
  9. CLSID = CLSID_SSLCONFIGPROV
  10. IID = IID_IADMEXT
  11. extension is used to launch SSL CONFIGURATION PROVIDER in the inetinfo
  12. that would enable strmfilt.dll to connect to named pipes and retrieve
  13. metabase data rather than using COM based metabase (ABO).
  14. Author:
  15. Michael W. Thomas 16-Sep-97
  16. --*/
  17. #include "precomp.hxx"
  18. //
  19. // Debug parameters registry key.
  20. //
  21. #define MODULE_NAME_A "sslcfg"
  22. #define REGISTRY_KEY_SSLCFG_PARAMETERS_A \
  23. "System\\CurrentControlSet\\Services\\w3svc\\Parameters\\" MODULE_NAME_A
  24. #include <initguid.h>
  25. CAdmExt::CAdmExt():
  26. m_dwRefCount(0)
  27. {
  28. }
  29. CAdmExt::~CAdmExt()
  30. {
  31. }
  32. HRESULT
  33. CAdmExt::QueryInterface(REFIID riid, void **ppObject) {
  34. if (riid==IID_IUnknown || riid==IID_IADMEXT) {
  35. *ppObject = (IADMEXT *) this;
  36. }
  37. else {
  38. *ppObject = NULL;
  39. return E_NOINTERFACE;
  40. }
  41. AddRef();
  42. return NO_ERROR;
  43. }
  44. ULONG
  45. CAdmExt::AddRef()
  46. {
  47. DWORD dwRefCount;
  48. InterlockedIncrement((long *)&g_dwRefCount);
  49. dwRefCount = InterlockedIncrement((long *)&m_dwRefCount);
  50. return dwRefCount;
  51. }
  52. ULONG
  53. CAdmExt::Release()
  54. {
  55. DWORD dwRefCount;
  56. InterlockedDecrement((long *)&g_dwRefCount);
  57. dwRefCount = InterlockedDecrement((long *)&m_dwRefCount);
  58. //
  59. // This is now a member of class factory.
  60. // It is not dynamically allocated, so don't delete it.
  61. //
  62. /*
  63. if (dwRefCount == 0) {
  64. delete this;
  65. return 0;
  66. }
  67. */
  68. return dwRefCount;
  69. }
  70. HRESULT STDMETHODCALLTYPE
  71. CAdmExt::Initialize(void)
  72. {
  73. HRESULT hr = E_FAIL;
  74. CREATE_DEBUG_PRINT_OBJECT( MODULE_NAME_A );
  75. LOAD_DEBUG_FLAGS_FROM_REG_STR( REGISTRY_KEY_SSLCFG_PARAMETERS_A , 0 );
  76. if (!VALID_DEBUG_PRINT_OBJECT())
  77. {
  78. return E_FAIL;
  79. }
  80. hr = m_SslConfigProvServer.Initialize();
  81. if ( FAILED( hr ) )
  82. {
  83. return hr;
  84. }
  85. hr = m_SslConfigChangeProvServer.Initialize();
  86. return hr;
  87. }
  88. HRESULT STDMETHODCALLTYPE
  89. CAdmExt::EnumDcomCLSIDs(
  90. /* [size_is][out] */ CLSID *pclsidDcom,
  91. /* [in] */ DWORD dwEnumIndex)
  92. {
  93. return HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS);
  94. }
  95. HRESULT STDMETHODCALLTYPE
  96. CAdmExt::Terminate(void)
  97. {
  98. HRESULT hr = E_FAIL;
  99. hr = m_SslConfigChangeProvServer.Terminate();
  100. DBG_ASSERT( SUCCEEDED( hr ) );
  101. hr = m_SslConfigProvServer.Terminate();
  102. DBG_ASSERT( SUCCEEDED( hr ) );
  103. return S_OK;
  104. }