Rules | Recent posts | topic RSS | Search | Register  | Log in

How to interrogate win2K PnP Manager

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing
Author Message
Pinczakko



Joined: 29 Jul 2004
Posts: 140
Helped: 13
Location: Taka Bonerate National Park, Indonesia


Post23 Dec 2004 3:00   How to interrogate win2K PnP Manager

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
Back to top
Pinczakko



Joined: 29 Jul 2004
Posts: 140
Helped: 13
Location: Taka Bonerate National Park, Indonesia


Post23 Dec 2004 13:42   Re: How to interrogate win2K PnP Manager

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

Quote:

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 http://www.codeproject.com/csharp/DivingSysProg3.asp
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing
Page 1 of 1 All times are GMT + 1 Hour


Abuse
Administrator
Moderators
topic RSS 
sitemap