[USETUP] Simplify code.

svn path=/branches/setup_improvements/; revision=75698
This commit is contained in:
Hermès Bélusca-Maïto 2017-08-28 13:51:25 +00:00
parent acd933faa0
commit 58e402e08e
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -337,6 +337,8 @@ CreateComputerTypeList(
do
{
BOOLEAN FoundId;
if (!INF_GetDataField(&Context, 1, &KeyValue))
{
/* FIXME: Handle error! */
@ -345,9 +347,12 @@ CreateComputerTypeList(
}
DPRINT("KeyValue: %S\n", KeyValue);
if (wcsstr(ComputerIdentifier, KeyValue))
{
FoundId = !!wcsstr(ComputerIdentifier, KeyValue);
INF_FreeData(KeyValue);
if (!FoundId)
continue;
if (!INF_GetDataField(&Context, 0, &KeyName))
{
/* FIXME: Handle error! */
@ -358,8 +363,6 @@ CreateComputerTypeList(
DPRINT("Computer key: %S\n", KeyName);
wcscpy(ComputerKey, KeyName);
INF_FreeData(KeyName);
}
INF_FreeData(KeyValue);
} while (SetupFindNextLine(&Context, &Context));
List = CreateGenericList();
@ -594,6 +597,8 @@ CreateDisplayDriverList(
do
{
BOOLEAN FoundId;
if (!INF_GetDataField(&Context, 1, &KeyValue))
{
/* FIXME: Handle error! */
@ -602,9 +607,12 @@ CreateDisplayDriverList(
}
DPRINT("KeyValue: %S\n", KeyValue);
if (wcsstr(DisplayIdentifier, KeyValue))
{
FoundId = !!wcsstr(DisplayIdentifier, KeyValue);
INF_FreeData(KeyValue);
if (!FoundId)
continue;
if (!INF_GetDataField(&Context, 0, &KeyName))
{
/* FIXME: Handle error! */
@ -615,8 +623,6 @@ CreateDisplayDriverList(
DPRINT("Display key: %S\n", KeyName);
wcscpy(DisplayKey, KeyName);
INF_FreeData(KeyName);
}
INF_FreeData(KeyValue);
} while (SetupFindNextLine(&Context, &Context));
List = CreateGenericList();