Connection Category

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

NetConnectionEnum

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.

NetConnectionEnum32

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 server’s shared resource by means of a connection (or link). Thus, a connection is the path between a client’s redirected NULL or local device name and a shared resource on a server.

Connection Category Data Structures

The NetConnectionEnum and NetConnectionEnum32 functions return data details at levels 0 or 1.

Connection Information (level 0)

The format of the connection_info_0 data structure that can be returned by the NetConnectionEnum function is as follows:

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:

Within this structure, the parameters are defined in the same way as in the connection_info_0 structure.

Connection Information (level 1)

The format of the connection_info_1 data structure that can be returned by NetConnectionEnum is as follows:

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 server’s shared resource or the computer name of the client, depending on which name was specified as the NetConnectionEnum function’s 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:

Within this structure, the parameters are defined in the same way as in the connection_info_1 structure.

Previous Page Page Top Index Next Page See Page