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.

325 lines
8.0 KiB

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