Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
DosStopSession (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_DOSSESMGR
USHORT DosStopSession(fScope, idSession, ulReserved)
USHORT fScope; /* all sessions/specified session stopped */
USHORT idSession; /* session identifier */
ULONG ulReserved; /* must be zero */
The DosStopSession function terminates a session that was started by using
the DosStartSession function.
Parameter Description
────────────────────────────────────────────────────────────────────────────
fScope Specifies whether the function stops all sessions or only the
specified session. If the fScope parameter is 0x0000, the
function stops only the specified session. If it is 0x0001, the
function stops all sessions.
idSession Specifies the identifier of the session to be stopped. This
identifier must have been created previously by using the
DosStartSession function. This parameter is ignored if the
fScope parameter is set to 0x0001.
ulReserved Specifies a reserved value; must be zero.
Return Value
The return value is zero if the function is successful. Otherwise, it is an
error value.
Comments
The DosStopSession function can terminate only child sessions that were
started by using the DosStartSession function (child sessions of the
terminated session will terminate as well). Sessions that were started as
independent sessions cannot be terminated by using DosStopSession.
A parent session can be running in either the foreground or the background
when DosStopSession is issued. If a child session is in the foreground when
it is stopped, the parent session becomes the foreground session. The
DosStopSession function breaks any bond between the parent session and the
specified child session.
A process running in the session specified by the idSession parameter can
refuse to terminate. If this happens, DosStopSession returns zero. To verify
that the target session has terminated, a process can wait for notification
through the termination queue that is specified in the DosStartSession
function.
See Also
DosSetSession, DosStartSession
♦