Tech Support > Microsoft Windows > Drivers > Read value from register
Read value from register
Posted by Adam Piotrowski on August 15th, 2003


Hello I have little problem.
I write virtual com port driver and I want read from register
information about free com port number (COM3 or COM4 ...). When I use
IoOpenDeviceRegistryKey in DriverEntry I receive
STATUS_INVALID_DEVICE_REQUEST. I know what that means (my PDO is not
ready ). But what can I do now ? I need value from register for my
IoCreateSymbolicLink function but I don't get this value because my
DriveEntry (when I call IoCreateSymbolicLink ) with my PDO don't
return jet.

I try use AddDevice function but Windows call DriveEntry and
immediately call DriverUnload. But if I write virtual device driver
can I used AddDevice ? This function is call by PnP Manager and where
in my driver is PnP

Adam Piotrowski

Posted by Del Fredricks on August 15th, 2003



You can not use the IoOpenDeviceRegistryKey function in DriverEntry because
PnP has not yet fully registered your PDO. Thus, there is no Registry
mapping available for your device.

At this point DriverEntry should only be identifying your callback functions
(i.e. not calling IoCreateSymbolicLink to register the interface to your
device). When AddDevice is called, your PDO is not fully registered and you
can call IoOpenDeviceRegistryKey for it as well as calling
IoCreateSymbolicLink to identify the interface to your device.

If your DriverEntry function returns anything other than STATUS_SUCCESS,
then PnP will unload your driver.

"Adam Piotrowski" <apiotro@zly.kis.p.lodz.pl> wrote in message
news:2c5005ef.0308141607.74e32e46@posting.google.c om...



Similar Posts