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.

126 lines
3.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. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #define CSR_API_PORT_NAME L"ApiPort"
  18. //
  19. // This structure is filled in by the client prior to connecting to the CSR
  20. // server. The CSR server will fill in the OUT fields if prior to accepting
  21. // the connection.
  22. //
  23. typedef struct _CSR_API_CONNECTINFO {
  24. OUT HANDLE ObjectDirectory;
  25. OUT PVOID SharedSectionBase;
  26. OUT PVOID SharedStaticServerData;
  27. OUT PVOID SharedSectionHeap;
  28. OUT ULONG DebugFlags;
  29. OUT ULONG SizeOfPebData;
  30. OUT ULONG SizeOfTebData;
  31. OUT ULONG NumberOfServerDllNames;
  32. OUT HANDLE ServerProcessId;
  33. } CSR_API_CONNECTINFO, *PCSR_API_CONNECTINFO;
  34. //
  35. // Message format for messages sent from the client to the server
  36. //
  37. typedef struct _CSR_CLIENTCONNECT_MSG {
  38. IN ULONG ServerDllIndex;
  39. IN OUT PVOID ConnectionInformation;
  40. IN OUT ULONG ConnectionInformationLength;
  41. } CSR_CLIENTCONNECT_MSG, *PCSR_CLIENTCONNECT_MSG;
  42. #define CSR_NORMAL_PRIORITY_CLASS 0x00000010
  43. #define CSR_IDLE_PRIORITY_CLASS 0x00000020
  44. #define CSR_HIGH_PRIORITY_CLASS 0x00000040
  45. #define CSR_REALTIME_PRIORITY_CLASS 0x00000080
  46. //
  47. // This helps out the Wow64 thunk generater, so we can change
  48. // RelatedCaptureBuffer from struct _CSR_CAPTURE_HEADER* to PCSR_CAPTURE_HEADER.
  49. // Redundant typedefs are legal, so we leave the usual form in as well.
  50. //
  51. struct _CSR_CAPTURE_HEADER;
  52. typedef struct _CSR_CAPTURE_HEADER CSR_CAPTURE_HEADER, *PCSR_CAPTURE_HEADER;
  53. typedef struct _CSR_CAPTURE_HEADER {
  54. ULONG Length;
  55. PCSR_CAPTURE_HEADER RelatedCaptureBuffer;
  56. ULONG CountMessagePointers;
  57. PCHAR FreeSpace;
  58. ULONG_PTR MessagePointerOffsets[1]; // Offsets within CSR_API_MSG of pointers
  59. } CSR_CAPTURE_HEADER, *PCSR_CAPTURE_HEADER;
  60. typedef ULONG CSR_API_NUMBER;
  61. typedef struct _CSR_API_MSG {
  62. PORT_MESSAGE h;
  63. union {
  64. CSR_API_CONNECTINFO ConnectionRequest;
  65. struct {
  66. PCSR_CAPTURE_HEADER CaptureBuffer;
  67. CSR_API_NUMBER ApiNumber;
  68. ULONG ReturnValue;
  69. ULONG Reserved;
  70. union {
  71. CSR_CLIENTCONNECT_MSG ClientConnect;
  72. ULONG_PTR ApiMessageData[39];
  73. } u;
  74. };
  75. };
  76. } CSR_API_MSG, *PCSR_API_MSG;
  77. #define WINSS_OBJECT_DIRECTORY_NAME L"\\Windows"
  78. #define CSRSRV_SERVERDLL_INDEX 0
  79. #define CSRSRV_FIRST_API_NUMBER 0
  80. #define BASESRV_SERVERDLL_INDEX 1
  81. #define BASESRV_FIRST_API_NUMBER 0
  82. #define CONSRV_SERVERDLL_INDEX 2
  83. #define CONSRV_FIRST_API_NUMBER 512
  84. #define USERSRV_SERVERDLL_INDEX 3
  85. #define USERSRV_FIRST_API_NUMBER 1024
  86. #define CSR_MAKE_API_NUMBER( DllIndex, ApiIndex ) \
  87. (CSR_API_NUMBER)(((DllIndex) << 16) | (ApiIndex))
  88. #define CSR_APINUMBER_TO_SERVERDLLINDEX( ApiNumber ) \
  89. ((ULONG)((ULONG)(ApiNumber) >> 16))
  90. #define CSR_APINUMBER_TO_APITABLEINDEX( ApiNumber ) \
  91. ((ULONG)((USHORT)(ApiNumber)))
  92. #ifdef __cplusplus
  93. }
  94. #endif
  95. #endif