42 &
Thread->Process->LdtDescriptor,
114 DPRINT(
"KeSetGdtSelector(Entry %x, Value1 %x, Value2 %x)\n",
115 Entry, Value1, Value2);
123 Gdt[
Entry + 1] = Value2;
164 SegLimit=(SegLimit << 12) | 0xfff;
170 DPRINT1(
"WARNING: Windows would mark this descriptor invalid!\n");
204 NewLdtSize += (Selector1 >= Selector2) ? Selector1 : Selector2;
209 LdtBase = LdtDescriptor[1] |
210 ((LdtDescriptor[2] & 0xff) << 16) |
211 ((LdtDescriptor[3] & ~0xff) << 16);
212 LdtLimit = LdtDescriptor[0] |
213 ((LdtDescriptor[3] & 0xf) << 16);
215 if(LdtLimit < (NewLdtSize - 1))
234 LdtDescriptor[0] = (
USHORT)((--NewLdtSize) & 0xffff);
235 LdtDescriptor[1] = (
USHORT)(NewLdtBase & 0xffff);
236 LdtDescriptor[2] = (
USHORT)(((NewLdtBase & 0xff0000) >> 16) | 0x8200);
237 LdtDescriptor[3] = (
USHORT)(((NewLdtSize & 0xf0000) >> 16) |
238 ((NewLdtBase & 0xff000000) >> 16));
241 ((
PULONG) LdtDescriptor)[0],
242 ((
PULONG) LdtDescriptor)[1]);
244 Ke386SetLocalDescriptorTable(
KGDT_LDT);
251 LdtBase = NewLdtBase;
256 memcpy((
char*)LdtBase + Selector1,
263 memcpy((
char*)LdtBase + Selector2,
#define KeReleaseSpinLock(sl, irql)
#define KeAcquireSpinLock(sl, irql)
#define ExAllocatePool(type, size)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
static KSPIN_LOCK LdtLock
static KSPIN_LOCK GdtLock
VOID KeSetGdtSelector(ULONG Entry, ULONG Value1, ULONG Value2)
BOOLEAN PspIsDescriptorValid(PLDT_ENTRY ldt_entry)
NTSTATUS NTAPI NtSetLdtEntries(ULONG Selector1, LDT_ENTRY LdtEntry1, ULONG Selector2, LDT_ENTRY LdtEntry2)
NTSTATUS NTAPI Ke386GetGdtEntryThread(IN PKTHREAD Thread, IN ULONG Offset, IN PKGDTENTRY Descriptor)
VOID KeSetBaseGdtSelector(ULONG Entry, PVOID Base)
#define memcpy(s1, s2, n)
_In_ ULONG _In_ ULONG Offset
#define STATUS_INVALID_LDT_DESCRIPTOR
#define STATUS_ACCESS_VIOLATION
PVOID MmHighestUserAddress
base of all file and directory entries
union _LDT_ENTRY::@356 HighWord
struct _LDT_ENTRY::@356::@358 Bits
struct _LDT_ENTRY::@356::@357 Bytes
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
#define PsGetCurrentProcess