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.

81 lines
1.8 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // SYNOPSIS
  6. //
  7. // Defines the class LoggingMethod.
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #include "Precompiled.h"
  11. #include "logcomp.h"
  12. #include "logcompd.h"
  13. #include "loggingmethod.h"
  14. #include "loggingmethodsnode.h"
  15. #include "snapinnode.cpp"
  16. LoggingMethod::LoggingMethod(long sdoId, CSnapInItem* parent)
  17. : CSnapinNode<
  18. LoggingMethod,
  19. CLoggingComponentData,
  20. CLoggingComponent
  21. >(parent),
  22. componentId(sdoId)
  23. {
  24. }
  25. LoggingMethod::~LoggingMethod() throw ()
  26. {
  27. }
  28. HRESULT LoggingMethod::InitSdoPointers(ISdo* machine) throw ()
  29. {
  30. if (machine == 0)
  31. {
  32. return E_POINTER;
  33. }
  34. CComPtr<ISdo> newConfigSdo;
  35. HRESULT hr = SDOGetSdoFromCollection(
  36. machine,
  37. PROPERTY_IAS_REQUESTHANDLERS_COLLECTION,
  38. PROPERTY_COMPONENT_ID,
  39. componentId,
  40. &newConfigSdo
  41. );
  42. if (FAILED(hr))
  43. {
  44. return hr;
  45. }
  46. CComPtr<ISdoServiceControl> newControlSdo;
  47. hr = machine->QueryInterface(
  48. __uuidof(ISdoServiceControl),
  49. reinterpret_cast<void**>(&newControlSdo)
  50. );
  51. if (FAILED(hr))
  52. {
  53. return hr;
  54. }
  55. configSdo = newConfigSdo;
  56. controlSdo = newControlSdo;
  57. return LoadCachedInfoFromSdo();
  58. }
  59. CLoggingMethodsNode* LoggingMethod::Parent() const throw ()
  60. {
  61. return static_cast<CLoggingMethodsNode*>(m_pParentNode);
  62. }
  63. CLoggingComponentData* LoggingMethod::GetComponentData()
  64. {
  65. return (Parent() != 0) ? Parent()->GetComponentData() : 0;
  66. }