Open System Services Programmer's Guide

A DLL type mismatch occurs when the linker searches for a 32-bit or 64-bit DLL, and the linker
encounters a DLL of the opposite model. In this case:
1. The linker will:
a. Issue a warning that a DLL of the incorrect model was found
b. Remember the location of the incorrect DLL
c. Continue searching
2. If a DLL of the correct model (or a neutral DLL) is subsequently found, that DLL is used. If a
correct or neutral DLL is not found, the linker issues a second warning and attempts to resolve
symbols using the incorrect DLL. This is done under the assumption that a DLL of the correct
model might still be found by the run-time loader at run time.
3. If the run-time loader finds a DLL of the opposite model, it ignores that file and continues
searching.
Mixed Data-Model Programming
A program that contains both 32-bit and 64-bit pointers is a mixed data-model program. The use
of the _ptrnn modifiers and the p64_shared pragma results in a mixed data-model program.
For information about_ptr32 and _ptr64, see “New Pointer Modifiers” (page 299) .
Mixed data-model programming uses one of the following methods:
The ILP32 data model with explicit 64-bit pointers to access data outside of the 32-bit
addressable range
The LP64 data model with explicit 32-bit pointers to access data in the 32-bit addressable
range
For example, access to 64-bit memory segments from native Guardian and 32-bit OSS processes
on TNS/E systems requires mixed data-model programming.
IMPORTANT: A 32-bit process cannot use a 64-bit address to call a 32-bit function or procedure.
For example, a 32-bit process cannot use a 64-bit pointer to call recvmsg(). Instead, the 32-bit
process must use a 64-bit pointer and call recvmsg64().
See “OSS Functions Callable from 32-bit Processes Using 64-bit Pointers” (page 297) for the 64-bit
functions that can be called from 32-bit applications.
New Pointer Modifiers
The majority of applications are built using either the ILP32 or the LP64 data model. The entire set
of operating system APIs are not available in a 64-bit variant, and there is limited support for
creating 32-bit pointers in the LP64 data model and 64-bit pointers in the ILP32 data model.
New pointer modifiers are supported that explicitly specify the size of a pointer. The _ptr64
modifier is used to declare a 64-bit pointer and the _ptr32 modifier is used to declare a 32-bit
pointer. These modifiers can be used in both the ILP32 data model and the LP64 data model.
Example 60 Examples of _ptr64 and _ptr32 Pointer Modifiers
char _ptr64 *Ptr1; /* Ptr1 is a 64-bit pointer to a character. */
char _ptr32 *Ptr2; /* Ptr2 is a 32-bit pointer to a character. */
Mixed Data-Model Programming 299