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.

220 lines
5.5 KiB

  1. /*--
  2. Copyright (c) 1993 Microsoft Corporation
  3. Module Name:
  4. NWDOS.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. 16 bit applications accessing the redirector.
  8. Author:
  9. Colin Watson (ColinW) 08-Jul-1993
  10. Revision History:
  11. --*/
  12. #define NWDOS_INCLUDED
  13. #define MC 8 // maximum number of connections
  14. #define NC 8 // number of novell connections
  15. #define MP 3 // maximum number of printers
  16. #define MD 32 // maximum number of drives
  17. #define PZ 64 // print buffer size
  18. #define SERVERNAME_LENGTH 48
  19. #define USERNAME_LENGTH 16
  20. #define PASSWORD_LENGTH 16
  21. #define IPXADDRESS_LENGTH 12
  22. #define NODEADDRESS_LENGTH 6
  23. typedef UCHAR byte;
  24. typedef USHORT word;
  25. typedef byte CONN_INDEX; // index into ConnectionIdTable, range 0..MC-1
  26. typedef byte DRIVE; // index into DriveXxxTable, range 0..MD-1
  27. /* OpenFile() Flags */
  28. #define OF_READ_WRITE_MASK 0x0003
  29. /*
  30. #define OF_READ 0x0000
  31. #define OF_WRITE 0x0001
  32. #define OF_READWRITE 0x0002
  33. */
  34. #define OF_SHARE_MASK 0x0070
  35. /*
  36. #define OF_SHARE_COMPAT 0x0000
  37. #define OF_SHARE_EXCLUSIVE 0x0010
  38. #define OF_SHARE_DENY_WRITE 0x0020
  39. #define OF_SHARE_DENY_READ 0x0030
  40. #define OF_SHARE_DENY_NONE 0x0040
  41. #define OF_PARSE 0x0100
  42. #define OF_DELETE 0x0200
  43. #define OF_VERIFY 0x0400 */ /* Used with OF_REOPEN */
  44. /*
  45. #define OF_SEARCH 0x0400 */ /* Used without OF_REOPEN */
  46. /*
  47. #define OF_CANCEL 0x0800
  48. #define OF_CREATE 0x1000
  49. #define OF_PROMPT 0x2000
  50. #define OF_EXIST 0x4000
  51. #define OF_REOPEN 0x8000
  52. */
  53. //
  54. // Force misalignment of the following structures
  55. //
  56. /* XLATOFF */
  57. #include <packon.h>
  58. /* XLATON */
  59. typedef struct CID { /* */
  60. byte ci_InUse;
  61. byte ci_OrderNo;
  62. byte ci_ServerAddress[IPXADDRESS_LENGTH];
  63. word ci_TimeOut;
  64. byte ci_LocalNode[NODEADDRESS_LENGTH];
  65. byte ci_SequenceNo;
  66. byte ci_ConnectionNo;
  67. byte ci_ConnectionStatus;
  68. word ci_MaxTimeOut;
  69. byte ci_ConnectionLo;
  70. byte ci_ConnectionHi;
  71. byte ci_MajorVersion;
  72. byte ci_1;
  73. byte ci_MinorVersion;
  74. } CONNECTIONID;
  75. typedef CONNECTIONID UNALIGNED *PCONNECTIONID;
  76. #if 0 /* Already declared in nw\inc\ntddnwfs.h */
  77. typedef char SERVERNAME[SERVERNAME_LENGTH];
  78. #endif
  79. typedef char USERNAME[USERNAME_LENGTH];
  80. typedef char PASSWORD[PASSWORD_LENGTH];
  81. typedef char IPXADDRESS[IPXADDRESS_LENGTH];
  82. typedef char NODEADDRESS[NODEADDRESS_LENGTH];
  83. //
  84. // The following type collects all the structures used between the TSR
  85. // and the 32 bit dll into one packed structure.
  86. //
  87. // *** ANY CHANGES TO THIS STRUCTURE MUST ALSO BE MADE TO THE ASM NWDOSTABLE_ASM
  88. // *** STRUCTURE (below)
  89. //
  90. /* XLATOFF */
  91. typedef struct {
  92. CONNECTIONID ConnectionIdTable[MC];
  93. SERVERNAME ServerNameTable[MC];
  94. CONN_INDEX DriveIdTable[MD]; // Corresponding ConnectionId
  95. UCHAR DriveFlagTable[MD];
  96. UCHAR DriveHandleTable[MD];
  97. UCHAR PreferredServer;
  98. UCHAR PrimaryServer;
  99. UCHAR TaskModeByte;
  100. UCHAR CurrentDrive;
  101. USHORT SavedAx;
  102. USHORT NtHandleHi;
  103. USHORT NtHandleLow;
  104. USHORT NtHandleSrcHi;
  105. USHORT NtHandleSrcLow;
  106. USHORT hVdd;
  107. USHORT PmSelector;
  108. UCHAR CreatedJob;
  109. UCHAR JobHandle;
  110. UCHAR DeNovellBuffer[256];
  111. UCHAR DeNovellBuffer2[256];
  112. } NWDOSTABLE;
  113. typedef NWDOSTABLE *PNWDOSTABLE;
  114. /* XLATON */
  115. //
  116. // Turn structure packing back off
  117. //
  118. /* XLATOFF */
  119. #include <packoff.h>
  120. /* XLATON */
  121. //
  122. // CONNECTIONID Constants
  123. //
  124. #define FREE 0
  125. #define IN_USE 0xff
  126. //
  127. // Values for DriveFlags
  128. //
  129. #define NOT_MAPPED 0
  130. #define PERMANENT_NETWORK_DRIVE 1
  131. #define TEMPORARY_NETWORK_DRIVE 2
  132. #define LOCAL_DRIVE 0x80
  133. ///// Client state tables:
  134. extern CONNECTIONID* ConnectionIdTable; // MC entries
  135. extern SERVERNAME* ServerNameTable; // MC entries
  136. extern byte* DriveFlagTable; // MD entries
  137. extern byte* DriveIdTable; // MD entries
  138. //
  139. // this next egregious grossness is extant because MASM cannot handle anything
  140. // other than a basic type inside a structure declaration
  141. //
  142. // *** ANY CHANGES TO THIS STRUCTURE MUST ALSO BE MADE TO THE C NWDOSTABLE
  143. // *** STRUCTURE (above)
  144. //
  145. // NB. The leading underscores are there because we already have globals with
  146. // the same names
  147. //
  148. /* ASM
  149. NWDOSTABLE_ASM struc
  150. _ConnectionIdTable db ((size CID) * MC) dup (?)
  151. _ServerNameTable db (MC * SERVERNAME_LENGTH) dup (?)
  152. _DriveIdTable db MD dup (?)
  153. _DriveFlagTable db MD dup (?)
  154. _DriveHandleTable db MD dup (?)
  155. _PreferredServer db ?
  156. _PrimaryServer db ?
  157. _TaskModeByte db ?
  158. _CurrentDrive db ?
  159. _SavedAx dw ?
  160. _NtHandleHi dw ?
  161. _NtHandleLow dw ?
  162. _NtHandleSrcHi dw ?
  163. _NtHandleSrcLow dw ?
  164. _hVdd dw ?
  165. _PmSelector dw ?
  166. _CreatedJob db ?
  167. _JobHandle db ?
  168. _DeNovellBuffer db 256 dup (?)
  169. _DeNovellBuffer2 db 256 dup (?)
  170. NWDOSTABLE_ASM ends
  171. */
  172. /* XLATOFF */
  173. //
  174. // IS_ASCII_PATH_SEPARATOR - returns TRUE if ch is / or \. ch is a single
  175. // byte (ASCII) character
  176. //
  177. #define IS_ASCII_PATH_SEPARATOR(ch) (((ch) == '/') || ((ch) == '\\'))
  178. /* XLATON */