[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,21 +347,22 @@ CreateComputerTypeList(
}
DPRINT("KeyValue: %S\n", KeyValue);
if (wcsstr(ComputerIdentifier, KeyValue))
{
INF_FreeData(KeyValue);
if (!INF_GetDataField(&Context, 0, &KeyName))
{
/* FIXME: Handle error! */
DPRINT("INF_GetDataField() failed\n");
return NULL;
}
DPRINT("Computer key: %S\n", KeyName);
wcscpy(ComputerKey, KeyName);
INF_FreeData(KeyName);
}
FoundId = !!wcsstr(ComputerIdentifier, KeyValue);
INF_FreeData(KeyValue);
if (!FoundId)
continue;
if (!INF_GetDataField(&Context, 0, &KeyName))
{
/* FIXME: Handle error! */
DPRINT("INF_GetDataField() failed\n");
return NULL;
}
DPRINT("Computer key: %S\n", KeyName);
wcscpy(ComputerKey, KeyName);
INF_FreeData(KeyName);
} while (SetupFindNextLine(&Context, &Context));
List = CreateGenericList();
@ -594,6 +597,8 @@ CreateDisplayDriverList(
do
{
BOOLEAN FoundId;
if (!INF_GetDataField(&Context, 1, &KeyValue))
{
/* FIXME: Handle error! */
@ -602,21 +607,22 @@ CreateDisplayDriverList(
}
DPRINT("KeyValue: %S\n", KeyValue);
if (wcsstr(DisplayIdentifier, KeyValue))
{
INF_FreeData(KeyValue);
if (!INF_GetDataField(&Context, 0, &KeyName))
{
/* FIXME: Handle error! */
DPRINT("INF_GetDataField() failed\n");
return NULL;
}
DPRINT("Display key: %S\n", KeyName);
wcscpy(DisplayKey, KeyName);
INF_FreeData(KeyName);
}
FoundId = !!wcsstr(DisplayIdentifier, KeyValue);
INF_FreeData(KeyValue);
if (!FoundId)
continue;
if (!INF_GetDataField(&Context, 0, &KeyName))
{
/* FIXME: Handle error! */
DPRINT("INF_GetDataField() failed\n");
return NULL;
}
DPRINT("Display key: %S\n", KeyName);
wcscpy(DisplayKey, KeyName);
INF_FreeData(KeyName);
} while (SetupFindNextLine(&Context, &Context));
List = CreateGenericList();