IBM C and C++ Compilers provides special 48-bit function pointers so you can make indirect calls to 32-bit functions that use the _Far32 _Pascal convention. The _Far32 _Pascal pointers are required to build virtual device drivers and similar applications that run at ring 0. For example, you would use 48-bit pointers to allow your VDD to communicate with physical device drivers.
The _Far32 _Pascal pointers, like the _Far32 _Pascal calling convention, are only supported when the /Gr+ compiler option is specified.
The 48-bit pointer consists of 2 fields:
To declare a 48-bit pointer, use the _Far32 and _Pascal keywords in the pointer declaration. For example:
void (* _Far32 _Pascal foo)(int);
declares foo to be a 48-bit pointer to a function with the _Far32 _Pascal convention that takes an integer argument and does not return a value.
The only operations that can be performed on or with a _Far32 _Pascal pointer are:
If you assign an integer or unsigned value to a 48-bit pointer, the selector field of the pointer is set to the default CODE32 segment, and the offset field is initialized to the integer value being assigned. This type of assignment is not generally useful, because you cannot know where a function will reside in a code segment, and because if your code segment is CODE32, a 32-bit function pointer is sufficient.
Note: _Far32 _Pascal pointers cannot be directly converted to _Far16 pointers.
![]()
Developing Virtual Device
Drivers in OS/2
Calling Between 32-bit and
16-bit Code