2 * Selector manipulation functions
4 * Copyright 1995 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "wine/winbase16.h"
24 #include "wine/debug.h"
25 #include "kernel16_private.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(selector
);
29 const struct ldt_copy
*ldt_copy
= NULL
;
31 static ULONG bitmap_data
[LDT_SIZE
/ 32];
32 static RTL_BITMAP ldt_bitmap
= { LDT_SIZE
, bitmap_data
};
33 static const LDT_ENTRY null_entry
;
34 static WORD first_ldt_entry
= 32;
36 /* get the number of selectors needed to cover up to the selector limit */
37 static inline WORD
get_sel_count( WORD sel
)
39 return (ldt_get_limit( sel
) >> 16) + 1;
42 static inline int is_gdt_sel( WORD sel
)
47 static LDT_ENTRY
ldt_make_entry( const void *base
, unsigned int limit
, unsigned char flags
)
51 entry
.BaseLow
= (WORD
)(ULONG_PTR
)base
;
52 entry
.HighWord
.Bits
.BaseMid
= (BYTE
)((ULONG_PTR
)base
>> 16);
53 entry
.HighWord
.Bits
.BaseHi
= (BYTE
)((ULONG_PTR
)base
>> 24);
54 if ((entry
.HighWord
.Bits
.Granularity
= (limit
>= 0x100000))) limit
>>= 12;
55 entry
.LimitLow
= (WORD
)limit
;
56 entry
.HighWord
.Bits
.LimitHi
= limit
>> 16;
57 entry
.HighWord
.Bits
.Dpl
= 3;
58 entry
.HighWord
.Bits
.Pres
= 1;
59 entry
.HighWord
.Bits
.Type
= flags
;
60 entry
.HighWord
.Bits
.Sys
= 0;
61 entry
.HighWord
.Bits
.Reserved_0
= 0;
62 entry
.HighWord
.Bits
.Default_Big
= (flags
& LDT_FLAGS_32BIT
) != 0;
66 /***********************************************************************
69 void init_selectors(void)
71 const struct ldt_copy
**ldt_copy_ptr
;
72 if (!is_gdt_sel( get_gs() )) first_ldt_entry
+= 512;
73 if (!is_gdt_sel( get_fs() )) first_ldt_entry
+= 512;
74 RtlSetBits( &ldt_bitmap
, 0, first_ldt_entry
);
75 ldt_copy_ptr
= (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "__wine_ldt_copy" );
76 if (ldt_copy_ptr
) ldt_copy
= *ldt_copy_ptr
;
79 /***********************************************************************
82 BOOL
ldt_is_system( WORD sel
)
84 return is_gdt_sel( sel
) || ((sel
>> 3) < first_ldt_entry
);
87 /***********************************************************************
90 BOOL
ldt_is_valid( WORD sel
)
92 return !ldt_is_system( sel
) && RtlAreBitsSet( &ldt_bitmap
, sel
>> 3, 1 );
95 /***********************************************************************
98 void *ldt_get_ptr( WORD sel
, DWORD offset
)
100 if (ldt_is_system( sel
)) return (void *)offset
;
101 if (!(ldt_get_flags( sel
) & LDT_FLAGS_32BIT
)) offset
&= 0xffff;
102 return (char *)ldt_get_base( sel
) + offset
;
105 /***********************************************************************
108 BOOL
ldt_get_entry( WORD sel
, LDT_ENTRY
*entry
)
110 if (!ldt_is_valid( sel
))
115 *entry
= ldt_make_entry( ldt_get_base( sel
), ldt_get_limit( sel
), ldt_get_flags( sel
));
119 /***********************************************************************
122 void ldt_set_entry( WORD sel
, LDT_ENTRY entry
)
124 NtSetLdtEntries( sel
, entry
, 0, null_entry
);
128 static ULONG
alloc_entries( ULONG count
)
130 ULONG idx
= RtlFindClearBitsAndSet( &ldt_bitmap
, count
, first_ldt_entry
);
132 if (idx
== ~0u) return 0;
133 return (idx
<< 3) | 7;
136 static void free_entries( ULONG sel
, ULONG count
)
138 RtlClearBits( &ldt_bitmap
, sel
>> 3, count
);
141 ldt_set_entry( sel
, null_entry
);
147 /***********************************************************************
148 * AllocSelectorArray (KERNEL.206)
150 WORD WINAPI
AllocSelectorArray16( WORD count
)
152 WORD i
, sel
= alloc_entries( count
);
156 LDT_ENTRY entry
= ldt_make_entry( 0, 1, LDT_FLAGS_DATA
); /* avoid 0 base and limit */
157 for (i
= 0; i
< count
; i
++) ldt_set_entry( sel
+ (i
<< 3), entry
);
163 /***********************************************************************
164 * AllocSelector (KERNEL.175)
166 WORD WINAPI
AllocSelector16( WORD sel
)
168 WORD newsel
, count
, i
;
170 count
= sel
? get_sel_count(sel
) : 1;
171 newsel
= alloc_entries( count
);
172 TRACE("(%04x): returning %04x\n", sel
, newsel
);
173 if (!newsel
) return 0;
174 if (!sel
) return newsel
; /* nothing to copy */
175 for (i
= 0; i
< count
; i
++)
178 if (!ldt_get_entry( sel
+ (i
<< 3), &entry
)) break;
179 ldt_set_entry( newsel
+ (i
<< 3), entry
);
185 /***********************************************************************
186 * FreeSelector (KERNEL.176)
188 WORD WINAPI
FreeSelector16( WORD sel
)
192 if (idx
< first_ldt_entry
) return sel
; /* error */
193 if (!RtlAreBitsSet( &ldt_bitmap
, idx
, 1 )) return sel
; /* error */
194 free_entries( sel
, 1 );
199 /***********************************************************************
200 * SELECTOR_SetEntries
202 * Set the LDT entries for an array of selectors.
204 static void SELECTOR_SetEntries( WORD sel
, const void *base
, DWORD size
, unsigned char flags
)
206 WORD i
, count
= (size
+ 0xffff) / 0x10000;
208 for (i
= 0; i
< count
; i
++)
210 ldt_set_entry( sel
+ (i
<< 3), ldt_make_entry( base
, size
- 1, flags
));
211 base
= (const char *)base
+ 0x10000;
212 size
-= 0x10000; /* yep, Windows sets limit like that, not 64K sel units */
217 /***********************************************************************
218 * SELECTOR_AllocBlock
220 * Allocate selectors for a block of linear memory.
222 WORD
SELECTOR_AllocBlock( const void *base
, DWORD size
, unsigned char flags
)
227 count
= (size
+ 0xffff) / 0x10000;
228 if ((sel
= alloc_entries( count
))) SELECTOR_SetEntries( sel
, base
, size
, flags
);
233 /***********************************************************************
236 * Free a block of selectors.
238 void SELECTOR_FreeBlock( WORD sel
)
240 WORD idx
= sel
>> 3, count
= get_sel_count( sel
);
242 TRACE("(%04x,%d)\n", sel
, count
);
244 if (idx
< first_ldt_entry
) return; /* error */
245 if (!RtlAreBitsSet( &ldt_bitmap
, idx
, count
)) return; /* error */
246 free_entries( sel
, count
);
250 /***********************************************************************
251 * SELECTOR_ReallocBlock
253 * Change the size of a block of selectors.
255 WORD
SELECTOR_ReallocBlock( WORD sel
, const void *base
, DWORD size
)
257 int oldcount
, newcount
;
261 if (!ldt_is_valid( sel
)) return sel
;
262 flags
= ldt_get_flags( sel
);
263 oldcount
= (ldt_get_limit( sel
) >> 16) + 1;
264 newcount
= (size
+ 0xffff) >> 16;
266 if (oldcount
< newcount
) /* we need to add selectors */
268 ULONG idx
= sel
>> 3;
270 if (RtlAreBitsClear( &ldt_bitmap
, idx
+ oldcount
, newcount
- oldcount
))
272 RtlSetBits( &ldt_bitmap
, idx
+ oldcount
, newcount
- oldcount
);
276 free_entries( sel
, oldcount
);
277 sel
= alloc_entries( newcount
);
280 else if (oldcount
> newcount
)
282 free_entries( sel
+ (newcount
<< 3), oldcount
- newcount
);
284 if (sel
) SELECTOR_SetEntries( sel
, base
, size
, flags
);
289 /***********************************************************************
290 * PrestoChangoSelector (KERNEL.177)
292 WORD WINAPI
PrestoChangoSelector16( WORD selSrc
, WORD selDst
)
294 if (!ldt_is_valid( selSrc
)) return selDst
;
295 /* toggle the executable bit */
296 ldt_set_entry( selDst
, ldt_make_entry( ldt_get_base( selSrc
), ldt_get_limit( selSrc
),
297 ldt_get_flags( selSrc
) ^ (LDT_FLAGS_CODE
^ LDT_FLAGS_DATA
) ));
302 /***********************************************************************
303 * AllocCStoDSAlias (KERNEL.170)
304 * AllocAlias (KERNEL.172)
306 WORD WINAPI
AllocCStoDSAlias16( WORD sel
)
310 if (!ldt_is_valid( sel
)) return 0;
311 newsel
= AllocSelector16( 0 );
312 TRACE("(%04x): returning %04x\n", sel
, newsel
);
313 if (!newsel
) return 0;
314 ldt_set_entry( newsel
, ldt_make_entry( ldt_get_base(sel
), ldt_get_limit(sel
), LDT_FLAGS_DATA
));
319 /***********************************************************************
320 * AllocDStoCSAlias (KERNEL.171)
322 WORD WINAPI
AllocDStoCSAlias16( WORD sel
)
326 if (!ldt_is_valid( sel
)) return 0;
327 newsel
= AllocSelector16( 0 );
328 TRACE("(%04x): returning %04x\n", sel
, newsel
);
329 if (!newsel
) return 0;
330 ldt_set_entry( newsel
, ldt_make_entry( ldt_get_base(sel
), ldt_get_limit(sel
), LDT_FLAGS_CODE
));
335 /***********************************************************************
336 * LongPtrAdd (KERNEL.180)
338 void WINAPI
LongPtrAdd16( SEGPTR ptr
, DWORD add
)
340 WORD sel
= SELECTOROF( ptr
);
342 if (!ldt_is_valid( sel
)) return;
343 ldt_set_entry( sel
, ldt_make_entry( (char *)ldt_get_base( sel
) + add
,
344 ldt_get_limit( sel
), ldt_get_flags( sel
)));
348 /***********************************************************************
349 * GetSelectorBase (KERNEL.186)
351 DWORD WINAPI
GetSelectorBase( WORD sel
)
353 /* if base points into DOSMEM, assume we have to
354 * return pointer into physical lower 1MB */
355 return DOSMEM_MapLinearToDos( ldt_get_base( sel
));
359 /***********************************************************************
360 * SetSelectorBase (KERNEL.187)
362 WORD WINAPI
SetSelectorBase( WORD sel
, DWORD base
)
364 if (!ldt_is_valid( sel
)) return 0;
365 ldt_set_entry( sel
, ldt_make_entry( DOSMEM_MapDosToLinear(base
),
366 ldt_get_limit( sel
), ldt_get_flags( sel
)));
371 /***********************************************************************
372 * GetSelectorLimit (KERNEL.188)
374 DWORD WINAPI
GetSelectorLimit16( WORD sel
)
376 return ldt_get_limit( sel
);
380 /***********************************************************************
381 * SetSelectorLimit (KERNEL.189)
383 WORD WINAPI
SetSelectorLimit16( WORD sel
, DWORD limit
)
385 if (!ldt_is_valid( sel
)) return 0;
386 ldt_set_entry( sel
, ldt_make_entry( ldt_get_base( sel
), limit
, ldt_get_flags( sel
)));
391 /***********************************************************************
392 * SelectorAccessRights (KERNEL.196)
394 WORD WINAPI
SelectorAccessRights16( WORD sel
, WORD op
, WORD val
)
398 if (!ldt_get_entry( sel
, &entry
)) return 0;
399 if (op
== 0) /* get */
401 return entry
.HighWord
.Bytes
.Flags1
| ((entry
.HighWord
.Bytes
.Flags2
& 0xf0) << 8);
405 entry
.HighWord
.Bytes
.Flags1
= LOBYTE(val
) | 0xf0;
406 entry
.HighWord
.Bytes
.Flags2
= (entry
.HighWord
.Bytes
.Flags2
& 0x0f) | (HIBYTE(val
) & 0xf0);
407 ldt_set_entry( sel
, entry
);
413 /***********************************************************************
414 * IsBadCodePtr (KERNEL.336)
416 BOOL16 WINAPI
IsBadCodePtr16( SEGPTR ptr
)
418 WORD sel
= SELECTOROF( ptr
);
420 /* check for code segment, ignoring conforming, read-only and accessed bits */
421 if ((ldt_get_flags( sel
) ^ LDT_FLAGS_CODE
) & 0x18) return TRUE
;
422 if (OFFSETOF(ptr
) > ldt_get_limit( sel
)) return TRUE
;
427 /***********************************************************************
428 * IsBadStringPtr (KERNEL.337)
430 BOOL16 WINAPI
IsBadStringPtr16( SEGPTR ptr
, UINT16 size
)
432 WORD sel
= SELECTOROF( ptr
);
434 /* check for data or readable code segment */
435 if (!(ldt_get_flags( sel
) & 0x10)) return TRUE
; /* system descriptor */
436 if ((ldt_get_flags( sel
) & 0x0a) == 0x08) return TRUE
; /* non-readable code segment */
437 if (strlen(MapSL(ptr
)) < size
) size
= strlen(MapSL(ptr
)) + 1;
438 if (size
&& (OFFSETOF(ptr
) + size
- 1 > ldt_get_limit( sel
))) return TRUE
;
443 /***********************************************************************
444 * IsBadHugeReadPtr (KERNEL.346)
446 BOOL16 WINAPI
IsBadHugeReadPtr16( SEGPTR ptr
, DWORD size
)
448 WORD sel
= SELECTOROF( ptr
);
450 /* check for data or readable code segment */
451 if (!(ldt_get_flags( sel
) & 0x10)) return TRUE
; /* system descriptor */
452 if ((ldt_get_flags( sel
) & 0x0a) == 0x08) return TRUE
; /* non-readable code segment */
453 if (size
&& (OFFSETOF(ptr
) + size
- 1 > ldt_get_limit( sel
))) return TRUE
;
458 /***********************************************************************
459 * IsBadHugeWritePtr (KERNEL.347)
461 BOOL16 WINAPI
IsBadHugeWritePtr16( SEGPTR ptr
, DWORD size
)
463 WORD sel
= SELECTOROF( ptr
);
465 /* check for writable data segment, ignoring expand-down and accessed flags */
466 if ((ldt_get_flags( sel
) ^ LDT_FLAGS_DATA
) & 0x1a) return TRUE
;
467 if (size
&& (OFFSETOF(ptr
) + size
- 1 > ldt_get_limit( sel
))) return TRUE
;
471 /***********************************************************************
472 * IsBadReadPtr (KERNEL.334)
474 BOOL16 WINAPI
IsBadReadPtr16( SEGPTR ptr
, UINT16 size
)
476 return IsBadHugeReadPtr16( ptr
, size
);
480 /***********************************************************************
481 * IsBadWritePtr (KERNEL.335)
483 BOOL16 WINAPI
IsBadWritePtr16( SEGPTR ptr
, UINT16 size
)
485 return IsBadHugeWritePtr16( ptr
, size
);
489 /***********************************************************************
490 * IsBadFlatReadWritePtr (KERNEL.627)
492 BOOL16 WINAPI
IsBadFlatReadWritePtr16( SEGPTR ptr
, DWORD size
, BOOL16 bWrite
)
494 return bWrite
? IsBadHugeWritePtr16( ptr
, size
)
495 : IsBadHugeReadPtr16( ptr
, size
);
499 /************************************* Win95 pointer mapping functions *
505 struct mapls_entry
*next
;
506 void *addr
; /* linear address */
507 int count
; /* ref count */
508 WORD sel
; /* selector */
511 static struct mapls_entry
*first_entry
;
514 /***********************************************************************
518 * Maps linear pointer to segmented.
520 SEGPTR WINAPI
MapLS( LPCVOID ptr
)
522 struct mapls_entry
*entry
, *free
= NULL
;
526 if (!HIWORD(ptr
)) return (SEGPTR
)LOWORD(ptr
);
528 base
= (const char *)ptr
- ((ULONG_PTR
)ptr
& 0x7fff);
529 HeapLock( GetProcessHeap() );
530 for (entry
= first_entry
; entry
; entry
= entry
->next
)
532 if (entry
->addr
== base
) break;
533 if (!entry
->count
) free
= entry
;
538 if (!free
) /* no free entry found, create a new one */
540 if (!(free
= HeapAlloc( GetProcessHeap(), 0, sizeof(*free
) ))) goto done
;
541 if (!(free
->sel
= SELECTOR_AllocBlock( base
, 0x10000, LDT_FLAGS_DATA
)))
543 HeapFree( GetProcessHeap(), 0, free
);
547 free
->next
= first_entry
;
550 SetSelectorBase( free
->sel
, (DWORD
)base
);
551 free
->addr
= (void*)base
;
555 ret
= MAKESEGPTR( entry
->sel
, (const char *)ptr
- (char *)entry
->addr
);
557 HeapUnlock( GetProcessHeap() );
561 /***********************************************************************
562 * UnMapLS (KERNEL32.@)
563 * UnMapLS (KERNEL.359)
565 * Free mapped selector.
567 void WINAPI
UnMapLS( SEGPTR sptr
)
569 struct mapls_entry
*entry
;
570 WORD sel
= SELECTOROF(sptr
);
574 HeapLock( GetProcessHeap() );
575 for (entry
= first_entry
; entry
; entry
= entry
->next
) if (entry
->sel
== sel
) break;
576 if (entry
&& entry
->count
> 0) entry
->count
--;
577 HeapUnlock( GetProcessHeap() );
581 /***********************************************************************
585 * Maps fixed segmented pointer to linear.
587 LPVOID WINAPI
MapSL( SEGPTR sptr
)
589 return (char *)ldt_get_base( SELECTOROF(sptr
) ) + OFFSETOF(sptr
);
592 /***********************************************************************
593 * MapSLFix (KERNEL32.@)
595 * FIXME: MapSLFix and UnMapSLFixArray should probably prevent
596 * unexpected linear address change when GlobalCompact() shuffles
600 LPVOID WINAPI
MapSLFix( SEGPTR sptr
)
606 /***********************************************************************
607 * UnMapSLFixArray (KERNEL32.@)
609 * Must not change EAX, hence defined as asm function.
611 __ASM_STDCALL_FUNC( UnMapSLFixArray
, 8, "ret $8" )
613 /***********************************************************************
614 * SMapLS (KERNEL32.@)
616 __ASM_STDCALL_FUNC( SMapLS
, 0,
618 "testl $0xffff0000,%eax\n\t"
621 "call " __ASM_STDCALL("MapLS",4) "\n\t"
625 /***********************************************************************
626 * SUnMapLS (KERNEL32.@)
628 __ASM_STDCALL_FUNC( SUnMapLS
, 0,
629 "pushl %eax\n\t" /* preserve eax */
631 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
635 /***********************************************************************
636 * SMapLS_IP_EBP_8 (KERNEL32.@)
638 * These functions map linear pointers at [EBP+xxx] to segmented pointers
640 * Win95 uses some kind of alias structs, which it stores in [EBP+x] to
641 * unravel them at SUnMapLS. We just store the segmented pointer there.
643 __ASM_STDCALL_FUNC( SMapLS_IP_EBP_8
, 0,
644 "movl 8(%ebp),%eax\n\t"
645 "call " __ASM_STDCALL("SMapLS",0) "\n\t"
646 "movl %edx,8(%ebp)\n\t"
649 /***********************************************************************
650 * SMapLS_IP_EBP_12 (KERNEL32.@)
652 __ASM_STDCALL_FUNC( SMapLS_IP_EBP_12
, 0,
653 "movl 12(%ebp),%eax\n\t"
654 "call " __ASM_STDCALL("SMapLS",0) "\n\t"
655 "movl %edx,12(%ebp)\n\t"
658 /***********************************************************************
659 * SMapLS_IP_EBP_16 (KERNEL32.@)
661 __ASM_STDCALL_FUNC( SMapLS_IP_EBP_16
, 0,
662 "movl 16(%ebp),%eax\n\t"
663 "call " __ASM_STDCALL("SMapLS",0) "\n\t"
664 "movl %edx,16(%ebp)\n\t"
667 /***********************************************************************
668 * SMapLS_IP_EBP_20 (KERNEL32.@)
670 __ASM_STDCALL_FUNC( SMapLS_IP_EBP_20
, 0,
671 "movl 20(%ebp),%eax\n\t"
672 "call " __ASM_STDCALL("SMapLS",0) "\n\t"
673 "movl %edx,20(%ebp)\n\t"
676 /***********************************************************************
677 * SMapLS_IP_EBP_24 (KERNEL32.@)
679 __ASM_STDCALL_FUNC( SMapLS_IP_EBP_24
, 0,
680 "movl 24(%ebp),%eax\n\t"
681 "call " __ASM_STDCALL("SMapLS",0) "\n\t"
682 "movl %edx,24(%ebp)\n\t"
685 /***********************************************************************
686 * SMapLS_IP_EBP_28 (KERNEL32.@)
688 __ASM_STDCALL_FUNC( SMapLS_IP_EBP_28
, 0,
689 "movl 28(%ebp),%eax\n\t"
690 "call " __ASM_STDCALL("SMapLS",0) "\n\t"
691 "movl %edx,28(%ebp)\n\t"
694 /***********************************************************************
695 * SMapLS_IP_EBP_32 (KERNEL32.@)
697 __ASM_STDCALL_FUNC( SMapLS_IP_EBP_32
, 0,
698 "movl 32(%ebp),%eax\n\t"
699 "call " __ASM_STDCALL("SMapLS",0) "\n\t"
700 "movl %edx,32(%ebp)\n\t"
703 /***********************************************************************
704 * SMapLS_IP_EBP_36 (KERNEL32.@)
706 __ASM_STDCALL_FUNC( SMapLS_IP_EBP_36
, 0,
707 "movl 36(%ebp),%eax\n\t"
708 "call " __ASM_STDCALL("SMapLS",0) "\n\t"
709 "movl %edx,36(%ebp)\n\t"
712 /***********************************************************************
713 * SMapLS_IP_EBP_40 (KERNEL32.@)
715 __ASM_STDCALL_FUNC( SMapLS_IP_EBP_40
, 0,
716 "movl 40(%ebp),%eax\n\t"
717 "call " __ASM_STDCALL("SMapLS",0) "\n\t"
718 "movl %edx,40(%ebp)\n\t"
721 /***********************************************************************
722 * SUnMapLS_IP_EBP_8 (KERNEL32.@)
724 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_8
, 0,
725 "pushl %eax\n\t" /* preserve eax */
727 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
728 "movl $0,8(%ebp)\n\t"
732 /***********************************************************************
733 * SUnMapLS_IP_EBP_12 (KERNEL32.@)
735 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_12
, 0,
736 "pushl %eax\n\t" /* preserve eax */
738 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
739 "movl $0,12(%ebp)\n\t"
743 /***********************************************************************
744 * SUnMapLS_IP_EBP_16 (KERNEL32.@)
746 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_16
, 0,
747 "pushl %eax\n\t" /* preserve eax */
749 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
750 "movl $0,16(%ebp)\n\t"
754 /***********************************************************************
755 * SUnMapLS_IP_EBP_20 (KERNEL32.@)
757 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_20
, 0,
758 "pushl %eax\n\t" /* preserve eax */
760 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
761 "movl $0,20(%ebp)\n\t"
765 /***********************************************************************
766 * SUnMapLS_IP_EBP_24 (KERNEL32.@)
768 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_24
, 0,
769 "pushl %eax\n\t" /* preserve eax */
771 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
772 "movl $0,24(%ebp)\n\t"
776 /***********************************************************************
777 * SUnMapLS_IP_EBP_28 (KERNEL32.@)
779 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_28
, 0,
780 "pushl %eax\n\t" /* preserve eax */
782 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
783 "movl $0,28(%ebp)\n\t"
787 /***********************************************************************
788 * SUnMapLS_IP_EBP_32 (KERNEL32.@)
790 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_32
, 0,
791 "pushl %eax\n\t" /* preserve eax */
793 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
794 "movl $0,32(%ebp)\n\t"
798 /***********************************************************************
799 * SUnMapLS_IP_EBP_36 (KERNEL32.@)
801 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_36
, 0,
802 "pushl %eax\n\t" /* preserve eax */
804 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
805 "movl $0,36(%ebp)\n\t"
809 /***********************************************************************
810 * SUnMapLS_IP_EBP_40 (KERNEL32.@)
812 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_40
, 0,
813 "pushl %eax\n\t" /* preserve eax */
815 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
816 "movl $0,40(%ebp)\n\t"