[ros-diffs] [janderwald] 41285: - 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
janderwald at svn.reactos.org
janderwald at svn.reactos.org
Thu Jun 4 16:16:59 CEST 2009
Author: janderwald
Date: Thu Jun 4 18:16:57 2009
New Revision: 41285
URL: http://svn.reactos.org/svn/reactos?rev=41285&view=rev
Log:
- 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
Modified:
trunk/reactos/drivers/video/videoprt/dispatch.c
trunk/reactos/drivers/video/videoprt/resource.c
Modified: trunk/reactos/drivers/video/videoprt/dispatch.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/dispatch.c?rev=41285&r1=41284&r2=41285&view=diff
==============================================================================
--- trunk/reactos/drivers/video/videoprt/dispatch.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/video/videoprt/dispatch.c [iso-8859-1] Thu Jun 4 18:16:57 2009
@@ -340,11 +340,9 @@
/* Save the resource list */
ResourceCount = AllocatedResources->List[0].PartialResourceList.Count;
- ResourceListSize = sizeof(CM_RESOURCE_LIST);
-
- if (ResourceCount > 1)
- ResourceListSize += (ResourceCount-1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
-
+ ResourceListSize =
+ FIELD_OFFSET(CM_RESOURCE_LIST, List[0].PartialResourceList.
+ PartialDescriptors[ResourceCount]);
DeviceExtension->AllocatedResources = ExAllocatePool(PagedPool, ResourceListSize);
if (DeviceExtension->AllocatedResources == NULL)
{
@@ -360,6 +358,9 @@
FullList < AllocatedResources->List + AllocatedResources->Count;
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? */
ASSERT(FullList->InterfaceType == PCIBus &&
FullList->BusNumber == DeviceExtension->SystemIoBusNumber &&
Modified: trunk/reactos/drivers/video/videoprt/resource.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/resource.c?rev=41285&r1=41284&r2=41285&view=diff
==============================================================================
--- trunk/reactos/drivers/video/videoprt/resource.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/video/videoprt/resource.c [iso-8859-1] Thu Jun 4 18:16:57 2009
@@ -520,6 +520,9 @@
FullList < AllocatedResources->List + AllocatedResources->Count;
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 &&
FullList->BusNumber == DeviceExtension->SystemIoBusNumber &&
1 == FullList->PartialResourceList.Version &&
More information about the Ros-diffs
mailing list