home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / winnetwk.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  23KB  |  806 lines

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