home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / WINNETWK.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  22KB  |  796 lines

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