winnetwk.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 22k
Category:

Windows Kernel

Development Platform:

Visual C++

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