- [FORMATTING] Code style and comment cleanup. No code change.

svn path=/trunk/; revision=35608
This commit is contained in:
Stefan Ginsberg 2008-08-24 18:47:14 +00:00
parent 0eaca617d3
commit 3250ec8a01

View file

@ -350,39 +350,44 @@ IoCreateDriverList(VOID)
NTSTATUS INIT_FUNCTION NTSTATUS INIT_FUNCTION
IoDestroyDriverList(VOID) IoDestroyDriverList(VOID)
{ {
PSERVICE_GROUP CurrentGroup, tmp1; PSERVICE_GROUP CurrentGroup, tmp1;
PSERVICE CurrentService, tmp2; PSERVICE CurrentService, tmp2;
DPRINT("IoDestroyDriverList() called\n"); DPRINT("IoDestroyDriverList() called\n");
/* Destroy group list */ /* Destroy the Group List */
LIST_FOR_EACH_SAFE(CurrentGroup, tmp1, &GroupListHead, SERVICE_GROUP, GroupListEntry) LIST_FOR_EACH_SAFE(CurrentGroup, tmp1, &GroupListHead, SERVICE_GROUP, GroupListEntry)
{ {
ExFreePool(CurrentGroup->GroupName.Buffer); /* Remove it from the list */
RemoveEntryList(&CurrentGroup->GroupListEntry); RemoveEntryList(&CurrentGroup->GroupListEntry);
if (CurrentGroup->TagArray)
{ /* Free buffers */
ExFreePool(CurrentGroup->TagArray); ExFreePool(CurrentGroup->GroupName.Buffer);
} if (CurrentGroup->TagArray)
ExFreePool(CurrentGroup); ExFreePool(CurrentGroup->TagArray);
ExFreePool(CurrentGroup);
} }
/* Destroy service list */ /* Destroy the Service List */
LIST_FOR_EACH_SAFE(CurrentService, tmp2, &ServiceListHead, SERVICE, ServiceListEntry) LIST_FOR_EACH_SAFE(CurrentService, tmp2, &ServiceListHead, SERVICE, ServiceListEntry)
{ {
ExFreePool(CurrentService->ServiceName.Buffer); /* Remove it from the list */
ExFreePool(CurrentService->RegistryPath.Buffer); RemoveEntryList(&CurrentService->ServiceListEntry);
if (CurrentService->ServiceGroup.Buffer)
ExFreePool(CurrentService->ServiceGroup.Buffer); /* Free buffers */
if (CurrentService->ImagePath.Buffer) ExFreePool(CurrentService->ServiceName.Buffer);
ExFreePool(CurrentService->ImagePath.Buffer); ExFreePool(CurrentService->RegistryPath.Buffer);
RemoveEntryList(&CurrentService->ServiceListEntry); if (CurrentService->ServiceGroup.Buffer)
ExFreePool(CurrentService); ExFreePool(CurrentService->ServiceGroup.Buffer);
if (CurrentService->ImagePath.Buffer)
ExFreePool(CurrentService->ImagePath.Buffer);
ExFreePool(CurrentService);
} }
DPRINT("IoDestroyDriverList() done\n"); DPRINT("IoDestroyDriverList() done\n");
return(STATUS_SUCCESS); /* Return success */
return STATUS_SUCCESS;
} }
static INIT_FUNCTION NTSTATUS static INIT_FUNCTION NTSTATUS
@ -435,8 +440,8 @@ IopLoadDriver(PSERVICE Service)
* Return Value * Return Value
* None * None
*/ */
VOID
VOID FASTCALL FASTCALL
IopInitializeSystemDrivers(VOID) IopInitializeSystemDrivers(VOID)
{ {
PSERVICE_GROUP CurrentGroup; PSERVICE_GROUP CurrentGroup;
@ -446,50 +451,55 @@ IopInitializeSystemDrivers(VOID)
DPRINT("IopInitializeSystemDrivers()\n"); DPRINT("IopInitializeSystemDrivers()\n");
LIST_FOR_EACH(CurrentGroup, &GroupListHead, SERVICE_GROUP, GroupListEntry) /* Loop the list */
{ LIST_FOR_EACH(CurrentGroup, &GroupListHead, SERVICE_GROUP, GroupListEntry)
DPRINT("Group: %wZ\n", &CurrentGroup->GroupName); {
/* Load all drivers with a valid tag */ DPRINT("Group: %wZ\n", &CurrentGroup->GroupName);
for (i = 0; i < CurrentGroup->TagCount; i++)
{
LIST_FOR_EACH(CurrentService, &ServiceListHead, SERVICE, ServiceListEntry)
{
if ((RtlCompareUnicodeString(&CurrentGroup->GroupName,
&CurrentService->ServiceGroup, TRUE) == 0) &&
(CurrentService->Start == 1 /*SERVICE_SYSTEM_START*/) &&
(CurrentService->Tag == CurrentGroup->TagArray[i]))
{
DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath);
Status = IopLoadDriver(CurrentService);
}
}
}
/* Load all drivers without a tag or with an invalid tag */ /* Load all drivers with a valid tag */
LIST_FOR_EACH(CurrentService, &ServiceListHead, SERVICE, ServiceListEntry) for (i = 0; i < CurrentGroup->TagCount; i++)
{ {
if ((RtlCompareUnicodeString(&CurrentGroup->GroupName, /* Loop the list */
&CurrentService->ServiceGroup, TRUE) == 0) && LIST_FOR_EACH(CurrentService, &ServiceListHead, SERVICE, ServiceListEntry)
(CurrentService->Start == 1 /*SERVICE_SYSTEM_START*/)) {
{ if ((!RtlCompareUnicodeString(&CurrentGroup->GroupName,
for (i = 0; i < CurrentGroup->TagCount; i++) &CurrentService->ServiceGroup,
{ TRUE)) &&
if (CurrentGroup->TagArray[i] == CurrentService->Tag) (CurrentService->Start == SERVICE_SYSTEM_START) &&
{ (CurrentService->Tag == CurrentGroup->TagArray[i]))
break;
}
}
if (i >= CurrentGroup->TagCount)
{
DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath);
Status = IopLoadDriver(CurrentService);
}
}
}
} {
DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath);
Status = IopLoadDriver(CurrentService);
}
}
}
DPRINT("IopInitializeSystemDrivers() done\n"); /* Load all drivers without a tag or with an invalid tag */
LIST_FOR_EACH(CurrentService, &ServiceListHead, SERVICE, ServiceListEntry)
{
if ((!RtlCompareUnicodeString(&CurrentGroup->GroupName,
&CurrentService->ServiceGroup,
TRUE)) &&
(CurrentService->Start == SERVICE_SYSTEM_START))
{
for (i = 0; i < CurrentGroup->TagCount; i++)
{
if (CurrentGroup->TagArray[i] == CurrentService->Tag)
{
break;
}
}
if (i >= CurrentGroup->TagCount)
{
DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath);
Status = IopLoadDriver(CurrentService);
}
}
}
}
DPRINT("IopInitializeSystemDrivers() done\n");
} }
/* EOF */