mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
C89 compatibility
svn path=/trunk/; revision=5718
This commit is contained in:
parent
6f9d6a7c74
commit
cbbd90f4f1
2 changed files with 15 additions and 8 deletions
|
@ -43,6 +43,7 @@ static KSPIN_LOCK LdtLock;
|
||||||
|
|
||||||
BOOL PspIsDescriptorValid(PLDT_ENTRY ldt_entry)
|
BOOL PspIsDescriptorValid(PLDT_ENTRY ldt_entry)
|
||||||
{
|
{
|
||||||
|
ULONG Base, SegLimit;
|
||||||
/*
|
/*
|
||||||
Allow invalid descriptors.
|
Allow invalid descriptors.
|
||||||
*/
|
*/
|
||||||
|
@ -60,10 +61,10 @@ BOOL PspIsDescriptorValid(PLDT_ENTRY ldt_entry)
|
||||||
|
|
||||||
if(!ldt_entry->HighWord.Bits.Pres) return TRUE;
|
if(!ldt_entry->HighWord.Bits.Pres) return TRUE;
|
||||||
|
|
||||||
ULONG Base=ldt_entry->BaseLow | (ldt_entry->HighWord.Bytes.BaseMid << 16) |
|
Base=ldt_entry->BaseLow | (ldt_entry->HighWord.Bytes.BaseMid << 16) |
|
||||||
(ldt_entry->HighWord.Bytes.BaseHi << 24);
|
(ldt_entry->HighWord.Bytes.BaseHi << 24);
|
||||||
|
|
||||||
ULONG SegLimit=ldt_entry->LimitLow |
|
SegLimit=ldt_entry->LimitLow |
|
||||||
(ldt_entry->HighWord.Bits.LimitHi << 16);
|
(ldt_entry->HighWord.Bits.LimitHi << 16);
|
||||||
|
|
||||||
if(ldt_entry->HighWord.Bits.Type & 0x4)
|
if(ldt_entry->HighWord.Bits.Type & 0x4)
|
||||||
|
@ -87,6 +88,9 @@ NtSetLdtEntries (ULONG Selector1,
|
||||||
{
|
{
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
ULONG NewLdtSize = sizeof(LDT_ENTRY);
|
ULONG NewLdtSize = sizeof(LDT_ENTRY);
|
||||||
|
PUSHORT LdtDescriptor;
|
||||||
|
ULONG LdtBase;
|
||||||
|
ULONG LdtLimit;
|
||||||
|
|
||||||
if((Selector1 & ~0xffff) || (Selector2 & ~0xffff)) return STATUS_INVALID_LDT_DESCRIPTOR;
|
if((Selector1 & ~0xffff) || (Selector2 & ~0xffff)) return STATUS_INVALID_LDT_DESCRIPTOR;
|
||||||
|
|
||||||
|
@ -101,11 +105,11 @@ NtSetLdtEntries (ULONG Selector1,
|
||||||
|
|
||||||
KeAcquireSpinLock(&LdtLock, &oldIrql);
|
KeAcquireSpinLock(&LdtLock, &oldIrql);
|
||||||
|
|
||||||
PUSHORT LdtDescriptor = (PUSHORT) &KeGetCurrentProcess()->LdtDescriptor[0];
|
LdtDescriptor = (PUSHORT) &KeGetCurrentProcess()->LdtDescriptor[0];
|
||||||
ULONG LdtBase = LdtDescriptor[1] |
|
LdtBase = LdtDescriptor[1] |
|
||||||
((LdtDescriptor[2] & 0xff) << 16) |
|
((LdtDescriptor[2] & 0xff) << 16) |
|
||||||
((LdtDescriptor[3] & ~0xff) << 16);
|
((LdtDescriptor[3] & ~0xff) << 16);
|
||||||
ULONG LdtLimit = LdtDescriptor[0] |
|
LdtLimit = LdtDescriptor[0] |
|
||||||
((LdtDescriptor[3] & 0xf) << 16);
|
((LdtDescriptor[3] & 0xf) << 16);
|
||||||
|
|
||||||
if(LdtLimit < (NewLdtSize - 1))
|
if(LdtLimit < (NewLdtSize - 1))
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: page.c,v 1.57 2003/08/19 23:59:08 dwelch Exp $
|
/* $Id: page.c,v 1.58 2003/08/21 04:17:15 royce Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/mm/i386/page.c
|
* FILE: ntoskrnl/mm/i386/page.c
|
||||||
|
@ -122,10 +122,13 @@ ProtectToPTE(ULONG flProtect)
|
||||||
|
|
||||||
NTSTATUS Mmi386ReleaseMmInfo(PEPROCESS Process)
|
NTSTATUS Mmi386ReleaseMmInfo(PEPROCESS Process)
|
||||||
{
|
{
|
||||||
|
PUSHORT LdtDescriptor;
|
||||||
|
ULONG LdtBase;
|
||||||
|
|
||||||
DPRINT("Mmi386ReleaseMmInfo(Process %x)\n",Process);
|
DPRINT("Mmi386ReleaseMmInfo(Process %x)\n",Process);
|
||||||
|
|
||||||
PUSHORT LdtDescriptor = (PUSHORT) &Process->Pcb.LdtDescriptor[0];
|
LdtDescriptor = (PUSHORT) &Process->Pcb.LdtDescriptor[0];
|
||||||
ULONG LdtBase = LdtDescriptor[1] |
|
LdtBase = LdtDescriptor[1] |
|
||||||
((LdtDescriptor[2] & 0xff) << 16) |
|
((LdtDescriptor[2] & 0xff) << 16) |
|
||||||
((LdtDescriptor[3] & ~0xff) << 16);
|
((LdtDescriptor[3] & ~0xff) << 16);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue