From 55feb47d30230255009c4bc1dd57fd4e41ab9c8a Mon Sep 17 00:00:00 2001 From: jean Date: Fri, 1 Dec 2000 12:44:15 +0000 Subject: [PATCH] added test arg in NtFlushKey svn path=/trunk/; revision=1441 --- reactos/ntoskrnl/cm/registry.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/cm/registry.c b/reactos/ntoskrnl/cm/registry.c index 8a2d05732b7..551f67e6585 100644 --- a/reactos/ntoskrnl/cm/registry.c +++ b/reactos/ntoskrnl/cm/registry.c @@ -1,4 +1,4 @@ -/* $Id: registry.c,v 1.51 2000/11/27 14:54:28 jean Exp $ +/* $Id: registry.c,v 1.52 2000/12/01 12:44:15 jean Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -1051,12 +1051,17 @@ NtFlushKey ( int i; LARGE_INTEGER fileOffset; DWORD * pEntDword; + /* Verify that the handle is valid and is a registry key */ Status = ObReferenceObjectByHandle(KeyHandle, KEY_QUERY_VALUE, CmiKeyType, UserMode, (PVOID *)&KeyObject, NULL); + if (!NT_SUCCESS(Status)) + { + return Status; + } RegistryFile = KeyObject->RegistryFile; // KeAcquireSpinLock(&RegistryFile->RegLock, &OldIrql); /* then write changed blocks in .log */