winnetwk.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. /*
  2. * Copyright (C) the Wine project
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef _WINNETWK_H_
  19. #define _WINNETWK_H_
  20. /*
  21. * Network types
  22. */
  23. #define WNNC_NET_MSNET 0x00010000
  24. #define WNNC_NET_LANMAN 0x00020000
  25. #define WNNC_NET_NETWARE 0x00030000
  26. #define WNNC_NET_VINES 0x00040000
  27. #define WNNC_NET_10NET 0x00050000
  28. #define WNNC_NET_LOCUS 0x00060000
  29. #define WNNC_NET_SUN_PC_NFS 0x00070000
  30. #define WNNC_NET_LANSTEP 0x00080000
  31. #define WNNC_NET_9TILES 0x00090000
  32. #define WNNC_NET_LANTASTIC 0x000A0000
  33. #define WNNC_NET_AS400 0x000B0000
  34. #define WNNC_NET_FTP_NFS 0x000C0000
  35. #define WNNC_NET_PATHWORKS 0x000D0000
  36. #define WNNC_NET_LIFENET 0x000E0000
  37. #define WNNC_NET_POWERLAN 0x000F0000
  38. #define WNNC_NET_BWNFS 0x00100000
  39. #define WNNC_NET_COGENT 0x00110000
  40. #define WNNC_NET_FARALLON 0x00120000
  41. #define WNNC_NET_APPLETALK 0x00130000
  42. #define WNNC_NET_INTERGRAPH 0x00140000
  43. /*
  44. * Network resources
  45. */
  46. #define RESOURCE_CONNECTED 0x00000001
  47. #define RESOURCE_GLOBALNET 0x00000002
  48. #define RESOURCE_REMEMBERED 0x00000003
  49. #define RESOURCE_RECENT 0x00000004
  50. #define RESOURCE_CONTEXT 0x00000005
  51. #define RESOURCETYPE_ANY 0x00000000
  52. #define RESOURCETYPE_DISK 0x00000001
  53. #define RESOURCETYPE_PRINT 0x00000002
  54. #define RESOURCETYPE_RESERVED 0x00000008
  55. #define RESOURCETYPE_UNKNOWN 0xFFFFFFFF
  56. #define RESOURCEUSAGE_CONNECTABLE 0x00000001
  57. #define RESOURCEUSAGE_CONTAINER 0x00000002
  58. #define RESOURCEUSAGE_NOLOCALDEVICE 0x00000004
  59. #define RESOURCEUSAGE_SIBLING 0x00000008
  60. #define RESOURCEUSAGE_ATTACHED 0x00000010
  61. #define RESOURCEUSAGE_ALL (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED)
  62. #define RESOURCEUSAGE_RESERVED 0x80000000
  63. #define RESOURCEDISPLAYTYPE_GENERIC 0x00000000
  64. #define RESOURCEDISPLAYTYPE_DOMAIN 0x00000001
  65. #define RESOURCEDISPLAYTYPE_SERVER 0x00000002
  66. #define RESOURCEDISPLAYTYPE_SHARE 0x00000003
  67. #define RESOURCEDISPLAYTYPE_FILE 0x00000004
  68. #define RESOURCEDISPLAYTYPE_GROUP 0x00000005
  69. #define RESOURCEDISPLAYTYPE_NETWORK 0x00000006
  70. #define RESOURCEDISPLAYTYPE_ROOT 0x00000007
  71. #define RESOURCEDISPLAYTYPE_SHAREADMIN 0x00000008
  72. #define RESOURCEDISPLAYTYPE_DIRECTORY 0x00000009
  73. #define RESOURCEDISPLAYTYPE_TREE 0x0000000A
  74. typedef struct {
  75. DWORD dwScope;
  76. DWORD dwType;
  77. DWORD dwDisplayType;
  78. DWORD dwUsage;
  79. LPSTR lpLocalName;
  80. LPSTR lpRemoteName;
  81. LPSTR lpComment ;
  82. LPSTR lpProvider;
  83. } NETRESOURCEA,*LPNETRESOURCEA;
  84. typedef struct {
  85. DWORD dwScope;
  86. DWORD dwType;
  87. DWORD dwDisplayType;
  88. DWORD dwUsage;
  89. LPWSTR lpLocalName;
  90. LPWSTR lpRemoteName;
  91. LPWSTR lpComment ;
  92. LPWSTR lpProvider;
  93. } NETRESOURCEW,*LPNETRESOURCEW;
  94. DECL_WINELIB_TYPE_AW(NETRESOURCE)
  95. DECL_WINELIB_TYPE_AW(LPNETRESOURCE)
  96. /*
  97. * Network connections
  98. */
  99. #define NETPROPERTY_PERSISTENT 1
  100. #define CONNECT_UPDATE_PROFILE 0x00000001
  101. #define CONNECT_UPDATE_RECENT 0x00000002
  102. #define CONNECT_TEMPORARY 0x00000004
  103. #define CONNECT_INTERACTIVE 0x00000008
  104. #define CONNECT_PROMPT 0x00000010
  105. #define CONNECT_NEED_DRIVE 0x00000020
  106. #define CONNECT_REFCOUNT 0x00000040
  107. #define CONNECT_REDIRECT 0x00000080
  108. #define CONNECT_LOCALDRIVE 0x00000100
  109. #define CONNECT_CURRENT_MEDIA 0x00000200
  110. DWORD WINAPI WNetAddConnectionA(LPCSTR,LPCSTR,LPCSTR);
  111. DWORD WINAPI WNetAddConnectionW(LPCWSTR,LPCWSTR,LPCWSTR);
  112. #define WNetAddConnection WINELIB_NAME_AW(WNetAddConnection)
  113. DWORD WINAPI WNetAddConnection2A(LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD);
  114. DWORD WINAPI WNetAddConnection2W(LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD);
  115. #define WNetAddConnection2 WINELIB_NAME_AW(WNetAddConnection2)
  116. DWORD WINAPI WNetAddConnection3A(HWND,LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD);
  117. DWORD WINAPI WNetAddConnection3W(HWND,LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD);
  118. #define WNetAddConnection3 WINELIB_NAME_AW(WNetAddConnection3)
  119. DWORD WINAPI WNetCancelConnectionA(LPCSTR,BOOL);
  120. DWORD WINAPI WNetCancelConnectionW(LPCWSTR,BOOL);
  121. #define WNetCancelConnection WINELIB_NAME_AW(WNetCancelConnection)
  122. DWORD WINAPI WNetCancelConnection2A(LPCSTR,DWORD,BOOL);
  123. DWORD WINAPI WNetCancelConnection2W(LPCWSTR,DWORD,BOOL);
  124. #define WNetCancelConnection2 WINELIB_NAME_AW(WNetCancelConnection2)
  125. DWORD WINAPI WNetGetConnectionA(LPCSTR,LPSTR,LPDWORD);
  126. DWORD WINAPI WNetGetConnectionW(LPCWSTR,LPWSTR,LPDWORD);
  127. #define WNetGetConnection WINELIB_NAME_AW(WNetGetConnection)
  128. DWORD WINAPI WNetUseConnectionA(HWND,LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD,LPSTR,LPDWORD,LPDWORD);
  129. DWORD WINAPI WNetUseConnectionW(HWND,LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPDWORD,LPDWORD);
  130. #define WNetUseConnection WINELIB_NAME_AW(WNetUseConnection)
  131. DWORD WINAPI WNetSetConnectionA(LPCSTR,DWORD,LPVOID);
  132. DWORD WINAPI WNetSetConnectionW(LPCWSTR,DWORD,LPVOID);
  133. #define WNetSetConnection WINELIB_NAME_AW(WNetSetConnection)
  134. /*
  135. * Network connection dialogs
  136. */
  137. typedef struct {
  138. DWORD cbStructure; /* size of this structure in bytes */
  139. HWND hwndOwner; /* owner window for the dialog */
  140. LPNETRESOURCEA lpConnRes;/* Requested Resource info */
  141. DWORD dwFlags; /* flags (see below) */
  142. DWORD dwDevNum; /* number of devices connected to */
  143. } CONNECTDLGSTRUCTA, *LPCONNECTDLGSTRUCTA;
  144. typedef struct {
  145. DWORD cbStructure; /* size of this structure in bytes */
  146. HWND hwndOwner; /* owner window for the dialog */
  147. LPNETRESOURCEW lpConnRes;/* Requested Resource info */
  148. DWORD dwFlags; /* flags (see below) */
  149. DWORD dwDevNum; /* number of devices connected to */
  150. } CONNECTDLGSTRUCTW, *LPCONNECTDLGSTRUCTW;
  151. DECL_WINELIB_TYPE_AW(CONNECTDLGSTRUCT)
  152. DECL_WINELIB_TYPE_AW(LPCONNECTDLGSTRUCT)
  153. #define CONNDLG_RO_PATH 0x00000001 /* Resource path should be read-only */
  154. #define CONNDLG_CONN_POINT 0x00000002 /* Netware -style movable connection point enabled */
  155. #define CONNDLG_USE_MRU 0x00000004 /* Use MRU combobox */
  156. #define CONNDLG_HIDE_BOX 0x00000008 /* Hide persistent connect checkbox */
  157. #define CONNDLG_PERSIST 0x00000010 /* Force persistent connection */
  158. #define CONNDLG_NOT_PERSIST 0x00000020 /* Force connection NOT persistent */
  159. typedef struct {
  160. DWORD cbStructure; /* size of this structure in bytes */
  161. HWND hwndOwner; /* owner window for the dialog */
  162. LPSTR lpLocalName; /* local device name */
  163. LPSTR lpRemoteName; /* network resource name */
  164. DWORD dwFlags; /* flags */
  165. } DISCDLGSTRUCTA, *LPDISCDLGSTRUCTA;
  166. typedef struct {
  167. DWORD cbStructure; /* size of this structure in bytes */
  168. HWND hwndOwner; /* owner window for the dialog */
  169. LPWSTR lpLocalName; /* local device name */
  170. LPWSTR lpRemoteName; /* network resource name */
  171. DWORD dwFlags; /* flags */
  172. } DISCDLGSTRUCTW, *LPDISCDLGSTRUCTW;
  173. DECL_WINELIB_TYPE_AW(DISCDLGSTRUCT)
  174. DECL_WINELIB_TYPE_AW(LPDISCDLGSTRUCT)
  175. #define DISC_UPDATE_PROFILE 0x00000001
  176. #define DISC_NO_FORCE 0x00000040
  177. DWORD WINAPI WNetConnectionDialog(HWND,DWORD);
  178. DWORD WINAPI WNetDisconnectDialog(HWND,DWORD);
  179. DWORD WINAPI WNetConnectionDialog1A(LPCONNECTDLGSTRUCTA);
  180. DWORD WINAPI WNetConnectionDialog1W(LPCONNECTDLGSTRUCTW);
  181. #define WNetConnectionDialog1 WINELIB_NAME_AW(WNetConnectionDialog1)
  182. DWORD WINAPI WNetDisconnectDialog1A(LPDISCDLGSTRUCTA);
  183. DWORD WINAPI WNetDisconnectDialog1W(LPDISCDLGSTRUCTW);
  184. #define WNetDisconnectDialog1 WINELIB_NAME_AW(WNetDisconnectDialog1)
  185. /*
  186. * Network browsing
  187. */
  188. DWORD WINAPI WNetOpenEnumA(DWORD,DWORD,DWORD,LPNETRESOURCEA,LPHANDLE);
  189. DWORD WINAPI WNetOpenEnumW(DWORD,DWORD,DWORD,LPNETRESOURCEW,LPHANDLE);
  190. #define WNetOpenEnum WINELIB_NAME_AW(WNetOpenEnum)
  191. DWORD WINAPI WNetEnumResourceA(HANDLE,LPDWORD,LPVOID,LPDWORD);
  192. DWORD WINAPI WNetEnumResourceW(HANDLE,LPDWORD,LPVOID,LPDWORD);
  193. #define WNetEnumResource WINELIB_NAME_AW(WNetEnumResource)
  194. DWORD WINAPI WNetGetResourceInformationA(LPNETRESOURCEA,LPVOID,LPDWORD,LPSTR*);
  195. DWORD WINAPI WNetGetResourceInformationW(LPNETRESOURCEW,LPVOID,LPDWORD,LPWSTR*);
  196. #define WNetGetResourceInformation WINELIB_NAME_AW(WNetGetResourceInformation)
  197. DWORD WINAPI WNetGetResourceParentA(LPNETRESOURCEA,LPVOID,LPDWORD);
  198. DWORD WINAPI WNetGetResourceParentW(LPNETRESOURCEW,LPVOID,LPDWORD);
  199. #define WNetGetResourceParent WINELIB_NAME_AW(WNetGetResourceParent)
  200. DWORD WINAPI WNetCloseEnum(HANDLE);
  201. /*
  202. * Universal naming
  203. */
  204. #define UNIVERSAL_NAME_INFO_LEVEL 0x00000001
  205. #define REMOTE_NAME_INFO_LEVEL 0x00000002
  206. typedef struct {
  207. LPSTR lpUniversalName;
  208. } UNIVERSAL_NAME_INFOA, *LPUNIVERSAL_NAME_INFOA;
  209. typedef struct {
  210. LPWSTR lpUniversalName;
  211. } UNIVERSAL_NAME_INFOW, *LPUNIVERSAL_NAME_INFOW;
  212. DECL_WINELIB_TYPE_AW(UNIVERSAL_NAME_INFO)
  213. DECL_WINELIB_TYPE_AW(LPUNIVERSAL_NAME_INFO)
  214. typedef struct {
  215. LPSTR lpUniversalName;
  216. LPSTR lpConnectionName;
  217. LPSTR lpRemainingPath;
  218. }REMOTE_NAME_INFOA, *LPREMOTE_NAME_INFOA;
  219. typedef struct {
  220. LPWSTR lpUniversalName;
  221. LPWSTR lpConnectionName;
  222. LPWSTR lpRemainingPath;
  223. }REMOTE_NAME_INFOW, *LPREMOTE_NAME_INFOW;
  224. DECL_WINELIB_TYPE_AW(REMOTE_NAME_INFO)
  225. DECL_WINELIB_TYPE_AW(LPREMOTE_NAME_INFO)
  226. DWORD WINAPI WNetGetUniversalNameA(LPCSTR,DWORD,LPVOID,LPDWORD);
  227. DWORD WINAPI WNetGetUniversalNameW(LPCWSTR,DWORD,LPVOID,LPDWORD);
  228. #define WNetGetUniversalName WINELIB_NAME_AW(WNetGetUniversalName)
  229. /*
  230. * Other
  231. */
  232. DWORD WINAPI WNetGetUserA(LPCSTR,LPSTR,LPDWORD);
  233. DWORD WINAPI WNetGetUserW(LPCWSTR,LPWSTR,LPDWORD);
  234. #define WNetGetUser WINELIB_NAME_AW(WNetGetUser)
  235. #define WNFMT_MULTILINE 0x01
  236. #define WNFMT_ABBREVIATED 0x02
  237. #define WNFMT_INENUM 0x10
  238. #define WNFMT_CONNECTION 0x20
  239. DWORD WINAPI WNetGetProviderNameA(DWORD,LPSTR,LPDWORD);
  240. DWORD WINAPI WNetGetProviderNameW(DWORD,LPWSTR,LPDWORD);
  241. #define WNetGetProviderName WINELIB_NAME_AW(WNetGetProviderName)
  242. typedef struct {
  243. DWORD cbStructure;
  244. DWORD dwProviderVersion;
  245. DWORD dwStatus;
  246. DWORD dwCharacteristics;
  247. DWORD dwHandle;
  248. WORD wNetType;
  249. DWORD dwPrinters;
  250. DWORD dwDrives;
  251. } NETINFOSTRUCT, *LPNETINFOSTRUCT;
  252. #define NETINFO_DLL16 0x00000001
  253. #define NETINFO_DISKRED 0x00000004
  254. #define NETINFO_PRINTERRED 0x00000008
  255. DWORD WINAPI WNetGetNetworkInformationA(LPCSTR,LPNETINFOSTRUCT);
  256. DWORD WINAPI WNetGetNetworkInformationW(LPCWSTR,LPNETINFOSTRUCT);
  257. #define WNetGetNetworkInformation WINELIB_NAME_AW(WNetGetNetworkInformation)
  258. /*
  259. * Status codes
  260. */
  261. DWORD WINAPI WNetGetLastErrorA(LPDWORD,LPSTR,DWORD,LPSTR,DWORD);
  262. DWORD WINAPI WNetGetLastErrorW(LPDWORD,LPWSTR,DWORD,LPWSTR,DWORD);
  263. #define WNetGetLastError WINELIB_NAME_AW(WNetGetLastError)
  264. #define WN_SUCCESS NO_ERROR
  265. #define WN_NO_ERROR NO_ERROR
  266. #define WN_NOT_SUPPORTED ERROR_NOT_SUPPORTED
  267. #define WN_CANCEL ERROR_CANCELLED
  268. #define WN_RETRY ERROR_RETRY
  269. #define WN_NET_ERROR ERROR_UNEXP_NET_ERR
  270. #define WN_MORE_DATA ERROR_MORE_DATA
  271. #define WN_BAD_POINTER ERROR_INVALID_ADDRESS
  272. #define WN_BAD_VALUE ERROR_INVALID_PARAMETER
  273. #define WN_BAD_USER ERROR_BAD_USERNAME
  274. #define WN_BAD_PASSWORD ERROR_INVALID_PASSWORD
  275. #define WN_ACCESS_DENIED ERROR_ACCESS_DENIED
  276. #define WN_FUNCTION_BUSY ERROR_BUSY
  277. #define WN_WINDOWS_ERROR ERROR_UNEXP_NET_ERR
  278. #define WN_OUT_OF_MEMORY ERROR_NOT_ENOUGH_MEMORY
  279. #define WN_NO_NETWORK ERROR_NO_NETWORK
  280. #define WN_EXTENDED_ERROR ERROR_EXTENDED_ERROR
  281. #define WN_BAD_LEVEL ERROR_INVALID_LEVEL
  282. #define WN_BAD_HANDLE ERROR_INVALID_HANDLE
  283. #define WN_NOT_INITIALIZING ERROR_ALREADY_INITIALIZED
  284. #define WN_NO_MORE_DEVICES ERROR_NO_MORE_DEVICES
  285. #define WN_NOT_CONNECTED ERROR_NOT_CONNECTED
  286. #define WN_OPEN_FILES ERROR_OPEN_FILES
  287. #define WN_DEVICE_IN_USE ERROR_DEVICE_IN_USE
  288. #define WN_BAD_NETNAME ERROR_BAD_NET_NAME
  289. #define WN_BAD_LOCALNAME ERROR_BAD_DEVICE
  290. #define WN_ALREADY_CONNECTED ERROR_ALREADY_ASSIGNED
  291. #define WN_DEVICE_ERROR ERROR_GEN_FAILURE
  292. #define WN_CONNECTION_CLOSED ERROR_CONNECTION_UNAVAIL
  293. #define WN_NO_NET_OR_BAD_PATH ERROR_NO_NET_OR_BAD_PATH
  294. #define WN_BAD_PROVIDER ERROR_BAD_PROVIDER
  295. #define WN_CANNOT_OPEN_PROFILE ERROR_CANNOT_OPEN_PROFILE
  296. #define WN_BAD_PROFILE ERROR_BAD_PROFILE
  297. #define WN_BAD_DEV_TYPE ERROR_BAD_DEV_TYPE
  298. #define WN_DEVICE_ALREADY_REMEMBERED ERROR_DEVICE_ALREADY_REMEMBERED
  299. #define WN_NO_MORE_ENTRIES ERROR_NO_MORE_ITEMS
  300. #define WN_NOT_CONTAINER ERROR_NOT_CONTAINER
  301. #define WN_NOT_AUTHENTICATED ERROR_NOT_AUTHENTICATED
  302. #define WN_NOT_LOGGED_ON ERROR_NOT_LOGGED_ON
  303. #define WN_NOT_VALIDATED ERROR_NO_LOGON_SERVERS
  304. /*
  305. * Multinet (for Shell)
  306. */
  307. typedef struct {
  308. DWORD cbStructure;
  309. DWORD dwFlags;
  310. DWORD dwSpeed;
  311. DWORD dwDelay;
  312. DWORD dwOptDataSize;
  313. } NETCONNECTINFOSTRUCT,*LPNETCONNECTINFOSTRUCT;
  314. #define WNCON_FORNETCARD 0x00000001
  315. #define WNCON_NOTROUTED 0x00000002
  316. #define WNCON_SLOWLINK 0x00000004
  317. #define WNCON_DYNAMIC 0x00000008
  318. DWORD WINAPI MultinetGetConnectionPerformanceA(LPNETRESOURCEA,LPNETCONNECTINFOSTRUCT);
  319. DWORD WINAPI MultinetGetConnectionPerformanceW(LPNETRESOURCEW,LPNETCONNECTINFOSTRUCT);
  320. #define MultinetGetConnectionPerformance WINELIB_NAME_AW(MultinetGetConnectionPerformance)
  321. DWORD WINAPI MultinetGetErrorTextA(DWORD,DWORD,DWORD);
  322. DWORD WINAPI MultinetGetErrorTextW(DWORD,DWORD,DWORD);
  323. #define MultinetGetErrorText WINELIB_NAME_AW(MultinetGetErrorText)
  324. /*
  325. * Password cache
  326. */
  327. /* WNetEnumCachedPasswords */
  328. typedef struct tagPASSWORD_CACHE_ENTRY
  329. {
  330. WORD cbEntry;
  331. WORD cbResource;
  332. WORD cbPassword;
  333. BYTE iEntry;
  334. BYTE nType;
  335. BYTE abResource[1];
  336. } PASSWORD_CACHE_ENTRY;
  337. typedef BOOL (CALLBACK *ENUMPASSWORDPROC)(PASSWORD_CACHE_ENTRY *, DWORD);
  338. UINT WINAPI WNetEnumCachedPasswords( LPSTR, WORD, BYTE, ENUMPASSWORDPROC, DWORD);
  339. DWORD WINAPI WNetGetCachedPassword( LPSTR, WORD, LPSTR, LPWORD, BYTE );
  340. DWORD WINAPI WNetCachePassword( LPSTR, WORD, LPSTR, WORD, BYTE, WORD );
  341. #endif /* _WINNETWK_H_ */