📄 winnetwk.h
字号:
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
winnetwk.h
Abstract:
Standard WINNET Header File for WIN32
Environment:
User Mode -Win32
Notes:
optional-notes
--*/
#ifndef _WINNETWK_
#define _WINNETWK_
#ifdef __cplusplus
extern "C" {
#endif
//
// Network types
//
#define WNNC_NET_MSNET 0x00010000
#define WNNC_NET_LANMAN 0x00020000
#define WNNC_NET_NETWARE 0x00030000
#define WNNC_NET_VINES 0x00040000
#define WNNC_NET_10NET 0x00050000
#define WNNC_NET_LOCUS 0x00060000
#define WNNC_NET_SUN_PC_NFS 0x00070000
#define WNNC_NET_LANSTEP 0x00080000
#define WNNC_NET_9TILES 0x00090000
#define WNNC_NET_LANTASTIC 0x000A0000
#define WNNC_NET_AS400 0x000B0000
#define WNNC_NET_FTP_NFS 0x000C0000
#define WNNC_NET_PATHWORKS 0x000D0000
#define WNNC_NET_LIFENET 0x000E0000
#define WNNC_NET_POWERLAN 0x000F0000
#define WNNC_NET_BWNFS 0x00100000
#define WNNC_NET_COGENT 0x00110000
#define WNNC_NET_FARALLON 0x00120000
#define WNNC_NET_APPLETALK 0x00130000
#define WNNC_NET_INTERGRAPH 0x00140000
#define WNNC_NET_SYMFONET 0x00150000
#define WNNC_NET_CLEARCASE 0x00160000
#define WNNC_NET_FRONTIER 0x00170000
#define WNNC_NET_BMC 0x00180000
#define WNNC_NET_DCE 0x00190000
#define WNNC_NET_AVID 0x001A0000
#define WNNC_NET_DOCUSPACE 0x001B0000
#define WNNC_NET_MANGOSOFT 0x001C0000
#define WNNC_NET_SERNET 0x001D0000
#define WNNC_NET_RIVERFRONT1 0X001E0000
#define WNNC_NET_RIVERFRONT2 0x001F0000
#define WNNC_NET_DECORB 0x00200000
#define WNNC_NET_PROTSTOR 0x00210000
#define WNNC_NET_FJ_REDIR 0x00220000
#define WNNC_NET_DISTINCT 0x00230000
#define WNNC_NET_TWINS 0x00240000
#define WNNC_NET_RDR2SAMPLE 0x00250000
#define WNNC_NET_CSC 0x00260000
#define WNNC_NET_3IN1 0x00270000
#define WNNC_NET_EXTENDNET 0x00290000
#define WNNC_NET_STAC 0x002A0000
#define WNNC_NET_FOXBAT 0x002B0000
#define WNNC_NET_YAHOO 0x002C0000
#define WNNC_NET_EXIFS 0x002D0000
#define WNNC_NET_DAV 0x002E0000
#define WNNC_NET_KNOWARE 0x002F0000
#define WNNC_NET_OBJECT_DIRE 0x00300000
#define WNNC_NET_MASFAX 0x00310000
#define WNNC_NET_HOB_NFS 0x00320000
#define WNNC_NET_SHIVA 0x00330000
#define WNNC_NET_IBMAL 0x00340000
#define WNNC_NET_LOCK 0x00350000
#define WNNC_NET_TERMSRV 0x00360000
#define WNNC_CRED_MANAGER 0xFFFF0000
//
// Network Resources.
//
#define RESOURCE_CONNECTED 0x00000001
#define RESOURCE_GLOBALNET 0x00000002
#define RESOURCE_REMEMBERED 0x00000003
#if(WINVER >= 0x0400)
#define RESOURCE_RECENT 0x00000004
#define RESOURCE_CONTEXT 0x00000005
#endif /* WINVER >= 0x0400 */
#define RESOURCETYPE_ANY 0x00000000
#define RESOURCETYPE_DISK 0x00000001
#define RESOURCETYPE_PRINT 0x00000002
#if(WINVER >= 0x0400)
#define RESOURCETYPE_RESERVED 0x00000008
#endif /* WINVER >= 0x0400 */
#define RESOURCETYPE_UNKNOWN 0xFFFFFFFF
#define RESOURCEUSAGE_CONNECTABLE 0x00000001
#define RESOURCEUSAGE_CONTAINER 0x00000002
#if(WINVER >= 0x0400)
#define RESOURCEUSAGE_NOLOCALDEVICE 0x00000004
#define RESOURCEUSAGE_SIBLING 0x00000008
#define RESOURCEUSAGE_ATTACHED 0x00000010
#define RESOURCEUSAGE_ALL (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED)
#endif /* WINVER >= 0x0400 */
#define RESOURCEUSAGE_RESERVED 0x80000000
#define RESOURCEDISPLAYTYPE_GENERIC 0x00000000
#define RESOURCEDISPLAYTYPE_DOMAIN 0x00000001
#define RESOURCEDISPLAYTYPE_SERVER 0x00000002
#define RESOURCEDISPLAYTYPE_SHARE 0x00000003
#define RESOURCEDISPLAYTYPE_FILE 0x00000004
#define RESOURCEDISPLAYTYPE_GROUP 0x00000005
#if(WINVER >= 0x0400)
#define RESOURCEDISPLAYTYPE_NETWORK 0x00000006
#define RESOURCEDISPLAYTYPE_ROOT 0x00000007
#define RESOURCEDISPLAYTYPE_SHAREADMIN 0x00000008
#define RESOURCEDISPLAYTYPE_DIRECTORY 0x00000009
#endif /* WINVER >= 0x0400 */
#define RESOURCEDISPLAYTYPE_TREE 0x0000000A
#if(WINVER >= 0x0400)
#define RESOURCEDISPLAYTYPE_NDSCONTAINER 0x0000000B
#endif /* WINVER >= 0x0400 */
typedef struct _NETRESOURCEA {
DWORD dwScope;
DWORD dwType;
DWORD dwDisplayType;
DWORD dwUsage;
LPSTR lpLocalName;
LPSTR lpRemoteName;
LPSTR lpComment ;
LPSTR lpProvider;
}NETRESOURCEA, *LPNETRESOURCEA;
typedef struct _NETRESOURCEW {
DWORD dwScope;
DWORD dwType;
DWORD dwDisplayType;
DWORD dwUsage;
LPWSTR lpLocalName;
LPWSTR lpRemoteName;
LPWSTR lpComment ;
LPWSTR lpProvider;
}NETRESOURCEW, *LPNETRESOURCEW;
#ifdef UNICODE
typedef NETRESOURCEW NETRESOURCE;
typedef LPNETRESOURCEW LPNETRESOURCE;
#else
typedef NETRESOURCEA NETRESOURCE;
typedef LPNETRESOURCEA LPNETRESOURCE;
#endif // UNICODE
//
// Network Connections.
//
#define NETPROPERTY_PERSISTENT 1
#define CONNECT_UPDATE_PROFILE 0x00000001
#define CONNECT_UPDATE_RECENT 0x00000002
#define CONNECT_TEMPORARY 0x00000004
#define CONNECT_INTERACTIVE 0x00000008
#define CONNECT_PROMPT 0x00000010
#define CONNECT_NEED_DRIVE 0x00000020
#if(WINVER >= 0x0400)
#define CONNECT_REFCOUNT 0x00000040
#define CONNECT_REDIRECT 0x00000080
#define CONNECT_LOCALDRIVE 0x00000100
#define CONNECT_CURRENT_MEDIA 0x00000200
#define CONNECT_DEFERRED 0x00000400
#define CONNECT_RESERVED 0xFF000000
#endif /* WINVER >= 0x0400 */
#if(WINVER >= 0x0500)
#define CONNECT_COMMANDLINE 0x00000800
#define CONNECT_CMD_SAVECRED 0x00001000
#endif /* WINVER >= 0x0500 */
DWORD APIENTRY
WNetAddConnectionA(
IN LPCSTR lpRemoteName,
IN LPCSTR lpPassword,
IN LPCSTR lpLocalName
);
DWORD APIENTRY
WNetAddConnectionW(
IN LPCWSTR lpRemoteName,
IN LPCWSTR lpPassword,
IN LPCWSTR lpLocalName
);
#ifdef UNICODE
#define WNetAddConnection WNetAddConnectionW
#else
#define WNetAddConnection WNetAddConnectionA
#endif // !UNICODE
DWORD APIENTRY
WNetAddConnection2A(
IN LPNETRESOURCEA lpNetResource,
IN LPCSTR lpPassword,
IN LPCSTR lpUserName,
IN DWORD dwFlags
);
DWORD APIENTRY
WNetAddConnection2W(
IN LPNETRESOURCEW lpNetResource,
IN LPCWSTR lpPassword,
IN LPCWSTR lpUserName,
IN DWORD dwFlags
);
#ifdef UNICODE
#define WNetAddConnection2 WNetAddConnection2W
#else
#define WNetAddConnection2 WNetAddConnection2A
#endif // !UNICODE
DWORD APIENTRY
WNetAddConnection3A(
IN HWND hwndOwner,
IN LPNETRESOURCEA lpNetResource,
IN LPCSTR lpPassword,
IN LPCSTR lpUserName,
IN DWORD dwFlags
);
DWORD APIENTRY
WNetAddConnection3W(
IN HWND hwndOwner,
IN LPNETRESOURCEW lpNetResource,
IN LPCWSTR lpPassword,
IN LPCWSTR lpUserName,
IN DWORD dwFlags
);
#ifdef UNICODE
#define WNetAddConnection3 WNetAddConnection3W
#else
#define WNetAddConnection3 WNetAddConnection3A
#endif // !UNICODE
DWORD APIENTRY
WNetCancelConnectionA(
IN LPCSTR lpName,
IN BOOL fForce
);
DWORD APIENTRY
WNetCancelConnectionW(
IN LPCWSTR lpName,
IN BOOL fForce
);
#ifdef UNICODE
#define WNetCancelConnection WNetCancelConnectionW
#else
#define WNetCancelConnection WNetCancelConnectionA
#endif // !UNICODE
DWORD APIENTRY
WNetCancelConnection2A(
IN LPCSTR lpName,
IN DWORD dwFlags,
IN BOOL fForce
);
DWORD APIENTRY
WNetCancelConnection2W(
IN LPCWSTR lpName,
IN DWORD dwFlags,
IN BOOL fForce
);
#ifdef UNICODE
#define WNetCancelConnection2 WNetCancelConnection2W
#else
#define WNetCancelConnection2 WNetCancelConnection2A
#endif // !UNICODE
DWORD APIENTRY
WNetGetConnectionA(
IN LPCSTR lpLocalName,
OUT LPSTR lpRemoteName,
IN OUT LPDWORD lpnLength
);
DWORD APIENTRY
WNetGetConnectionW(
IN LPCWSTR lpLocalName,
OUT LPWSTR lpRemoteName,
IN OUT LPDWORD lpnLength
);
#ifdef UNICODE
#define WNetGetConnection WNetGetConnectionW
#else
#define WNetGetConnection WNetGetConnectionA
#endif // !UNICODE
#if(WINVER >= 0x0400)
DWORD APIENTRY
WNetUseConnectionA(
IN HWND hwndOwner,
IN LPNETRESOURCEA lpNetResource,
IN LPCSTR lpPassword,
IN LPCSTR lpUserID,
IN DWORD dwFlags,
OUT LPSTR lpAccessName,
IN OUT LPDWORD lpBufferSize,
OUT LPDWORD lpResult
);
DWORD APIENTRY
WNetUseConnectionW(
IN HWND hwndOwner,
IN LPNETRESOURCEW lpNetResource,
IN LPCWSTR lpPassword,
IN LPCWSTR lpUserID,
IN DWORD dwFlags,
OUT LPWSTR lpAccessName,
IN OUT LPDWORD lpBufferSize,
OUT LPDWORD lpResult
);
#ifdef UNICODE
#define WNetUseConnection WNetUseConnectionW
#else
#define WNetUseConnection WNetUseConnectionA
#endif // !UNICODE
#endif /* WINVER >= 0x0400 */
//
// Network Connection Dialogs.
//
DWORD APIENTRY
WNetConnectionDialog(
IN HWND hwnd,
IN DWORD dwType
);
DWORD APIENTRY
WNetDisconnectDialog(
IN HWND hwnd,
IN DWORD dwType
);
#if(WINVER >= 0x0400)
typedef struct _CONNECTDLGSTRUCTA{
DWORD cbStructure; /* size of this structure in bytes */
HWND hwndOwner; /* owner window for the dialog */
LPNETRESOURCEA lpConnRes;/* Requested Resource info */
DWORD dwFlags; /* flags (see below) */
DWORD dwDevNum; /* number of devices connected to */
} CONNECTDLGSTRUCTA, FAR *LPCONNECTDLGSTRUCTA;
typedef struct _CONNECTDLGSTRUCTW{
DWORD cbStructure; /* size of this structure in bytes */
HWND hwndOwner; /* owner window for the dialog */
LPNETRESOURCEW lpConnRes;/* Requested Resource info */
DWORD dwFlags; /* flags (see below) */
DWORD dwDevNum; /* number of devices connected to */
} CONNECTDLGSTRUCTW, FAR *LPCONNECTDLGSTRUCTW;
#ifdef UNICODE
typedef CONNECTDLGSTRUCTW CONNECTDLGSTRUCT;
typedef LPCONNECTDLGSTRUCTW LPCONNECTDLGSTRUCT;
#else
typedef CONNECTDLGSTRUCTA CONNECTDLGSTRUCT;
typedef LPCONNECTDLGSTRUCTA LPCONNECTDLGSTRUCT;
#endif // UNICODE
#define CONNDLG_RO_PATH 0x00000001 /* Resource path should be read-only */
#define CONNDLG_CONN_POINT 0x00000002 /* Netware -style movable connection point enabled */
#define CONNDLG_USE_MRU 0x00000004 /* Use MRU combobox */
#define CONNDLG_HIDE_BOX 0x00000008 /* Hide persistent connect checkbox */
/*
* NOTE: Set at most ONE of the below flags. If neither flag is set,
* then the persistence is set to whatever the user chose during
* a previous connection
*/
#define CONNDLG_PERSIST 0x00000010 /* Force persistent connection */
#define CONNDLG_NOT_PERSIST 0x00000020 /* Force connection NOT persistent */
DWORD APIENTRY
WNetConnectionDialog1A(
IN OUT LPCONNECTDLGSTRUCTA lpConnDlgStruct
);
DWORD APIENTRY
WNetConnectionDialog1W(
IN OUT LPCONNECTDLGSTRUCTW lpConnDlgStruct
);
#ifdef UNICODE
#define WNetConnectionDialog1 WNetConnectionDialog1W
#else
#define WNetConnectionDialog1 WNetConnectionDialog1A
#endif // !UNICODE
typedef struct _DISCDLGSTRUCTA{
DWORD cbStructure; /* size of this structure in bytes */
HWND hwndOwner; /* owner window for the dialog */
LPSTR lpLocalName; /* local device name */
LPSTR lpRemoteName; /* network resource name */
DWORD dwFlags; /* flags */
} DISCDLGSTRUCTA, FAR *LPDISCDLGSTRUCTA;
typedef struct _DISCDLGSTRUCTW{
DWORD cbStructure; /* size of this structure in bytes */
HWND hwndOwner; /* owner window for the dialog */
LPWSTR lpLocalName; /* local device name */
LPWSTR lpRemoteName; /* network resource name */
DWORD dwFlags; /* flags */
} DISCDLGSTRUCTW, FAR *LPDISCDLGSTRUCTW;
#ifdef UNICODE
typedef DISCDLGSTRUCTW DISCDLGSTRUCT;
typedef LPDISCDLGSTRUCTW LPDISCDLGSTRUCT;
#else
typedef DISCDLGSTRUCTA DISCDLGSTRUCT;
typedef LPDISCDLGSTRUCTA LPDISCDLGSTRUCT;
#endif // UNICODE
#define DISC_UPDATE_PROFILE 0x00000001
#define DISC_NO_FORCE 0x00000040
DWORD APIENTRY
WNetDisconnectDialog1A(
IN LPDISCDLGSTRUCTA lpConnDlgStruct
);
DWORD APIENTRY
WNetDisconnectDialog1W(
IN LPDISCDLGSTRUCTW lpConnDlgStruct
);
#ifdef UNICODE
#define WNetDisconnectDialog1 WNetDisconnectDialog1W
#else
#define WNetDisconnectDialog1 WNetDisconnectDialog1A
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -