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