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.

237 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1998-2000 Microsoft Corporation
  3. Module Name :
  4. rdpdrp.h
  5. Abstract:
  6. Private prototypes, structures, and macros that are used throughout the
  7. driver.
  8. Revision History:
  9. --*/
  10. #pragma once
  11. // Dr's Pooltag (doctor! doctor!)
  12. #define DR_POOLTAG 'rDrD'
  13. // REVIEW: um, I just made these up. They are used to determine
  14. // how many outstandng irps we can have at one time
  15. #define DR_MAX_OPERATIONS 1024
  16. #define DR_TYPICAL_OPERATIONS 128
  17. // Indexes in to RxContext->MRxContext
  18. #define MRX_DR_CONTEXT 0
  19. #define INVALID_MID 0xFFFF
  20. // Session ID for console seession.
  21. #define CONSOLE_SESSIONID 0
  22. //
  23. // Flag values for configuring Devices to send IO packets to client at low priority.
  24. //
  25. #define DEVICE_LOWPRIOSEND_PRINTERS 0x00000000
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif // __cplusplus
  29. extern PRDBSS_DEVICE_OBJECT DrDeviceObject;
  30. NTKERNELAPI NTSTATUS IoGetRequestorSessionId(
  31. IN PIRP Irp,
  32. OUT PULONG pSessionId
  33. );
  34. NTKERNELAPI
  35. NTSTATUS
  36. IoOpenDeviceInterfaceRegistryKey(
  37. IN PUNICODE_STRING SymbolicLinkName,
  38. IN ACCESS_MASK DesiredAccess,
  39. OUT PHANDLE DeviceInterfaceKey
  40. );
  41. NTKERNELAPI
  42. NTSTATUS
  43. NTAPI
  44. IoRegisterDeviceInterface(
  45. IN PDEVICE_OBJECT PhysicalDeviceObject,
  46. IN CONST GUID *InterfaceClassGuid,
  47. IN PUNICODE_STRING ReferenceString, OPTIONAL
  48. OUT PUNICODE_STRING SymbolicLinkName
  49. );
  50. NTSYSAPI
  51. VOID
  52. NTAPI
  53. RtlGetDefaultCodePage(
  54. OUT PUSHORT AnsiCodePage,
  55. OUT PUSHORT OemCodePage
  56. );
  57. NTSTATUS
  58. ObSetSecurityObjectByPointer (
  59. IN PVOID Object,
  60. IN SECURITY_INFORMATION SecurityInformation,
  61. IN PSECURITY_DESCRIPTOR SecurityDescriptor
  62. );
  63. VOID
  64. DrUnload(
  65. IN PDRIVER_OBJECT DriverObject
  66. );
  67. NTSTATUS
  68. DrFlush(
  69. IN OUT PRX_CONTEXT RxContext
  70. );
  71. NTSTATUS
  72. DrWrite(
  73. IN OUT PRX_CONTEXT RxContext
  74. );
  75. NTSTATUS
  76. DrRead(
  77. IN OUT PRX_CONTEXT RxContext
  78. );
  79. NTSTATUS
  80. DrIoControl(
  81. IN OUT PRX_CONTEXT RxContext
  82. );
  83. NTSTATUS
  84. DrCreate(
  85. IN OUT PRX_CONTEXT RxContext
  86. );
  87. NTSTATUS
  88. DrCloseSrvOpen(
  89. IN OUT PRX_CONTEXT RxContext
  90. );
  91. NTSTATUS
  92. DrCleanup(
  93. IN OUT PRX_CONTEXT RxContext
  94. );
  95. NTSTATUS
  96. DrQueryInformationFile(
  97. IN OUT PRX_CONTEXT RxContext
  98. );
  99. NTSTATUS
  100. DrSetInformationFile(
  101. IN OUT PRX_CONTEXT RxContext
  102. );
  103. NTSTATUS
  104. DrDevFcbXXXControlFile (
  105. IN OUT PRX_CONTEXT RxContext
  106. );
  107. NTSTATUS
  108. DrOnSessionConnect(
  109. IN OUT PRX_CONTEXT RxContext
  110. );
  111. NTSTATUS
  112. DrOnSessionDisconnect(
  113. IN OUT PRX_CONTEXT RxContext
  114. );
  115. NTSTATUS
  116. DrDeallocateForFobx(
  117. IN OUT PMRX_FOBX pFobx
  118. );
  119. NTSTATUS
  120. DrForceClosed(
  121. IN PMRX_SRV_OPEN pSrvOpen
  122. );
  123. VOID
  124. DrStartMinirdr(
  125. PRX_CONTEXT RxContext
  126. );
  127. NTSTATUS
  128. DrEnumerateConnections (
  129. IN PRX_CONTEXT RxContext
  130. );
  131. NTSTATUS
  132. DrEnumerateShares (
  133. IN PRX_CONTEXT RxContext
  134. );
  135. NTSTATUS
  136. DrEnumerateServers (
  137. IN PRX_CONTEXT RxContext
  138. );
  139. NTSTATUS
  140. DrGetConnectionInfo (
  141. IN PRX_CONTEXT RxContext
  142. );
  143. NTSTATUS
  144. DrDeleteConnection (
  145. IN PRX_CONTEXT RxContext,
  146. OUT PBOOLEAN PostToFsp
  147. );
  148. VOID
  149. DrStartMinirdrWorker(
  150. IN PVOID StartContext
  151. );
  152. BOOLEAN
  153. DrFindChannelFromConnectIn(
  154. PULONG ChannelId,
  155. PCHANNEL_CONNECT_IN ConnectIn
  156. );
  157. BOOLEAN
  158. DrIsAdminIoRequest (
  159. PIRP Irp,
  160. PIO_STACK_LOCATION IrpSp
  161. );
  162. BOOLEAN
  163. DrIsSystemProcessRequest(
  164. PIRP Irp,
  165. PIO_STACK_LOCATION IrpSp
  166. );
  167. #ifdef __cplusplus
  168. } // extern "C"
  169. #endif // __cplusplus
  170. //
  171. // UNC server name
  172. //
  173. #define DRUNCSERVERNAME_U L"tsclient"
  174. #define DRUNCSERVERNAME_A "tsclient"
  175. // The following constant defines the length of the above name.
  176. #define DRUNCSERVERNAME_U_LENGTH (sizeof(DRUNCSERVERNAME_U))
  177. #define DRUNCSERVERNAME_A_LENGTH (sizeof(DRUNCSERVERNAME_A))
  178. extern HANDLE DrSystemProcessId;
  179. extern KSPIN_LOCK DrSpinLock;
  180. extern FAST_MUTEX DrMutex;
  181. extern KIRQL DrOldIrql;
  182. #define DrAcquireSpinLock() KeAcquireSpinLock(&DrSpinLock, &DrOldIrql)
  183. #define DrReleaseSpinLock() KeReleaseSpinLock(&DrSpinLock, DrOldIrql)
  184. #define DrAcquireMutex() ExAcquireFastMutex(&DrMutex)
  185. #define DrReleaseMutex() ExReleaseFastMutex(&DrMutex)
  186. #define IS_SYSTEM_PROCESS() (PsGetCurrentProcessId() == DrSystemProcessId)