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.

114 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 1995-1996 Microsoft Corporation
  3. Module Name :
  4. odblogc.h
  5. Abstract:
  6. NCSA Logging Format implementation
  7. Author:
  8. Terence Kwan ( terryk ) 18-Sep-1996
  9. Project:
  10. IIS Logging 3.0
  11. --*/
  12. #ifndef _ODBLOGC_H_
  13. #define _ODBLOGC_H_
  14. #include "lmcons.h"
  15. class CODBCLOG :
  16. public ILogPlugin,
  17. public CComCoClass<CODBCLOG, &CLSID_ODBCLOG>,
  18. public CComObjectRootEx<CComMultiThreadModel> {
  19. public:
  20. CODBCLOG();
  21. VOID Lock( VOID) {EnterCriticalSection( &m_csLock); }
  22. VOID Unlock( VOID) {LeaveCriticalSection( &m_csLock); }
  23. DWORD GetRegParameters( LPCSTR strRegKey, LPVOID pMetabase );
  24. DWORD GetRegParametersFromPublicInterface(LPCSTR strRegKey,
  25. LPVOID pMetabase);
  26. BOOL PrepareStatement(VOID);
  27. BOOL PrepareParameters(VOID);
  28. LPCSTR QueryServiceName( VOID) const { return m_rgchServiceName; }
  29. LPCSTR QueryServerName( VOID) const { return m_rgchServerName; }
  30. LPCSTR QueryDefaultUserName() const { return _T("-"); }
  31. protected:
  32. ~CODBCLOG();
  33. public:
  34. //
  35. // ATL Interface
  36. //
  37. DECLARE_NO_REGISTRY( );
  38. BEGIN_COM_MAP(CODBCLOG)
  39. COM_INTERFACE_ENTRY(ILogPlugin)
  40. END_COM_MAP()
  41. //
  42. // Plugin Interface
  43. //
  44. HRESULT STDMETHODCALLTYPE
  45. InitializeLog(
  46. IN LPCSTR InstanceName,
  47. IN LPCSTR MetabasePath,
  48. IN PCHAR pvIMDCOM );
  49. HRESULT STDMETHODCALLTYPE
  50. TerminateLog( VOID );
  51. HRESULT STDMETHODCALLTYPE
  52. LogInformation( IInetLogInformation *pLogObj );
  53. HRESULT STDMETHODCALLTYPE
  54. SetConfig( IN DWORD cbSize, PBYTE Log );
  55. HRESULT STDMETHODCALLTYPE
  56. GetConfig( IN DWORD cbSize, PBYTE Log );
  57. HRESULT STDMETHODCALLTYPE
  58. QueryExtraLoggingFields(PDWORD cbSize, PCHAR szParameters);
  59. private:
  60. CRITICAL_SECTION m_csLock;
  61. CHAR m_rgchDataSource[ MAX_DATABASE_NAME_LEN];
  62. CHAR m_rgchTableName[ MAX_TABLE_NAME_LEN];
  63. CHAR m_rgchUserName[ UNLEN + 1];
  64. CHAR m_rgchPassword[ UNLEN + 1];
  65. // count of odbc params to be logged.
  66. DWORD m_cOdbcParams;
  67. // odbc connection for connecting to DB
  68. PODBC_CONNECTION m_poc;
  69. // Odbc statement for inserting records.
  70. PODBC_STATEMENT m_poStmt;
  71. // array of odbc parameters.
  72. PODBC_PARAMETER * m_ppParams;
  73. CHAR m_rgchServiceName[ MAX_PATH + 1];
  74. CHAR m_rgchServerName[ MAX_PATH + 1];
  75. CHAR m_rgchMetabasePath[MAX_PATH + 1];
  76. bool m_fEnableEventLog;
  77. DWORD m_TickResumeOpen;
  78. };
  79. #endif // _ODBLOGC_H_