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.

65 lines
1.6 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // auditor.cpp
  8. //
  9. // SYNOPSIS
  10. //
  11. // This file defines the class Auditor
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 02/27/1998 Original version.
  16. // 08/13/1998 Minor clean up.
  17. //
  18. ///////////////////////////////////////////////////////////////////////////////
  19. #include <iascore.h>
  20. #include <iasutil.h>
  21. #include <auditor.h>
  22. HRESULT Auditor::Initialize()
  23. {
  24. //////////
  25. // Connect to the audit channel.
  26. //////////
  27. CLSID clsid;
  28. RETURN_ERROR(CLSIDFromProgID(IAS_PROGID(AuditChannel), &clsid));
  29. CComPtr<IAuditSource> channel;
  30. RETURN_ERROR(CoCreateInstance(clsid,
  31. NULL,
  32. CLSCTX_INPROC_SERVER,
  33. __uuidof(IAuditSource),
  34. (PVOID*)&channel));
  35. return channel->Connect(this);
  36. }
  37. STDMETHODIMP Auditor::Shutdown()
  38. {
  39. //////////
  40. // Disconnect from the audit channel.
  41. //////////
  42. CLSID clsid;
  43. RETURN_ERROR(CLSIDFromProgID(IAS_PROGID(AuditChannel), &clsid));
  44. CComPtr<IAuditSource> channel;
  45. RETURN_ERROR(CoCreateInstance(clsid,
  46. NULL,
  47. CLSCTX_INPROC_SERVER,
  48. __uuidof(IAuditSource),
  49. (PVOID*)&channel));
  50. // Ignore disconnect errors.
  51. channel->Disconnect(this);
  52. return S_OK;
  53. }