From a6d944ecfcb3b17662b9572c0d2e57272c2a62bd Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Wed, 27 Apr 2005 21:55:02 +0000 Subject: [PATCH] Close only the Nls directory handle if the directory was created. svn path=/trunk/; revision=14835 --- reactos/lib/kernel32/misc/nls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reactos/lib/kernel32/misc/nls.c b/reactos/lib/kernel32/misc/nls.c index 8ecee401051..51bda6d1af8 100755 --- a/reactos/lib/kernel32/misc/nls.c +++ b/reactos/lib/kernel32/misc/nls.c @@ -93,8 +93,10 @@ NlsInit() InitializeObjectAttributes(&ObjectAttributes, &DirName, OBJ_CASE_INSENSITIVE | OBJ_PERMANENT, NULL, NULL); - NtCreateDirectoryObject(&Handle, DIRECTORY_ALL_ACCESS, &ObjectAttributes); - NtClose(Handle); + if (NT_SUCCESS(NtCreateDirectoryObject(&Handle, DIRECTORY_ALL_ACCESS, &ObjectAttributes))) + { + NtClose(Handle); + } /* Setup ANSI code page. */ AnsiCodePage.CodePage = CP_ACP;