Notification Function 0003h Activate Session

mov bx, SessionID ;identifier for new session

mov cx, Flags ;session status flags

les di, Service ;es:di is address of service-function handler

mov ax, 0003h ;Activate Session

call [Notification] ;client program's notification-function handler

Activate Session (Notification Function 0003h) notifies client programs that a session is about to become active. If the session is a previously suspended session, it has been reinstalled in memory, including its local memory and interrupt-vector table. However, interrupts are disabled and must remain disabled.

Parameters

SessionID

Identifies the session to be activated.

Flags

Specifies the session's status. If bit 0 is 1, the session is being activated for the first time. If bit 0 is zero, the session has been suspended and is now being resumed. All other bits are reserved and must be zero.

Service

Points to the service-function handler for the task switcher.

Return Value

The AX register contains 0000h.

Comment

If interrupts are enabled while the session memory is being swapped, global programs can receive interrupts but local programs cannot. Once the new session's interrupt-vector table has been loaded, a problem can arise if a hardware interrupt occurs just as interrupts are enabled. The task switcher disables interrupts before calling the client program, to prevent local programs from receiving the interrupt and calling global programs that cannot handle such an interrupt correctly until they receive the new session identifier.

If this is a newly created session being activated for the first time, Activate Session will be preceded by a call to Create Session (Notification Function 0005h).

The task switcher disables interrupts before calling the client program, and the client program must not enable interrupts or call MS-DOS system functions. Although the client program modifies the AX register, it must preserve all other registers.

See Also

Notification Function 0005h Create Session