RtlInitUnicodeString(&LayoutValueName,L"Layout File");
Status = ReadRegistryValue(&LayoutKeyName,&LayoutValueName,&LayoutFile);
- RtlInitUnicodeString(&FullLayoutPath,SYSTEMROOT_DIR);
+
+ RtlFreeUnicodeString(&LayoutKeyName);
if( !NT_SUCCESS(Status) )
{
{
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);
return;
}
memcpy(KeyboardLayoutWSTR,FullLayoutPath.Buffer,
- FullLayoutPath.Length + sizeof(WCHAR));
+ FullLayoutPath.Length);
KeyboardLayoutWSTR[FullLayoutPath.Length / sizeof(WCHAR)] = 0;
kbModule = EngLoadImage(KeyboardLayoutWSTR);
if( !kbModule )
DPRINT1( "Load Keyboard Layout: No %wZ\n", &FullLayoutPath );
+ ExFreePool(KeyboardLayoutWSTR);
RtlFreeUnicodeString(&FullLayoutPath);
}
}
#undef XX_STATUS
}
-PKBDTABLES W32kGetDefaultKeyLayout()
+PKBDTABLES W32kGetDefaultKeyLayout(VOID)
{
PKBDTABLES pkKeyboardLayout = 0;
InitKbdLayout( (PVOID) &pkKeyboardLayout );