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.

321 lines
6.8 KiB

  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 <bowdbg.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 "domain.h" // Domain emulation specific definitions.
  48. #include "bowname.h" // Bowser name structure definitions.
  49. #include "bowtimer.h" // Timer related routines
  50. #include "bowtdi.h" // Bowser TDI specific definitions.
  51. #include "receive.h" // Bowser receive engine code.
  52. #include "announce.h" // Announcement related stuff
  53. #include "mailslot.h" // Mailslot specific routines
  54. #include "bowelect.h" // Election routines
  55. #include "bowmastr.h" // Master related routines.
  56. #include "bowbackp.h" // Backup related routines.
  57. #include "brsrvlst.h" // Definitions for browser server list.
  58. #include "bowipx.h"
  59. #include "bowsecur.h" // definitions for security
  60. #include <wchar.h> // CRT wide character routines
  61. #include "..\rdbss\smb.mrx\ntbowsif.h"
  62. //++
  63. //
  64. // VOID
  65. // BowserCompleteRequest (
  66. // IN PIRP Irp,
  67. // IN NTSTATUS Status
  68. // );
  69. //
  70. // Routine Description:
  71. //
  72. // This routine is used to complete an IRP with the indicated
  73. // status. It does the necessary raise and lower of IRQL.
  74. //
  75. // Arguments:
  76. //
  77. // Irp - Supplies a pointer to the Irp to complete
  78. //
  79. // Status - Supplies the completion status for the Irp
  80. //
  81. // Return Value:
  82. //
  83. // None.
  84. //
  85. //--
  86. #define BowserCompleteRequest(IRP,STATUS) { \
  87. (IRP)->IoStatus.Status = (STATUS); \
  88. if (NT_ERROR((STATUS))) { \
  89. (IRP)->IoStatus.Information = 0; \
  90. } \
  91. IoCompleteRequest( (IRP), 0 ); \
  92. }
  93. //
  94. // The following macros are used to establish the semantics needed
  95. // to do a return from within a try-finally clause. As a rule every
  96. // try clause must end with a label call try_exit. For example,
  97. //
  98. // try {
  99. // :
  100. // :
  101. //
  102. // try_exit: NOTHING;
  103. // } finally {
  104. //
  105. // :
  106. // :
  107. // }
  108. //
  109. // Every return statement executed inside of a try clause should use the
  110. // try_return macro. If the compiler fully supports the try-finally construct
  111. // then the macro should be
  112. //
  113. // #define try_return(S) { return(S); }
  114. //
  115. // If the compiler does not support the try-finally construct then the macro
  116. // should be
  117. //
  118. #define try_return(S) { S; goto try_exit; }
  119. //
  120. //
  121. // This macro returns TRUE if a flag in a set of flags is on and FALSE
  122. // otherwise. It is followed by two macros for setting and clearing
  123. // flags
  124. //
  125. //#ifndef BooleanFlagOn
  126. //#define BooleanFlagOn(Flags,SingleFlag) ((BOOLEAN)((((Flags) & (SingleFlag)) != 0)))
  127. //#endif
  128. //#ifndef SetFlag
  129. //#define SetFlag(Flags,SingleFlag) { \
  130. // (Flags) |= (SingleFlag); \
  131. //}
  132. //#endif
  133. //#ifndef ClearFlag
  134. //#define ClearFlag(Flags,SingleFlag) { \
  135. // (Flags) &= ~(SingleFlag); \
  136. //}
  137. //#endif
  138. #ifdef _M_IX86
  139. #define INLINE _inline
  140. #else
  141. #define INLINE
  142. #endif
  143. _inline BOOLEAN
  144. IsZeroTerminated(
  145. IN PSZ String,
  146. IN ULONG MaximumStringLength
  147. )
  148. // Return TRUE if a zero terminator exists on String.
  149. {
  150. while ( MaximumStringLength-- ) {
  151. if (*String++ == 0 ) {
  152. return TRUE;
  153. }
  154. }
  155. return FALSE;
  156. }
  157. NTSTATUS
  158. BowserStopProcessingAnnouncements(
  159. IN PTRANSPORT_NAME TransportName,
  160. IN PVOID Context
  161. );
  162. BOOLEAN
  163. BowserMapUsersBuffer (
  164. IN PIRP Irp,
  165. OUT PVOID *UserBuffer,
  166. IN ULONG Length
  167. );
  168. NTSTATUS
  169. BowserLockUsersBuffer (
  170. IN PIRP Irp,
  171. IN LOCK_OPERATION Operation,
  172. IN ULONG BufferLength
  173. );
  174. NTSTATUS
  175. BowserConvertType3IoControlToType2IoControl (
  176. IN PIRP Irp,
  177. IN PIO_STACK_LOCATION IrpSp
  178. );
  179. ULONG
  180. BowserPackNtString(
  181. PUNICODE_STRING string,
  182. ULONG_PTR BufferDisplacement,
  183. PCHAR dataend,
  184. PCHAR * laststring
  185. );
  186. ULONG
  187. BowserPackUnicodeString(
  188. IN OUT PWSTR * string, // pointer by reference: string to be copied.
  189. IN ULONG StringLength, // Length of this string.
  190. IN ULONG_PTR OutputBufferDisplacement, // Amount to subtract from output buffer
  191. IN PVOID dataend, // pointer to end of fixed size data.
  192. IN OUT PVOID * laststring // pointer by reference: top of string data.
  193. );
  194. ULONG
  195. BowserTimeUp(
  196. VOID
  197. );
  198. ULONG
  199. BowserRandom(
  200. ULONG MaxValue
  201. );
  202. VOID
  203. _cdecl
  204. BowserWriteErrorLogEntry(
  205. IN ULONG UniqueErrorCode,
  206. IN NTSTATUS NtStatusCode,
  207. IN PVOID ExtraInformationBuffer,
  208. IN USHORT ExtraInformationLength,
  209. IN USHORT NumberOfInsertionStrings,
  210. ...
  211. );
  212. VOID
  213. BowserLogIllegalName(
  214. IN NTSTATUS NtStatusCode,
  215. IN PVOID NameBuffer,
  216. IN USHORT NameBufferSize
  217. );
  218. VOID
  219. BowserInitializeFsd(
  220. VOID
  221. );
  222. VOID
  223. BowserReferenceDiscardableCode(
  224. DISCARDABLE_SECTION_NAME SectionName
  225. );
  226. VOID
  227. BowserDereferenceDiscardableCode(
  228. DISCARDABLE_SECTION_NAME SectionName
  229. );
  230. VOID
  231. BowserInitializeDiscardableCode(
  232. VOID
  233. );
  234. VOID
  235. BowserUninitializeDiscardableCode(
  236. VOID
  237. );
  238. NTSTATUS
  239. BowserStartElection(
  240. IN PTRANSPORT Transport
  241. );
  242. BOOL
  243. BowserValidUnicodeString(
  244. IN PUNICODE_STRING Str
  245. );
  246. #endif // _BOWSER_