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.

364 lines
11 KiB

  1. /*
  2. * Windows/Network Interface
  3. * Copyright (C) Microsoft 1989-1994
  4. *
  5. * Standard WINNET Driver Header File, spec version 3.10
  6. */
  7. typedef WORD far * LPWORD;
  8. /*
  9. * SPOOLING - CONTROLLING JOBS
  10. */
  11. #define WNJ_NULL_JOBID 0
  12. WORD WINAPI WNetOpenJob(LPSTR,LPSTR,WORD,LPINT);
  13. WORD WINAPI WNetCloseJob(WORD,LPINT,LPSTR);
  14. WORD WINAPI WNetWriteJob(HANDLE,LPSTR,LPINT);
  15. WORD WINAPI WNetAbortJob(WORD,LPSTR);
  16. WORD WINAPI WNetHoldJob(LPSTR,WORD);
  17. WORD WINAPI WNetReleaseJob(LPSTR,WORD);
  18. WORD WINAPI WNetCancelJob(LPSTR,WORD);
  19. WORD WINAPI WNetSetJobCopies(LPSTR,WORD,WORD);
  20. /*
  21. * SPOOLING - QUEUE AND JOB INFO
  22. */
  23. typedef struct _queuestruct {
  24. WORD pqName;
  25. WORD pqComment;
  26. WORD pqStatus;
  27. WORD pqJobcount;
  28. WORD pqPrinters;
  29. } QUEUESTRUCT;
  30. typedef QUEUESTRUCT far * LPQUEUESTRUCT;
  31. #define WNPRQ_ACTIVE 0x0
  32. #define WNPRQ_PAUSE 0x1
  33. #define WNPRQ_ERROR 0x2
  34. #define WNPRQ_PENDING 0x3
  35. #define WNPRQ_PROBLEM 0x4
  36. typedef struct _jobstruct {
  37. WORD pjId;
  38. WORD pjUsername;
  39. WORD pjParms;
  40. WORD pjPosition;
  41. WORD pjStatus;
  42. DWORD pjSubmitted;
  43. DWORD pjSize;
  44. WORD pjCopies;
  45. WORD pjComment;
  46. } JOBSTRUCT;
  47. typedef JOBSTRUCT far * LPJOBSTRUCT;
  48. #define WNPRJ_QSTATUS 0x0007
  49. #define WNPRJ_QS_QUEUED 0x0000
  50. #define WNPRJ_QS_PAUSED 0x0001
  51. #define WNPRJ_QS_SPOOLING 0x0002
  52. #define WNPRJ_QS_PRINTING 0x0003
  53. #define WNPRJ_DEVSTATUS 0x0FF8
  54. #define WNPRJ_DS_COMPLETE 0x0008
  55. #define WNPRJ_DS_INTERV 0x0010
  56. #define WNPRJ_DS_ERROR 0x0020
  57. #define WNPRJ_DS_DESTOFFLINE 0x0040
  58. #define WNPRJ_DS_DESTPAUSED 0x0080
  59. #define WNPRJ_DS_NOTIFY 0x0100
  60. #define WNPRJ_DS_DESTNOPAPER 0x0200
  61. #define WNPRJ_DS_DESTFORMCHG 0x0400
  62. #define WNPRJ_DS_DESTCRTCHG 0x0800
  63. #define WNPRJ_DS_DESTPENCHG 0x1000
  64. #define SP_QUEUECHANGED 0x0500
  65. WORD WINAPI WNetWatchQueue(HWND,LPSTR,LPSTR,WORD);
  66. WORD WINAPI WNetUnwatchQueue(LPSTR);
  67. WORD WINAPI WNetLockQueueData(LPSTR,LPSTR,LPQUEUESTRUCT FAR *);
  68. WORD WINAPI WNetUnlockQueueData(LPSTR);
  69. /*
  70. * CONNECTIONS
  71. *
  72. * these are defined in windows.h now
  73. *
  74. * WORD WINAPI WNetAddConnection(LPSTR,LPSTR,LPSTR);
  75. * WORD WINAPI WNetCancelConnection(LPSTR,BOOL);
  76. * WORD WINAPI WNetGetConnection(LPSTR,LPSTR,LPWORD);
  77. */
  78. WORD WINAPI WNetRestoreConnection(HWND,LPSTR);
  79. /*
  80. * CAPABILITIES
  81. */
  82. #define WNNC_SPEC_VERSION 0x0001
  83. #define WNNC_NET_TYPE 0x0002
  84. #define WNNC_NET_NONE 0x0000
  85. #define WNNC_NET_MSNet 0x0100
  86. #define WNNC_NET_LanMan 0x0200
  87. #define WNNC_NET_NetWare 0x0300
  88. #define WNNC_NET_Vines 0x0400
  89. #define WNNC_NET_10NET 0x0500
  90. #define WNNC_NET_Locus 0x0600
  91. #define WNNC_NET_Sun_PC_NFS 0x0700
  92. #define WNNC_NET_LANstep 0x0800
  93. #define WNNC_NET_9TILES 0x0900
  94. #define WNNC_NET_LANtastic 0x0A00
  95. #define WNNC_NET_AS400 0x0B00
  96. #define WNNC_NET_FTP_NFS 0x0C00
  97. #define WNNC_NET_PATHWORKS 0x0D00
  98. #define WNNC_NET_LifeNet 0x0E00
  99. #define WNNC_NET_POWERLan 0x0F00
  100. #define WNNC_NET_BWNFS 0x1000
  101. #define WNNC_NET_Cogent 0x1100
  102. #define WNNC_NET_Farallon 0x1200
  103. #define WNNC_NET_MultiNet 0x8000
  104. #define WNNC_SUBNET_NONE 0x0000
  105. #define WNNC_SUBNET_MSNet 0x0001
  106. #define WNNC_SUBNET_LanMan 0x0002
  107. #define WNNC_SUBNET_WinWorkgroups 0x0004
  108. #define WNNC_SUBNET_NetWare 0x0008
  109. #define WNNC_SUBNET_Vines 0x0010
  110. #define WNNC_SUBNET_10NET 0x0020
  111. #define WNNC_SUBNET_Locus 0x0040
  112. #define WNNC_SUBNET_Sun_PC_NFS 0x0080
  113. #define WNNC_SUBNET_LANstep 0x0100
  114. #define WNNC_SUBNET_9TILES 0x0200
  115. #define WNNC_SUBNET_LANtastic 0x0400
  116. #define WNNC_SUBNET_AS400 0x0800
  117. #define WNNC_SUBNET_FTP_NFS 0x1000
  118. #define WNNC_SUBNET_PATHWORKS 0x2000
  119. #define WNNC_SUBNET_Extension 0x4000
  120. #define WNNC_SUBNET_Other 0x8000
  121. #define WNNC_DRIVER_VERSION 0x0003
  122. #define WNNC_USER 0x0004
  123. #define WNNC_USR_GetUser 0x0001
  124. #define WNNC_CONNECTION 0x0006
  125. #define WNNC_CON_AddConnection 0x0001
  126. #define WNNC_CON_CancelConnection 0x0002
  127. #define WNNC_CON_GetConnections 0x0004
  128. #define WNNC_CON_AutoConnect 0x0008
  129. #define WNNC_CON_BrowseDialog 0x0010
  130. #define WNNC_CON_RestoreConnection 0x0020
  131. #define WNNC_PRINTING 0x0007
  132. #define WNNC_PRT_OpenJob 0x0002
  133. #define WNNC_PRT_CloseJob 0x0004
  134. #define WNNC_PRT_HoldJob 0x0010
  135. #define WNNC_PRT_ReleaseJob 0x0020
  136. #define WNNC_PRT_CancelJob 0x0040
  137. #define WNNC_PRT_SetJobCopies 0x0080
  138. #define WNNC_PRT_WatchQueue 0x0100
  139. #define WNNC_PRT_UnwatchQueue 0x0200
  140. #define WNNC_PRT_LockQueueData 0x0400
  141. #define WNNC_PRT_UnlockQueueData 0x0800
  142. #define WNNC_PRT_ChangeMsg 0x1000
  143. #define WNNC_PRT_AbortJob 0x2000
  144. #define WNNC_PRT_NoArbitraryLock 0x4000
  145. #define WNNC_PRT_WriteJob 0x8000
  146. #define WNNC_DIALOG 0x0008
  147. #define WNNC_DLG_DeviceMode 0x0001
  148. #define WNNC_DLG_BrowseDialog 0x0002
  149. #define WNNC_DLG_ConnectDialog 0x0004
  150. #define WNNC_DLG_DisconnectDialog 0x0008
  151. #define WNNC_DLG_ViewQueueDialog 0x0010
  152. #define WNNC_DLG_PropertyDialog 0x0020
  153. #define WNNC_DLG_ConnectionDialog 0x0040
  154. #define WNNC_DLG_SharesDialog 0x0100
  155. #define WNNC_DLG_ShareAsDialog 0x0200
  156. #define WNNC_ADMIN 0x0009
  157. #define WNNC_ADM_GetDirectoryType 0x0001
  158. #define WNNC_ADM_DirectoryNotify 0x0002
  159. #define WNNC_ADM_LongNames 0x0004
  160. #define WNNC_ADM_SetDefaultDrive 0x0008
  161. #define WNNC_ERROR 0x000A
  162. #define WNNC_ERR_GetError 0x0001
  163. #define WNNC_ERR_GetErrorText 0x0002
  164. WORD WINAPI WNetGetCaps(WORD);
  165. /*
  166. * OTHER
  167. */
  168. WORD WINAPI WNetGetUser(LPSTR,LPINT);
  169. /*
  170. * BROWSE DIALOG
  171. */
  172. #define WNBD_CONN_UNKNOWN 0x0
  173. #define WNBD_CONN_DISKTREE 0x1
  174. #define WNBD_CONN_PRINTQ 0x3
  175. #define WNBD_MAX_LENGTH 0x80 // path length, includes the NULL
  176. #define WNTYPE_DRIVE 1
  177. #define WNTYPE_FILE 2
  178. #define WNTYPE_PRINTER 3
  179. #define WNTYPE_COMM 4
  180. #define WNPS_FILE 0
  181. #define WNPS_DIR 1
  182. #define WNPS_MULT 2
  183. WORD WINAPI WNetDeviceMode(HWND);
  184. WORD WINAPI WNetBrowseDialog(HWND,WORD,LPSTR);
  185. WORD WINAPI WNetConnectDialog(HWND,WORD);
  186. WORD WINAPI WNetDisconnectDialog(HWND,WORD);
  187. WORD WINAPI WNetConnectionDialog(HWND,WORD);
  188. WORD WINAPI WNetViewQueueDialog(HWND,LPSTR);
  189. WORD WINAPI WNetPropertyDialog(HWND hwndParent, WORD iButton, WORD nPropSel, LPSTR lpszName, WORD nType);
  190. WORD WINAPI WNetGetPropertyText(WORD iButton, WORD nPropSel, LPSTR lpszName, LPSTR lpszButtonName, WORD cbButtonName, WORD nType);
  191. /*
  192. * ADMIN
  193. */
  194. #define WNDT_NORMAL 0
  195. #define WNDT_NETWORK 2
  196. #define WNDN_MKDIR 1
  197. #define WNDN_RMDIR 2
  198. #define WNDN_MVDIR 3
  199. WORD WINAPI WNetGetDirectoryType(LPSTR,LPINT);
  200. WORD WINAPI WNetDirectoryNotify(HWND,LPSTR,WORD);
  201. /*
  202. * ERRORS
  203. */
  204. WORD WINAPI WNetGetError(LPINT);
  205. WORD WINAPI WNetGetErrorText(WORD,LPSTR,LPINT);
  206. /*
  207. * STATUS CODES
  208. */
  209. /* General */
  210. #define WN_SUCCESS 0x0000
  211. #define WN_NOT_SUPPORTED 0x0001
  212. #define WN_NET_ERROR 0x0002
  213. #define WN_MORE_DATA 0x0003
  214. #define WN_BAD_POINTER 0x0004
  215. #define WN_BAD_VALUE 0x0005
  216. #define WN_BAD_PASSWORD 0x0006
  217. #define WN_ACCESS_DENIED 0x0007
  218. #define WN_FUNCTION_BUSY 0x0008
  219. #define WN_WINDOWS_ERROR 0x0009
  220. #define WN_BAD_USER 0x000A
  221. #define WN_OUT_OF_MEMORY 0x000B
  222. #define WN_CANCEL 0x000C
  223. #define WN_CONTINUE 0x000D
  224. /* Connection */
  225. #define WN_NOT_CONNECTED 0x0030
  226. #define WN_OPEN_FILES 0x0031
  227. #define WN_BAD_NETNAME 0x0032
  228. #define WN_BAD_LOCALNAME 0x0033
  229. #define WN_ALREADY_CONNECTED 0x0034
  230. #define WN_DEVICE_ERROR 0x0035
  231. #define WN_CONNECTION_CLOSED 0x0036
  232. /* Printing */
  233. #define WN_BAD_JOBID 0x0040
  234. #define WN_JOB_NOT_FOUND 0x0041
  235. #define WN_JOB_NOT_HELD 0x0042
  236. #define WN_BAD_QUEUE 0x0043
  237. #define WN_BAD_FILE_HANDLE 0x0044
  238. #define WN_CANT_SET_COPIES 0x0045
  239. #define WN_ALREADY_LOCKED 0x0046
  240. /* BUGBUG, review these: new errors for chicago winnet calls */
  241. #define WN_NO_MORE_ENTRIES 0x0047
  242. #define WN_NO_NETWORK 0x0048
  243. #define WN_BAD_HANDLE 0x0049
  244. #define WN_NO_ERROR 0x0050
  245. #define WN_NO_NET_OR_BAD_PATH 0x0051
  246. #define WN_NOT_AUTHENTICATED 0x0052
  247. #define WN_NOT_CONTAINER 0x0053
  248. #define WN_NOT_LOGGED_ON 0x0054
  249. #define WN_RETRY 0x0055
  250. #define WN_BAD_PROVIDER 0x0056
  251. #ifdef LFN
  252. /* this is the data structure returned from LFNFindFirst and
  253. * LFNFindNext. The last field, achName, is variable length. The size
  254. * of the name in that field is given by cchName, plus 1 for the zero
  255. * terminator.
  256. */
  257. typedef struct _filefindbuf2
  258. {
  259. WORD fdateCreation;
  260. WORD ftimeCreation;
  261. WORD fdateLastAccess;
  262. WORD ftimeLastAccess;
  263. WORD fdateLastWrite;
  264. WORD ftimeLastWrite;
  265. DWORD cbFile;
  266. DWORD cbFileAlloc;
  267. WORD attr;
  268. DWORD cbList;
  269. BYTE cchName;
  270. BYTE achName[1];
  271. } FILEFINDBUF2, FAR * PFILEFINDBUF2;
  272. typedef BOOL (WINAPI *PQUERYPROC)( void );
  273. WORD WINAPI LFNFindFirst(LPSTR,WORD,LPINT,LPINT,WORD,PFILEFINDBUF2);
  274. WORD WINAPI LFNFindNext(HANDLE,LPINT,WORD,PFILEFINDBUF2);
  275. WORD WINAPI LFNFindClose(HANDLE);
  276. WORD WINAPI LFNGetAttribute(LPSTR,LPINT);
  277. WORD WINAPI LFNSetAttribute(LPSTR,WORD);
  278. WORD WINAPI LFNCopy(LPSTR,LPSTR,PQUERYPROC);
  279. WORD WINAPI LFNMove(LPSTR,LPSTR);
  280. WORD WINAPI LFNDelete(LPSTR);
  281. WORD WINAPI LFNMKDir(LPSTR);
  282. WORD WINAPI LFNRMDir(LPSTR);
  283. WORD WINAPI LFNGetVolumeLabel(WORD,LPSTR);
  284. WORD WINAPI LFNSetVolumeLabel(WORD,LPSTR);
  285. WORD WINAPI LFNParse(LPSTR,LPSTR,LPSTR);
  286. WORD WINAPI LFNVolumeType(WORD,LPINT);
  287. /* return values from LFNParse
  288. */
  289. #define FILE_83_CI 0
  290. #define FILE_83_CS 1
  291. #define FILE_LONG 2
  292. /* volumes types from LFNVolumeType
  293. */
  294. #define VOLUME_STANDARD 0
  295. #define VOLUME_LONGNAMES 1
  296. // will add others later, == DOS int 21h error codes.
  297. // this error code causes a call to WNetGetError, WNetGetErrorText
  298. // to get the error text.
  299. #define ERROR_NETWORKSPECIFIC 0xFFFF
  300. #endif