Source code of Windows XP (NT5)
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
2.8 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 DIR_ACCESS_ALL GENERIC_ALL | DELETE | READ_CONTROL | SYNCHRONIZE | SPECIFIC_RIGHTS_ALL
  50. #define ACCESS_ALL GENERIC_READ | GENERIC_WRITE | DELETE | READ_CONTROL | SYNCHRONIZE | SPECIFIC_RIGHTS_ALL
  51. #define ACCESS_RW GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE
  52. const WCHAR c_wszQSubdir[] = L"PCHealth\\ErrorRep\\UserDumps";
  53. const WCHAR c_wszDWMCmdLine64[] = L"\"%ls\\dumprep.exe\" %ld -H%c %ld \"%ls\"";
  54. const WCHAR c_wszDWMCmdLine32[] = L"\"%ls\\dumprep.exe\" %ld -H %ld \"%ls\"";
  55. const WCHAR c_wszERSvc[] = L"ersvc";
  56. const WCHAR c_wszFaultPipe[] = ERRORREP_FAULT_PIPENAME;
  57. const WCHAR c_wszHangPipe[] = ERRORREP_HANG_PIPENAME;
  58. //////////////////////////////////////////////////////////////////////////////
  59. // globals
  60. extern CRITICAL_SECTION g_csReqs;
  61. extern HINSTANCE g_hInstance;
  62. extern HANDLE g_hevSvcStop;
  63. //////////////////////////////////////////////////////////////////////////////
  64. // prototypes
  65. // utility prototypes
  66. BOOL StartERSvc(SERVICE_STATUS_HANDLE hss, SERVICE_STATUS &ss,
  67. SRequest **prgReqs, DWORD *pcReqs);
  68. BOOL StopERSvc(SERVICE_STATUS_HANDLE hss, SERVICE_STATUS &ss,
  69. SRequest *rgReqs, DWORD cReqs);
  70. BOOL ProcessRequests(SRequest *rgReqs, DWORD cReqs);
  71. // pipe function prototypes
  72. BOOL ProcessFaultRequest(HANDLE hPipe, PBYTE pBuf, DWORD *pcbBuf);
  73. BOOL ProcessHangRequest(HANDLE hPipe, PBYTE pBuf, DWORD *pcbBuf);
  74. //misc
  75. void InitializeSvcDataStructs(void);
  76. //////////////////////////////////////////////////////////////////////////////
  77. // macros
  78. #endif