From a518edc3aabeaabf581775584389309a360ff8ed Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 15 Dec 2008 13:31:52 +0100 Subject: [PATCH] include: Allow 64-bit pointers to pass through LDT functions unmolested. --- include/wine/library.h | 6 ++++++ include/winnt.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/include/wine/library.h b/include/wine/library.h index 52186c612f2..110239029b6 100644 --- a/include/wine/library.h +++ b/include/wine/library.h @@ -135,6 +135,9 @@ static inline void wine_ldt_set_base( LDT_ENTRY *ent, const void *base ) ent->BaseLow = (WORD)(ULONG_PTR)base; ent->HighWord.Bits.BaseMid = (BYTE)((ULONG_PTR)base >> 16); ent->HighWord.Bits.BaseHi = (BYTE)((ULONG_PTR)base >> 24); +#ifdef _WIN64 + ent->BaseHigh = (ULONG_PTR)base >> 32; +#endif } static inline void wine_ldt_set_limit( LDT_ENTRY *ent, unsigned int limit ) { @@ -145,6 +148,9 @@ static inline void wine_ldt_set_limit( LDT_ENTRY *ent, unsigned int limit ) static inline void *wine_ldt_get_base( const LDT_ENTRY *ent ) { return (void *)(ent->BaseLow | +#ifdef _WIN64 + (ULONG_PTR)ent->BaseHigh << 32 | +#endif (ULONG_PTR)ent->HighWord.Bits.BaseMid << 16 | (ULONG_PTR)ent->HighWord.Bits.BaseHi << 24); } diff --git a/include/winnt.h b/include/winnt.h index 083bd961701..580c2e55d09 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -846,6 +846,9 @@ typedef struct _LDT_ENTRY { unsigned BaseHi : 8; } Bits; } HighWord; +#ifdef _WIN64 /* FIXME: 64-bit code should not be using the LDT */ + DWORD BaseHigh; +#endif } LDT_ENTRY, *PLDT_ENTRY; /* x86-64 context definitions */ -- 2.11.4.GIT