From 591d95523038f73293afc8ea0aeed3c0e6430260 Mon Sep 17 00:00:00 2001 From: David Welch Date: Tue, 20 Mar 2001 16:09:44 +0000 Subject: [PATCH] Bug fixes svn path=/trunk/; revision=1721 --- reactos/Makefile | 2 +- reactos/install.sh | 1 + reactos/ntoskrnl/include/internal/ob.h | 7 ++++++ reactos/ntoskrnl/ke/catch.c | 4 +-- reactos/ntoskrnl/mm/freelist.c | 2 +- reactos/ntoskrnl/ob/handle.c | 35 +++++++++++++++++++++++++- reactos/subsys/csrss/api/process.c | 6 ++--- 7 files changed, 49 insertions(+), 8 deletions(-) diff --git a/reactos/Makefile b/reactos/Makefile index d3e3daf42bf..8d562cf692f 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -56,7 +56,7 @@ NET_DEVICE_DRIVERS = ne2000 SYS_APPS = shell winlogon services APPS = args hello test cat bench apc shm lpc thread event file gditest \ - pteb consume dump_shared_data vmtest regtest + pteb consume dump_shared_data vmtest regtest alive # objdir diff --git a/reactos/install.sh b/reactos/install.sh index c368aacda75..ffb30d9a65a 100644 --- a/reactos/install.sh +++ b/reactos/install.sh @@ -19,6 +19,7 @@ cp lib/crtdll/crtdll.dll $1/reactos/system32 cp lib/fmifs/fmifs.dll $1/reactos/system32 cp lib/gdi32/gdi32.dll $1/reactos/system32 cp lib/advapi32/advapi32.dll $1/reactos/system32 +cp lib/user32/user32.dll $1/reactos/system32/ cp apps/hello/hello.exe $1/reactos/bin cp apps/args/args.exe $1/reactos/bin cp apps/bench/bench-thread.exe $1/reactos/bin diff --git a/reactos/ntoskrnl/include/internal/ob.h b/reactos/ntoskrnl/include/internal/ob.h index 27a4686a0c3..d1f24bbc0f6 100644 --- a/reactos/ntoskrnl/include/internal/ob.h +++ b/reactos/ntoskrnl/include/internal/ob.h @@ -106,5 +106,12 @@ VOID ObCloseAllHandles(struct _EPROCESS* Process); VOID ObDeleteHandleTable(struct _EPROCESS* Process); PVOID ObDeleteHandle(struct _EPROCESS* Process, HANDLE Handle); +NTSTATUS STDCALL +ObInsertObject(PVOID Object, + PACCESS_STATE PassedAccessState, + ACCESS_MASK DesiredAccess, + ULONG AdditionalReferences, + PVOID* ReferencedObject, + PHANDLE Handle); #endif /* __INCLUDE_INTERNAL_OBJMGR_H */ diff --git a/reactos/ntoskrnl/ke/catch.c b/reactos/ntoskrnl/ke/catch.c index 0adfe991692..342530c5253 100644 --- a/reactos/ntoskrnl/ke/catch.c +++ b/reactos/ntoskrnl/ke/catch.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: catch.c,v 1.13 2001/03/18 19:35:12 dwelch Exp $ +/* $Id: catch.c,v 1.14 2001/03/20 16:09:44 dwelch Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/catch.c @@ -46,7 +46,7 @@ KiDispatchException(PEXCEPTION_RECORD Er, /* PCR->KeExceptionDispatchCount++; */ - if (Context != NULL) + if (Context == NULL) { TContext.ContextFlags = CONTEXT_FULL; if (PreviousMode == UserMode) diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c index c4955ade0e2..0b8d93606ee 100644 --- a/reactos/ntoskrnl/mm/freelist.c +++ b/reactos/ntoskrnl/mm/freelist.c @@ -556,7 +556,7 @@ MmAllocPage(SWAPENTRY SavedSwapEntry) KeAcquireSpinLock(&PageListLock, &oldIrql); if (IsListEmpty(&FreePageListHead)) { - DPRINT("MmAllocPage(): Out of memory\n"); + DPRINT1("MmAllocPage(): Out of memory\n"); KeReleaseSpinLock(&PageListLock, oldIrql); return(NULL); } diff --git a/reactos/ntoskrnl/ob/handle.c b/reactos/ntoskrnl/ob/handle.c index 841bea5b40e..9656676dd03 100644 --- a/reactos/ntoskrnl/ob/handle.c +++ b/reactos/ntoskrnl/ob/handle.c @@ -1,4 +1,22 @@ -/* $Id: handle.c,v 1.29 2001/03/07 16:48:45 dwelch Exp $ +/* + * ReactOS kernel + * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: handle.c,v 1.30 2001/03/20 16:09:44 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -613,5 +631,20 @@ NTSTATUS STDCALL NtClose(HANDLE Handle) return(STATUS_SUCCESS); } +NTSTATUS STDCALL +ObInsertObject(PVOID Object, + PACCESS_STATE PassedAccessState, + ACCESS_MASK DesiredAccess, + ULONG AdditionalReferences, + PVOID* ReferencedObject, + PHANDLE Handle) +{ + return(ObCreateHandle(PsGetCurrentProcess(), + Object, + DesiredAccess, + FALSE, + Handle)); +} + /* EOF */ diff --git a/reactos/subsys/csrss/api/process.c b/reactos/subsys/csrss/api/process.c index 408233739f3..79e5f0cd7e6 100644 --- a/reactos/subsys/csrss/api/process.c +++ b/reactos/subsys/csrss/api/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.11 2001/01/21 00:11:54 phreak Exp $ +/* $Id: process.c,v 1.12 2001/03/20 16:09:44 dwelch Exp $ * * reactos/subsys/csrss/api/process.c * @@ -68,11 +68,11 @@ PCSRSS_PROCESS_DATA CsrGetProcessData(ULONG ProcessId) } } // DbgPrint("CSR: CsrGetProcessData() failed\n"); - RtlLeaveCriticalSection( &ProcessDataLock ); + RtlLeaveCriticalSection(&ProcessDataLock); return(NULL); } -NTSTATUS CsrFreeProcessData( ULONG Pid ) +NTSTATUS CsrFreeProcessData(ULONG Pid) { int i; RtlEnterCriticalSection( &ProcessDataLock );