From 0675bc242425e8ce4890b1fc181a992271f3d146 Mon Sep 17 00:00:00 2001 From: Saveliy Tretiakov Date: Sat, 10 Feb 2007 08:09:04 +0000 Subject: [PATCH] Fix a bug. svn path=/trunk/; revision=25760 --- .../win32/win32k/ntuser/kbdlayout.c | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c b/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c index e2fba1aeda1..6d80087efda 100644 --- a/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c +++ b/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c @@ -158,34 +158,35 @@ static BOOL UserLoadKbdDll(WCHAR *wsKLID, *phModule = EngLoadImage(FullLayoutPath.Buffer); - if(!*phModule) + if(*phModule) { - DPRINT1( "Failed to load %wZ\n", &FullLayoutPath ); - } - else - { - DPRINT( "Loaded Keyboard Layout: %wZ\n", &FullLayoutPath ); - } + DPRINT("Loaded %wZ\n", &FullLayoutPath); + + RtlInitAnsiString( &kbdProcedureName, "KbdLayerDescriptor" ); + LdrGetProcedureAddress((PVOID)*phModule, + &kbdProcedureName, + 0, + (PVOID*)&layerDescGetFn); - RtlInitAnsiString( &kbdProcedureName, "KbdLayerDescriptor" ); - LdrGetProcedureAddress((PVOID)*phModule, - &kbdProcedureName, - 0, - (PVOID*)&layerDescGetFn); + if(layerDescGetFn) + { + *pKbdTables = layerDescGetFn(); + } + else + { + DPRINT1("Error: %wZ has no KbdLayerDescriptor()\n", &FullLayoutPath); + } - if(layerDescGetFn) - { - *pKbdTables = layerDescGetFn(); + if(!layerDescGetFn || !*pKbdTables) + { + DPRINT1("Failed to load the keyboard layout.\n"); + EngUnloadImage(*phModule); + return FALSE; + } } else { - DPRINT1("Error: %wZ has no KbdLayerDescriptor()\n", &FullLayoutPath); - } - - if(!layerDescGetFn || !*pKbdTables) - { - DPRINT1("Failed to load the keyboard layout.\n"); - EngUnloadImage(*phModule); + DPRINT1("Failed to load dll %wZ\n", &FullLayoutPath); return FALSE; }