}
-PGENERIC_LIST
-CreateComputerTypeList(
- IN HINF InfFile)
+BOOLEAN
+AddComputerTypeEntries(
+ _In_ HINF InfFile,
+ PGENERIC_LIST List,
+ _In_ PWSTR SectionName)
{
- PGENERIC_LIST List;
INFCONTEXT Context;
PCWSTR KeyName;
PCWSTR KeyValue;
WCHAR ComputerIdentifier[128];
WCHAR ComputerKey[32];
+ ULONG Count1, Count2;
/* Get the computer identification */
if (!GetComputerIdentifier(ComputerIdentifier, 128))
DPRINT("Computer identifier: '%S'\n", ComputerIdentifier);
/* Search for matching device identifier */
- if (!SpInfFindFirstLine(InfFile, L"Map.Computer", NULL, &Context))
+ if (!SpInfFindFirstLine(InfFile, SectionName, NULL, &Context))
{
/* FIXME: error message */
- return NULL;
+ return FALSE;
}
do
{
/* FIXME: Handle error! */
DPRINT("INF_GetDataField() failed\n");
- return NULL;
+ return FALSE;
}
DPRINT("KeyValue: %S\n", KeyValue);
{
/* FIXME: Handle error! */
DPRINT("INF_GetDataField() failed\n");
- return NULL;
+ return FALSE;
}
DPRINT("Computer key: %S\n", KeyName);
INF_FreeData(KeyName);
} while (SpInfFindNextLine(&Context, &Context));
+ Count1 = AddEntriesFromInfSection(List,
+ InfFile,
+ L"Computer",
+ &Context,
+ DefaultProcessEntry,
+ ComputerKey);
+ Count2 = AddEntriesFromInfSection(List,
+ InfFile,
+ L"Computer.NT" INF_ARCH,
+ &Context,
+ DefaultProcessEntry,
+ ComputerKey);
+ if ((Count1 == -1) && (Count2 == -1))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+PGENERIC_LIST
+CreateComputerTypeList(
+ IN HINF InfFile)
+{
+ PGENERIC_LIST List;
+ BOOLEAN Success;
+
List = CreateGenericList();
if (List == NULL)
return NULL;
- if (AddEntriesFromInfSection(List,
- InfFile,
- L"Computer",
- &Context,
- DefaultProcessEntry,
- ComputerKey) == -1)
+ Success = AddComputerTypeEntries(InfFile, List, L"Map.Computer");
+ Success |= AddComputerTypeEntries(InfFile, List, L"Map.Computer.NT" INF_ARCH);
+ if (!Success)
{
DestroyGenericList(List, TRUE);
return NULL;