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.1 KiB

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