Virtual Device Driver Calling Conventions (OS/2)

If you are building a virtual device driver in C, you must use 32-bit _Pascal or _Far32 _Pascal calling conventions to call the Virtual Driver Help interfaces or communicate with physical device drivers. These calling conventions are not supported for C++ programs.

Within a virtual device driver, you can use the _Optlink convention in most cases. Private interfaces between physical and virtual device drivers can use any calling convention provided both device drivers support it.

The _Far32 _Pascal calling convention is only available for code running at ring 0. It allows you to make calls between code segments with different selectors. It also allows your virtual device drivers to communicate with physical device drivers.

You can specify the calling convention using either the _Pascal or _Far32 _Pascal keywords.



Developing Virtual Device Drivers in OS/2


Create Code to Run at Ring 0
Modify a Module Definition File for Virtual Device Drivers


Pascal and _Far32_Pascal Calling Conventions
16-bit Calling Conventions
Keywords
Using _Far32 _Pascal Function Pointers