home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / winnetwk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  15.0 KB  |  516 lines

  1. /*++
  2.  
  3. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  4. ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  5. THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  6. PARTICULAR PURPOSE.
  7. Copyright (c) 1995, 1996, 1997  Microsoft Corporation
  8.  
  9. Module Name:
  10.  
  11.     winnetwk.h
  12.  
  13. Abstract:
  14.  
  15.     Standard WINNET Header File for WIN32
  16.  
  17. Notes:
  18.  
  19.         
  20. --*/
  21.  
  22. // @CESYSGEN IF CE_MODULES_REDIR
  23.  
  24. #ifndef _WINNETWK_
  25. #define _WINNETWK_
  26.  
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  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.  
  57.  
  58. //
  59. //  Network Resources.
  60. //
  61.  
  62. #define RESOURCE_CONNECTED      0x00000001
  63. #define RESOURCE_GLOBALNET      0x00000002
  64. #define RESOURCE_REMEMBERED     0x00000003
  65. #if(WINVER >= 0x0400)
  66. #define RESOURCE_RECENT         0x00000004
  67. #define RESOURCE_CONTEXT        0x00000005
  68. #endif /* WINVER >= 0x0400 */
  69.  
  70. #define RESOURCETYPE_ANY        0x00000000
  71. #define RESOURCETYPE_DISK       0x00000001
  72. #define RESOURCETYPE_PRINT      0x00000002
  73. #if(WINVER >= 0x0400)
  74. #define RESOURCETYPE_RESERVED   0x00000008
  75. #endif /* WINVER >= 0x0400 */
  76. #define RESOURCETYPE_UNKNOWN    0xFFFFFFFF
  77.  
  78. #define RESOURCEUSAGE_CONNECTABLE   0x00000001
  79. #define RESOURCEUSAGE_CONTAINER     0x00000002
  80. #if(WINVER >= 0x0400)
  81. #define RESOURCEUSAGE_NOLOCALDEVICE 0x00000004
  82. #define RESOURCEUSAGE_SIBLING       0x00000008
  83. #define RESOURCEUSAGE_ALL           (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER)
  84. #endif /* WINVER >= 0x0400 */
  85. #define RESOURCEUSAGE_RESERVED      0x80000000
  86.  
  87. #define RESOURCEDISPLAYTYPE_GENERIC        0x00000000
  88. #define RESOURCEDISPLAYTYPE_DOMAIN         0x00000001
  89. #define RESOURCEDISPLAYTYPE_SERVER         0x00000002
  90. #define RESOURCEDISPLAYTYPE_SHARE          0x00000003
  91. #define RESOURCEDISPLAYTYPE_FILE           0x00000004
  92. #define RESOURCEDISPLAYTYPE_GROUP          0x00000005
  93. #if(WINVER >= 0x0400)
  94. #define RESOURCEDISPLAYTYPE_NETWORK        0x00000006
  95. #define RESOURCEDISPLAYTYPE_ROOT           0x00000007
  96. #define RESOURCEDISPLAYTYPE_SHAREADMIN     0x00000008
  97. #define RESOURCEDISPLAYTYPE_DIRECTORY      0x00000009
  98. #endif /* WINVER >= 0x0400 */
  99. #define RESOURCEDISPLAYTYPE_TREE           0x0000000A
  100.  
  101. typedef struct  _NETRESOURCEA {
  102.     DWORD    dwScope;
  103.     DWORD    dwType;
  104.     DWORD    dwDisplayType;
  105.     DWORD    dwUsage;
  106.     LPSTR    lpLocalName;
  107.     LPSTR    lpRemoteName;
  108.     LPSTR    lpComment ;
  109.     LPSTR    lpProvider;
  110. }NETRESOURCEA, *LPNETRESOURCEA;
  111. typedef struct  _NETRESOURCEW {
  112.     DWORD    dwScope;
  113.     DWORD    dwType;
  114.     DWORD    dwDisplayType;
  115.     DWORD    dwUsage;
  116.     LPWSTR   lpLocalName;
  117.     LPWSTR   lpRemoteName;
  118.     LPWSTR   lpComment ;
  119.     LPWSTR   lpProvider;
  120. }NETRESOURCEW, *LPNETRESOURCEW;
  121. #ifdef UNICODE
  122. typedef NETRESOURCEW NETRESOURCE;
  123. typedef LPNETRESOURCEW LPNETRESOURCE;
  124. #else
  125. typedef NETRESOURCEA NETRESOURCE;
  126. typedef LPNETRESOURCEA LPNETRESOURCE;
  127. #endif // UNICODE
  128.  
  129.  
  130. //
  131. //  Network Connections.
  132. // 
  133.  
  134. #define NETPROPERTY_PERSISTENT       1
  135.  
  136. #define CONNECT_UPDATE_PROFILE      0x00000001
  137. #define CONNECT_UPDATE_RECENT       0x00000002
  138. #define CONNECT_TEMPORARY           0x00000004
  139. #define CONNECT_INTERACTIVE         0x00000008
  140. #define CONNECT_PROMPT              0x00000010
  141. #define CONNECT_NEED_DRIVE          0x00000020
  142. #if(WINVER >= 0x0400)
  143. #define CONNECT_REFCOUNT            0x00000040
  144. #define CONNECT_REDIRECT            0x00000080
  145. #define CONNECT_LOCALDRIVE          0x00000100
  146. #define CONNECT_CURRENT_MEDIA       0x00000200
  147. #endif /* WINVER >= 0x0400 */
  148.  
  149. DWORD APIENTRY
  150. WNetAddConnection3A(
  151.      HWND           hwndOwner,
  152.      LPNETRESOURCEA lpNetResource,
  153.      LPCSTR       lpPassword,
  154.      LPCSTR       lpUserName,
  155.      DWORD          dwFlags
  156.     );
  157. DWORD APIENTRY
  158. WNetAddConnection3W(
  159.      HWND           hwndOwner,
  160.      LPNETRESOURCEW lpNetResource,
  161.      LPCWSTR       lpPassword,
  162.      LPCWSTR       lpUserName,
  163.      DWORD          dwFlags
  164.     );
  165. #ifdef UNICODE
  166. #define WNetAddConnection3  WNetAddConnection3W
  167. #else
  168. #define WNetAddConnection3  WNetAddConnection3A
  169. #endif // !UNICODE
  170.  
  171. DWORD APIENTRY
  172. WNetCancelConnection2A(
  173.      LPCSTR lpName,
  174.      DWORD    dwFlags,
  175.      BOOL     fForce
  176.     );
  177. DWORD APIENTRY
  178. WNetCancelConnection2W(
  179.      LPCWSTR lpName,
  180.      DWORD    dwFlags,
  181.      BOOL     fForce
  182.     );
  183. #ifdef UNICODE
  184. #define WNetCancelConnection2  WNetCancelConnection2W
  185. #else
  186. #define WNetCancelConnection2  WNetCancelConnection2A
  187. #endif // !UNICODE
  188.  
  189. DWORD APIENTRY
  190. WNetGetConnectionA(
  191.      LPCSTR lpLocalName,
  192.      LPSTR  lpRemoteName,
  193.      LPDWORD  lpnLength
  194.     );
  195. DWORD APIENTRY
  196. WNetGetConnectionW(
  197.      LPCWSTR lpLocalName,
  198.      LPWSTR  lpRemoteName,
  199.      LPDWORD  lpnLength
  200.     );
  201. #ifdef UNICODE
  202. #define WNetGetConnection  WNetGetConnectionW
  203. #else
  204. #define WNetGetConnection  WNetGetConnectionA
  205. #endif // !UNICODE
  206.  
  207.  
  208. //
  209. //  Network Connection Dialogs.
  210. //
  211.  
  212.  
  213. DWORD APIENTRY
  214. WNetDisconnectDialog(
  215.     HWND  hwnd,
  216.     DWORD dwType
  217.     );
  218.  
  219. #if(WINVER >= 0x0400)
  220. typedef struct _CONNECTDLGSTRUCTA{
  221.     DWORD cbStructure;       /* size of this structure in bytes */
  222.     HWND hwndOwner;          /* owner window for the dialog */
  223.     LPNETRESOURCEA lpConnRes;/* Requested Resource info    */
  224.     DWORD dwFlags;           /* flags (see below) */
  225.     DWORD dwDevNum;          /* number of devices connected to */
  226. } CONNECTDLGSTRUCTA, FAR *LPCONNECTDLGSTRUCTA;
  227. typedef struct _CONNECTDLGSTRUCTW{
  228.     DWORD cbStructure;       /* size of this structure in bytes */
  229.     HWND hwndOwner;          /* owner window for the dialog */
  230.     LPNETRESOURCEW lpConnRes;/* Requested Resource info    */
  231.     DWORD dwFlags;           /* flags (see below) */
  232.     DWORD dwDevNum;          /* number of devices connected to */
  233. } CONNECTDLGSTRUCTW, FAR *LPCONNECTDLGSTRUCTW;
  234. #ifdef UNICODE
  235. typedef CONNECTDLGSTRUCTW CONNECTDLGSTRUCT;
  236. typedef LPCONNECTDLGSTRUCTW LPCONNECTDLGSTRUCT;
  237. #else
  238. typedef CONNECTDLGSTRUCTA CONNECTDLGSTRUCT;
  239. typedef LPCONNECTDLGSTRUCTA LPCONNECTDLGSTRUCT;
  240. #endif // UNICODE
  241.  
  242. #define CONNDLG_RO_PATH     0x00000001 /* Resource path should be read-only    */
  243. #define CONNDLG_CONN_POINT  0x00000002 /* Netware -style movable connection point enabled */
  244. #define CONNDLG_USE_MRU     0x00000004 /* Use MRU combobox  */
  245. #define CONNDLG_HIDE_BOX    0x00000008 /* Hide persistent connect checkbox  */
  246.  
  247. /*
  248.  * NOTE:  Set at most ONE of the below flags.  If neither flag is set,
  249.  *        then the persistence is set to whatever the user chose during
  250.  *        a previous connection
  251.  */
  252. #define CONNDLG_PERSIST     0x00000010 /* Force persistent connection */
  253. #define CONNDLG_NOT_PERSIST 0x00000020 /* Force connection NOT persistent */
  254.  
  255. DWORD APIENTRY
  256. WNetConnectionDialog1A(
  257.     LPCONNECTDLGSTRUCTA lpConnDlgStruct
  258.     );
  259. DWORD APIENTRY
  260. WNetConnectionDialog1W(
  261.     LPCONNECTDLGSTRUCTW lpConnDlgStruct
  262.     );
  263. #ifdef UNICODE
  264. #define WNetConnectionDialog1  WNetConnectionDialog1W
  265. #else
  266. #define WNetConnectionDialog1  WNetConnectionDialog1A
  267. #endif // !UNICODE
  268.  
  269. typedef struct _DISCDLGSTRUCTA{
  270.     DWORD           cbStructure;      /* size of this structure in bytes */
  271.     HWND            hwndOwner;        /* owner window for the dialog */
  272.     LPSTR           lpLocalName;      /* local device name */
  273.     LPSTR           lpRemoteName;     /* network resource name */
  274.     DWORD           dwFlags;          /* flags */
  275. } DISCDLGSTRUCTA, FAR *LPDISCDLGSTRUCTA;
  276. typedef struct _DISCDLGSTRUCTW{
  277.     DWORD           cbStructure;      /* size of this structure in bytes */
  278.     HWND            hwndOwner;        /* owner window for the dialog */
  279.     LPWSTR          lpLocalName;      /* local device name */
  280.     LPWSTR          lpRemoteName;     /* network resource name */
  281.     DWORD           dwFlags;          /* flags */
  282. } DISCDLGSTRUCTW, FAR *LPDISCDLGSTRUCTW;
  283. #ifdef UNICODE
  284. typedef DISCDLGSTRUCTW DISCDLGSTRUCT;
  285. typedef LPDISCDLGSTRUCTW LPDISCDLGSTRUCT;
  286. #else
  287. typedef DISCDLGSTRUCTA DISCDLGSTRUCT;
  288. typedef LPDISCDLGSTRUCTA LPDISCDLGSTRUCT;
  289. #endif // UNICODE
  290.  
  291. #define DISC_UPDATE_PROFILE         0x00000001
  292. #define DISC_NO_FORCE               0x00000040
  293.  
  294. DWORD APIENTRY
  295. WNetDisconnectDialog1A(
  296.     LPDISCDLGSTRUCTA lpConnDlgStruct
  297.     );
  298. DWORD APIENTRY
  299. WNetDisconnectDialog1W(
  300.     LPDISCDLGSTRUCTW lpConnDlgStruct
  301.     );
  302. #ifdef UNICODE
  303. #define WNetDisconnectDialog1  WNetDisconnectDialog1W
  304. #else
  305. #define WNetDisconnectDialog1  WNetDisconnectDialog1A
  306. #endif // !UNICODE
  307. #endif /* WINVER >= 0x0400 */
  308.  
  309.  
  310. //
  311. //  Network Browsing.
  312. //
  313.  
  314. DWORD APIENTRY
  315. WNetOpenEnumA(
  316.      DWORD          dwScope,
  317.      DWORD          dwType,
  318.      DWORD          dwUsage,
  319.      LPNETRESOURCEA lpNetResource,
  320.      LPHANDLE       lphEnum
  321.     );
  322. DWORD APIENTRY
  323. WNetOpenEnumW(
  324.      DWORD          dwScope,
  325.      DWORD          dwType,
  326.      DWORD          dwUsage,
  327.      LPNETRESOURCEW lpNetResource,
  328.      LPHANDLE       lphEnum
  329.     );
  330. #ifdef UNICODE
  331. #define WNetOpenEnum  WNetOpenEnumW
  332. #else
  333. #define WNetOpenEnum  WNetOpenEnumA
  334. #endif // !UNICODE
  335.  
  336. DWORD APIENTRY
  337. WNetEnumResourceA(
  338.      HANDLE  hEnum,
  339.      LPDWORD lpcCount,
  340.      LPVOID  lpBuffer,
  341.      LPDWORD lpBufferSize
  342.     );
  343. DWORD APIENTRY
  344. WNetEnumResourceW(
  345.      HANDLE  hEnum,
  346.      LPDWORD lpcCount,
  347.      LPVOID  lpBuffer,
  348.      LPDWORD lpBufferSize
  349.     );
  350. #ifdef UNICODE
  351. #define WNetEnumResource  WNetEnumResourceW
  352. #else
  353. #define WNetEnumResource  WNetEnumResourceA
  354. #endif // !UNICODE
  355.  
  356. DWORD APIENTRY
  357. WNetCloseEnum(
  358.     HANDLE   hEnum
  359.     );
  360.  
  361.  
  362. //
  363. //  Universal Naming.
  364. //
  365.  
  366. #define UNIVERSAL_NAME_INFO_LEVEL   0x00000001
  367. #define REMOTE_NAME_INFO_LEVEL      0x00000002
  368.  
  369. typedef struct  _UNIVERSAL_NAME_INFOA {
  370.     LPSTR    lpUniversalName;
  371. }UNIVERSAL_NAME_INFOA, *LPUNIVERSAL_NAME_INFOA;
  372. typedef struct  _UNIVERSAL_NAME_INFOW {
  373.     LPWSTR   lpUniversalName;
  374. }UNIVERSAL_NAME_INFOW, *LPUNIVERSAL_NAME_INFOW;
  375. #ifdef UNICODE
  376. typedef UNIVERSAL_NAME_INFOW UNIVERSAL_NAME_INFO;
  377. typedef LPUNIVERSAL_NAME_INFOW LPUNIVERSAL_NAME_INFO;
  378. #else
  379. typedef UNIVERSAL_NAME_INFOA UNIVERSAL_NAME_INFO;
  380. typedef LPUNIVERSAL_NAME_INFOA LPUNIVERSAL_NAME_INFO;
  381. #endif // UNICODE
  382.  
  383. typedef struct  _REMOTE_NAME_INFOA {
  384.     LPSTR    lpUniversalName;
  385.     LPSTR    lpConnectionName;
  386.     LPSTR    lpRemainingPath;
  387. }REMOTE_NAME_INFOA, *LPREMOTE_NAME_INFOA;
  388. typedef struct  _REMOTE_NAME_INFOW {
  389.     LPWSTR   lpUniversalName;
  390.     LPWSTR   lpConnectionName;
  391.     LPWSTR   lpRemainingPath;
  392. }REMOTE_NAME_INFOW, *LPREMOTE_NAME_INFOW;
  393. #ifdef UNICODE
  394. typedef REMOTE_NAME_INFOW REMOTE_NAME_INFO;
  395. typedef LPREMOTE_NAME_INFOW LPREMOTE_NAME_INFO;
  396. #else
  397. typedef REMOTE_NAME_INFOA REMOTE_NAME_INFO;
  398. typedef LPREMOTE_NAME_INFOA LPREMOTE_NAME_INFO;
  399. #endif // UNICODE
  400.  
  401. DWORD APIENTRY
  402. WNetGetUniversalNameA(
  403.      LPCSTR lpLocalPath,
  404.      DWORD    dwInfoLevel,
  405.      LPVOID   lpBuffer,
  406.      LPDWORD  lpBufferSize
  407.      );
  408. DWORD APIENTRY
  409. WNetGetUniversalNameW(
  410.      LPCWSTR lpLocalPath,
  411.      DWORD    dwInfoLevel,
  412.      LPVOID   lpBuffer,
  413.      LPDWORD  lpBufferSize
  414.      );
  415. #ifdef UNICODE
  416. #define WNetGetUniversalName  WNetGetUniversalNameW
  417. #else
  418. #define WNetGetUniversalName  WNetGetUniversalNameA
  419. #endif // !UNICODE
  420.  
  421. //
  422. //  Authentication and Logon/Logoff.
  423. //
  424.  
  425. DWORD APIENTRY
  426. WNetGetUserA(
  427.      LPCSTR  lpName,
  428.      LPSTR   lpUserName,
  429.      LPDWORD   lpnLength
  430.     );
  431. DWORD APIENTRY
  432. WNetGetUserW(
  433.      LPCWSTR  lpName,
  434.      LPWSTR   lpUserName,
  435.      LPDWORD   lpnLength
  436.     );
  437. #ifdef UNICODE
  438. #define WNetGetUser  WNetGetUserW
  439. #else
  440. #define WNetGetUser  WNetGetUserA
  441. #endif // !UNICODE
  442.  
  443.  
  444. //
  445. //  STATUS CODES
  446. //
  447.  
  448. // General   
  449.  
  450. #define WN_SUCCESS                      NO_ERROR
  451. #define WN_NO_ERROR                     NO_ERROR
  452. #define WN_NOT_SUPPORTED                ERROR_NOT_SUPPORTED
  453. #define WN_CANCEL                       ERROR_CANCELLED
  454. #define WN_RETRY                        ERROR_RETRY
  455. #define WN_NET_ERROR                    ERROR_UNEXP_NET_ERR
  456. #define WN_MORE_DATA                    ERROR_MORE_DATA
  457. #define WN_BAD_POINTER                  ERROR_INVALID_ADDRESS
  458. #define WN_BAD_VALUE                    ERROR_INVALID_PARAMETER
  459. #define WN_BAD_USER                     ERROR_BAD_USERNAME
  460. #define WN_BAD_PASSWORD                 ERROR_INVALID_PASSWORD
  461. #define WN_ACCESS_DENIED                ERROR_ACCESS_DENIED
  462. #define WN_FUNCTION_BUSY                ERROR_BUSY
  463. #define WN_WINDOWS_ERROR                ERROR_UNEXP_NET_ERR
  464. #define WN_OUT_OF_MEMORY                ERROR_NOT_ENOUGH_MEMORY
  465. #define WN_NO_NETWORK                   ERROR_NO_NETWORK
  466. #define WN_EXTENDED_ERROR               ERROR_EXTENDED_ERROR
  467. #define WN_BAD_LEVEL                    ERROR_INVALID_LEVEL
  468. #define WN_BAD_HANDLE                   ERROR_INVALID_HANDLE
  469. #if(WINVER >= 0x0400)
  470. #define WN_NOT_INITIALIZING             ERROR_ALREADY_INITIALIZED
  471. #define WN_NO_MORE_DEVICES              ERROR_NO_MORE_DEVICES
  472. #endif /* WINVER >= 0x0400 */
  473.  
  474. // Connection
  475.  
  476. #define WN_NOT_CONNECTED                ERROR_NOT_CONNECTED
  477. #define WN_OPEN_FILES                   ERROR_OPEN_FILES
  478. #define WN_DEVICE_IN_USE                ERROR_DEVICE_IN_USE
  479. #define WN_BAD_NETNAME                  ERROR_BAD_NET_NAME
  480. #define WN_BAD_LOCALNAME                ERROR_BAD_DEVICE
  481. #define WN_ALREADY_CONNECTED            ERROR_ALREADY_ASSIGNED
  482. #define WN_DEVICE_ERROR                 ERROR_GEN_FAILURE
  483. #define WN_CONNECTION_CLOSED            ERROR_CONNECTION_UNAVAIL
  484. #define WN_NO_NET_OR_BAD_PATH           ERROR_NO_NET_OR_BAD_PATH
  485. #define WN_BAD_PROVIDER                 ERROR_BAD_PROVIDER
  486. #define WN_CANNOT_OPEN_PROFILE          ERROR_CANNOT_OPEN_PROFILE
  487. #define WN_BAD_PROFILE                  ERROR_BAD_PROFILE
  488. #define WN_BAD_DEV_TYPE                 ERROR_BAD_DEV_TYPE
  489. #define WN_DEVICE_ALREADY_REMEMBERED    ERROR_DEVICE_ALREADY_REMEMBERED
  490.  
  491. // Enumeration
  492.  
  493. #define WN_NO_MORE_ENTRIES              ERROR_NO_MORE_ITEMS
  494. #define WN_NOT_CONTAINER                ERROR_NOT_CONTAINER
  495.  
  496. #if(WINVER >= 0x0400)
  497. // Authentication
  498.  
  499. #define WN_NOT_AUTHENTICATED            ERROR_NOT_AUTHENTICATED
  500. #define WN_NOT_LOGGED_ON                ERROR_NOT_LOGGED_ON
  501. #define WN_NOT_VALIDATED                ERROR_NO_LOGON_SERVERS
  502. #endif /* WINVER >= 0x0400 */
  503.  
  504.  
  505. #if defined(UNDER_CE) && defined(WINCEOEM) && defined(WINCEMACRO)
  506. #include <mwnetfun.h>
  507. #endif
  508.  
  509. #ifdef __cplusplus
  510. }
  511. #endif
  512.  
  513. #endif  // _WINNETWK_
  514.  
  515. // @CESYSGEN ENDIF
  516.