I'm trying to write a basic virtual serial port driver.

basicly, the code of the AddDevice routine is:
IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), &uNtDeviceName,
FILE_DEVICE_SERIAL_PORT, FILE_DEVICE_SECURE_OPEN, TRUE, &pDeviceObject)

IoOpenDeviceRegistryKey(pDO,PLUGPLAY_REGKEY_DEVICE,STANDARD_RIGHTS_READ,&key
Handle);

ZwQueryValueKey(keyHandle, L"PortName", KeyValuePartialInformation,pInfo,
length, &length);



but, ZwQueryValueKey always returns STATUS_OBJECT_NAME_NOT_FOUND.



Anyone has any idea what is wrong or how to make it work ?

Re: Virtual serial port by Doron

Doron
Sun Aug 31 00:41:37 CDT 2003

what device class is your device installed under? the ports class? or some
other class? for the PortName value to be placed in your device's key, you
must be in the ports class. furthermore, you must set your port subclass
value correctl so that the ports class installer knows that it is installing
a COM port (vs a LPT port).

d

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Goran Loncar" <goran.loncar@ka.htnet.hr> wrote in message
news:bird6k$16l$1@bagan.srce.hr...
> I'm trying to write a basic virtual serial port driver.
>
> basicly, the code of the AddDevice routine is:
> IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), &uNtDeviceName,
> FILE_DEVICE_SERIAL_PORT, FILE_DEVICE_SECURE_OPEN, TRUE, &pDeviceObject)
>
>
IoOpenDeviceRegistryKey(pDO,PLUGPLAY_REGKEY_DEVICE,STANDARD_RIGHTS_READ,&key
> Handle);
>
> ZwQueryValueKey(keyHandle, L"PortName", KeyValuePartialInformation,pInfo,
> length, &length);
>
>
>
> but, ZwQueryValueKey always returns STATUS_OBJECT_NAME_NOT_FOUND.
>
>
>
> Anyone has any idea what is wrong or how to make it work ?
>
>
>
>
>
>
>
>
>



Re: Virtual serial port by Goran

Goran
Sun Aug 31 12:32:12 CDT 2003


"Doron Holan [MS]" <doronh@online.microsoft.com> wrote in message
news:#wHzJK4bDHA.2436@TK2MSFTNGP09.phx.gbl...
> what device class is your device installed under? the ports class? or
some
> other class? for the PortName value to be placed in your device's key,
you
> must be in the ports class. furthermore, you must set your port subclass
> value correctl so that the ports class installer knows that it is
installing
> a COM port (vs a LPT port).
>
> d

The inf file contains:
[Version]
Signature = "$Windows NT$"
Class=Ports
ClassGUID={4d36e97d-e325-11ce-bfc1-08002be10318}

this should be ok, right ?



> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Goran Loncar" <goran.loncar@ka.htnet.hr> wrote in message
> news:bird6k$16l$1@bagan.srce.hr...
> > I'm trying to write a basic virtual serial port driver.
> >
> > basicly, the code of the AddDevice routine is:
> > IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), &uNtDeviceName,
> > FILE_DEVICE_SERIAL_PORT, FILE_DEVICE_SECURE_OPEN, TRUE, &pDeviceObject)
> >
> >
>
IoOpenDeviceRegistryKey(pDO,PLUGPLAY_REGKEY_DEVICE,STANDARD_RIGHTS_READ,&key
> > Handle);
> >
> > ZwQueryValueKey(keyHandle, L"PortName",
KeyValuePartialInformation,pInfo,
> > length, &length);
> >
> >
> >
> > but, ZwQueryValueKey always returns STATUS_OBJECT_NAME_NOT_FOUND.
> >
> >
> >
> > Anyone has any idea what is wrong or how to make it work ?
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>



Re: Virtual serial port by Doron

Doron
Mon Sep 01 00:52:27 CDT 2003

you also need to set the subclass value

[Xxx]
...
AddReg=Xxx.AddReg

[Xxx.AddReg]
HKR,,PortSubClass,1,01

also, you need to check this value in start device, not add device.

