From 7f94d6e5bf1d1f80052cf42a21ba5f28bbecab59 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Tue, 13 Sep 2005 18:08:18 +0000 Subject: [PATCH] - Freed the path string for the keyboard dll. - Freed some strings in all cases. svn path=/trunk/; revision=17835 --- reactos/subsys/win32k/ntuser/keyboard.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/reactos/subsys/win32k/ntuser/keyboard.c b/reactos/subsys/win32k/ntuser/keyboard.c index 5ff0cdcb5aa..431a49cd128 100644 --- a/reactos/subsys/win32k/ntuser/keyboard.c +++ b/reactos/subsys/win32k/ntuser/keyboard.c @@ -616,7 +616,8 @@ void InitKbdLayout( PVOID *pkKeyboardLayout ) RtlInitUnicodeString(&LayoutValueName,L"Layout File"); Status = ReadRegistryValue(&LayoutKeyName,&LayoutValueName,&LayoutFile); - RtlInitUnicodeString(&FullLayoutPath,SYSTEMROOT_DIR); + + RtlFreeUnicodeString(&LayoutKeyName); if( !NT_SUCCESS(Status) ) { @@ -627,8 +628,8 @@ void InitKbdLayout( PVOID *pkKeyboardLayout ) { DPRINT("Read registry and got %wZ\n", &LayoutFile); - RtlFreeUnicodeString(&LayoutKeyName); + RtlInitUnicodeString(&FullLayoutPath,SYSTEMROOT_DIR); AppendUnicodeString(&FullLayoutPath,&LayoutFile,FALSE); DPRINT("Loading Keyboard DLL %wZ\n", &FullLayoutPath); @@ -647,7 +648,7 @@ void InitKbdLayout( PVOID *pkKeyboardLayout ) return; } memcpy(KeyboardLayoutWSTR,FullLayoutPath.Buffer, - FullLayoutPath.Length + sizeof(WCHAR)); + FullLayoutPath.Length); KeyboardLayoutWSTR[FullLayoutPath.Length / sizeof(WCHAR)] = 0; kbModule = EngLoadImage(KeyboardLayoutWSTR); @@ -656,6 +657,7 @@ void InitKbdLayout( PVOID *pkKeyboardLayout ) if( !kbModule ) DPRINT1( "Load Keyboard Layout: No %wZ\n", &FullLayoutPath ); + ExFreePool(KeyboardLayoutWSTR); RtlFreeUnicodeString(&FullLayoutPath); } } @@ -694,7 +696,7 @@ void InitKbdLayout( PVOID *pkKeyboardLayout ) #undef XX_STATUS } -PKBDTABLES W32kGetDefaultKeyLayout() +PKBDTABLES W32kGetDefaultKeyLayout(VOID) { PKBDTABLES pkKeyboardLayout = 0; InitKbdLayout( (PVOID) &pkKeyboardLayout );