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.

79 lines
2.0 KiB

  1. //*************************************************************
  2. //
  3. // Events.h - header file for events.c
  4. //
  5. // Microsoft Confidential
  6. // Copyright (c) Microsoft Corporation 1995
  7. // All rights reserved
  8. //
  9. //*************************************************************
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. // Events type
  14. #define EVENT_ERROR_TYPE 0x00010000
  15. #define EVENT_WARNING_TYPE 0x00020000
  16. #define EVENT_INFO_TYPE 0x00040000
  17. BOOL InitializeEvents (void);
  18. int LogEvent (DWORD dwFlags, UINT idMsg, ...);
  19. BOOL ShutdownEvents (void);
  20. int ReportError (HANDLE hTokenUser, DWORD dwFlags, DWORD dwArgCount, UINT idMsg, ... );
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24. #ifdef __cplusplus
  25. #include "smartptr.h"
  26. class CEvents
  27. {
  28. private:
  29. DWORD m_dwEventType; // the kind of error to log
  30. DWORD m_dwId; // id of the msg
  31. XPtrLF<LPTSTR> m_xlpStrings; // Array to store arguments
  32. WORD m_cStrings; // Number of elements already in the array
  33. WORD m_cAllocated; // Number of elements allocated
  34. BOOL m_bInitialised; // Initialised ?
  35. BOOL m_bFailed; // Failed in processing ?
  36. // Not implemented.
  37. CEvents(const CEvents& x);
  38. CEvents& operator=(const CEvents& x);
  39. BOOL ReallocArgStrings();
  40. public:
  41. CEvents(DWORD bError, DWORD dwId );
  42. BOOL AddArg(LPTSTR szArg);
  43. BOOL AddArg(LPTSTR szArgFormat, LPTSTR szArg );
  44. BOOL AddArg(DWORD dwArg);
  45. BOOL AddArgHex(DWORD dwArg);
  46. BOOL AddArgWin32Error(DWORD dwArg);
  47. BOOL AddArgLdapError(DWORD dwArg);
  48. BOOL Report();
  49. LPTSTR FormatString();
  50. ~CEvents();
  51. };
  52. typedef struct _ERRORSTRUCT {
  53. DWORD dwTimeOut;
  54. LPTSTR lpErrorText;
  55. } ERRORSTRUCT, *LPERRORSTRUCT;
  56. void ErrorDialogEx(DWORD dwTimeOut, LPTSTR lpErrMsg);
  57. #endif