Session Category

The functions in the Session category control network sessions established between clients and servers.

Function

Description

NetSessionDel

Ends a session between a client and a server.

NetSessionDel32

This function is the same as NetSessionDel except that it is RPC-based.

NetSessionEnum

Provides information on all current sessions to a server.

NetSessionEnum32

This function is the same as NetSessionEnum except that it uses 32-bit data structures, is RPC-based, and is resumable.

NetSessionGetInfo

Retrieves information about a specified client/server session.

NetSessionGetInfo32

This function is the same as NetSessionGetInfo except that it uses 32-bit data structures and is RPC-based.

A session is a link between a client and a server. A client begins a session with a server the first time it requests to connect to a shared resource on the server. Any further connections from the client to the other shared resources on the same server do not create another session; multiple connections can be serviced on one session.

To end a session, deleting all current connections between the client and server, an application calls NetSessionDel or NetSessionDel32. NetSessionEnum and NetSessionEnum32 return information about all sessions established with a server. To obtain information about a specific session, an application calls NetSessionGetInfo or NetSessionGetInfo32.

Per-user information is managed by NetSession APIs through the use of the username parameter. This parameter is necessary to access user-specific information for this session because there can be multiple users per session.

Session Category Data Structures

The sLevel parameter controls the level of information that the NetSessionEnum, NetSessionEnum32, NetSessionGetInfo, and NetSessionGetInfo32 functions return.

Session Information (level 0)

The session_info_0 data structure that can be returned by NetSessionEnum or NetSessionGetInfo has the following format:

Within this structure, sesi0_cname points to an ASCIIZ string containing the computer name of the computer that established the session.

The SESSION_INFO_0 data structure that can be returned by NetSessionEnum32 or NetSessionGetInfo32 has the following format:

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

Session Information (level 1)

The session_info_1 data structure that can be returned by NetSessionEnum or NetSessionGetInfo has the following format:

Within this structure, the following parameters are defined:

sesi1_cname points to an ASCIIZ string containing the computer name of the computer that established the session.

sesi1_username points to an ASCIIZ string containing the name of the user who established the session.

sesi1_num_conns displays how many connections have been made during the session.

sesi1_num_opens displays how many files, devices, and pipes have been opened during the session.

sesi1_num_users specifies how many users have made connections via the session.

sesi1_sess_time specifies how many seconds a session has been active.

sesi1_idle_time specifies how many seconds a session has been idle.

sesi1_user_flags describes how the user established the session.

The bit mask for sesi1_user_flags is defined in the shares.h file, as follows:

Manifest

Value

Meaning

SESS_GUEST

1

sesi1_username established the session using a guest account.

SESS_NOENCRYPTION

2

sesi1_username established the session without using password encryption.

The SESSION_INFO_1 data structure that can be returned by NetSessionEnum32 or NetSessionGetInfo32 has the following format:

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

Session Information (level 2)

The session_info_2 data structure that can be used by NetSessionEnum or NetSessionGetInfo has the following format:

Within this structure, the following parameters are defined:

sesi2_cname to sesi2_user_flags have the same definition as the corresponding fields of the session_info_1 data structure. For a complete description, see Session Information (level 1).

sesi2_cltype_name points to an ASCIIZ string that specifies the type of client that established the session.

These are the defined types for Advanced Server servers:

Name

Type

DOS LM 1.0

LAN Manager for MS-DOS 1.0 clients.

DOS LM 2.0

LAN Manager for MS-DOS 2.0 clients.

OS/2 LM 1.0

LAN Manager for MS-OS/2 1.0 clients.

OS/2 LM 2.0

LAN Manager for MS-OS/2 2.0 clients.

NT LANMAN 1.0

Windows NT 1.0 clients.

Sessions from Advanced Server also will appear as OS/2 LM 2.0.

The SESSION_INFO_2 data structure that can be returned by NetSessionEnum32 or NetSessionGetInfo32 has the following format:

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

Session Information (level 10)

The session_info_10 data structure that can be returned by NetSessionEnum or NetSessionGetInfo has the following format:

Within this structure, the following parameters are defined:

sesi10_cname to sesi10_idle_time have the same definition as the corresponding fields of the session_info_1 data structure. For a complete description, see Session Information (level 1).

The SESSION_INFO_10 data structure that can be returned by NetSessionEnum32 or NetSessionGetInfo32 has the following format:

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

Previous Page Page Top Index Next Page See Page