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.

875 lines
24 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. winnetwk.h
  5. Abstract:
  6. Standard WINNET Header File for WIN32
  7. Environment:
  8. User Mode -Win32
  9. Notes:
  10. optional-notes
  11. --*/
  12. #ifndef _WINNETWK_
  13. #define _WINNETWK_
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. //
  18. // Network types
  19. //
  20. #define WNNC_NET_MSNET 0x00010000
  21. #define WNNC_NET_LANMAN 0x00020000
  22. #define WNNC_NET_NETWARE 0x00030000
  23. #define WNNC_NET_VINES 0x00040000
  24. #define WNNC_NET_10NET 0x00050000
  25. #define WNNC_NET_LOCUS 0x00060000
  26. #define WNNC_NET_SUN_PC_NFS 0x00070000
  27. #define WNNC_NET_LANSTEP 0x00080000
  28. #define WNNC_NET_9TILES 0x00090000
  29. #define WNNC_NET_LANTASTIC 0x000A0000
  30. #define WNNC_NET_AS400 0x000B0000
  31. #define WNNC_NET_FTP_NFS 0x000C0000
  32. #define WNNC_NET_PATHWORKS 0x000D0000
  33. #define WNNC_NET_LIFENET 0x000E0000
  34. #define WNNC_NET_POWERLAN 0x000F0000
  35. #define WNNC_NET_BWNFS 0x00100000
  36. #define WNNC_NET_COGENT 0x00110000
  37. #define WNNC_NET_FARALLON 0x00120000
  38. #define WNNC_NET_APPLETALK 0x00130000
  39. #define WNNC_NET_INTERGRAPH 0x00140000
  40. #define WNNC_NET_SYMFONET 0x00150000
  41. #define WNNC_NET_CLEARCASE 0x00160000
  42. #define WNNC_NET_FRONTIER 0x00170000
  43. #define WNNC_NET_BMC 0x00180000
  44. #define WNNC_NET_DCE 0x00190000
  45. #define WNNC_NET_AVID 0x001A0000
  46. #define WNNC_NET_DOCUSPACE 0x001B0000
  47. #define WNNC_NET_MANGOSOFT 0x001C0000
  48. #define WNNC_NET_SERNET 0x001D0000
  49. #define WNNC_NET_RIVERFRONT1 0X001E0000
  50. #define WNNC_NET_RIVERFRONT2 0x001F0000
  51. #define WNNC_NET_DECORB 0x00200000
  52. #define WNNC_NET_PROTSTOR 0x00210000
  53. #define WNNC_NET_FJ_REDIR 0x00220000
  54. #define WNNC_NET_DISTINCT 0x00230000
  55. #define WNNC_NET_TWINS 0x00240000
  56. #define WNNC_NET_RDR2SAMPLE 0x00250000
  57. #define WNNC_NET_CSC 0x00260000
  58. #define WNNC_NET_3IN1 0x00270000
  59. #define WNNC_NET_EXTENDNET 0x00290000
  60. #define WNNC_NET_STAC 0x002A0000
  61. #define WNNC_NET_FOXBAT 0x002B0000
  62. #define WNNC_NET_YAHOO 0x002C0000
  63. #define WNNC_NET_EXIFS 0x002D0000
  64. #define WNNC_NET_DAV 0x002E0000
  65. #define WNNC_NET_KNOWARE 0x002F0000
  66. #define WNNC_NET_OBJECT_DIRE 0x00300000
  67. #define WNNC_NET_MASFAX 0x00310000
  68. #define WNNC_NET_HOB_NFS 0x00320000
  69. #define WNNC_NET_SHIVA 0x00330000
  70. #define WNNC_NET_IBMAL 0x00340000
  71. #define WNNC_NET_LOCK 0x00350000
  72. #define WNNC_NET_TERMSRV 0x00360000
  73. #define WNNC_CRED_MANAGER 0xFFFF0000
  74. //
  75. // Network Resources.
  76. //
  77. #define RESOURCE_CONNECTED 0x00000001
  78. #define RESOURCE_GLOBALNET 0x00000002
  79. #define RESOURCE_REMEMBERED 0x00000003
  80. #if(WINVER >= 0x0400)
  81. #define RESOURCE_RECENT 0x00000004
  82. #define RESOURCE_CONTEXT 0x00000005
  83. #endif /* WINVER >= 0x0400 */
  84. #define RESOURCETYPE_ANY 0x00000000
  85. #define RESOURCETYPE_DISK 0x00000001
  86. #define RESOURCETYPE_PRINT 0x00000002
  87. #if(WINVER >= 0x0400)
  88. #define RESOURCETYPE_RESERVED 0x00000008
  89. #endif /* WINVER >= 0x0400 */
  90. #define RESOURCETYPE_UNKNOWN 0xFFFFFFFF
  91. #define RESOURCEUSAGE_CONNECTABLE 0x00000001
  92. #define RESOURCEUSAGE_CONTAINER 0x00000002
  93. #if(WINVER >= 0x0400)
  94. #define RESOURCEUSAGE_NOLOCALDEVICE 0x00000004
  95. #define RESOURCEUSAGE_SIBLING 0x00000008
  96. #define RESOURCEUSAGE_ATTACHED 0x00000010
  97. #define RESOURCEUSAGE_ALL (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED)
  98. #endif /* WINVER >= 0x0400 */
  99. #define RESOURCEUSAGE_RESERVED 0x80000000
  100. #define RESOURCEDISPLAYTYPE_GENERIC 0x00000000
  101. #define RESOURCEDISPLAYTYPE_DOMAIN 0x00000001
  102. #define RESOURCEDISPLAYTYPE_SERVER 0x00000002
  103. #define RESOURCEDISPLAYTYPE_SHARE 0x00000003
  104. #define RESOURCEDISPLAYTYPE_FILE 0x00000004
  105. #define RESOURCEDISPLAYTYPE_GROUP 0x00000005
  106. #if(WINVER >= 0x0400)
  107. #define RESOURCEDISPLAYTYPE_NETWORK 0x00000006
  108. #define RESOURCEDISPLAYTYPE_ROOT 0x00000007
  109. #define RESOURCEDISPLAYTYPE_SHAREADMIN 0x00000008
  110. #define RESOURCEDISPLAYTYPE_DIRECTORY 0x00000009
  111. #endif /* WINVER >= 0x0400 */
  112. #define RESOURCEDISPLAYTYPE_TREE 0x0000000A
  113. #if(WINVER >= 0x0400)
  114. #define RESOURCEDISPLAYTYPE_NDSCONTAINER 0x0000000B
  115. #endif /* WINVER >= 0x0400 */
  116. typedef struct _NETRESOURCEA {
  117. DWORD dwScope;
  118. DWORD dwType;
  119. DWORD dwDisplayType;
  120. DWORD dwUsage;
  121. LPSTR lpLocalName;
  122. LPSTR lpRemoteName;
  123. LPSTR lpComment ;
  124. LPSTR lpProvider;
  125. }NETRESOURCEA, *LPNETRESOURCEA;
  126. typedef struct _NETRESOURCEW {
  127. DWORD dwScope;
  128. DWORD dwType;
  129. DWORD dwDisplayType;
  130. DWORD dwUsage;
  131. LPWSTR lpLocalName;
  132. LPWSTR lpRemoteName;
  133. LPWSTR lpComment ;
  134. LPWSTR lpProvider;
  135. }NETRESOURCEW, *LPNETRESOURCEW;
  136. #ifdef UNICODE
  137. typedef NETRESOURCEW NETRESOURCE;
  138. typedef LPNETRESOURCEW LPNETRESOURCE;
  139. #else
  140. typedef NETRESOURCEA NETRESOURCE;
  141. typedef LPNETRESOURCEA LPNETRESOURCE;
  142. #endif // UNICODE
  143. //
  144. // Network Connections.
  145. //
  146. #define NETPROPERTY_PERSISTENT 1
  147. #define CONNECT_UPDATE_PROFILE 0x00000001
  148. #define CONNECT_UPDATE_RECENT 0x00000002
  149. #define CONNECT_TEMPORARY 0x00000004
  150. #define CONNECT_INTERACTIVE 0x00000008
  151. #define CONNECT_PROMPT 0x00000010
  152. #define CONNECT_NEED_DRIVE 0x00000020
  153. #if(WINVER >= 0x0400)
  154. #define CONNECT_REFCOUNT 0x00000040
  155. #define CONNECT_REDIRECT 0x00000080
  156. #define CONNECT_LOCALDRIVE 0x00000100
  157. #define CONNECT_CURRENT_MEDIA 0x00000200
  158. #define CONNECT_DEFERRED 0x00000400
  159. #define CONNECT_RESERVED 0xFF000000
  160. #endif /* WINVER >= 0x0400 */
  161. #if(WINVER >= 0x0500)
  162. #define CONNECT_COMMANDLINE 0x00000800
  163. #define CONNECT_CMD_SAVECRED 0x00001000
  164. #endif /* WINVER >= 0x0500 */
  165. DWORD APIENTRY
  166. WNetAddConnectionA(
  167. IN LPCSTR lpRemoteName,
  168. IN LPCSTR lpPassword,
  169. IN LPCSTR lpLocalName
  170. );
  171. DWORD APIENTRY
  172. WNetAddConnectionW(
  173. IN LPCWSTR lpRemoteName,
  174. IN LPCWSTR lpPassword,
  175. IN LPCWSTR lpLocalName
  176. );
  177. #ifdef UNICODE
  178. #define WNetAddConnection WNetAddConnectionW
  179. #else
  180. #define WNetAddConnection WNetAddConnectionA
  181. #endif // !UNICODE
  182. DWORD APIENTRY
  183. WNetAddConnection2A(
  184. IN LPNETRESOURCEA lpNetResource,
  185. IN LPCSTR lpPassword,
  186. IN LPCSTR lpUserName,
  187. IN DWORD dwFlags
  188. );
  189. DWORD APIENTRY
  190. WNetAddConnection2W(
  191. IN LPNETRESOURCEW lpNetResource,
  192. IN LPCWSTR lpPassword,
  193. IN LPCWSTR lpUserName,
  194. IN DWORD dwFlags
  195. );
  196. #ifdef UNICODE
  197. #define WNetAddConnection2 WNetAddConnection2W
  198. #else
  199. #define WNetAddConnection2 WNetAddConnection2A
  200. #endif // !UNICODE
  201. DWORD APIENTRY
  202. WNetAddConnection3A(
  203. IN HWND hwndOwner,
  204. IN LPNETRESOURCEA lpNetResource,
  205. IN LPCSTR lpPassword,
  206. IN LPCSTR lpUserName,
  207. IN DWORD dwFlags
  208. );
  209. DWORD APIENTRY
  210. WNetAddConnection3W(
  211. IN HWND hwndOwner,
  212. IN LPNETRESOURCEW lpNetResource,
  213. IN LPCWSTR lpPassword,
  214. IN LPCWSTR lpUserName,
  215. IN DWORD dwFlags
  216. );
  217. #ifdef UNICODE
  218. #define WNetAddConnection3 WNetAddConnection3W
  219. #else
  220. #define WNetAddConnection3 WNetAddConnection3A
  221. #endif // !UNICODE
  222. DWORD APIENTRY
  223. WNetCancelConnectionA(
  224. IN LPCSTR lpName,
  225. IN BOOL fForce
  226. );
  227. DWORD APIENTRY
  228. WNetCancelConnectionW(
  229. IN LPCWSTR lpName,
  230. IN BOOL fForce
  231. );
  232. #ifdef UNICODE
  233. #define WNetCancelConnection WNetCancelConnectionW
  234. #else
  235. #define WNetCancelConnection WNetCancelConnectionA
  236. #endif // !UNICODE
  237. DWORD APIENTRY
  238. WNetCancelConnection2A(
  239. IN LPCSTR lpName,
  240. IN DWORD dwFlags,
  241. IN BOOL fForce
  242. );
  243. DWORD APIENTRY
  244. WNetCancelConnection2W(
  245. IN LPCWSTR lpName,
  246. IN DWORD dwFlags,
  247. IN BOOL fForce
  248. );
  249. #ifdef UNICODE
  250. #define WNetCancelConnection2 WNetCancelConnection2W
  251. #else
  252. #define WNetCancelConnection2 WNetCancelConnection2A
  253. #endif // !UNICODE
  254. DWORD APIENTRY
  255. WNetGetConnectionA(
  256. IN LPCSTR lpLocalName,
  257. OUT LPSTR lpRemoteName,
  258. IN OUT LPDWORD lpnLength
  259. );
  260. DWORD APIENTRY
  261. WNetGetConnectionW(
  262. IN LPCWSTR lpLocalName,
  263. OUT LPWSTR lpRemoteName,
  264. IN OUT LPDWORD lpnLength
  265. );
  266. #ifdef UNICODE
  267. #define WNetGetConnection WNetGetConnectionW
  268. #else
  269. #define WNetGetConnection WNetGetConnectionA
  270. #endif // !UNICODE
  271. #if(WINVER >= 0x0400)
  272. DWORD APIENTRY
  273. WNetUseConnectionA(
  274. IN HWND hwndOwner,
  275. IN LPNETRESOURCEA lpNetResource,
  276. IN LPCSTR lpPassword,
  277. IN LPCSTR lpUserID,
  278. IN DWORD dwFlags,
  279. OUT LPSTR lpAccessName,
  280. IN OUT LPDWORD lpBufferSize,
  281. OUT LPDWORD lpResult
  282. );
  283. DWORD APIENTRY
  284. WNetUseConnectionW(
  285. IN HWND hwndOwner,
  286. IN LPNETRESOURCEW lpNetResource,
  287. IN LPCWSTR lpPassword,
  288. IN LPCWSTR lpUserID,
  289. IN DWORD dwFlags,
  290. OUT LPWSTR lpAccessName,
  291. IN OUT LPDWORD lpBufferSize,
  292. OUT LPDWORD lpResult
  293. );
  294. #ifdef UNICODE
  295. #define WNetUseConnection WNetUseConnectionW
  296. #else
  297. #define WNetUseConnection WNetUseConnectionA
  298. #endif // !UNICODE
  299. #endif /* WINVER >= 0x0400 */
  300. //
  301. // Network Connection Dialogs.
  302. //
  303. DWORD APIENTRY
  304. WNetConnectionDialog(
  305. IN HWND hwnd,
  306. IN DWORD dwType
  307. );
  308. DWORD APIENTRY
  309. WNetDisconnectDialog(
  310. IN HWND hwnd,
  311. IN DWORD dwType
  312. );
  313. #if(WINVER >= 0x0400)
  314. typedef struct _CONNECTDLGSTRUCTA{
  315. DWORD cbStructure; /* size of this structure in bytes */
  316. HWND hwndOwner; /* owner window for the dialog */
  317. LPNETRESOURCEA lpConnRes;/* Requested Resource info */
  318. DWORD dwFlags; /* flags (see below) */
  319. DWORD dwDevNum; /* number of devices connected to */
  320. } CONNECTDLGSTRUCTA, FAR *LPCONNECTDLGSTRUCTA;
  321. typedef struct _CONNECTDLGSTRUCTW{
  322. DWORD cbStructure; /* size of this structure in bytes */
  323. HWND hwndOwner; /* owner window for the dialog */
  324. LPNETRESOURCEW lpConnRes;/* Requested Resource info */
  325. DWORD dwFlags; /* flags (see below) */
  326. DWORD dwDevNum; /* number of devices connected to */
  327. } CONNECTDLGSTRUCTW, FAR *LPCONNECTDLGSTRUCTW;
  328. #ifdef UNICODE
  329. typedef CONNECTDLGSTRUCTW CONNECTDLGSTRUCT;
  330. typedef LPCONNECTDLGSTRUCTW LPCONNECTDLGSTRUCT;
  331. #else
  332. typedef CONNECTDLGSTRUCTA CONNECTDLGSTRUCT;
  333. typedef LPCONNECTDLGSTRUCTA LPCONNECTDLGSTRUCT;
  334. #endif // UNICODE
  335. #define CONNDLG_RO_PATH 0x00000001 /* Resource path should be read-only */
  336. #define CONNDLG_CONN_POINT 0x00000002 /* Netware -style movable connection point enabled */
  337. #define CONNDLG_USE_MRU 0x00000004 /* Use MRU combobox */
  338. #define CONNDLG_HIDE_BOX 0x00000008 /* Hide persistent connect checkbox */
  339. /*
  340. * NOTE: Set at most ONE of the below flags. If neither flag is set,
  341. * then the persistence is set to whatever the user chose during
  342. * a previous connection
  343. */
  344. #define CONNDLG_PERSIST 0x00000010 /* Force persistent connection */
  345. #define CONNDLG_NOT_PERSIST 0x00000020 /* Force connection NOT persistent */
  346. DWORD APIENTRY
  347. WNetConnectionDialog1A(
  348. IN OUT LPCONNECTDLGSTRUCTA lpConnDlgStruct
  349. );
  350. DWORD APIENTRY
  351. WNetConnectionDialog1W(
  352. IN OUT LPCONNECTDLGSTRUCTW lpConnDlgStruct
  353. );
  354. #ifdef UNICODE
  355. #define WNetConnectionDialog1 WNetConnectionDialog1W
  356. #else
  357. #define WNetConnectionDialog1 WNetConnectionDialog1A
  358. #endif // !UNICODE
  359. typedef struct _DISCDLGSTRUCTA{
  360. DWORD cbStructure; /* size of this structure in bytes */
  361. HWND hwndOwner; /* owner window for the dialog */
  362. LPSTR lpLocalName; /* local device name */
  363. LPSTR lpRemoteName; /* network resource name */
  364. DWORD dwFlags; /* flags */
  365. } DISCDLGSTRUCTA, FAR *LPDISCDLGSTRUCTA;
  366. typedef struct _DISCDLGSTRUCTW{
  367. DWORD cbStructure; /* size of this structure in bytes */
  368. HWND hwndOwner; /* owner window for the dialog */
  369. LPWSTR lpLocalName; /* local device name */
  370. LPWSTR lpRemoteName; /* network resource name */
  371. DWORD dwFlags; /* flags */
  372. } DISCDLGSTRUCTW, FAR *LPDISCDLGSTRUCTW;
  373. #ifdef UNICODE
  374. typedef DISCDLGSTRUCTW DISCDLGSTRUCT;
  375. typedef LPDISCDLGSTRUCTW LPDISCDLGSTRUCT;
  376. #else
  377. typedef DISCDLGSTRUCTA DISCDLGSTRUCT;
  378. typedef LPDISCDLGSTRUCTA LPDISCDLGSTRUCT;
  379. #endif // UNICODE
  380. #define DISC_UPDATE_PROFILE 0x00000001
  381. #define DISC_NO_FORCE 0x00000040
  382. DWORD APIENTRY
  383. WNetDisconnectDialog1A(
  384. IN LPDISCDLGSTRUCTA lpConnDlgStruct
  385. );
  386. DWORD APIENTRY
  387. WNetDisconnectDialog1W(
  388. IN LPDISCDLGSTRUCTW lpConnDlgStruct
  389. );
  390. #ifdef UNICODE
  391. #define WNetDisconnectDialog1 WNetDisconnectDialog1W
  392. #else
  393. #define WNetDisconnectDialog1 WNetDisconnectDialog1A
  394. #endif // !UNICODE
  395. #endif /* WINVER >= 0x0400 */
  396. //
  397. // Network Browsing.
  398. //
  399. DWORD APIENTRY
  400. WNetOpenEnumA(
  401. IN DWORD dwScope,
  402. IN DWORD dwType,
  403. IN DWORD dwUsage,
  404. IN LPNETRESOURCEA lpNetResource,
  405. OUT LPHANDLE lphEnum
  406. );
  407. DWORD APIENTRY
  408. WNetOpenEnumW(
  409. IN DWORD dwScope,
  410. IN DWORD dwType,
  411. IN DWORD dwUsage,
  412. IN LPNETRESOURCEW lpNetResource,
  413. OUT LPHANDLE lphEnum
  414. );
  415. #ifdef UNICODE
  416. #define WNetOpenEnum WNetOpenEnumW
  417. #else
  418. #define WNetOpenEnum WNetOpenEnumA
  419. #endif // !UNICODE
  420. DWORD APIENTRY
  421. WNetEnumResourceA(
  422. IN HANDLE hEnum,
  423. IN OUT LPDWORD lpcCount,
  424. OUT LPVOID lpBuffer,
  425. IN OUT LPDWORD lpBufferSize
  426. );
  427. DWORD APIENTRY
  428. WNetEnumResourceW(
  429. IN HANDLE hEnum,
  430. IN OUT LPDWORD lpcCount,
  431. OUT LPVOID lpBuffer,
  432. IN OUT LPDWORD lpBufferSize
  433. );
  434. #ifdef UNICODE
  435. #define WNetEnumResource WNetEnumResourceW
  436. #else
  437. #define WNetEnumResource WNetEnumResourceA
  438. #endif // !UNICODE
  439. DWORD APIENTRY
  440. WNetCloseEnum(
  441. IN HANDLE hEnum
  442. );
  443. #if(WINVER >= 0x0400)
  444. DWORD APIENTRY
  445. WNetGetResourceParentA(
  446. IN LPNETRESOURCEA lpNetResource,
  447. OUT LPVOID lpBuffer,
  448. IN OUT LPDWORD lpcbBuffer
  449. );
  450. DWORD APIENTRY
  451. WNetGetResourceParentW(
  452. IN LPNETRESOURCEW lpNetResource,
  453. OUT LPVOID lpBuffer,
  454. IN OUT LPDWORD lpcbBuffer
  455. );
  456. #ifdef UNICODE
  457. #define WNetGetResourceParent WNetGetResourceParentW
  458. #else
  459. #define WNetGetResourceParent WNetGetResourceParentA
  460. #endif // !UNICODE
  461. DWORD APIENTRY
  462. WNetGetResourceInformationA(
  463. IN LPNETRESOURCEA lpNetResource,
  464. OUT LPVOID lpBuffer,
  465. IN OUT LPDWORD lpcbBuffer,
  466. OUT LPSTR *lplpSystem
  467. );
  468. DWORD APIENTRY
  469. WNetGetResourceInformationW(
  470. IN LPNETRESOURCEW lpNetResource,
  471. OUT LPVOID lpBuffer,
  472. IN OUT LPDWORD lpcbBuffer,
  473. OUT LPWSTR *lplpSystem
  474. );
  475. #ifdef UNICODE
  476. #define WNetGetResourceInformation WNetGetResourceInformationW
  477. #else
  478. #define WNetGetResourceInformation WNetGetResourceInformationA
  479. #endif // !UNICODE
  480. #endif /* WINVER >= 0x0400 */
  481. //
  482. // Universal Naming.
  483. //
  484. #define UNIVERSAL_NAME_INFO_LEVEL 0x00000001
  485. #define REMOTE_NAME_INFO_LEVEL 0x00000002
  486. typedef struct _UNIVERSAL_NAME_INFOA {
  487. LPSTR lpUniversalName;
  488. }UNIVERSAL_NAME_INFOA, *LPUNIVERSAL_NAME_INFOA;
  489. typedef struct _UNIVERSAL_NAME_INFOW {
  490. LPWSTR lpUniversalName;
  491. }UNIVERSAL_NAME_INFOW, *LPUNIVERSAL_NAME_INFOW;
  492. #ifdef UNICODE
  493. typedef UNIVERSAL_NAME_INFOW UNIVERSAL_NAME_INFO;
  494. typedef LPUNIVERSAL_NAME_INFOW LPUNIVERSAL_NAME_INFO;
  495. #else
  496. typedef UNIVERSAL_NAME_INFOA UNIVERSAL_NAME_INFO;
  497. typedef LPUNIVERSAL_NAME_INFOA LPUNIVERSAL_NAME_INFO;
  498. #endif // UNICODE
  499. typedef struct _REMOTE_NAME_INFOA {
  500. LPSTR lpUniversalName;
  501. LPSTR lpConnectionName;
  502. LPSTR lpRemainingPath;
  503. }REMOTE_NAME_INFOA, *LPREMOTE_NAME_INFOA;
  504. typedef struct _REMOTE_NAME_INFOW {
  505. LPWSTR lpUniversalName;
  506. LPWSTR lpConnectionName;
  507. LPWSTR lpRemainingPath;
  508. }REMOTE_NAME_INFOW, *LPREMOTE_NAME_INFOW;
  509. #ifdef UNICODE
  510. typedef REMOTE_NAME_INFOW REMOTE_NAME_INFO;
  511. typedef LPREMOTE_NAME_INFOW LPREMOTE_NAME_INFO;
  512. #else
  513. typedef REMOTE_NAME_INFOA REMOTE_NAME_INFO;
  514. typedef LPREMOTE_NAME_INFOA LPREMOTE_NAME_INFO;
  515. #endif // UNICODE
  516. DWORD APIENTRY
  517. WNetGetUniversalNameA(
  518. IN LPCSTR lpLocalPath,
  519. IN DWORD dwInfoLevel,
  520. OUT LPVOID lpBuffer,
  521. IN OUT LPDWORD lpBufferSize
  522. );
  523. DWORD APIENTRY
  524. WNetGetUniversalNameW(
  525. IN LPCWSTR lpLocalPath,
  526. IN DWORD dwInfoLevel,
  527. OUT LPVOID lpBuffer,
  528. IN OUT LPDWORD lpBufferSize
  529. );
  530. #ifdef UNICODE
  531. #define WNetGetUniversalName WNetGetUniversalNameW
  532. #else
  533. #define WNetGetUniversalName WNetGetUniversalNameA
  534. #endif // !UNICODE
  535. //
  536. // Authentication and Logon/Logoff.
  537. //
  538. DWORD APIENTRY
  539. WNetGetUserA(
  540. IN LPCSTR lpName,
  541. OUT LPSTR lpUserName,
  542. IN OUT LPDWORD lpnLength
  543. );
  544. DWORD APIENTRY
  545. WNetGetUserW(
  546. IN LPCWSTR lpName,
  547. OUT LPWSTR lpUserName,
  548. IN OUT LPDWORD lpnLength
  549. );
  550. #ifdef UNICODE
  551. #define WNetGetUser WNetGetUserW
  552. #else
  553. #define WNetGetUser WNetGetUserA
  554. #endif // !UNICODE
  555. //
  556. // Other.
  557. //
  558. #if(WINVER >= 0x0400)
  559. #define WNFMT_MULTILINE 0x01
  560. #define WNFMT_ABBREVIATED 0x02
  561. #define WNFMT_INENUM 0x10
  562. #define WNFMT_CONNECTION 0x20
  563. #endif /* WINVER >= 0x0400 */
  564. #if(WINVER >= 0x0400)
  565. DWORD APIENTRY
  566. WNetGetProviderNameA(
  567. IN DWORD dwNetType,
  568. OUT LPSTR lpProviderName,
  569. IN OUT LPDWORD lpBufferSize
  570. );
  571. DWORD APIENTRY
  572. WNetGetProviderNameW(
  573. IN DWORD dwNetType,
  574. OUT LPWSTR lpProviderName,
  575. IN OUT LPDWORD lpBufferSize
  576. );
  577. #ifdef UNICODE
  578. #define WNetGetProviderName WNetGetProviderNameW
  579. #else
  580. #define WNetGetProviderName WNetGetProviderNameA
  581. #endif // !UNICODE
  582. typedef struct _NETINFOSTRUCT{
  583. DWORD cbStructure;
  584. DWORD dwProviderVersion;
  585. DWORD dwStatus;
  586. DWORD dwCharacteristics;
  587. ULONG_PTR dwHandle;
  588. WORD wNetType;
  589. DWORD dwPrinters;
  590. DWORD dwDrives;
  591. } NETINFOSTRUCT, FAR *LPNETINFOSTRUCT;
  592. #define NETINFO_DLL16 0x00000001 /* Provider running as 16 bit Winnet Driver */
  593. #define NETINFO_DISKRED 0x00000004 /* Provider requires disk redirections to connect */
  594. #define NETINFO_PRINTERRED 0x00000008 /* Provider requires printer redirections to connect */
  595. DWORD APIENTRY
  596. WNetGetNetworkInformationA(
  597. IN LPCSTR lpProvider,
  598. OUT LPNETINFOSTRUCT lpNetInfoStruct
  599. );
  600. DWORD APIENTRY
  601. WNetGetNetworkInformationW(
  602. IN LPCWSTR lpProvider,
  603. OUT LPNETINFOSTRUCT lpNetInfoStruct
  604. );
  605. #ifdef UNICODE
  606. #define WNetGetNetworkInformation WNetGetNetworkInformationW
  607. #else
  608. #define WNetGetNetworkInformation WNetGetNetworkInformationA
  609. #endif // !UNICODE
  610. //
  611. // User Profiles.
  612. //
  613. typedef UINT (FAR PASCAL *PFNGETPROFILEPATHA) (
  614. LPCSTR pszUsername,
  615. LPSTR pszBuffer,
  616. UINT cbBuffer
  617. );
  618. typedef UINT (FAR PASCAL *PFNGETPROFILEPATHW) (
  619. LPCWSTR pszUsername,
  620. LPWSTR pszBuffer,
  621. UINT cbBuffer
  622. );
  623. #ifdef UNICODE
  624. #define PFNGETPROFILEPATH PFNGETPROFILEPATHW
  625. #else
  626. #define PFNGETPROFILEPATH PFNGETPROFILEPATHA
  627. #endif // !UNICODE
  628. typedef UINT (FAR PASCAL *PFNRECONCILEPROFILEA) (
  629. LPCSTR pszCentralFile,
  630. LPCSTR pszLocalFile,
  631. DWORD dwFlags
  632. );
  633. typedef UINT (FAR PASCAL *PFNRECONCILEPROFILEW) (
  634. LPCWSTR pszCentralFile,
  635. LPCWSTR pszLocalFile,
  636. DWORD dwFlags
  637. );
  638. #ifdef UNICODE
  639. #define PFNRECONCILEPROFILE PFNRECONCILEPROFILEW
  640. #else
  641. #define PFNRECONCILEPROFILE PFNRECONCILEPROFILEA
  642. #endif // !UNICODE
  643. #define RP_LOGON 0x01 /* if set, do for logon, else for logoff */
  644. #define RP_INIFILE 0x02 /* if set, reconcile .INI file, else reg. hive */
  645. //
  646. // Policies.
  647. //
  648. typedef BOOL (FAR PASCAL *PFNPROCESSPOLICIESA) (
  649. HWND hwnd,
  650. LPCSTR pszPath,
  651. LPCSTR pszUsername,
  652. LPCSTR pszComputerName,
  653. DWORD dwFlags
  654. );
  655. typedef BOOL (FAR PASCAL *PFNPROCESSPOLICIESW) (
  656. HWND hwnd,
  657. LPCWSTR pszPath,
  658. LPCWSTR pszUsername,
  659. LPCWSTR pszComputerName,
  660. DWORD dwFlags
  661. );
  662. #ifdef UNICODE
  663. #define PFNPROCESSPOLICIES PFNPROCESSPOLICIESW
  664. #else
  665. #define PFNPROCESSPOLICIES PFNPROCESSPOLICIESA
  666. #endif // !UNICODE
  667. #define PP_DISPLAYERRORS 0x01 /* if set, display error messages, else fail silently if error */
  668. #endif /* WINVER >= 0x0400 */
  669. //
  670. // Error handling.
  671. //
  672. DWORD APIENTRY
  673. WNetGetLastErrorA(
  674. OUT LPDWORD lpError,
  675. OUT LPSTR lpErrorBuf,
  676. IN DWORD nErrorBufSize,
  677. OUT LPSTR lpNameBuf,
  678. IN DWORD nNameBufSize
  679. );
  680. DWORD APIENTRY
  681. WNetGetLastErrorW(
  682. OUT LPDWORD lpError,
  683. OUT LPWSTR lpErrorBuf,
  684. IN DWORD nErrorBufSize,
  685. OUT LPWSTR lpNameBuf,
  686. IN DWORD nNameBufSize
  687. );
  688. #ifdef UNICODE
  689. #define WNetGetLastError WNetGetLastErrorW
  690. #else
  691. #define WNetGetLastError WNetGetLastErrorA
  692. #endif // !UNICODE
  693. //
  694. // STATUS CODES
  695. //
  696. // General
  697. #define WN_SUCCESS NO_ERROR
  698. #define WN_NO_ERROR NO_ERROR
  699. #define WN_NOT_SUPPORTED ERROR_NOT_SUPPORTED
  700. #define WN_CANCEL ERROR_CANCELLED
  701. #define WN_RETRY ERROR_RETRY
  702. #define WN_NET_ERROR ERROR_UNEXP_NET_ERR
  703. #define WN_MORE_DATA ERROR_MORE_DATA
  704. #define WN_BAD_POINTER ERROR_INVALID_ADDRESS
  705. #define WN_BAD_VALUE ERROR_INVALID_PARAMETER
  706. #define WN_BAD_USER ERROR_BAD_USERNAME
  707. #define WN_BAD_PASSWORD ERROR_INVALID_PASSWORD
  708. #define WN_ACCESS_DENIED ERROR_ACCESS_DENIED
  709. #define WN_FUNCTION_BUSY ERROR_BUSY
  710. #define WN_WINDOWS_ERROR ERROR_UNEXP_NET_ERR
  711. #define WN_OUT_OF_MEMORY ERROR_NOT_ENOUGH_MEMORY
  712. #define WN_NO_NETWORK ERROR_NO_NETWORK
  713. #define WN_EXTENDED_ERROR ERROR_EXTENDED_ERROR
  714. #define WN_BAD_LEVEL ERROR_INVALID_LEVEL
  715. #define WN_BAD_HANDLE ERROR_INVALID_HANDLE
  716. #if(WINVER >= 0x0400)
  717. #define WN_NOT_INITIALIZING ERROR_ALREADY_INITIALIZED
  718. #define WN_NO_MORE_DEVICES ERROR_NO_MORE_DEVICES
  719. #endif /* WINVER >= 0x0400 */
  720. // Connection
  721. #define WN_NOT_CONNECTED ERROR_NOT_CONNECTED
  722. #define WN_OPEN_FILES ERROR_OPEN_FILES
  723. #define WN_DEVICE_IN_USE ERROR_DEVICE_IN_USE
  724. #define WN_BAD_NETNAME ERROR_BAD_NET_NAME
  725. #define WN_BAD_LOCALNAME ERROR_BAD_DEVICE
  726. #define WN_ALREADY_CONNECTED ERROR_ALREADY_ASSIGNED
  727. #define WN_DEVICE_ERROR ERROR_GEN_FAILURE
  728. #define WN_CONNECTION_CLOSED ERROR_CONNECTION_UNAVAIL
  729. #define WN_NO_NET_OR_BAD_PATH ERROR_NO_NET_OR_BAD_PATH
  730. #define WN_BAD_PROVIDER ERROR_BAD_PROVIDER
  731. #define WN_CANNOT_OPEN_PROFILE ERROR_CANNOT_OPEN_PROFILE
  732. #define WN_BAD_PROFILE ERROR_BAD_PROFILE
  733. #define WN_BAD_DEV_TYPE ERROR_BAD_DEV_TYPE
  734. #define WN_DEVICE_ALREADY_REMEMBERED ERROR_DEVICE_ALREADY_REMEMBERED
  735. #define WN_CONNECTED_OTHER_PASSWORD ERROR_CONNECTED_OTHER_PASSWORD
  736. #if(WINVER >= 0x0501)
  737. #define WN_CONNECTED_OTHER_PASSWORD_DEFAULT ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT
  738. #endif /* WINVER >= 0x0501 */
  739. // Enumeration
  740. #define WN_NO_MORE_ENTRIES ERROR_NO_MORE_ITEMS
  741. #define WN_NOT_CONTAINER ERROR_NOT_CONTAINER
  742. #if(WINVER >= 0x0400)
  743. // Authentication
  744. #define WN_NOT_AUTHENTICATED ERROR_NOT_AUTHENTICATED
  745. #define WN_NOT_LOGGED_ON ERROR_NOT_LOGGED_ON
  746. #define WN_NOT_VALIDATED ERROR_NO_LOGON_SERVERS
  747. #endif /* WINVER >= 0x0400 */
  748. //
  749. // For Shell
  750. //
  751. #if(WINVER >= 0x0400)
  752. typedef struct _NETCONNECTINFOSTRUCT{
  753. DWORD cbStructure;
  754. DWORD dwFlags;
  755. DWORD dwSpeed;
  756. DWORD dwDelay;
  757. DWORD dwOptDataSize;
  758. } NETCONNECTINFOSTRUCT, *LPNETCONNECTINFOSTRUCT;
  759. #define WNCON_FORNETCARD 0x00000001
  760. #define WNCON_NOTROUTED 0x00000002
  761. #define WNCON_SLOWLINK 0x00000004
  762. #define WNCON_DYNAMIC 0x00000008
  763. DWORD APIENTRY
  764. MultinetGetConnectionPerformanceA(
  765. IN LPNETRESOURCEA lpNetResource,
  766. OUT LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct
  767. );
  768. DWORD APIENTRY
  769. MultinetGetConnectionPerformanceW(
  770. IN LPNETRESOURCEW lpNetResource,
  771. OUT LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct
  772. );
  773. #ifdef UNICODE
  774. #define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceW
  775. #else
  776. #define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceA
  777. #endif // !UNICODE
  778. #endif /* WINVER >= 0x0400 */
  779. #ifdef __cplusplus
  780. }
  781. #endif
  782. #endif // _WINNETWK_