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, 0004h ;Session Active
call [Notification] ;client program's notification-function handler
Session Active (Notification Function 0004h) notifies client programs that a session has become active. If the session was previously suspended, the function notifies client programs that the session has been reinstalled in memory, including its local memory and interrupt-vector table.
SessionID
Identifies the session that is now active.
Flags
Specifies the session's status. If bit 0 is set, the session has just been created and is now active for the first time. If bit 0 is not set, the session was previously suspended and now has resumed. All other bits are reserved and must be zero.
Service
Points to the service-function handler for the task switcher.
The AX register contains 0000h.
If any client program fails a call to Query Suspend (Notification Function 0001h) or Suspend Session (Notification Function 0002h), all client programs may receive a Session Active notification, including the client program that denied the call to Suspend Session. Client programs can ignore a Session Active notification received without a preceding call to Query Suspend or Suspend Session.
The task switcher enables interrupts before calling the client program. The client program can call any MS-DOS system function. Although the client program modifies the AX register, it must preserve all other registers.
Notification Function 0001h Query Suspend
Notification Function 0002h Suspend Session