Johannes Anderwald schrieb: > Timo Kreuzer wrote: > >> Isn't that actually the same? >> >> >> > Hi, > > IMO the old code only calculated the offset from PartialDescriptors > array to CM_RESOURCE_LIST. This works fine if there are no partial > descriptors. But it breaks if there are. > It was
FIELD_OFFSET(CM_RESOURCE_LIST, List[0].PartialResourceList.PartialDescriptors[ResourceCount]); So it should have calculated the offset of PartialDescriptors[ResourceCount] which is one after the last one that belongs to the list or (ResourceCount-1) entries after the end of CM_RESOURCE_LIST. > >> It also ignores the number of full descriptors, which I guess is wrong. >> And it looks like the whole parsing code is broken. It ignores the >> number of partial descriptors and does FullList++ >> >> > The MSDN states the number of CM_FULL_RESOURCE_DESCRIPTOR in > CM_RESOURCE_LIST is always 1 for WDM drivers. > The partial descriptors are handeled in the 2nd for loop. > Ah, ok, but in this case the outer loop makes no sense and is only confusing. Maybe an ASSERT(..Count == 1) should be put instead?
_______________________________________________ Ros-dev mailing list [email protected] http://www.reactos.org/mailman/listinfo/ros-dev
