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.

92 lines
1.9 KiB

  1. // WMDMLogger.h : Declaration of the CWMDMLogger
  2. #ifndef __WMDMLOGGER_H_
  3. #define __WMDMLOGGER_H_
  4. #include "resource.h" // main symbols
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CWMDMLogger
  7. class ATL_NO_VTABLE CWMDMLogger :
  8. public CComObjectRootEx<CComSingleThreadModel>,
  9. public CComCoClass<CWMDMLogger, &CLSID_WMDMLogger>,
  10. public IWMDMLogger
  11. {
  12. public:
  13. CWMDMLogger();
  14. ~CWMDMLogger();
  15. DECLARE_REGISTRY_RESOURCEID(IDR_WMDMLOGGER)
  16. BEGIN_COM_MAP(CWMDMLogger)
  17. COM_INTERFACE_ENTRY(IWMDMLogger)
  18. END_COM_MAP()
  19. public:
  20. // IWMDMLogger Methods
  21. //
  22. STDMETHOD(IsEnabled)(
  23. BOOL *pfEnabled
  24. );
  25. STDMETHOD(Enable)(
  26. BOOL fEnable
  27. );
  28. STDMETHOD(GetLogFileName)(
  29. LPSTR pszFilename,
  30. UINT nMaxChars
  31. );
  32. STDMETHOD(SetLogFileName)(
  33. LPSTR pszFilename
  34. );
  35. STDMETHOD(LogString)(
  36. DWORD dwFlags,
  37. LPSTR pszSrcName,
  38. LPSTR pszLog
  39. );
  40. STDMETHOD(LogDword)(
  41. DWORD dwFlags,
  42. LPSTR pszSrcName,
  43. LPSTR pszLogFormat,
  44. DWORD dwLog
  45. );
  46. STDMETHOD(Reset)(
  47. void
  48. );
  49. STDMETHOD(GetSizeParams)(
  50. LPDWORD pdwMaxSize,
  51. LPDWORD pdwShrinkToSize
  52. );
  53. STDMETHOD(SetSizeParams)(
  54. DWORD dwMaxSize,
  55. DWORD dwShrinkToSize
  56. );
  57. private:
  58. HINSTANCE m_hInst;
  59. HRESULT m_hrInit;
  60. CHAR m_szFilename[MAX_PATH];
  61. BOOL m_fEnabled;
  62. DWORD m_dwMaxSize;
  63. DWORD m_dwShrinkToSize;
  64. HANDLE m_hMutexRegistry;
  65. HANDLE m_hMutexLogFile;
  66. HRESULT hrEnable( BOOL fEnable );
  67. HRESULT hrGetResourceDword( UINT uStrID, LPDWORD pdw );
  68. HRESULT hrLoadRegistryValues( void );
  69. HRESULT hrGetDefaultFileName( LPSTR szFilename, DWORD cchFilename );
  70. HRESULT hrSetLogFileName( LPSTR pszFilename );
  71. HRESULT hrSetSizeParams( DWORD dwMaxSize, DWORD dwShrinkToSize );
  72. HRESULT hrCheckFileSize( void );
  73. HRESULT hrWaitForAccess( HANDLE hMutex );
  74. };
  75. #endif //__WMDMLOGGER_H_