home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / WINNETWK.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  8.4 KB  |  372 lines

  1. /*++
  2.  
  3. Copyright (c) 1991  Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     winnetwk.h
  8.  
  9. Abstract:
  10.  
  11.     Standard WINNET Header File for NT-WIN32
  12.  
  13. Author:
  14.  
  15.     Dan Lafferty (danl)     08-Oct-1991
  16.  
  17. Environment:
  18.  
  19.     User Mode -Win32
  20.  
  21. Notes:
  22.  
  23.     optional-notes
  24.  
  25. Revision History:
  26.  
  27.     08-Oct-1991     danl
  28.         created from winnet 3.10.05 version.
  29.  
  30.     10-Dec-1991     Johnl
  31.         Updated to conform to Win32 Net API Spec. vers 0.4
  32.  
  33.     01-Apr-1992     JohnL
  34.         Changed CONNECTION_REMEMBERED flag to CONNECT_UPDATE_PROFILE
  35.         Updated WNetCancelConnection2 to match spec.
  36.  
  37.     23-Apr-1992     Johnl
  38.         Added error code mappings.  Changed byte counts to character counts.
  39.  
  40.     27-May-1992     ChuckC
  41.         Made into .x file.
  42.  
  43. --*/
  44.  
  45. #ifndef _WINNETWK_
  46. #define _WINNETWK_
  47.  
  48. #ifndef __WINDEF_H
  49. #include <windef.h>
  50. #endif
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55.  
  56. //
  57. // RESOURCE ENUMERATION
  58. //
  59.  
  60. #define RESOURCE_CONNECTED      0x00000001
  61. #define RESOURCE_GLOBALNET      0x00000002
  62. #define RESOURCE_REMEMBERED     0x00000003
  63.  
  64. #define RESOURCETYPE_ANY        0x00000000
  65. #define RESOURCETYPE_DISK       0x00000001
  66. #define RESOURCETYPE_PRINT      0x00000002
  67.  
  68. #define RESOURCETYPE_UNKNOWN    0xFFFFFFFF
  69.  
  70. #define RESOURCEUSAGE_CONNECTABLE   0x00000001
  71. #define RESOURCEUSAGE_CONTAINER     0x00000002
  72. #define RESOURCEUSAGE_RESERVED      0x80000000
  73.  
  74. #define RESOURCEDISPLAYTYPE_GENERIC        0x00000000
  75. #define RESOURCEDISPLAYTYPE_DOMAIN         0x00000001
  76. #define RESOURCEDISPLAYTYPE_SERVER         0x00000002
  77. #define RESOURCEDISPLAYTYPE_SHARE          0x00000003
  78.  
  79. #define RESOURCEDISPLAYTYPE_FILE           0x00000004
  80. #define RESOURCEDISPLAYTYPE_GROUP          0x00000005
  81.  
  82. typedef struct  _NETRESOURCEA {
  83.     DWORD    dwScope;
  84.     DWORD    dwType;
  85.     DWORD    dwDisplayType;
  86.     DWORD    dwUsage;
  87.     LPSTR    lpLocalName;
  88.     LPSTR    lpRemoteName;
  89.     LPSTR    lpComment ;
  90.     LPSTR    lpProvider;
  91. }NETRESOURCEA, *LPNETRESOURCEA;
  92. typedef struct  _NETRESOURCEW {
  93.     DWORD    dwScope;
  94.     DWORD    dwType;
  95.     DWORD    dwDisplayType;
  96.     DWORD    dwUsage;
  97.     LPWSTR   lpLocalName;
  98.     LPWSTR   lpRemoteName;
  99.     LPWSTR   lpComment ;
  100.     LPWSTR   lpProvider;
  101. }NETRESOURCEW, *LPNETRESOURCEW;
  102. #ifdef UNICODE
  103. typedef NETRESOURCEW NETRESOURCE;
  104. typedef LPNETRESOURCEW LPNETRESOURCE;
  105. #else
  106. typedef NETRESOURCEA NETRESOURCE;
  107. typedef LPNETRESOURCEA LPNETRESOURCE;
  108. #endif // UNICODE
  109.  
  110.  
  111. //
  112. //  CONNECTIONS
  113. //
  114.  
  115. #define CONNECT_UPDATE_PROFILE     0x00000001
  116.  
  117. DWORD APIENTRY
  118. WNetAddConnectionA (
  119.      LPSTR   lpRemoteName,
  120.      LPSTR   lpPassword,
  121.      LPSTR   lpLocalName
  122.     );
  123. DWORD APIENTRY
  124. WNetAddConnectionW (
  125.      LPWSTR   lpRemoteName,
  126.      LPWSTR   lpPassword,
  127.      LPWSTR   lpLocalName
  128.     );
  129. #ifdef UNICODE
  130. #define WNetAddConnection  WNetAddConnectionW
  131. #else
  132. #define WNetAddConnection  WNetAddConnectionA
  133. #endif // !UNICODE
  134.  
  135.  
  136. DWORD APIENTRY
  137. WNetAddConnection2A (
  138.      LPNETRESOURCEA lpNetResource,
  139.      LPSTR        lpPassword,
  140.      LPSTR        lpUserName,
  141.      DWORD          dwFlags
  142.     );
  143. DWORD APIENTRY
  144. WNetAddConnection2W (
  145.      LPNETRESOURCEW lpNetResource,
  146.      LPWSTR        lpPassword,
  147.      LPWSTR        lpUserName,
  148.      DWORD          dwFlags
  149.     );
  150. #ifdef UNICODE
  151. #define WNetAddConnection2  WNetAddConnection2W
  152. #else
  153. #define WNetAddConnection2  WNetAddConnection2A
  154. #endif // !UNICODE
  155.  
  156. DWORD APIENTRY
  157. WNetCancelConnectionA (
  158.      LPSTR lpName,
  159.      BOOL    fForce
  160.     );
  161. DWORD APIENTRY
  162. WNetCancelConnectionW (
  163.      LPWSTR lpName,
  164.      BOOL    fForce
  165.     );
  166. #ifdef UNICODE
  167. #define WNetCancelConnection  WNetCancelConnectionW
  168. #else
  169. #define WNetCancelConnection  WNetCancelConnectionA
  170. #endif // !UNICODE
  171.  
  172. DWORD APIENTRY
  173. WNetCancelConnection2A (
  174.      LPSTR lpName,
  175.      DWORD   dwFlags,
  176.      BOOL    fForce
  177.     );
  178. DWORD APIENTRY
  179. WNetCancelConnection2W (
  180.      LPWSTR lpName,
  181.      DWORD   dwFlags,
  182.      BOOL    fForce
  183.     );
  184. #ifdef UNICODE
  185. #define WNetCancelConnection2  WNetCancelConnection2W
  186. #else
  187. #define WNetCancelConnection2  WNetCancelConnection2A
  188. #endif // !UNICODE
  189.  
  190.  
  191. DWORD APIENTRY
  192. WNetGetConnectionA (
  193.      LPSTR lpLocalName,
  194.      LPSTR lpRemoteName,
  195.      LPDWORD lpnLength
  196.     );
  197. DWORD APIENTRY
  198. WNetGetConnectionW (
  199.      LPWSTR lpLocalName,
  200.      LPWSTR lpRemoteName,
  201.      LPDWORD lpnLength
  202.     );
  203. #ifdef UNICODE
  204. #define WNetGetConnection  WNetGetConnectionW
  205. #else
  206. #define WNetGetConnection  WNetGetConnectionA
  207. #endif // !UNICODE
  208.  
  209.  
  210. DWORD APIENTRY
  211. WNetOpenEnumA (
  212.      DWORD          dwScope,
  213.      DWORD          dwType,
  214.      DWORD          dwUsage,
  215.      LPNETRESOURCEA lpNetResource,
  216.      LPHANDLE       lphEnum
  217.     );
  218. DWORD APIENTRY
  219. WNetOpenEnumW (
  220.      DWORD          dwScope,
  221.      DWORD          dwType,
  222.      DWORD          dwUsage,
  223.      LPNETRESOURCEW lpNetResource,
  224.      LPHANDLE       lphEnum
  225.     );
  226. #ifdef UNICODE
  227. #define WNetOpenEnum  WNetOpenEnumW
  228. #else
  229. #define WNetOpenEnum  WNetOpenEnumA
  230. #endif // !UNICODE
  231.  
  232. DWORD APIENTRY
  233. WNetEnumResourceA (
  234.      HANDLE  hEnum,
  235.      LPDWORD lpcCount,
  236.      LPVOID  lpBuffer,
  237.      LPDWORD lpBufferSize
  238.     );
  239. DWORD APIENTRY
  240. WNetEnumResourceW (
  241.      HANDLE  hEnum,
  242.      LPDWORD lpcCount,
  243.      LPVOID  lpBuffer,
  244.      LPDWORD lpBufferSize
  245.     );
  246. #ifdef UNICODE
  247. #define WNetEnumResource  WNetEnumResourceW
  248. #else
  249. #define WNetEnumResource  WNetEnumResourceA
  250. #endif // !UNICODE
  251.  
  252. DWORD APIENTRY
  253. WNetCloseEnum (
  254.     HANDLE   hEnum
  255.     );
  256.  
  257. //
  258. //  OTHER
  259. //
  260.  
  261. DWORD APIENTRY
  262. WNetGetUserA (
  263.      LPSTR  lpName,
  264.      LPSTR  lpUserName,
  265.      LPDWORD  lpnLength
  266.     );
  267. DWORD APIENTRY
  268. WNetGetUserW (
  269.      LPWSTR  lpName,
  270.      LPWSTR  lpUserName,
  271.      LPDWORD  lpnLength
  272.     );
  273. #ifdef UNICODE
  274. #define WNetGetUser  WNetGetUserW
  275. #else
  276. #define WNetGetUser  WNetGetUserA
  277. #endif // !UNICODE
  278.  
  279. //
  280. //  BROWSE DIALOGS
  281. //
  282.  
  283. DWORD APIENTRY WNetConnectionDialog(
  284.     HWND  hwnd,
  285.     DWORD dwType
  286.     );
  287.  
  288. DWORD APIENTRY WNetDisconnectDialog(
  289.     HWND  hwnd,
  290.     DWORD dwType
  291.     );
  292.  
  293. //
  294. //  ERRORS
  295. //
  296.  
  297. DWORD APIENTRY
  298. WNetGetLastErrorA (
  299.      LPDWORD    lpError,
  300.      LPSTR    lpErrorBuf,
  301.      DWORD      nErrorBufSize,
  302.      LPSTR    lpNameBuf,
  303.      DWORD      nNameBufSize
  304.     );
  305. DWORD APIENTRY
  306. WNetGetLastErrorW (
  307.      LPDWORD    lpError,
  308.      LPWSTR    lpErrorBuf,
  309.      DWORD      nErrorBufSize,
  310.      LPWSTR    lpNameBuf,
  311.      DWORD      nNameBufSize
  312.     );
  313. #ifdef UNICODE
  314. #define WNetGetLastError  WNetGetLastErrorW
  315. #else
  316. #define WNetGetLastError  WNetGetLastErrorA
  317. #endif // !UNICODE
  318.  
  319. //
  320. //  STATUS CODES
  321. //
  322. //  This section is provided for backward compatibility.  Use of the ERROR_*
  323. //  codes is preferred.  The WN_* error codes may not be available in future
  324. //  releases.
  325. //
  326.  
  327. // General
  328.  
  329. #define WN_SUCCESS                 NO_ERROR
  330. #define WN_NOT_SUPPORTED           ERROR_NOT_SUPPORTED
  331. #define WN_NET_ERROR               ERROR_UNEXP_NET_ERR
  332. #define WN_MORE_DATA               ERROR_MORE_DATA
  333. #define WN_BAD_POINTER             ERROR_INVALID_ADDRESS
  334. #define WN_BAD_VALUE               ERROR_INVALID_PARAMETER
  335. #define WN_BAD_PASSWORD            ERROR_INVALID_PASSWORD
  336. #define WN_ACCESS_DENIED           ERROR_ACCESS_DENIED
  337. #define WN_FUNCTION_BUSY           ERROR_BUSY
  338. #define WN_WINDOWS_ERROR           ERROR_UNEXP_NET_ERR
  339. #define WN_BAD_USER                ERROR_BAD_USERNAME
  340. #define WN_OUT_OF_MEMORY           ERROR_NOT_ENOUGH_MEMORY
  341. #define WN_NO_NETWORK              ERROR_NO_NETWORK
  342. #define WN_EXTENDED_ERROR          ERROR_EXTENDED_ERROR
  343.  
  344. // Connection
  345.  
  346. #define WN_NOT_CONNECTED           ERROR_NOT_CONNECTED
  347. #define WN_OPEN_FILES              ERROR_OPEN_FILES
  348. #define WN_DEVICE_IN_USE           ERROR_DEVICE_IN_USE
  349. #define WN_BAD_NETNAME             ERROR_BAD_NET_NAME
  350. #define WN_BAD_LOCALNAME           ERROR_BAD_DEVICE
  351. #define WN_ALREADY_CONNECTED       ERROR_ALREADY_ASSIGNED
  352. #define WN_DEVICE_ERROR            ERROR_GEN_FAILURE
  353. #define WN_CONNECTION_CLOSED       ERROR_CONNECTION_UNAVAIL
  354. #define WN_NO_NET_OR_BAD_PATH      ERROR_NO_NET_OR_BAD_PATH
  355. #define WN_BAD_PROVIDER            ERROR_BAD_PROVIDER
  356. #define WN_CANNOT_OPEN_PROFILE     ERROR_CANNOT_OPEN_PROFILE
  357. #define WN_BAD_PROFILE             ERROR_BAD_PROFILE
  358.  
  359. // Enumeration
  360.  
  361. #define WN_BAD_HANDLE              ERROR_INVALID_HANDLE
  362. #define WN_NO_MORE_ENTRIES         ERROR_NO_MORE_ITEMS
  363. #define WN_NOT_CONTAINER           ERROR_NOT_CONTAINER
  364.  
  365. #define WN_NO_ERROR                NO_ERROR
  366.  
  367. #ifdef __cplusplus
  368. }
  369. #endif
  370.  
  371. #endif  // _WINNETWK_
  372.