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.

107 lines
3.0 KiB

  1. /******************************************************************************
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. ers.h
  5. Revision History:
  6. derekm 02/28/2001 created
  7. ******************************************************************************/
  8. #ifndef ERS_H
  9. #define ERS_H
  10. //////////////////////////////////////////////////////////////////////////////
  11. // structs, enums, & types
  12. struct SRequest;
  13. typedef BOOL (*REQUEST_FN)(HANDLE, PBYTE, DWORD *);
  14. enum ERequestThreadId
  15. {
  16. ertiHang = 0,
  17. ertiFault,
  18. ertiCount,
  19. };
  20. enum ERequestStatus
  21. {
  22. ersEmpty = 0,
  23. ersWaiting,
  24. ersProcessing,
  25. };
  26. struct SRequestEventType
  27. {
  28. SECURITY_DESCRIPTOR *psd;
  29. REQUEST_FN pfn;
  30. LPCWSTR wszPipeName;
  31. LPCWSTR wszRVPipeCount;
  32. DWORD cPipes;
  33. BOOL fAllowNonLS;
  34. };
  35. // the critical section member MUST be the first member in the structure.
  36. // BuildRequestObj assumes that it is.
  37. struct SRequest
  38. {
  39. CRITICAL_SECTION csReq;
  40. SRequestEventType *pret;
  41. ERequestStatus ers;
  42. OVERLAPPED ol;
  43. HANDLE hPipe;
  44. HANDLE hth;
  45. HMODULE hModErsvc;
  46. };
  47. //////////////////////////////////////////////////////////////////////////////
  48. // defines & constants
  49. #define ACCESS_ALL GENERIC_ALL | STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL
  50. #define ACCESS_RW GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE
  51. #define ER_ACCESS_ALL GENERIC_ALL | DELETE | READ_CONTROL | SYNCHRONIZE | SPECIFIC_RIGHTS_ALL
  52. // #define ER_ACCESS_ALL GENERIC_ALL | STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL
  53. const WCHAR c_wszQSubdir[] = L"PCHealth\\ErrorRep\\UserDumps";
  54. const WCHAR c_wszDWMCmdLine64[] = L"\"%ls\\dumprep.exe\" %ld -H%c %ld \"%ls\"";
  55. const WCHAR c_wszDWMCmdLine32[] = L"\"%ls\\dumprep.exe\" %ld -H %ld \"%ls\"";
  56. const WCHAR c_wszERSvc[] = L"ersvc";
  57. const WCHAR c_wszFaultPipe[] = ERRORREP_FAULT_PIPENAME;
  58. const WCHAR c_wszHangPipe[] = ERRORREP_HANG_PIPENAME;
  59. //////////////////////////////////////////////////////////////////////////////
  60. // globals
  61. extern CRITICAL_SECTION g_csReqs;
  62. extern HINSTANCE g_hInstance;
  63. extern HANDLE g_hevSvcStop;
  64. //////////////////////////////////////////////////////////////////////////////
  65. // prototypes
  66. // utility prototypes
  67. BOOL StartERSvc(SERVICE_STATUS_HANDLE hss, SERVICE_STATUS &ss,
  68. SRequest **prgReqs, DWORD *pcReqs);
  69. BOOL StopERSvc(SERVICE_STATUS_HANDLE hss, SERVICE_STATUS &ss,
  70. SRequest *rgReqs, DWORD cReqs);
  71. BOOL ProcessRequests(SRequest *rgReqs, DWORD cReqs);
  72. // pipe function prototypes
  73. BOOL ProcessFaultRequest(HANDLE hPipe, PBYTE pBuf, DWORD *pcbBuf);
  74. BOOL ProcessHangRequest(HANDLE hPipe, PBYTE pBuf, DWORD *pcbBuf);
  75. //misc
  76. void InitializeSvcDataStructs(void);
  77. //////////////////////////////////////////////////////////////////////////////
  78. // macros
  79. #endif