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.

164 lines
4.4 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntcsrmsg.h
  5. Abstract:
  6. This module defines the public message format shared by the client and
  7. server sides of the Client-Server Runtime (Csr) Subsystem.
  8. Author:
  9. Steve Wood (stevewo) 09-Oct-1990
  10. Revision History:
  11. --*/
  12. #ifndef _NTCSRMSG_
  13. #define _NTCSRMSG_
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #define CSR_API_PORT_NAME L"ApiPort"
  21. //
  22. // This structure is filled in by the client prior to connecting to the CSR
  23. // server. The CSR server will fill in the OUT fields if prior to accepting
  24. // the connection.
  25. //
  26. typedef struct _CSR_API_CONNECTINFO {
  27. IN ULONG ExpectedVersion;
  28. OUT ULONG CurrentVersion;
  29. OUT HANDLE ObjectDirectory;
  30. OUT PVOID SharedSectionBase;
  31. OUT PVOID SharedStaticServerData;
  32. OUT PVOID SharedSectionHeap;
  33. OUT ULONG DebugFlags;
  34. OUT ULONG SizeOfPebData;
  35. OUT ULONG SizeOfTebData;
  36. OUT ULONG NumberOfServerDllNames;
  37. OUT HANDLE ServerProcessId;
  38. } CSR_API_CONNECTINFO, *PCSR_API_CONNECTINFO;
  39. #define CSR_VERSION 0x10000
  40. //
  41. // Message format for messages sent from the client to the server
  42. //
  43. typedef struct _CSR_CLIENTCONNECT_MSG {
  44. IN ULONG ServerDllIndex;
  45. IN OUT PVOID ConnectionInformation;
  46. IN OUT ULONG ConnectionInformationLength;
  47. } CSR_CLIENTCONNECT_MSG, *PCSR_CLIENTCONNECT_MSG;
  48. typedef struct _CSR_THREADCONNECT_MSG {
  49. HANDLE SectionHandle;
  50. HANDLE EventPairHandle;
  51. OUT PCHAR MessageStack;
  52. OUT ULONG MessageStackSize;
  53. OUT ULONG RemoteViewDelta;
  54. } CSR_THREADCONNECT_MSG, *PCSR_THREADCONNECT_MSG;
  55. #define CSR_PROFILE_START 0x00000001
  56. #define CSR_PROFILE_STOP 0x00000002
  57. #define CSR_PROFILE_DUMP 0x00000003
  58. #define CSR_PROFILE_STOPDUMP 0x00000004
  59. typedef struct _CSR_PROFILE_CONTROL_MSG {
  60. IN ULONG ProfileControlFlag;
  61. } CSR_PROFILE_CONTROL_MSG, *PCSR_PROFILE_CONTROL_MSG;
  62. typedef struct _CSR_IDENTIFY_ALERTABLE_MSG {
  63. IN CLIENT_ID ClientId;
  64. } CSR_IDENTIFY_ALERTABLE_MSG, *PCSR_IDENTIFY_ALERTABLE_MSG;
  65. #define CSR_NORMAL_PRIORITY_CLASS 0x00000010
  66. #define CSR_IDLE_PRIORITY_CLASS 0x00000020
  67. #define CSR_HIGH_PRIORITY_CLASS 0x00000040
  68. #define CSR_REALTIME_PRIORITY_CLASS 0x00000080
  69. typedef struct _CSR_SETPRIORITY_CLASS_MSG {
  70. IN HANDLE ProcessHandle;
  71. IN ULONG PriorityClass;
  72. } CSR_SETPRIORITY_CLASS_MSG, *PCSR_SETPRIORITY_CLASS_MSG;
  73. //
  74. // This helps out the Wow64 thunk generater, so we can change
  75. // RelatedCaptureBuffer from struct _CSR_CAPTURE_HEADER* to PCSR_CAPTURE_HEADER.
  76. // Redundant typedefs are legal, so we leave the usual form in as well.
  77. //
  78. struct _CSR_CAPTURE_HEADER;
  79. typedef struct _CSR_CAPTURE_HEADER CSR_CAPTURE_HEADER, *PCSR_CAPTURE_HEADER;
  80. typedef struct _CSR_CAPTURE_HEADER {
  81. ULONG Length;
  82. PCSR_CAPTURE_HEADER RelatedCaptureBuffer;
  83. ULONG CountMessagePointers;
  84. PCHAR FreeSpace;
  85. ULONG_PTR MessagePointerOffsets[1]; // Offsets within CSR_API_MSG of pointers
  86. } CSR_CAPTURE_HEADER, *PCSR_CAPTURE_HEADER;
  87. typedef ULONG CSR_API_NUMBER;
  88. typedef struct _CSR_API_MSG {
  89. PORT_MESSAGE h;
  90. union {
  91. CSR_API_CONNECTINFO ConnectionRequest;
  92. struct {
  93. PCSR_CAPTURE_HEADER CaptureBuffer;
  94. CSR_API_NUMBER ApiNumber;
  95. ULONG ReturnValue;
  96. ULONG Reserved;
  97. union {
  98. CSR_CLIENTCONNECT_MSG ClientConnect;
  99. CSR_THREADCONNECT_MSG ThreadConnect;
  100. CSR_PROFILE_CONTROL_MSG ProfileControl;
  101. CSR_IDENTIFY_ALERTABLE_MSG IdentifyAlertable;
  102. CSR_SETPRIORITY_CLASS_MSG PriorityClass;
  103. ULONG_PTR ApiMessageData[39];
  104. } u;
  105. };
  106. };
  107. } CSR_API_MSG, *PCSR_API_MSG;
  108. #define WINSS_OBJECT_DIRECTORY_NAME L"\\Windows"
  109. #define CSRSRV_SERVERDLL_INDEX 0
  110. #define CSRSRV_FIRST_API_NUMBER 0
  111. #define BASESRV_SERVERDLL_INDEX 1
  112. #define BASESRV_FIRST_API_NUMBER 0
  113. #define CONSRV_SERVERDLL_INDEX 2
  114. #define CONSRV_FIRST_API_NUMBER 512
  115. #define USERSRV_SERVERDLL_INDEX 3
  116. #define USERSRV_FIRST_API_NUMBER 1024
  117. #define CSR_MAKE_API_NUMBER( DllIndex, ApiIndex ) \
  118. (CSR_API_NUMBER)(((DllIndex) << 16) | (ApiIndex))
  119. #define CSR_APINUMBER_TO_SERVERDLLINDEX( ApiNumber ) \
  120. ((ULONG)((ULONG)(ApiNumber) >> 16))
  121. #define CSR_APINUMBER_TO_APITABLEINDEX( ApiNumber ) \
  122. ((ULONG)((USHORT)(ApiNumber)))
  123. #ifdef __cplusplus
  124. }
  125. #endif
  126. #endif // _NTCSRMSG_