Windows NT 4.0 source code leak
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.

296 lines
6.2 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. bowser.h
  5. Abstract:
  6. This module is the main header file for the NT redirector file
  7. system.
  8. Author:
  9. Darryl Havens (darrylh) 29-Jun-1989
  10. Larry Osterman (larryo) 06-May-1991
  11. Revision History:
  12. --*/
  13. #ifndef _BOWSER_
  14. #define _BOWSER_
  15. #ifndef BOWSERDBG
  16. #define BOWSERDBG 0
  17. #endif
  18. //
  19. //
  20. // Global include file definitions
  21. //
  22. //
  23. #include <ntddbrow.h> // Browser FSCTL defs.
  24. #include <lmcons.h> // Include global network constants
  25. #include <tdikrnl.h>
  26. #include <tdi.h>
  27. #include <smbtypes.h>
  28. #include <smb.h>
  29. #include <smbtrans.h>
  30. #include <smbgtpt.h>
  31. #include <smbipx.h>
  32. #include <hostannc.h> // Host announcement structures.
  33. #include <lmserver.h>
  34. //
  35. //
  36. // Separate include file definitions
  37. //
  38. //
  39. //
  40. #include "bowpub.h" // Public bowser definitions.
  41. #include "bowtypes.h" // Bowser structure type definitions.
  42. #include "debug.h" // Debugging definitions.
  43. #include "workque.h" // FSP/FSD worker queue functions.
  44. #include "bowdata.h" // Global data variables.
  45. #include "fspdisp.h" // Global FSP dispatch definitions.
  46. #include "fsddisp.h" // Global FSP dispatch definitions.
  47. #include "bowname.h" // Bowser name structure definitions.
  48. #include "bowtimer.h" // Timer related routines
  49. #include "bowtdi.h" // Bowser TDI specific definitions.
  50. #include "receive.h" // Bowser receive engine code.
  51. #include "announce.h" // Announcement related stuff
  52. #include "mailslot.h" // Mailslot specific routines
  53. #include "bowelect.h" // Election routines
  54. #include "bowmastr.h" // Master related routines.
  55. #include "bowbackp.h" // Backup related routines.
  56. #include "brsrvlst.h" // Definitions for browser server list.
  57. #include "bowipx.h"
  58. #include <wchar.h> // CRT wide character routines
  59. #include "..\rdr\disccode.h"
  60. //++
  61. //
  62. // VOID
  63. // BowserCompleteRequest (
  64. // IN PIRP Irp,
  65. // IN NTSTATUS Status
  66. // );
  67. //
  68. // Routine Description:
  69. //
  70. // This routine is used to complete an IRP with the indicated
  71. // status. It does the necessary raise and lower of IRQL.
  72. //
  73. // Arguments:
  74. //
  75. // Irp - Supplies a pointer to the Irp to complete
  76. //
  77. // Status - Supplies the completion status for the Irp
  78. //
  79. // Return Value:
  80. //
  81. // None.
  82. //
  83. //--
  84. #define BowserCompleteRequest(IRP,STATUS) { \
  85. (IRP)->IoStatus.Status = (STATUS); \
  86. if (NT_ERROR((STATUS))) { \
  87. (IRP)->IoStatus.Information = 0; \
  88. } \
  89. IoCompleteRequest( (IRP), 0 ); \
  90. }
  91. //
  92. // The following macros are used to establish the semantics needed
  93. // to do a return from within a try-finally clause. As a rule every
  94. // try clause must end with a label call try_exit. For example,
  95. //
  96. // try {
  97. // :
  98. // :
  99. //
  100. // try_exit: NOTHING;
  101. // } finally {
  102. //
  103. // :
  104. // :
  105. // }
  106. //
  107. // Every return statement executed inside of a try clause should use the
  108. // try_return macro. If the compiler fully supports the try-finally construct
  109. // then the macro should be
  110. //
  111. // #define try_return(S) { return(S); }
  112. //
  113. // If the compiler does not support the try-finally construct then the macro
  114. // should be
  115. //
  116. #define try_return(S) { S; goto try_exit; }
  117. //
  118. //
  119. // This macro returns TRUE if a flag in a set of flags is on and FALSE
  120. // otherwise. It is followed by two macros for setting and clearing
  121. // flags
  122. //
  123. #define BooleanFlagOn(Flags,SingleFlag) ((BOOLEAN)((((Flags) & (SingleFlag)) != 0)))
  124. #define SetFlag(Flags,SingleFlag) { \
  125. (Flags) |= (SingleFlag); \
  126. }
  127. #define ClearFlag(Flags,SingleFlag) { \
  128. (Flags) &= ~(SingleFlag); \
  129. }
  130. #ifdef _M_IX86
  131. #define INLINE _inline
  132. #else
  133. #define INLINE
  134. #endif
  135. NTSTATUS
  136. BowserStopProcessingAnnouncements(
  137. IN PTRANSPORT_NAME TransportName,
  138. IN PVOID Context
  139. );
  140. BOOLEAN
  141. BowserMapUsersBuffer (
  142. IN PIRP Irp,
  143. OUT PVOID *UserBuffer,
  144. IN ULONG Length
  145. );
  146. VOID
  147. BowserUnMapUsersBuffer (
  148. IN PIRP Irp,
  149. IN PVOID UserBuffer
  150. );
  151. NTSTATUS
  152. BowserLockUsersBuffer (
  153. IN PIRP Irp,
  154. IN LOCK_OPERATION Operation,
  155. IN ULONG BufferLength
  156. );
  157. NTSTATUS
  158. BowserConvertType3IoControlToType2IoControl (
  159. IN PIRP Irp,
  160. IN PIO_STACK_LOCATION IrpSp
  161. );
  162. ULONG
  163. BowserPackNtString(
  164. PUNICODE_STRING string,
  165. ULONG BufferDisplacement,
  166. PCHAR dataend,
  167. PCHAR * laststring
  168. );
  169. ULONG
  170. BowserPackString(
  171. IN OUT LPTSTR * string, // pointer by reference: string to be copied.
  172. IN ULONG OutputBufferDisplacement, // Amount to subtract from output buffer
  173. IN LPTSTR dataend, // pointer to end of fixed size data.
  174. IN OUT LPTSTR * laststring // pointer by reference: top of string data.
  175. );
  176. ULONG
  177. BowserPackUnicodeString(
  178. IN OUT PWSTR * string, // pointer by reference: string to be copied.
  179. IN ULONG StringLength, // Length of this string.
  180. IN ULONG OutputBufferDisplacement, // Amount to subtract from output buffer
  181. IN PVOID dataend, // pointer to end of fixed size data.
  182. IN OUT PVOID * laststring // pointer by reference: top of string data.
  183. );
  184. ULONG
  185. BowserTimeUp(
  186. VOID
  187. );
  188. ULONG
  189. BowserRandom(
  190. ULONG MaxValue
  191. );
  192. VOID
  193. _cdecl
  194. BowserWriteErrorLogEntry(
  195. IN ULONG UniqueErrorCode,
  196. IN NTSTATUS NtStatusCode,
  197. IN PVOID ExtraInformationBuffer,
  198. IN USHORT ExtraInformationLength,
  199. IN USHORT NumberOfInsertionStrings,
  200. ...
  201. );
  202. VOID
  203. BowserInitializeFsd(
  204. VOID
  205. );
  206. VOID
  207. BowserReferenceDiscardableCode(
  208. DISCARDABLE_SECTION_NAME SectionName
  209. );
  210. VOID
  211. BowserDereferenceDiscardableCode(
  212. DISCARDABLE_SECTION_NAME SectionName
  213. );
  214. VOID
  215. BowserInitializeDiscardableCode(
  216. VOID
  217. );
  218. VOID
  219. BowserUninitializeDiscardableCode(
  220. VOID
  221. );
  222. NTSTATUS
  223. BowserStartElection(
  224. IN PTRANSPORT Transport
  225. );
  226. #endif // _BOWSER_