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.

98 lines
3.0 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // SYNOPSIS
  6. //
  7. // Declares the class LocalFile
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef LOCALFILE_H
  11. #define LOCALFILE_H
  12. #pragma once
  13. #include "lmcons.h"
  14. #include "account.h"
  15. #include "logfile.h"
  16. #include "resource.h"
  17. class FormattedBuffer;
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // CLASS
  21. //
  22. // LocalFile
  23. //
  24. ///////////////////////////////////////////////////////////////////////////////
  25. class ATL_NO_VTABLE LocalFile
  26. : public Accountant,
  27. public CComCoClass<LocalFile, &__uuidof(Accounting)>
  28. {
  29. public:
  30. IAS_DECLARE_REGISTRY(Accounting, 1, IAS_REGISTRY_AUTO, IASTypeLibrary)
  31. IAS_DECLARE_OBJECT_ID(IAS_PROVIDER_MICROSOFT_ACCOUNTING)
  32. LocalFile() throw ();
  33. protected:
  34. // IIasComponent
  35. STDMETHOD(Initialize)();
  36. STDMETHOD(Shutdown)();
  37. STDMETHOD(PutProperty)(LONG Id, VARIANT* pValue);
  38. private:
  39. virtual void Process(IASTL::IASRequest& request);
  40. virtual void InsertRecord(
  41. void* context,
  42. IASTL::IASRequest& request,
  43. const SYSTEMTIME& localTime,
  44. PATTRIBUTEPOSITION first,
  45. PATTRIBUTEPOSITION last
  46. );
  47. virtual void Flush(
  48. void* context,
  49. IASTL::IASRequest& request,
  50. const SYSTEMTIME& localTime
  51. );
  52. // Signature of a record formatter.
  53. typedef void (__stdcall LocalFile::*Formatter)(
  54. IASTL::IASRequest& request,
  55. FormattedBuffer& buffer,
  56. const SYSTEMTIME& localTime,
  57. PATTRIBUTEPOSITION firstPos,
  58. PATTRIBUTEPOSITION lastPos
  59. ) const;
  60. // Formatter for ODBC records.
  61. void __stdcall formatODBCRecord(
  62. IASTL::IASRequest& request,
  63. FormattedBuffer& buffer,
  64. const SYSTEMTIME& localTime,
  65. PATTRIBUTEPOSITION firstPos,
  66. PATTRIBUTEPOSITION lastPos
  67. ) const;
  68. // Formatter for W3C records.
  69. void __stdcall formatW3CRecord(
  70. IASTL::IASRequest& request,
  71. FormattedBuffer& buffer,
  72. const SYSTEMTIME& localTime,
  73. PATTRIBUTEPOSITION firstPos,
  74. PATTRIBUTEPOSITION lastPos
  75. ) const;
  76. LogFile log; // Log file.
  77. Formatter format; // Pointer to member function being used for formatting.
  78. // Cached computername in UTF-8.
  79. CHAR computerName[MAX_COMPUTERNAME_LENGTH * 3];
  80. DWORD computerNameLen;
  81. };
  82. #endif // LOCALFILE_H