[ros-dev] [ros-diffs] [janderwald] 40694: - Fix allocation of CM_RESOURCE_LIST - Might fix bug 4354 See issue #4354 for more details.

Timo Kreuzer timo.kreuzer at web.de
Sun Apr 26 00:10:10 CEST 2009


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?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-dev/attachments/20090426/ce5cde3c/attachment.html 


More information about the Ros-dev mailing list