winex11.drv: Map coordinates before calling send_mouse_input.
[wine/zf.git] / dlls / krnl386.exe16 / selector.c
blobab5881c89271827ef6ef0dececf9326098be51c3
1 /*
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
21 #include <string.h>
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 )
44 return !(sel & 4);
47 static LDT_ENTRY ldt_make_entry( const void *base, unsigned int limit, unsigned char flags )
49 LDT_ENTRY entry;
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;
63 return entry;
66 /***********************************************************************
67 * init_selectors
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 /***********************************************************************
80 * ldt_is_system
82 BOOL ldt_is_system( WORD sel )
84 return is_gdt_sel( sel ) || ((sel >> 3) < first_ldt_entry);
87 /***********************************************************************
88 * ldt_is_valid
90 BOOL ldt_is_valid( WORD sel )
92 return !ldt_is_system( sel ) && RtlAreBitsSet( &ldt_bitmap, sel >> 3, 1 );
95 /***********************************************************************
96 * ldt_get_ptr
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 /***********************************************************************
106 * ldt_get_entry
108 BOOL ldt_get_entry( WORD sel, LDT_ENTRY *entry )
110 if (!ldt_is_valid( sel ))
112 *entry = null_entry;
113 return FALSE;
115 *entry = ldt_make_entry( ldt_get_base( sel ), ldt_get_limit( sel ), ldt_get_flags( sel ));
116 return TRUE;
119 /***********************************************************************
120 * ldt_set_entry
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 );
139 while (count--)
141 ldt_set_entry( sel, null_entry );
142 sel += 8;
147 /***********************************************************************
148 * AllocSelectorArray (KERNEL.206)
150 WORD WINAPI AllocSelectorArray16( WORD count )
152 WORD i, sel = alloc_entries( count );
154 if (sel)
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 );
159 return sel;
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++)
177 LDT_ENTRY entry;
178 if (!ldt_get_entry( sel + (i << 3), &entry )) break;
179 ldt_set_entry( newsel + (i << 3), entry );
181 return newsel;
185 /***********************************************************************
186 * FreeSelector (KERNEL.176)
188 WORD WINAPI FreeSelector16( WORD sel )
190 WORD idx = sel >> 3;
192 if (idx < first_ldt_entry) return sel; /* error */
193 if (!RtlAreBitsSet( &ldt_bitmap, idx, 1 )) return sel; /* error */
194 free_entries( sel, 1 );
195 return 0;
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 )
224 WORD sel, count;
226 if (!size) return 0;
227 count = (size + 0xffff) / 0x10000;
228 if ((sel = alloc_entries( count ))) SELECTOR_SetEntries( sel, base, size, flags );
229 return sel;
233 /***********************************************************************
234 * SELECTOR_FreeBlock
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;
258 BYTE flags;
260 if (!size) size = 1;
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 );
274 else
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 );
285 return sel;
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) ));
298 return selDst;
302 /***********************************************************************
303 * AllocCStoDSAlias (KERNEL.170)
304 * AllocAlias (KERNEL.172)
306 WORD WINAPI AllocCStoDSAlias16( WORD sel )
308 WORD newsel;
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 ));
315 return newsel;
319 /***********************************************************************
320 * AllocDStoCSAlias (KERNEL.171)
322 WORD WINAPI AllocDStoCSAlias16( WORD sel )
324 WORD newsel;
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 ));
331 return newsel;
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 )));
367 return 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 )));
387 return sel;
391 /***********************************************************************
392 * SelectorAccessRights (KERNEL.196)
394 WORD WINAPI SelectorAccessRights16( WORD sel, WORD op, WORD val )
396 LDT_ENTRY entry;
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);
403 else /* set */
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 );
408 return 0;
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;
423 return FALSE;
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;
439 return FALSE;
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;
454 return FALSE;
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;
468 return FALSE;
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 *
503 struct mapls_entry
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 /***********************************************************************
515 * MapLS (KERNEL32.@)
516 * MapLS (KERNEL.358)
518 * Maps linear pointer to segmented.
520 SEGPTR WINAPI MapLS( LPCVOID ptr )
522 struct mapls_entry *entry, *free = NULL;
523 const void *base;
524 SEGPTR ret = 0;
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;
536 if (!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 );
544 goto done;
546 free->count = 0;
547 free->next = first_entry;
548 first_entry = free;
550 SetSelectorBase( free->sel, (DWORD)base );
551 free->addr = (void*)base;
552 entry = free;
554 entry->count++;
555 ret = MAKESEGPTR( entry->sel, (const char *)ptr - (char *)entry->addr );
556 done:
557 HeapUnlock( GetProcessHeap() );
558 return ret;
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);
572 if (sel)
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 /***********************************************************************
582 * MapSL (KERNEL32.@)
583 * MapSL (KERNEL.357)
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
597 * moveable blocks.
600 LPVOID WINAPI MapSLFix( SEGPTR sptr )
602 return MapSL(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,
617 "xor %edx,%edx\n\t"
618 "testl $0xffff0000,%eax\n\t"
619 "jz 1f\n\t"
620 "pushl %eax\n\t"
621 "call " __ASM_STDCALL("MapLS",4) "\n\t"
622 "movl %eax,%edx\n"
623 "1:\tret" )
625 /***********************************************************************
626 * SUnMapLS (KERNEL32.@)
628 __ASM_STDCALL_FUNC( SUnMapLS, 0,
629 "pushl %eax\n\t" /* preserve eax */
630 "pushl %eax\n\t"
631 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
632 "popl %eax\n\t"
633 "ret" )
635 /***********************************************************************
636 * SMapLS_IP_EBP_8 (KERNEL32.@)
638 * These functions map linear pointers at [EBP+xxx] to segmented pointers
639 * and return them.
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"
647 "ret" )
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"
656 "ret" )
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"
665 "ret" )
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"
674 "ret" )
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"
683 "ret" )
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"
692 "ret" )
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"
701 "ret" )
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"
710 "ret" )
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"
719 "ret" )
721 /***********************************************************************
722 * SUnMapLS_IP_EBP_8 (KERNEL32.@)
724 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_8, 0,
725 "pushl %eax\n\t" /* preserve eax */
726 "pushl 8(%ebp)\n\t"
727 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
728 "movl $0,8(%ebp)\n\t"
729 "popl %eax\n\t"
730 "ret" )
732 /***********************************************************************
733 * SUnMapLS_IP_EBP_12 (KERNEL32.@)
735 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_12, 0,
736 "pushl %eax\n\t" /* preserve eax */
737 "pushl 12(%ebp)\n\t"
738 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
739 "movl $0,12(%ebp)\n\t"
740 "popl %eax\n\t"
741 "ret" )
743 /***********************************************************************
744 * SUnMapLS_IP_EBP_16 (KERNEL32.@)
746 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_16, 0,
747 "pushl %eax\n\t" /* preserve eax */
748 "pushl 16(%ebp)\n\t"
749 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
750 "movl $0,16(%ebp)\n\t"
751 "popl %eax\n\t"
752 "ret" )
754 /***********************************************************************
755 * SUnMapLS_IP_EBP_20 (KERNEL32.@)
757 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_20, 0,
758 "pushl %eax\n\t" /* preserve eax */
759 "pushl 20(%ebp)\n\t"
760 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
761 "movl $0,20(%ebp)\n\t"
762 "popl %eax\n\t"
763 "ret" )
765 /***********************************************************************
766 * SUnMapLS_IP_EBP_24 (KERNEL32.@)
768 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_24, 0,
769 "pushl %eax\n\t" /* preserve eax */
770 "pushl 24(%ebp)\n\t"
771 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
772 "movl $0,24(%ebp)\n\t"
773 "popl %eax\n\t"
774 "ret" )
776 /***********************************************************************
777 * SUnMapLS_IP_EBP_28 (KERNEL32.@)
779 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_28, 0,
780 "pushl %eax\n\t" /* preserve eax */
781 "pushl 28(%ebp)\n\t"
782 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
783 "movl $0,28(%ebp)\n\t"
784 "popl %eax\n\t"
785 "ret" )
787 /***********************************************************************
788 * SUnMapLS_IP_EBP_32 (KERNEL32.@)
790 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_32, 0,
791 "pushl %eax\n\t" /* preserve eax */
792 "pushl 32(%ebp)\n\t"
793 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
794 "movl $0,32(%ebp)\n\t"
795 "popl %eax\n\t"
796 "ret" )
798 /***********************************************************************
799 * SUnMapLS_IP_EBP_36 (KERNEL32.@)
801 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_36, 0,
802 "pushl %eax\n\t" /* preserve eax */
803 "pushl 36(%ebp)\n\t"
804 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
805 "movl $0,36(%ebp)\n\t"
806 "popl %eax\n\t"
807 "ret" )
809 /***********************************************************************
810 * SUnMapLS_IP_EBP_40 (KERNEL32.@)
812 __ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_40, 0,
813 "pushl %eax\n\t" /* preserve eax */
814 "pushl 40(%ebp)\n\t"
815 "call " __ASM_STDCALL("UnMapLS",4) "\n\t"
816 "movl $0,40(%ebp)\n\t"
817 "popl %eax\n\t"
818 "ret" )