doubt regarding gameport address

hai all…

i have written a generic port driver which can be used to Read/write data
to/from a given port.
The port address and the data will be send to the driver using
DeviceIoControl function.

i am using game port for testing and the game port address is hardcoded as
201 in the user mode test Application. i have tested it in both NT and
Win2K. in NT almost the asumption (address of game port as 201) is ok. But
in win2k
it fails… When i checked through the Device manager it is showing two
game ports. one having address range of (201-201) and another one having a
range of (209-209) … Driver is working when i Read data from port 209 and
for 201 it is not working.i have used DDK sample gameenum to enumerate the
gameports… it is also showing the two ports.

  1. Why it is showing two game ports… i checked the motherboard (and the
    manual also) and couldn’t find the
    second port.
  2. In How we can Query the address of GamePort either from usermode or
    from kernel mode
    in an NT system.

Deepu.


Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


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 am using game port for testing and the game port address is hardcoded as

201 in the user mode test Application. i have tested it in both NT and

The app must not know anything about the hardware addresses.
The app (assuming it’s w2k) must enumerate all instances of the device interface using SetupDixxx, then open one of it and use
read/write/DeviceIoControl on it.

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

hai MAX,

Thanks for the replay… but i think SetupDixxx is not supported in NT.
is there any similar functions in NT and in 95/98 to find the Device
information

The app must not know anything about the hardware addresses.
The app (assuming it’s w2k) must enumerate all instances of the device
interface using SetupDixxx, then open one of it and use
read/write/DeviceIoControl on it.

Thanks, Deepu.L.R


Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


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

> Thanks for the replay… but i think SetupDixxx is not supported in NT.

is there any similar functions in NT and in 95/98 to find the Device
information

95/98 seem to have SetupDixxx.
For NT4, parsing HKLM\HARDWARE\OWNERMAP seems to be the only way.
Again - the app must not know this. If the driver is correct, then there are no causes for the app to require such knowledge.

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

hai MAX,
Thanks for the replay

For NT4, parsing HKLM\HARDWARE\OWNERMAP seems to be the only way.
i am unable to find HKLM\HARDWARE\OWNERMAP key. is this key will be there
in all NT machines…

Again - the app must not know this. If the driver is correct, then there
are no causes for the app to require such knowledge.

Yes … true… I am not sure that this is a good practice or not. my problem
is like this.

in 95/98 we can directly write/read data from the system ports from an
application because there is no usermode/kernaelmode seperation.we can use
the _inp function which takes the address of the port. _inp is a generic
function that can be used to read/write data from the given port address. So
a generic dirver is written which takes portaddress and the buffer as
argument in the DeviceIoControl( ) and reads/writes data to/from the given
address using READ/WRITE_PORT_ULONG.(Since our driver is not a game port
driver and it doesnt identifies its hardware resources in its DriverEnry -
it is a generic driver which can be used to write data to any user supplied
port) - That is why i need port address in user application. i know it is an
indirect but still…

your advice please…

Thanks Deepu.L.R


Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


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

> it is a generic driver which can be used to write data to any user supplied

port) - That is why i need port address in user application. i know it is an
indirect but still…

Under this circumstances, your only solution is to ask the user about the port address and then save it somewhere in the app’s
registry. No kernel mode code will know your port address in this case.

It is a PCI device? If yes - then the whole app/driver combo must be redesigned, since PCI uses dynamic address assignment by means
of config space, and this require the real kernel-mode device driver, not just “portio”.

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

hai max,

of config space, and this require the real kernel-mode device driver, not
just “portio”.

thanks for the reply max Deepu.L.R


Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


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