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.

96 lines
2.0 KiB

  1. /*++
  2. Copyright (C) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. smalrtsv.cpp
  5. Abstract:
  6. This object is used to represent the alert query components of the
  7. sysmon log service
  8. --*/
  9. #include "Stdafx.h"
  10. #include "smalrtsv.h"
  11. //
  12. // Constructor
  13. CSmAlertService::CSmAlertService()
  14. {
  15. CString strTemp;
  16. ResourceStateManager rsm;
  17. // String allocation errors are thrown, to be
  18. // captured by rootnode alloc exception handler
  19. strTemp.LoadString ( IDS_SERVICE_NAME_ALERT );
  20. SetBaseName ( strTemp );
  21. strTemp.LoadString ( IDS_ALERT_NODE_DESCRIPTION );
  22. SetDescription( strTemp );
  23. }
  24. //
  25. // Destructor
  26. CSmAlertService::~CSmAlertService()
  27. {
  28. // Make sure Close method was called first!
  29. ASSERT ( NULL == m_QueryList.GetHeadPosition() );
  30. return;
  31. }
  32. PSLQUERY
  33. CSmAlertService::CreateQuery ( const CString& rstrName )
  34. {
  35. return ( CSmLogService::CreateTypedQuery( rstrName, SLQ_ALERT ) );
  36. }
  37. DWORD
  38. CSmAlertService::DeleteQuery (PSLQUERY pQuery)
  39. {
  40. ASSERT ( SLQ_ALERT == pQuery->GetLogType () );
  41. return ( CSmLogService::DeleteQuery( pQuery ) );
  42. }
  43. DWORD
  44. CSmAlertService::LoadQueries ( void )
  45. {
  46. return ( CSmLogService::LoadQueries( SLQ_ALERT ) );
  47. }
  48. //
  49. // Open function. Opens all existing alert entries.
  50. //
  51. DWORD
  52. CSmAlertService::Open ( const CString& rstrMachineName )
  53. {
  54. return ( CSmLogService::Open ( rstrMachineName ) );
  55. }
  56. //
  57. // Close Function
  58. // closes registry handles and frees allocated memory
  59. //
  60. DWORD
  61. CSmAlertService::Close ()
  62. {
  63. return ( CSmLogService::Close() );
  64. }
  65. //
  66. // SyncWithRegistry()
  67. // reads the current values for all queries from the registry
  68. // and reloads the internal values to match.
  69. //
  70. //
  71. DWORD
  72. CSmAlertService::SyncWithRegistry ( PSLQUERY* ppActiveQuery )
  73. {
  74. DWORD dwStatus = ERROR_SUCCESS;
  75. dwStatus = CSmLogService::SyncWithRegistry ( ppActiveQuery );
  76. return dwStatus;
  77. }