I have a question about this function that has bugged me for years, so I decided to let this community a try :) So, this function supposedly locks a XMS extended memory block in place, and returns an address (or pointer) to it. The problem is that according to the XMS 2.0 specification, a linear address is returned, but according to XMS 3.0, the returned address is physical (which means that it can't be used as a pointer).
My question is, does somebody know how to tell if the returned address is linear or physical? I have read on the internet the following advice:
When there is no EMM386 (or other EMM) or enhanced mode Windows and the CPU is in real mode, there is no difference between linear and physical addresses;
when the CPU is in V86 mode and EMM386 is present, but no enhanced mode Windows, then the returned address is physical (so it can be used directly by a VCPI client);
when the CPU is in V86 mode and enhanced mode Windows is present, then physical addresses are only available to the Windows kernel itself, and the function returns a linear address.
The book "The Old New Thing: Practical Development Throughout the Evolution of Windows" by Raymond Chen says that there is no way to determine if the returned address is linear or physical, and the author's advice is to not use this function at all.
Any thoughts? Thanks in advance.