00039 :
00040
00041 This routine returns
the contents of an entry in
the Gdt. If
the
00042 entry
is thread specific,
the entry
for the specified thread
is
00043 created and returned (KGDT_LDT, and KGDT_R3_TEB). If
the selector
00044
is processor dependent,
the entry
for the current processor
is
00045 returned (KGDT_R0_PCR).
00046
00047 Arguments:
00048
00049 Thread -- Supplies a pointer to
the thread to
return the entry
for.
00050
00051
Offset -- Supplies
the offset in
the Gdt. This value must be 0
00052 mod 8.
00053
00054 Descriptor -- Returns
the contents of
the Gdt descriptor
00055
00056 Return Value:
00057
00058 None.
00059
00060 --*/
00061
00062 {
00063
#if 0
00064
PKGDTENTRY Gdt;
00065
PKPROCESS Process;
00066
00067
00068
00069
00070
00071
if (
Offset >= GDT_TABLE_SIZE) {
00072
return ;
00073 }
00074
00075
if (
Offset == KGDT_LDT) {
00076
00077
00078
00079
00080
00081 Process = Thread->ApcState.Process;
00082
00083
00084
00085
00086
ASSERT (&(
PsGetCurrentProcess()->Pcb) == Process);
00087
00088 *Descriptor = Process->LdtDescriptor;
00089
00090 }
else {
00091
00092
00093
00094
00095
00096
00097
00098 PTEB Teb = (PTEB)(Thread->Teb);
00099
00100 *Descriptor = *((PKGDTENTRY)((PCHAR)(Teb->Gdt) +
Offset));
00101
00102
00103
00104
00105
00106
if (
Offset == KGDT_R3_TEB) {
00107 Descriptor->BaseLow = (
USHORT)((ULONG_PTR)(Thread->Teb) & 0xFFFF);
00108 Descriptor->HighWord.Bytes.BaseMid =
00109 (UCHAR) ( ( (ULONG_PTR)(Thread->Teb) & ((ULONG_PTR)0xFF0000
L)) >> 16);
00110 Descriptor->HighWord.Bytes.BaseHi =
00111 (
CHAR) ( ( (ULONG_PTR)(Thread->Teb) & ((ULONG_PTR)0xFF000000
L)) >> 24);
00112 }
00113 }
00114
00115
return ;
00116
#endif
00117
}
}