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.

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