Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to interrogate win2K PnP Manager

Status
Not open for further replies.

Pinczakko

Full Member level 2
Full Member level 2
Joined
Jul 29, 2004
Messages
136
Helped
13
Reputation
26
Reaction score
0
Trophy points
1,296
Location
Taka Bonerate National Park, Indonesia
Activity points
1,592
I'm currently building a user mode application that need to know the "resource map" (i.e. the I/O map and memory map) of windows 2K/XP. I need to know how to obtain the I/O space or memory space that is consumed by PCI devices. This is needed since we can not invoke the BAR (base address register) sizing algorithm from within windows, if we attempt to do so, the system will eventually or directly hang. I presume that this information is available from the PnP manager of win2K/XP, but how to do it

Thx in advance

Pinczakko
 

I found a nice article at codeproject.com that solve the problem. Perhaps, this info will be of some use for somebody. And to the moderators, I really sorry if this is considered as spamming. But in my opinion, it's not, since this info perhaps is of some use to low level/system programmer like me :wink:

So how to get information about resources.

* Get class Guid using device class name (SetupDiClassGuidsFromNameA function)
* Get device info set for device class (SetupDiGetClassDevsA function)
* Get device info data for every device (SetupDiGetClassDevsA function, second parameter for this function is sequential device index in the device class, so call this function in circle with device index = 0, 1, etc.).
* Get information about current configuration (CM_Get_First_Log_Conf function)
* Get resource descriptor from current configuration (CM_Get_Next_Res_Des function, do this and follow steps for every resource till they exist)
* Get information about size of resource data (CM_Get_Res_Des_Data_Size function)
* Get resource data (CM_Get_Res_Des_Data function)
* Marshal resource data in suitable structures (class Marshal, methods PtrToStructure; structure IntPtr, method ToInt32 and vice versa to IntPtr)

the complete article by Vladimir Afanasyev **broken link removed**
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top