Annotation of mstools/h/winnetwk.h, revision 1.1.1.3

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.