Author: janderwald
Date: Sat Apr 25 16:05:08 2009
New Revision: 40694

URL: http://svn.reactos.org/svn/reactos?rev=40694&view=rev
Log:
- Fix allocation of CM_RESOURCE_LIST
- Might fix bug 4354
See issue #4354 for more details.

Modified:
    trunk/reactos/drivers/video/videoprt/dispatch.c

Modified: trunk/reactos/drivers/video/videoprt/dispatch.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/dispatch.c?rev=40694&r1=40693&r2=40694&view=diff
==============================================================================
--- trunk/reactos/drivers/video/videoprt/dispatch.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/video/videoprt/dispatch.c [iso-8859-1] Sat Apr 25 
16:05:08 2009
@@ -340,9 +340,11 @@
 
       /* Save the resource list */
       ResourceCount = AllocatedResources->List[0].PartialResourceList.Count;
-      ResourceListSize =
-         FIELD_OFFSET(CM_RESOURCE_LIST, List[0].PartialResourceList.
-                      PartialDescriptors[ResourceCount]);
+      ResourceListSize = sizeof(CM_RESOURCE_LIST);
+
+      if (ResourceCount > 1)
+         ResourceListSize += (ResourceCount-1) * 
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
+
       DeviceExtension->AllocatedResources = ExAllocatePool(PagedPool, 
ResourceListSize);
       if (DeviceExtension->AllocatedResources == NULL)
       {

Reply via email to