home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / win32 / Winnetwk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-08  |  22.2 KB  |  821 lines

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