Session Functions

The session functions control network sessions established between workstations and servers. They require that the Server service be started on the specified server. The session functions are:

NetSessionDel
NetSessionEnum
NetSessionGetInfo

A session is a link between a workstation and a server. It is established the first time a workstation makes a connection with a shared resource on the server. Until the session ends, all further connections between the workstation and the server are part of this same session. To end a session, an application on the server end of a connection calls NetSessionDel. This deletes all current connections between the workstation and the server. The NetSessionEnum function returns information about all sessions established for a server. The NetSessionGetInfo function returns information about a particular session.

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

Session functions are available at five information levels:

SESSION_INFO_0
SESSION_INFO_1

SESSION_INFO_2

SESSION_INFO_10

SESSION_INFO_502

Note that sesi_username cannot be NULL and sesi1_flags and sesi2_flags can take the following bits:

SESS_GUEST 0x00000001

SESS_NONENCRYPTION 0x00000002