- Revert 40694 as FIELD_OFFSET is perfectly working code and the new one might not work on some compilers

- Add informal debug traces for bug 4354

svn path=/trunk/; revision=41285
This commit is contained in:
Johannes Anderwald 2009-06-04 14:16:57 +00:00
parent aed29dde4e
commit 42771ef723
2 changed files with 9 additions and 5 deletions

View file

@ -340,11 +340,9 @@ IntVideoPortPnPStartDevice(
/* Save the resource list */ /* Save the resource list */
ResourceCount = AllocatedResources->List[0].PartialResourceList.Count; ResourceCount = AllocatedResources->List[0].PartialResourceList.Count;
ResourceListSize = sizeof(CM_RESOURCE_LIST); ResourceListSize =
FIELD_OFFSET(CM_RESOURCE_LIST, List[0].PartialResourceList.
if (ResourceCount > 1) PartialDescriptors[ResourceCount]);
ResourceListSize += (ResourceCount-1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
DeviceExtension->AllocatedResources = ExAllocatePool(PagedPool, ResourceListSize); DeviceExtension->AllocatedResources = ExAllocatePool(PagedPool, ResourceListSize);
if (DeviceExtension->AllocatedResources == NULL) if (DeviceExtension->AllocatedResources == NULL)
{ {
@ -360,6 +358,9 @@ IntVideoPortPnPStartDevice(
FullList < AllocatedResources->List + AllocatedResources->Count; FullList < AllocatedResources->List + AllocatedResources->Count;
FullList++) FullList++)
{ {
INFO_(VIDEOPRT, "InterfaceType %u BusNumber List %u Device BusNumber %u Version %u Revision %u\n",
FullList->InterfaceType, FullList->BusNumber, DeviceExtension->SystemIoBusNumber, FullList->PartialResourceList.Version, FullList->PartialResourceList.Revision);
/* FIXME: Is this ASSERT ok for resources from the PNP manager? */ /* FIXME: Is this ASSERT ok for resources from the PNP manager? */
ASSERT(FullList->InterfaceType == PCIBus && ASSERT(FullList->InterfaceType == PCIBus &&
FullList->BusNumber == DeviceExtension->SystemIoBusNumber && FullList->BusNumber == DeviceExtension->SystemIoBusNumber &&

View file

@ -520,6 +520,9 @@ VideoPortGetAccessRanges(
FullList < AllocatedResources->List + AllocatedResources->Count; FullList < AllocatedResources->List + AllocatedResources->Count;
FullList++) FullList++)
{ {
INFO_(VIDEOPRT, "InterfaceType %u BusNumber List %u Device BusNumber %u Version %u Revision %u\n",
FullList->InterfaceType, FullList->BusNumber, DeviceExtension->SystemIoBusNumber, FullList->PartialResourceList.Version, FullList->PartialResourceList.Revision);
ASSERT(FullList->InterfaceType == PCIBus && ASSERT(FullList->InterfaceType == PCIBus &&
FullList->BusNumber == DeviceExtension->SystemIoBusNumber && FullList->BusNumber == DeviceExtension->SystemIoBusNumber &&
1 == FullList->PartialResourceList.Version && 1 == FullList->PartialResourceList.Version &&