A computer accesses a shared resource on a server by means of a connection. A connection is a software link between a computer and a server, made by assigning a local or null device name to the shared resource on the server.
|
Function |
Description |
|
Lists all connections (or links) made to a specified resource on the server or all resource connections (or links) made by a specified computer to any resource on the server. |
|
|
This function is the same as NetConnectionEnum except that it uses 32-bit data structures, is RPC-based, and is resumable. |
A client accesses a servers shared resource by means of a connection (or link). Thus, a connection is the path between a clients redirected NULL or local device name and a shared resource on a server.
The NetConnectionEnum and NetConnectionEnum32 functions return data details at levels 0 or 1.
The format of the connection_info_0 data structure that can be returned by the NetConnectionEnum function is as follows:
struct connection_info_0 {
unsigned short coni0_id;
};
Within this structure, the parameters are defined as follows:
coni0_id is the connection identification number.
The format of the 32-bit CONNECTION_INFO_0 data structure that can be returned by the NetConnectionEnum32 function is as follows:
typedef struct _CONNECTION_INFO_0 {
DWORD coni0_id;
} CONNECTION_INFO_0, *PCONNECTION_INFO_0, *LPCONNECTION_INFO_0;
Within this structure, the parameters are defined in the same way as in the connection_info_0 structure.
The format of the connection_info_1 data structure that can be returned by NetConnectionEnum is as follows:
struct connection_info_1 {
unsigned short coni1_id;
unsigned short coni1_type;
unsigned short coni1_num_opens;
unsigned short coni1_num_users;
unsigned long coni1_time;
char * coni1_username;
char * coni1_netname;
};
Within this structure, the parameters are defined as follows: where
coni1_id is the connection identification number.
coni1_type tells the type of connection made from the local device name to the shared resource. The shares.h include file defines four types of connections:
|
Manifest |
Value |
Meaning |
|
STYPE_DISKTREE |
0 |
Disk connection. |
|
STYPE_PRINTQ |
1 |
Print queue connection. |
|
STYPE_DEVICE |
2 |
Character device connection. |
|
STYPE_IPC |
3 |
Interprocess communications connection. |
coni1_num_opens tells how many files currently are open as a result of the connection.
coni1_num_users tells how many users are on the connection.
coni1_time tells how many seconds the connection has been established.
coni1_username points to an ASCIIZ string. It describes which user made the connection.
coni1_netname points to an ASCIIZ string specifying either the share name of the servers shared resource or the computer name of the client, depending on which name was specified as the NetConnectionEnum functions pszQualifier parameter. The type of name supplied to coni1_netname is the inverse of the type supplied to pszQualifier.
The format of the 32-bit CONNECTION_INFO_1 data structure that can be returned by NetConnectionEnum32 is as follows:
typedef struct _CONNECTION_INFO_1 {
DWORD coni1_id;
DWORD coni1_type;
DWORD coni1_num_opens;
DWORD coni1_num_users;
DWORD coni1_time;
LPTSTR coni1_username;
LPTSTR coni1_netname;
} CONNECTION_INFO_1, *PCONNECTION_INFO_1, $LPCONNECTION_INFO_1;
Within this structure, the parameters are defined in the same way as in the connection_info_1 structure.