SMapLS_IP_EBP question

Eric Pouech pouech-eric at wanadoo.fr
Fri May 9 01:51:17 CDT 2003


Gerhard W. Gruber wrote:
> In a DLL I looked into the exported function calls
> SMapLS_IP_EBP/SUnmapLS_IP_EBP. I noticed that these functions are implemented
> in wine/memory.c (if I remember correctly), but I haven't found any code in
> wine that references this functions. Now I wonder why. 
> 
> These functions deal with linear/segmented pointers which I suppose are used
> for 32/16 Bit transition. The DLL has two implementations one for 32 and one
> for 16 Bit and I assume that the 32 Bit version uses code from the 16 Bit
> code. I guess that there are other DLLs where the same would be true, so I
> would expect that other DLL implementations also call these functions (at
> least in the original version). Since there are no calls in wine to this
> functions, does this mean that this can be ignored because it is an
> implementation detail? But then how is the code handled in 16Bit environment?
> 

there are two cases to look at:
- native DLLs: those libraries actually uses the Win32 thunking 
mechanism, and then call the kernel32/krnl386 functions to map/unmap 
segmented pointers into linear addresses and to create thunks (ability 
to call from 32bit into 16 bit, and the other way around). Those 
functions are part of the ones you were talking about.
- builtin DLLs: those DLLs use a slightly different approach. The 16 bit 
and the 32 bit counterparts of a DLL (for example USER and USER32) are 
in fact stored in the same ELF .so library, which means we don't need 
thunking between those two DLLs (we use regular 32bit calls). The 
winebuild tool creates the appropriate glue so that the 16 bit DLL entry 
points can actually be implemented as 32 bit functions (it also, in most 
of the cases, converts the 16 bit pointers into 32 bit ones). There are 
a few cases remaining where the implementation of the builtin DLL must 
deal with segmented/linear conversion, in which case it uses the MapSL 
and UnmapSL function. Since the glue takes care of the conversion of the 
function's parameters the SMapLS_IP_EBP (and the like) functions you're 
referring to are of no use.

HTH
A+
-- 
Eric Pouech




More information about the wine-devel mailing list