This call allows a parent session to switch one of its child sessions to the foreground.
DosSelectSession
SessID (USHORT) - input
Value
DosSelectSession can be issued by a parent session to select only itself or a child session. It cannot be used to select a grandchild session. The child session must have been started by the caller with a request to DosStartSession, specifying "Related = 1." Sessions started as independent sessions cannot be selected with this call.
When DosSelectSession is issued, the session is brought to the foreground only if the parent session or one of its descendant sessions is executing in the foreground. Otherwise, ERROR_SMG_SESSION_NOT_FOREGRND is returned.