Jump to content

DosCallback: Difference between revisions

From EDM2
Created page with "image:legacy.png This function has been eliminated since OS/2 2.0 [https://books.google.com.ec/books?id=u7WbsmbttwYC&pg=PT372&lpg=PT372&dq#v=onepage&q&f=false] ==Descript..."
 
Ak120 (talk | contribs)
m Undo revision 76154 by Martini (talk) bs
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[image:legacy.png]]
This function has been eliminated since OS/2 2.0 [https://books.google.com.ec/books?id=u7WbsmbttwYC&pg=PT372&lpg=PT372&dq#v=onepage&q&f=false]
==Description==
This call provides a privilege level 2 IOPL segment to call a privilege level 3 application segment.
This call provides a privilege level 2 IOPL segment to call a privilege level 3 application segment.


==Syntax==
==Syntax==
<PRE>
  DosCallback (Ring3Routine)
  DosCallback


    (Ring3Routine)
</PRE>
==Parameters==
==Parameters==
; Ring3Routine (PFN) - input : Address of the privilege level 3 application routine to be called.
;Ring3Routine ([[PFN]]) - input : Address of the privilege level 3 application routine to be called.
 
==Return Code==


==Remarks==
==Remarks==
Line 25: Line 16:
The privilege level 2 stack can not be used to pass data to the privilege level 3 routine.
The privilege level 2 stack can not be used to pass data to the privilege level 3 routine.


If DosCallback is used in a nested fashion such that a privilege level 3 routine issues a call to a privilege level 2 routine while performing a "Callback" operation (after being invoked by "Callback" but before having issued a Far RET back to the privilege level 2 code), any subsequent DosCallback requests must complete execution and issue their corresponding Far RETs in last-in-first-out (LIFO) order.  
If DosCallback is used in a nested fashion such that a privilege level 3 routine issues a call to a privilege level 2 routine while performing a "Callback" operation (after being invoked by "Callback" but before having issued a Far RET back to the privilege level 2 code), any subsequent DosCallback requests must complete execution and issue their corresponding Far RETs in last-in-first-out (LIFO) order.


==Example Code==
==Bindings==
===C Binding===
===C===
<PRE>
<PRE>
#define INCL_DOSDEVICES
#define INCL_DOSDEVICES
Line 34: Line 25:
VOID    DosCallback(Ring3Routine);
VOID    DosCallback(Ring3Routine);


PFN             Ring3Routine;  /* Address of privilege level 3 routine */
PFN     Ring3Routine;  /* Address of privilege level 3 routine */
</PRE>
</PRE>


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  DosCallback:FAR
EXTRN  DosCallback:FAR
Line 47: Line 38:
Returns NONE
Returns NONE
</PRE>
</PRE>
==Related Functions==
*


[[Category:The OS/2 API Project]]
[[Category:Dos16]]

Latest revision as of 15:09, 15 October 2023

This call provides a privilege level 2 IOPL segment to call a privilege level 3 application segment.

Syntax

DosCallback (Ring3Routine)

Parameters

Ring3Routine (PFN) - input
Address of the privilege level 3 application routine to be called.

Remarks

This function allows a routine executing with I/O privilege (at privilege level 2) to call a segment that is executing at privilege level 3 and also to have the target routine execute at privilege level 3; for example, not to allow/require the target routine to be privilege level 2 conforming.

The requested routine is given control at privilege level 3 and when it completes execution and returns, return is made to the privilege level 2 calling routine.

All registers except FLAGs are passed intact across this call return sequence and may be used to pass parameters or data. Any addresses passed from privilege level 2 to privilege level 3 must be based on privilege level 3 selectors only as the privilege level 3 code does not have proper addressability to any privilege level 2 data selectors.

The privilege level 2 stack can not be used to pass data to the privilege level 3 routine.

If DosCallback is used in a nested fashion such that a privilege level 3 routine issues a call to a privilege level 2 routine while performing a "Callback" operation (after being invoked by "Callback" but before having issued a Far RET back to the privilege level 2 code), any subsequent DosCallback requests must complete execution and issue their corresponding Far RETs in last-in-first-out (LIFO) order.

Bindings

C

#define INCL_DOSDEVICES

VOID    DosCallback(Ring3Routine);

PFN     Ring3Routine;  /* Address of privilege level 3 routine */

MASM

EXTRN  DosCallback:FAR
INCL_DOSDEVICES     EQU 1

PUSH@  OTHER   Ring3Routine  ;Address of privilege level 3 routine
CALL   DosCallback

Returns NONE