retreiving the Assigned resource

hi friends,

I would like to make sure whether am I right…??? I read somewhere that,the
resource would have been allocated not in order,for example,in case of
PCI,the resources address BAR0,BAR1,BAR2,BAR3…BAR5…the resource is not
allocated in this order…so when I use the following code,to get the
assigned base address BAR,then,how can we know for which BAR is the present
“MEMBASE” being assigned…??

How should the comparison of the “membase” to be implemented to make
sure,For example,the first iteration is for BAR 0,next for BAR 2,…so on…

This problem arises when I have more than one resource of the same type.

PIO_STACK_LOCATION stack;
PCM_PARTIAL_RESOURCE_DESCRIPTOR resTrans;
PCM_PARTIAL_RESOURCE_LIST partialResListTrans;

stack = IoGetCurrentIrpStackLocation(Irp);

partialResListTrans =
&stack->Parameters.StartDevice.AllocatedResourcesTranslated->List[0].Par
tialResourceList;

resTrans = &partialResListTrans->PartialDescriptors[0];

switch (resTrans->Type) {

case CmResourceTypeMemory:

membase= resTrans->u.Memory.Start.QuadPart;
pdx->memsize = resTrans->u.Memory.Length;

break;


}

THANX,

shiv


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> I would like to make sure whether am I right…??? I read somewhere that,the

resource would have been allocated not in order,for example,in case of
PCI,the resources address BAR0,BAR1,BAR2,BAR3…BAR5

At least in NT4, the order or resources in CM_RESOURCE_LIST is the same as the order of BAR’s in PCI config space.
As about the memory address values - they can be arbitrary.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com