Author: cgutman
Date: Sat May 29 01:17:59 2010
New Revision: 47390
URL:
http://svn.reactos.org/svn/reactos?rev=47390&view=rev
Log:
[NTOSKRNL]
- Use PnpDetermineResourceListSize to determine the resource list size and remove the
broken IopCalculateResourceListSize function
Modified:
trunk/reactos/ntoskrnl/include/internal/io.h
trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c
Modified: trunk/reactos/ntoskrnl/include/internal/io.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] Sat May 29 01:17:59 2010
@@ -496,9 +496,7 @@
//
ULONG
NTAPI
-IopCalculateResourceListSize(
- IN PCM_RESOURCE_LIST ResourceList
-);
+PnpDetermineResourceListSize(IN PCM_RESOURCE_LIST ResourceList);
NTSTATUS
NTAPI
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Sat May 29 01:17:59 2010
@@ -948,7 +948,7 @@
0,
REG_RESOURCE_LIST,
DeviceNode->BootResources,
-
IopCalculateResourceListSize(DeviceNode->BootResources));
+
PnpDetermineResourceListSize(DeviceNode->BootResources));
}
}
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c [iso-8859-1] Sat May 29 01:17:59 2010
@@ -17,30 +17,6 @@
IN PCM_RESOURCE_LIST ResourceList,
IN BOOLEAN Silent,
OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor);
-
-ULONG
-NTAPI
-IopCalculateResourceListSize(
- IN PCM_RESOURCE_LIST ResourceList)
-{
- ULONG Size, i, j;
- PCM_PARTIAL_RESOURCE_LIST pPartialResourceList;
-
- Size = FIELD_OFFSET(CM_RESOURCE_LIST, List);
- for (i = 0; i < ResourceList->Count; i++)
- {
- pPartialResourceList = &ResourceList->List[i].PartialResourceList;
- Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR,
PartialResourceList.PartialDescriptors) +
- pPartialResourceList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
- for (j = 0; j < pPartialResourceList->Count; j++)
- {
- if (pPartialResourceList->PartialDescriptors[j].Type ==
CmResourceTypeDeviceSpecific)
- Size +=
pPartialResourceList->PartialDescriptors[j].u.DeviceSpecificData.DataSize;
- }
- }
-
- return Size;
-}
static
BOOLEAN
@@ -533,7 +509,7 @@
0,
REG_RESOURCE_LIST,
DeviceNode->ResourceList,
- IopCalculateResourceListSize(DeviceNode->ResourceList));
+ PnpDetermineResourceListSize(DeviceNode->ResourceList));
ZwClose(ControlKey);
if (!NT_SUCCESS(Status))
@@ -674,7 +650,7 @@
0,
REG_RESOURCE_LIST,
DeviceNode->ResourceList,
- IopCalculateResourceListSize(DeviceNode->ResourceList));
+ PnpDetermineResourceListSize(DeviceNode->ResourceList));
if (!NT_SUCCESS(Status))
{
ZwClose(PnpMgrLevel2);
@@ -692,7 +668,7 @@
0,
REG_RESOURCE_LIST,
DeviceNode->ResourceListTranslated,
-
IopCalculateResourceListSize(DeviceNode->ResourceListTranslated));
+
PnpDetermineResourceListSize(DeviceNode->ResourceListTranslated));
ZwClose(PnpMgrLevel2);
ASSERT(DeviceName);
ExFreePool(DeviceName);
@@ -732,7 +708,7 @@
/* That's easy to translate a resource list. Just copy the
* untranslated one and change few fields in the copy
*/
- ListSize = IopCalculateResourceListSize(DeviceNode->ResourceList);
+ ListSize = PnpDetermineResourceListSize(DeviceNode->ResourceList);
DeviceNode->ResourceListTranslated = ExAllocatePool(PagedPool, ListSize);
if (!DeviceNode->ResourceListTranslated)
@@ -852,7 +828,7 @@
if (DeviceNode->BootResources)
{
- ListSize = IopCalculateResourceListSize(DeviceNode->BootResources);
+ ListSize = PnpDetermineResourceListSize(DeviceNode->BootResources);
DeviceNode->ResourceList = ExAllocatePool(PagedPool, ListSize);
if (!DeviceNode->ResourceList)