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.

361 lines
15 KiB

  1. /******************************************************************************
  2. *
  3. * NWSCRIPT.H
  4. *
  5. * This module contains typedefs and defines required for the
  6. * NetWare script utility.
  7. *
  8. * Copyright (c) 1995 Microsoft Corporation
  9. *
  10. * $Log: N:\NT\PRIVATE\NW4\NWSCRIPT\INC\VCS\NWSCRIPT.H $
  11. *
  12. * Rev 1.10 18 Apr 1996 16:53:02 terryt
  13. * Various enhancements
  14. *
  15. * Rev 1.9 10 Apr 1996 14:22:36 terryt
  16. * Hotfix for 21181hq
  17. *
  18. * Rev 1.10 12 Mar 1996 19:42:52 terryt
  19. * Relative NDS name support
  20. *
  21. * Rev 1.9 07 Mar 1996 18:34:46 terryt
  22. * Misc fixes
  23. *
  24. * Rev 1.8 22 Jan 1996 16:44:02 terryt
  25. * Add automatic map attaches
  26. *
  27. * Rev 1.7 08 Jan 1996 13:58:34 terryt
  28. * Correct NDS Preferred Server
  29. *
  30. * Rev 1.6 05 Jan 1996 17:19:08 terryt
  31. * Ensure context is the correct login default
  32. *
  33. * Rev 1.5 04 Jan 1996 18:58:34 terryt
  34. * Bug fixes reported by MS
  35. *
  36. * Rev 1.4 22 Dec 1995 14:20:34 terryt
  37. * Add Microsoft headers
  38. *
  39. * Rev 1.3 28 Nov 1995 17:13:56 terryt
  40. * Cleanup resource file
  41. *
  42. * Rev 1.2 22 Nov 1995 15:44:34 terryt
  43. * Use proper NetWare user name call
  44. *
  45. * Rev 1.1 20 Nov 1995 16:11:34 terryt
  46. * Context and capture changes
  47. *
  48. * Rev 1.0 15 Nov 1995 18:05:38 terryt
  49. * Initial revision.
  50. *
  51. * Rev 1.5 25 Aug 1995 17:03:52 terryt
  52. * CAPTURE support
  53. *
  54. * Rev 1.4 18 Jul 1995 16:07:52 terryt
  55. * Screen out capture commands
  56. *
  57. * Rev 1.3 17 Jul 1995 09:43:02 terryt
  58. * Use Microsoft name for environment
  59. *
  60. * Rev 1.2 23 Jun 1995 09:49:58 terryt
  61. * Add error message for mapping over MS network drive
  62. *
  63. * Rev 1.1 23 May 1995 19:38:14 terryt
  64. * Spruce up source
  65. *
  66. * Rev 1.0 15 May 1995 19:09:42 terryt
  67. * Initial revision.
  68. *
  69. ******************************************************************************/
  70. #define SCRIPT_ENVIRONMENT_VALUENAME L"Volatile Environment"
  71. #define REGISTRY_PROVIDER L"System\\CurrentControlSet\\Services\\NWCWorkstation\\networkProvider"
  72. #define REGISTRY_PROVIDERNAME L"Name"
  73. typedef enum SYNTAX
  74. {
  75. NDSI_UNKNOWN, /* 0 */
  76. NDSI_DIST_NAME, /* 1 */
  77. NDSI_CE_STRING, /* 2 */
  78. NDSI_CI_STRING, /* 3 */
  79. NDSI_PR_STRING, /* 4 */
  80. NDSI_NU_STRING, /* 5 */
  81. NDSI_CI_LIST, /* 6 */
  82. NDSI_BOOLEAN, /* 7 */
  83. NDSI_INTEGER, /* 8 */
  84. NDSI_OCTET_STRING, /* 9 */
  85. NDSI_TEL_NUMBER, /* 10 */
  86. NDSI_FAX_NUMBER, /* 11 */
  87. NDSI_NET_ADDRESS, /* 12 */
  88. NDSI_OCTET_LIST, /* 13 */
  89. NDSI_EMAIL_ADDRESS, /* 14 */
  90. NDSI_PATH, /* 15 */
  91. NDSI_REPLICA_POINTER, /* 16 */
  92. NDSI_OBJECT_ACL, /* 17 */
  93. NDSI_PO_ADDRESS, /* 18 */
  94. NDSI_TIMESTAMP, /* 19 */
  95. NDSI_CLASS_NAME, /* 20 */
  96. NDSI_STREAM, /* 21 */
  97. NDSI_COUNTER, /* 22 */
  98. NDSI_BACK_LINK, /* 23 */
  99. NDSI_TIME, /* 24 */
  100. NDSI_TYPED_NAME, /* 25 */
  101. NDSI_HOLD, /* 26 */
  102. NDSI_INTERVAL, /* 27 */
  103. NDSI_TAX_COUNT /* 28 */
  104. } SYNTAX;
  105. #define DSCL_AFP_SERVER "AFP Server"
  106. #define DSCL_ALIAS "Alias"
  107. #define DSCL_BINDERY_OBJECT "Bindery Object"
  108. #define DSCL_BINDERY_QUEUE "Bindery Queue"
  109. #define DSCL_COMPUTER "Computer"
  110. #define DSCL_COUNTRY "Country"
  111. #define DSCL_DEVICE "Device"
  112. #define DSCL_DIRECTORY_MAP "Directory Map"
  113. #define DSCL_EXTERNAL_ENTITY "External Entity"
  114. #define DSCL_GROUP "Group"
  115. #define DSCL_LIST "List"
  116. #define DSCL_LOCALITY "Locality"
  117. #define DSCL_MESSAGE_ROUTING_GROUP "Message Routing Group"
  118. #define DSCL_MESSAGING_SERVER "Messaging Server"
  119. #define DSCL_NCP_SERVER "NCP Server"
  120. #define DSCL_ORGANIZATION "Organization"
  121. #define DSCL_ORGANIZATIONAL_PERSON "Organizational Person"
  122. #define DSCL_ORGANIZATIONAL_ROLE "Organizational Role"
  123. #define DSCL_ORGANIZATIONAL_UNIT "Organizational Unit"
  124. #define DSCL_PARTITION "Partition"
  125. #define DSCL_PERSON "Person"
  126. #define DSCL_PRINT_SERVER "Print Server"
  127. #define DSCL_PRINTER "Printer"
  128. #define DSCL_PROFILE "Profile"
  129. #define DSCL_QUEUE "Queue"
  130. #define DSCL_RESOURCE "Resource"
  131. #define DSCL_SERVER "Server"
  132. #define DSCL_TOP "Top"
  133. #define DSCL_UNKNOWN "Unknown"
  134. #define DSCL_USER "User"
  135. #define DSCL_VOLUME "Volume"
  136. #define DSAT_HOST_SERVER "Host Server"
  137. #define DSAT_HOST_RESOURCE_NAME "Host Resource Name"
  138. #define DSAT_PATH "Path"
  139. void ConvertUnicodeToAscii( PVOID );
  140. void NTGetTheDate( unsigned int *, unsigned char *, unsigned char * );
  141. void NTGetVersionOfShell( char *, unsigned char *, unsigned char *, unsigned char * );
  142. void NTBreakOff( void );
  143. void NTBreakOn( void );
  144. unsigned short NTNetWareDriveStatus( unsigned short );
  145. unsigned int NTGetNWDrivePath( unsigned short, unsigned char *, unsigned char * );
  146. char * NTNWtoUNCFormat( char * );
  147. unsigned int NTLoginToFileServer( char *, char *, char * );
  148. unsigned int NTAttachToFileServer( unsigned char *, unsigned int * );
  149. unsigned int NTIsConnected( unsigned char * );
  150. unsigned int NTSetDriveBase( unsigned char *, unsigned char *, unsigned char * );
  151. unsigned int NTGetUserID( unsigned int, unsigned long * );
  152. unsigned int NTIsNetWareDrive( unsigned int );
  153. void NTInitProvider( void );
  154. void DisplayMessage( unsigned int, ... );
  155. void DisplayOemString( char * );
  156. void ExportEnv( unsigned char * );
  157. void ExportCurrentDirectory( int );
  158. void ExportCurrentDrive( int );
  159. void GetOldPaths( void );
  160. void NTPrintExtendedError( void );
  161. unsigned int NTGetCurrentDirectory( unsigned char, unsigned char * );
  162. void Capture( char ** argv, unsigned int );
  163. unsigned int ConverNDSPathToNetWarePathA(char *, char *, char *);
  164. #define CONTEXT_MAX 256
  165. #define ATTRBUFSIZE 2048
  166. #define NDS_NAME_CHARS 1024
  167. unsigned int NDSInitUserProperty( void );
  168. unsigned int NDSGetUserProperty( PBYTE, PBYTE Data, unsigned int, SYNTAX *, unsigned int * );
  169. void NDSGetVar ( PBYTE, PBYTE, unsigned int );
  170. unsigned int NDSChangeContext( PBYTE );
  171. unsigned int NDSGetContext( PBYTE, unsigned int );
  172. unsigned int Is40Server( unsigned int );
  173. unsigned int NDSfopenStream ( PBYTE, PBYTE, PHANDLE, unsigned int * );
  174. unsigned int IsMemberOfNDSGroup( PBYTE );
  175. unsigned int NDSGetProperty ( PBYTE, PBYTE, PBYTE, unsigned int, unsigned int * );
  176. unsigned int NDSTypeless( LPSTR, LPSTR );
  177. void CleanupExit( int );
  178. void NDSCleanup( void );
  179. int NTGetNWUserName( PWCHAR, PWCHAR, int );
  180. unsigned int NDSGetClassName( LPSTR, LPSTR );
  181. unsigned int NDSCanonicalizeName( PBYTE, PBYTE, int, int );
  182. #define LIST_3X_SERVER 1
  183. #define LIST_4X_SERVER 2
  184. BOOL IsServerInAttachList( char *, unsigned int );
  185. void AddServerToAttachList( char *, unsigned int );
  186. int DoAttachProcessing( char * );
  187. #define FLAGS_LOCAL_CONTEXT 0x1
  188. #define FLAGS_NO_CONTEXT 0x2
  189. #define FLAGS_TYPED_NAMES 0x4
  190. unsigned int NDSAbbreviateName( DWORD, LPSTR, LPSTR );
  191. /*
  192. * Resource string IDs
  193. */
  194. #define IDR_ERROR 100
  195. #define IDR_NO_DEFAULT_CONNECTION 101
  196. #define IDR_NO_KNOWN_FILE_SERVER 102
  197. #define IDR_LOCAL_DRIVE 103
  198. #define IDR_NETWARE_DRIVE 104
  199. #define IDR_DASHED_LINE 105
  200. #define IDR_LOCAL_SEARCH 106
  201. #define IDR_NETWARE_SEARCH 107
  202. #define IDR_NOT_ENOUGH_MEMORY 108
  203. #define IDR_PASSWORD 109
  204. #define IDR_ATTACHED 110
  205. #define IDR_ACCESS_DENIED 111
  206. #define IDR_UNAUTHORIZED_LOGIN_TIME 112
  207. #define IDR_LOGIN_DENIED_NO_CONNECTION 113
  208. #define IDR_UNAUTHORIZED_LOGIN_STATION 114
  209. #define IDR_ACCOUNT_DISABLED 115
  210. #define IDR_PASSWORD_EXPRIED_NO_GRACE 116
  211. #define IDR_MAP_NOT_ATTACHED_SERVER 117
  212. #define IDR_MAP_USAGE 118
  213. #define IDR_UNDEFINED 119
  214. #define IDR_DIRECTORY_NOT_FOUND 120
  215. #define IDR_VOLUME_NOT_EXIST 121
  216. #define IDR_WRONG_DRIVE 122
  217. #define IDR_DEL_DRIVE 123
  218. #define IDR_DEL_SEARCH_DRIVE 124
  219. #define IDR_SEARCH_DRIVE_NOT_EXIST 125
  220. #define IDR_NOT_NETWORK_DRIVE 126
  221. #define IDR_NO_DRIVE_AVAIL 127
  222. #define IDR_INVALID_PATH 128
  223. #define IDR_CAN_NOT_CHANGE_DRIVE 129
  224. #define IDR_MAP_INVALID_PATH 130
  225. #define IDR_MAP_FAILED 131
  226. #define IDR_NO_SCRIPT_FILE 132
  227. #define IDR_STRIKE_KEY 133
  228. #define IDR_CANNOT_EXECUTE 134
  229. #define IDR_ENOENT 135
  230. #define IDR_EXIT_NOT_SUPPORTED 136
  231. #define IDR_IF_TOO_DEEP 137
  232. #define IDR_SCRIPT_ERROR 138
  233. #define IDR_ORIGINAL_LINE_WAS 139
  234. #define IDR_BAD_COMMAND 140
  235. #define IDR_LABEL_NOT_FOUND 141
  236. #define IDR_NO_VOLUME 142
  237. #define IDR_ERROR_DURING 143
  238. #define IDR_MAP_ERROR 144
  239. #define IDR_ENTER_SERVER_NAME 145
  240. #define IDR_ENTER_LOGIN_NAME 146
  241. #define IDR_ERROR_SET_DEFAULT_DRIVE 147
  242. #define IDR_ERROR_OPEN_SCRIPT 148
  243. #define IDR_DIVIDE_BY_ZERO 149
  244. #define IDR_NEWLINE 150
  245. #define IDR_SERVER_USER 151
  246. #define IDR_NON_NETWARE_NETWORK_DRIVE 152
  247. #define IDR_CAPTURE_USAGE 153
  248. #define IDR_COPIES_EXPECTED 154
  249. #define IDR_COPIES_OUTOF_RANGE 155
  250. #define IDR_FILE_CAPTURE_UNSUPPORTED 156
  251. #define IDR_FORM_EXPECTED 157
  252. #define IDR_INVALID_BANNER 158
  253. #define IDR_INVALID_FORM_NAME 159
  254. #define IDR_INVALID_FORM_TYPE 160
  255. #define IDR_INVALID_LPT_NUMBER 161
  256. #define IDR_INVALID_PATH_NAME 162
  257. #define IDR_JOB_NOT_FOUND 163
  258. #define IDR_LPT_NUMBER_EXPECTED 164
  259. #define IDR_LPT_STATUS 165
  260. #define IDR_NOT_ACTIVE 166
  261. #define IDR_NO_AUTOENDCAP 167
  262. #define IDR_NO_PRINTERS 168
  263. #define IDR_LPT_STATUS_NO_BANNER 169
  264. #define IDR_QUEUE_NOT_EXIST 170
  265. #define IDR_SERVER_NOT_FOUND 171
  266. #define IDR_SUCCESS_QUEUE 172
  267. #define IDR_TABSIZE_OUTOF_RANGE 173
  268. #define IDR_TAB_SIZE_EXPECTED 174
  269. #define IDR_TIMEOUT_OUTOF_RANGE 175
  270. #define IDR_TIME_OUT_EXPECTED 176
  271. #define IDR_UNKNOW_FLAG 177
  272. #define IDR_DISABLED 178
  273. #define IDR_ENABLED 179
  274. #define IDR_YES 180
  275. #define IDR_NO 181
  276. #define IDR_SECONDS 182
  277. #define IDR_CONVERT_TO_SPACE 183
  278. #define IDR_NO_CONVERSION 184
  279. #define IDR_NOTIFY_USER 185
  280. #define IDR_NOT_NOTIFY_USER 186
  281. #define IDR_NONE 187
  282. #define IDR_CONNECTION_REFUSED 188
  283. #define IDR_LASTLOGIN_PM 189
  284. #define IDR_LASTLOGIN_AM 190
  285. #define IDR_ALL_LOCAL_DRIVES 191
  286. #define IDR_CHANGE_CONTEXT_ERROR 192
  287. #define IDR_GET_CONTEXT_ERROR 193
  288. #define IDR_DISPLAY_CONTEXT 194
  289. #define IDR_LPT_STATUS_NDS 195
  290. #define IDR_LPT_STATUS_NO_BANNER_NDS 196
  291. #define IDR_NO_QUEUE 197
  292. #define IDR_LASTLOGIN 198
  293. #define IDR_TREE_OPEN_FAILED 199
  294. #define IDR_NDS_CONTEXT_INVALID 200
  295. #define IDR_NDS_USERNAME_FAILED 201
  296. #define IDR_QUERY_INFO_FAILED 202
  297. #define IDR_NO_RESPONSE 203
  298. #define IDR_NDSQUEUE_NOT_EXIST 204
  299. #define IDR_NDSSUCCESS_QUEUE 205
  300. #define IDR_CAPTURE_FAILED 206
  301. #define IDR_CURRENT_TREE 207
  302. #define IDR_CURRENT_SERVER 208
  303. #define IDR_CURRENT_CONTEXT 209
  304. #define IDR_AUTHENTICATING_SERVER 210
  305. #define IDR_NO_END_QUOTE 211
  306. #define IDR_ALREADY_ATTACHED 212
  307. //
  308. // BEGIN WARNING!!! Items below MUST be consequtive. Eg. the code assumes
  309. // that March is January+2.
  310. //
  311. #define IDR_GREETING_MORNING 300
  312. #define IDR_GREETING_AFTERNOON 301
  313. #define IDR_GREETING_EVENING 302
  314. #define IDR_AM 305
  315. #define IDR_PM 306
  316. #define IDR_SUNDAY 310
  317. #define IDR_MONDAY 311
  318. #define IDR_TUESDAY 312
  319. #define IDR_WEDNESDAY 313
  320. #define IDR_THURSDAY 314
  321. #define IDR_FRIDAY 315
  322. #define IDR_SATURDAY 316
  323. #define IDR_JANUARY 320
  324. #define IDR_FEBRUARY 321
  325. #define IDR_MARCH 322
  326. #define IDR_APRIL 323
  327. #define IDR_MAY 324
  328. #define IDR_JUNE 325
  329. #define IDR_JULY 326
  330. #define IDR_AUGUST 327
  331. #define IDR_SEPTEMBER 328
  332. #define IDR_OCTOBER 329
  333. #define IDR_NOVEMBER 330
  334. #define IDR_DECEMBER 331
  335. //
  336. // END WARNING!!!
  337. //