Fix a bug.

svn path=/trunk/; revision=25760
This commit is contained in:
Saveliy Tretiakov 2007-02-10 08:09:04 +00:00
parent 011bca506e
commit 0675bc2424

View file

@ -158,34 +158,35 @@ static BOOL UserLoadKbdDll(WCHAR *wsKLID,
*phModule = EngLoadImage(FullLayoutPath.Buffer); *phModule = EngLoadImage(FullLayoutPath.Buffer);
if(!*phModule) if(*phModule)
{ {
DPRINT1( "Failed to load %wZ\n", &FullLayoutPath ); DPRINT("Loaded %wZ\n", &FullLayoutPath);
}
else RtlInitAnsiString( &kbdProcedureName, "KbdLayerDescriptor" );
{ LdrGetProcedureAddress((PVOID)*phModule,
DPRINT( "Loaded Keyboard Layout: %wZ\n", &FullLayoutPath ); &kbdProcedureName,
} 0,
(PVOID*)&layerDescGetFn);
RtlInitAnsiString( &kbdProcedureName, "KbdLayerDescriptor" ); if(layerDescGetFn)
LdrGetProcedureAddress((PVOID)*phModule, {
&kbdProcedureName, *pKbdTables = layerDescGetFn();
0, }
(PVOID*)&layerDescGetFn); else
{
DPRINT1("Error: %wZ has no KbdLayerDescriptor()\n", &FullLayoutPath);
}
if(layerDescGetFn) if(!layerDescGetFn || !*pKbdTables)
{ {
*pKbdTables = layerDescGetFn(); DPRINT1("Failed to load the keyboard layout.\n");
EngUnloadImage(*phModule);
return FALSE;
}
} }
else else
{ {
DPRINT1("Error: %wZ has no KbdLayerDescriptor()\n", &FullLayoutPath); DPRINT1("Failed to load dll %wZ\n", &FullLayoutPath);
}
if(!layerDescGetFn || !*pKbdTables)
{
DPRINT1("Failed to load the keyboard layout.\n");
EngUnloadImage(*phModule);
return FALSE; return FALSE;
} }