HOWTO: Convert a Linear Address to a Flat Offset on Win32sLast reviewed: June 10, 1997Article ID: Q115080 |
The information in this article applies to:
- Microsoft Win32s, versions 1.1, 1.15, 1.2, 1.3, 1.30c
SUMMARYWin32s flat code and data selectors are not zero-based. Linear addresses retrieved through a VxD can be used in a Win32-based application running under Win32s, after one small change is made. In addition, there are two Universal Thunk APIs that are used to convert segmented addresses to flat addresses and vice versa.
MORE INFORMATION
Linear Address to Flat AddressWin32s does not base linear addresses at 0, so that exceptions will be generated when null pointers are dereferenced. Therefore, an access violation occurs when:
Segmented Address to Flat AddressThe following Win32s Universal Thunk APIs are used for address translation:
UTLinearToSelectorOffset( UTSelectorOffsetToLinear( x ) );where x is a segmented address, you may not necessarily get the original value of x back. It is by design that the sel:off pair may be different. If the memory was allocated by a 16-bit application, Win32s does not have x in its LinearAddress->selector translation tables. Therefore, when UTLinearToSelectorOffset() is called, new selectors are created.
|
Additional query words: gpf gp-fault
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |