Jump to content

DosSMRegisterDD: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Legacy
|RepFunc=
|Remarks=This page list the older version of the function for reference.
}}
Allows a device driver to register itself with the Session Manager.
Allows a device driver to register itself with the Session Manager.


==Syntax==
==Syntax==
<PRE>
  DosSMRegisterDD (RegisterData)
  DosSMRegisterDD


    (RegisterData)
</PRE>
==Parameters==
==Parameters==
; RegisterData (PREGISTERDATA) - input : Address of the structure containing the RegisterData necessary for this call.
;RegisterData (PREGISTERDATA) - input : Address of the structure containing the RegisterData necessary for this call.
 
:;Length (USHORT) : Length of the data structure in bytes including Length itself. Length is 8 for OS/2 version 1.2.
Length (USHORT) : Length of the data structure in bytes including Length itself. Length is 8 for OS/2 version 1.2.  
:;Notification (USHORT) : Bit map that informs the session manager when to issue the notification IOCTL to the device driver. The bits of this word are defined as follows:
 
::15-4 Reserved and must be set to zero.
Notification (USHORT) : Bit map that informs the session manager when to issue the notification IOCTL to the device driver. The bits of this word are defined as follows:
::3 Session termination notification. Action = 8
 
::2 Post-Session restore notification. Action = 4
'''Bit            Description'''
::1 Post-Session save notification. Action = 2
15-4         Reserved and must be set to zero.  
::0 Pre-Session save notification. Action = 1
3           Session termination notification. Action = 8  
::Action is the unsigned integer in the Action field of the notification IOCTL. This tells the device driver what is happening. Notice that the integers correspond to bits 0 to 3 being set.
2           Post-Session restore notification. Action = 4  
:;DDName (ULONG):Address of the device name, as an ASCIIZ string (ie. SCREEN$, KBD$, etc.).
1           Post-Session save notification. Action = 2  
0           Pre-Session save notification. Action = 1  
 
Action is the unsigned integer in the Action field of the notification IOCTL. This tells the device driver what is happening. Notice that the integers correspond to bits 0 to 3 being set.  
 
DDName (ULONG) : Address of the device name, as an ASCIIZ string (ie. SCREEN$, KBD$, etc.).


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
*418 ERROR_SMG_INVALID_CALL
Return code descriptions are:
*461 ERROR_SMG_INVALID_DATA_LENGTH
 
*515 ERROR_SMG_TOO_MANY_DDS
* 418       ERROR_SMG_INVALID_CALL
*516 ERROR_SMG_INVALID_NOTIFICATION
* 461       ERROR_SMG_INVALID_DATA_LENGTH
* 515       ERROR_SMG_TOO_MANY_DDS
* 516       ERROR_SMG_INVALID_NOTIFICATION


==Remarks==
==Remarks==
The Session Manger calls the registered device driver during a session switch, based on the specific form of notifications required.
The Session Manager calls the registered device driver during a session switch, based on the specific form of notifications required.


The notification IOCTL passed to the device driver has the following format:
The notification IOCTL passed to the device driver has the following format:
 
  Size    Definition
  Size    Definition  
  WORD    DevIOCtl packet length, including the length itself
 
  WORD    Screen switch notification type
  WORD    DevIOCtl packet length, including the length itself  
  WORD    Incoming session number
  WORD    Screen switch notification type  
  WORD    Outgoing session number.
  WORD    Incoming session number  
  WORD    Outgoing session number.  
 
The device driver passes a bit map that informs the session manager when the device driver needs to be called. The possible phases are:
The device driver passes a bit map that informs the session manager when the device driver needs to be called. The possible phases are:
 
* Before a session save
* Before a session save  
* After a session save (before a restore)
* After a session save (before a restore)
* After a session restore
* After a session restore
* After a session termination.
* After a session termination.
The device drivers must issue this API only during their initialization phase. After the session manager has been initialized, it rejects all further calls to this API, returning ERROR_SMG_INVALID_CALL.


The device drivers must issue this API only during their initialization phase. After the session manager has been initialized, it rejects all further calls to this API, returning ERROR_SMG_INVALID_CALL.
==Bindings==
 
===C===
==Example Code==
===C Binding===
<PRE>
<PRE>
#define INCL_DOSFILEMGR
#define INCL_DOSFILEMGR
Line 67: Line 46:
USHORT  rc = DosSMRegisterDD(RegisterData);
USHORT  rc = DosSMRegisterDD(RegisterData);


PREGISTERDATA RegisterData;         /* Data packet */
PREGISTERDATA RegisterData; /* Data packet */
 
USHORT       rc;            /* return code */
USHORT           rc;            /* return code */
</PRE>
</PRE>


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  DosSMRegisterDD:FAR
EXTRN  DosSMRegisterDD:FAR
Line 82: Line 60:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
 
*
[[Category:Dos16]]
[[Category:Dos]]

Latest revision as of 08:07, 26 January 2020

Allows a device driver to register itself with the Session Manager.

Syntax

DosSMRegisterDD (RegisterData)

Parameters

RegisterData (PREGISTERDATA) - input
Address of the structure containing the RegisterData necessary for this call.
Length (USHORT)
Length of the data structure in bytes including Length itself. Length is 8 for OS/2 version 1.2.
Notification (USHORT)
Bit map that informs the session manager when to issue the notification IOCTL to the device driver. The bits of this word are defined as follows:
15-4 Reserved and must be set to zero.
3 Session termination notification. Action = 8
2 Post-Session restore notification. Action = 4
1 Post-Session save notification. Action = 2
0 Pre-Session save notification. Action = 1
Action is the unsigned integer in the Action field of the notification IOCTL. This tells the device driver what is happening. Notice that the integers correspond to bits 0 to 3 being set.
DDName (ULONG)
Address of the device name, as an ASCIIZ string (ie. SCREEN$, KBD$, etc.).

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 418 ERROR_SMG_INVALID_CALL
  • 461 ERROR_SMG_INVALID_DATA_LENGTH
  • 515 ERROR_SMG_TOO_MANY_DDS
  • 516 ERROR_SMG_INVALID_NOTIFICATION

Remarks

The Session Manager calls the registered device driver during a session switch, based on the specific form of notifications required.

The notification IOCTL passed to the device driver has the following format:

Size    Definition
WORD    DevIOCtl packet length, including the length itself
WORD    Screen switch notification type
WORD    Incoming session number
WORD    Outgoing session number.

The device driver passes a bit map that informs the session manager when the device driver needs to be called. The possible phases are:

  • Before a session save
  • After a session save (before a restore)
  • After a session restore
  • After a session termination.

The device drivers must issue this API only during their initialization phase. After the session manager has been initialized, it rejects all further calls to this API, returning ERROR_SMG_INVALID_CALL.

Bindings

C

#define INCL_DOSFILEMGR

USHORT  rc = DosSMRegisterDD(RegisterData);

PREGISTERDATA RegisterData;  /* Data packet */
USHORT        rc;            /* return code */

MASM

EXTRN  DosSMRegisterDD:FAR
INCL_DOSFILEMGR     EQU 1

PUSH@  OTHER RegisterData        ;Data packet
CALL   DosSMRegisterDD

Returns WORD