d

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Goran Loncar" <goran.loncar@ka.htnet.hr> wrote in message
news:bitbf5$rdi$1@bagan.srce.hr...
>
> "Doron Holan [MS]" <doronh@online.microsoft.com> wrote in message
> news:#wHzJK4bDHA.2436@TK2MSFTNGP09.phx.gbl...
> > what device class is your device installed under? the ports class? or
> some
> > other class? for the PortName value to be placed in your device's key,
> you
> > must be in the ports class. furthermore, you must set your port
subclass
> > value correctl so that the ports class installer knows that it is
> installing
> > a COM port (vs a LPT port).
> >
> > d
>
> The inf file contains:
> [Version]
> Signature = "$Windows NT$"
> Class=Ports
> ClassGUID={4d36e97d-e325-11ce-bfc1-08002be10318}
>
> this should be ok, right ?
>
>
>
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > "Goran Loncar" <goran.loncar@ka.htnet.hr> wrote in message
> > news:bird6k$16l$1@bagan.srce.hr...
> > > I'm trying to write a basic virtual serial port driver.
> > >
> > > basicly, the code of the AddDevice routine is:
> > > IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), &uNtDeviceName,
> > > FILE_DEVICE_SERIAL_PORT, FILE_DEVICE_SECURE_OPEN, TRUE,
&pDeviceObject)
> > >
> > >
> >
>
IoOpenDeviceRegistryKey(pDO,PLUGPLAY_REGKEY_DEVICE,STANDARD_RIGHTS_READ,&key
> > > Handle);
> > >
> > > ZwQueryValueKey(keyHandle, L"PortName",
> KeyValuePartialInformation,pInfo,
> > > length, &length);
> > >
> > >
> > >
> > > but, ZwQueryValueKey always returns STATUS_OBJECT_NAME_NOT_FOUND.
> > >
> > >
> > >
> > > Anyone has any idea what is wrong or how to make it work ?
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>



Re: Virtual serial port by Goran

Goran
Mon Sep 01 18:37:42 CDT 2003

I made the chages, but still no luck with it,
still the STATUS_OBJECT_NAME_NOT_FOUND is returned.

any ideas, please ?



"Doron Holan [MS]" <doronh@online.microsoft.com> wrote in message
news:uRiS20EcDHA.1772@TK2MSFTNGP10.phx.gbl...
> you also need to set the subclass value
>
> [Xxx]
> ...
> AddReg=Xxx.AddReg
>
> [Xxx.AddReg]
> HKR,,PortSubClass,1,01
>
> also, you need to check this value in start device, not add device.
>
> d
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Goran Loncar" <goran.loncar@ka.htnet.hr> wrote in message
> news:bitbf5$rdi$1@bagan.srce.hr...
> >
> > "Doron Holan [MS]" <doronh@online.microsoft.com> wrote in message
> > news:#wHzJK4bDHA.2436@TK2MSFTNGP09.phx.gbl...
> > > what device class is your device installed under? the ports class?
or
> > some
> > > other class? for the PortName value to be placed in your device's
key,
> > you
> > > must be in the ports class. furthermore, you must set your port
> subclass
> > > value correctl so that the ports class installer knows that it is
> > installing
> > > a COM port (vs a LPT port).
> > >
> > > d
> >
> > The inf file contains:
> > [Version]
> > Signature = "$Windows NT$"
> > Class=Ports
> > ClassGUID={4d36e97d-e325-11ce-bfc1-08002be10318}
> >
> > this should be ok, right ?
> >
> >
> >
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > "Goran Loncar" <goran.loncar@ka.htnet.hr> wrote in message
> > > news:bird6k$16l$1@bagan.srce.hr...
> > > > I'm trying to write a basic virtual serial port driver.
> > > >
> > > > basicly, the code of the AddDevice routine is:
> > > > IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION),
&uNtDeviceName,
> > > > FILE_DEVICE_SERIAL_PORT, FILE_DEVICE_SECURE_OPEN, TRUE,
> &pDeviceObject)
> > > >
> > > >
> > >
> >
>
IoOpenDeviceRegistryKey(pDO,PLUGPLAY_REGKEY_DEVICE,STANDARD_RIGHTS_READ,&key
> > > > Handle);
> > > >
> > > > ZwQueryValueKey(keyHandle, L"PortName",
> > KeyValuePartialInformation,pInfo,
> > > > length, &length);
> > > >
> > > >
> > > >
> > > > but, ZwQueryValueKey always returns STATUS_OBJECT_NAME_NOT_FOUND.
> > > >
> > > >
> > > >
> > > > Anyone has any idea what is wrong or how to make it work ?
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>