Hi

Can't we use _inp( ) and _outp( ) in Windows XP, should we use
WRITE_REGISTER_UCHAR and READ_REGISTER_UCHAR and WRITE_PORT_UCHAR and
READ_PORT_UCHAR in kernel mode ?

How can I see the port of a device from Windows Device Manager ? I can see
IO range of some devices, what's the deffirence between IO range and IO port ?
Should I get IO port and register info by some function or IO control , or
all of them should read from documents ?

Thank for your teaching .

Re: _inp( ) and _outp( ) question .. by Maxim

Maxim
Fri Jul 04 03:35:42 CDT 2008

> Can't we use _inp( ) and _outp( ) in Windows XP, should we use
> WRITE_REGISTER_UCHAR and READ_REGISTER_UCHAR and
>WRITE_PORT_UCHAR and
> READ_PORT_UCHAR in kernel mode ?

Yes.

> How can I see the port of a device from Windows Device Manager ? I can see
> IO range of some devices, what's the deffirence between IO range and IO port
?

They are the same.

> Should I get IO port and register info by some function or IO control

You get them from PnP MN_START_DEVICE IRP.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


RE: _inp( ) and _outp( ) question .. by GottfriedStckl

GottfriedStckl
Wed Jul 23 06:13:00 CDT 2008

"Kid" wrote:

> Can't we use _inp( ) and _outp( ) in Windows XP, should we use
> WRITE_REGISTER_UCHAR and READ_REGISTER_UCHAR and WRITE_PORT_UCHAR and
> READ_PORT_UCHAR in kernel mode ?
Indeed. These are the correct macros. You may also use the USHORT or ULONG
pendants, if your registers are larger than 8 Bits in width.

> How can I see the port of a device from Windows Device Manager ? I can see
> IO range of some devices, what's the deffirence between IO range and IO port ?
They are basically the same. The difference is that IO port is really one
port with 8,16,32 Bit width. There may be "holes" between each IO Port
addresses.
IORange may be larger but is contigous.

> Should I get IO port and register info by some function or IO control , or
> all of them should read from documents ?
You must use the resources that the IO Manager reserves for you.
The information is transmitted to your driver via MN_START_DEVICE IRP ioctl
call.
use the
PCM_RESOURCE_LIST pResListTranslated = irp->TranslatedResources;
These resourselist is a list that contains each addresses for each port you
have assigned (better said, the plug and play manager has assigned)