advice on driver implementation

You will need to specify the installation of the modem driver within
your driver. I can’t find an example of how to install an OS component
from the INF, but it is not that hard.

Would it be easier if I made a fake COM port instead of a fake modem?
How would I do that?
No, not really. COM names are handed out by the ports class installer
and the easiest way to get one is to enumerate a COM port stack. Is the
end goal that you are going to dial out on the modem ? or just that
some component is going to open your driver with a COM name and expect a
COM device interface?

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Friday, May 04, 2007 1:06 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Re:Re:advice on driver implementation

I am running on embedded XP. Is there some modem service that I need to

enable. This is the error I am getting.

#E262 Controlling Service: Failed to open service “Modem”. Error 1060:
The
specified service does not exist as an installed service.
#E275 Error while installing services. Error 1060: The specified service

does not exist as an installed service.
#E122 Device install failed. Error 1060: The specified service does not
exist as an installed service.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

The goal is for the device to function as a fax modem on 4 ports and a data
modem on one port, as well are provide our voice interface. An application
like PC Aywhere will need to be able to open the modem or com port of the
modem and use it in a normal manner. It does not really matter if the
application sees a com port or a modem.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
You will need to specify the installation of the modem driver within
your driver. I can’t find an example of how to install an OS component
from the INF, but it is not that hard.

> Would it be easier if I made a fake COM port instead of a fake modem?
How would I do that?
No, not really. COM names are handed out by the ports class installer
and the easiest way to get one is to enumerate a COM port stack. Is the
end goal that you are going to dial out on the modem ? or just that
some component is going to open your driver with a COM name and expect a
COM device interface?

d

Doron,

I could use some help with:

“You will need to specify the installation of the modem driver within
your driver. I can’t find an example of how to install an OS component
from the INF, but it is not that hard.”

Writing the driver was easy compared to this install part.

'Greg

Greg Coleson wrote:

“You will need to specify the installation of the modem driver
within your driver. I can’t find an example of how to install
an OS component from the INF, but it is not that hard.”

First, which modem driver are you actually using? One that you wrote based on fakemodem, or something else?

Do you understand the relationship between the modem driver and your PCI bus driver? The modem driver and your bus driver will need to have a contract that determines how the modem driver controls your actual hardware. I ask because the fakemodem sample doesn’t control any hardware, it just echoes back to you (and fakes some basic AT commands) – and is also missing a lot of serial I/O implementation, etc.

The INF for your modem driver will need to contain the hardware ID that your bus driver is creating. You will be a lower filter to modem.sys. If this is too hard you can also just be a COM port (instead of a modem), then your modem driver is the function driver for the entire stack.

Look at msports.inf for an example of a Ports INF or maybe if your machine has a built-in PCI modem, just look at its INF.

I have a piece of PCI hardware that I wrote a driver for in KMDF. It works
great, install, .inf, functionality, etc. The piece of PCI hardware also
has a DSP on it that supports 4 fax modems and 1 data modem. I want this
driver also to appear as a Com port or a modem. If a Com port is easier
then I want it to appear as a Com port, I don’t really care.

I started with the fakemodem because my hardware does not appear as a PCI
modem. I want it to have a modem or Com port interface so an application
like PC Anywhere can use it. Any help would be appreciated in helping me
understand what I am missing.

When I create the child device PDO I assign a hardware and device ID for my
fake modem ports.

status = WdfPdoInitAssignDeviceID(pDeviceInit, &deviceId);
status = WdfPdoInitAddHardwareID(pDeviceInit, &deviceId);

I have the same ID in my .INF and the installer finds it and the install
proceeds fine copying files, etc. I get error code one and traced that to:
#E262 Controlling Service: Failed to open service “Modem”. Error 1060: The
specified service does not exist as an installed service.
#E275 Error while installing services. Error 1060: The specified service
does not exist as an installed service.
#E122 Device install failed. Error 1060: The specified service does not
exist as an installed service.

So I would love to forget this modem interface and try something easier like
a Com port interface. I am trying to do this now by following the serial
example in the kmdf. In the serial.inf that it generates, how does the
system know to make it a com port?

From :
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
In the .inf?

This is a very frustrating experience. Any help would be appreciated. The
guys from MS seem to have left me out in the cold.

Not sure what you mean by being left out in the cold…if you want
somebody to dial out over your com port, you need to expose a modem.
Let’s get you going with straight up com ports though.

In the serial.inf that it generates, how does the system know to make
it a com port?
The class in the INF is the first step. The class contains both COM and
LPT ports. You must also specify the COM subtype (which is a value
named “PortSubClass” in the registry) so that the ports class installer
knows you are a com port and gives you a COMX name. To do this, you
must also copy this section

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

Into your INF and wire in the call to the ComPort.AddReg in the right
section (this was taken from %windir%\inf\msports.inf, you can look
there for its usage). That is the only thing that the installer needs.
After that, everything else depends on the driver. You must create the
symbolic link, create the device interface and write the correct value
to the SERIALCOMM key (see SerialDoExternalNaming for the all the
details).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Monday, May 07, 2007 1:19 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] advice on driver implementation

I have a piece of PCI hardware that I wrote a driver for in KMDF. It
works
great, install, .inf, functionality, etc. The piece of PCI hardware
also
has a DSP on it that supports 4 fax modems and 1 data modem. I want
this
driver also to appear as a Com port or a modem. If a Com port is easier

then I want it to appear as a Com port, I don’t really care.

I started with the fakemodem because my hardware does not appear as a
PCI
modem. I want it to have a modem or Com port interface so an
application
like PC Anywhere can use it. Any help would be appreciated in helping
me
understand what I am missing.

When I create the child device PDO I assign a hardware and device ID for
my
fake modem ports.

status = WdfPdoInitAssignDeviceID(pDeviceInit, &deviceId);
status = WdfPdoInitAddHardwareID(pDeviceInit, &deviceId);

I have the same ID in my .INF and the installer finds it and the install

proceeds fine copying files, etc. I get error code one and traced that
to:
#E262 Controlling Service: Failed to open service “Modem”. Error 1060:
The
specified service does not exist as an installed service.
#E275 Error while installing services. Error 1060: The specified service
does not exist as an installed service.
#E122 Device install failed. Error 1060: The specified service does not
exist as an installed service.

So I would love to forget this modem interface and try something easier
like
a Com port interface. I am trying to do this now by following the
serial
example in the kmdf. In the serial.inf that it generates, how does the
system know to make it a com port?

From :
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
In the .inf?

This is a very frustrating experience. Any help would be appreciated.
The
guys from MS seem to have left me out in the cold.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Are you talking about putting this into the same .inf that installed my
voice interface driver or in a separate .inf like you referred to before
when I was trying to create a modem interface.

The serial.inf from the serial example does not have this in it, why is
that?

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

I think the modem interface is very close to working. I can see it in the
device manager, it just keeps complaining about:
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.511 #V282 Add Service: Modified
existing service “wdfdio”.
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.521 #E262 Controlling Service:
Failed to open service “Modem”. Error 1060: The specified service does not
exist as an installed service.
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.531 #E275 Error while installing
services. Error 1060: The specified service does not exist as an installed
service.
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.531 #T224 Install Device: Cleaning
up failed device.
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.531 #E122 Device install failed.
Error 1060: The specified service does not exist as an installed service.
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.541 #T201 Install Device: End.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Not sure what you mean by being left out in the cold…if you want
somebody to dial out over your com port, you need to expose a modem.
Let’s get you going with straight up com ports though.

> In the serial.inf that it generates, how does the system know to make
it a com port?
The class in the INF is the first step. The class contains both COM and
LPT ports. You must also specify the COM subtype (which is a value
named “PortSubClass” in the registry) so that the ports class installer
knows you are a com port and gives you a COMX name. To do this, you
must also copy this section

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

Into your INF and wire in the call to the ComPort.AddReg in the right
section (this was taken from %windir%\inf\msports.inf, you can look
there for its usage). That is the only thing that the installer needs.
After that, everything else depends on the driver. You must create the
symbolic link, create the device interface and write the correct value
to the SERIALCOMM key (see SerialDoExternalNaming for the all the
details).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Monday, May 07, 2007 1:19 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] advice on driver implementation

I have a piece of PCI hardware that I wrote a driver for in KMDF. It
works
great, install, .inf, functionality, etc. The piece of PCI hardware
also
has a DSP on it that supports 4 fax modems and 1 data modem. I want
this
driver also to appear as a Com port or a modem. If a Com port is easier

then I want it to appear as a Com port, I don’t really care.

I started with the fakemodem because my hardware does not appear as a
PCI
modem. I want it to have a modem or Com port interface so an
application
like PC Anywhere can use it. Any help would be appreciated in helping
me
understand what I am missing.

When I create the child device PDO I assign a hardware and device ID for
my
fake modem ports.

status = WdfPdoInitAssignDeviceID(pDeviceInit, &deviceId);
status = WdfPdoInitAddHardwareID(pDeviceInit, &deviceId);

I have the same ID in my .INF and the installer finds it and the install

proceeds fine copying files, etc. I get error code one and traced that
to:
#E262 Controlling Service: Failed to open service “Modem”. Error 1060:
The
specified service does not exist as an installed service.
#E275 Error while installing services. Error 1060: The specified service
does not exist as an installed service.
#E122 Device install failed. Error 1060: The specified service does not
exist as an installed service.

So I would love to forget this modem interface and try something easier
like
a Com port interface. I am trying to do this now by following the
serial
example in the kmdf. In the serial.inf that it generates, how does the
system know to make it a com port?

From :
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
In the .inf?

This is a very frustrating experience. Any help would be appreciated.
The
guys from MS seem to have left me out in the cold.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

If PortSubClass is missing, then it is assumed to be a COM port (forgot
that part). That would explain why it is missing. This would have been
put into the separate INF for the modem device, not in the voice
interface INF.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Tuesday, May 08, 2007 9:34 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] advice on driver implementation

Are you talking about putting this into the same .inf that installed my
voice interface driver or in a separate .inf like you referred to before

when I was trying to create a modem interface.

The serial.inf from the serial example does not have this in it, why is
that?

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

I think the modem interface is very close to working. I can see it in
the
device manager, it just keeps complaining about:
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.511 #V282 Add Service: Modified

existing service “wdfdio”.
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.521 #E262 Controlling Service:
Failed to open service “Modem”. Error 1060: The specified service does
not
exist as an installed service.
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.531 #E275 Error while
installing
services. Error 1060: The specified service does not exist as an
installed
service.
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.531 #T224 Install Device:
Cleaning
up failed device.
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.531 #E122 Device install
failed.
Error 1060: The specified service does not exist as an installed
service.
[2007/05/08 12:41:13 3164.2]: @ 12:42:09.541 #T201 Install Device: End.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Not sure what you mean by being left out in the cold…if you want
somebody to dial out over your com port, you need to expose a modem.
Let’s get you going with straight up com ports though.

> In the serial.inf that it generates, how does the system know to make
it a com port?
The class in the INF is the first step. The class contains both COM and
LPT ports. You must also specify the COM subtype (which is a value
named “PortSubClass” in the registry) so that the ports class installer
knows you are a com port and gives you a COMX name. To do this, you
must also copy this section

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

Into your INF and wire in the call to the ComPort.AddReg in the right
section (this was taken from %windir%\inf\msports.inf, you can look
there for its usage). That is the only thing that the installer needs.
After that, everything else depends on the driver. You must create the
symbolic link, create the device interface and write the correct value
to the SERIALCOMM key (see SerialDoExternalNaming for the all the
details).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Monday, May 07, 2007 1:19 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] advice on driver implementation

I have a piece of PCI hardware that I wrote a driver for in KMDF. It
works
great, install, .inf, functionality, etc. The piece of PCI hardware
also
has a DSP on it that supports 4 fax modems and 1 data modem. I want
this
driver also to appear as a Com port or a modem. If a Com port is easier

then I want it to appear as a Com port, I don’t really care.

I started with the fakemodem because my hardware does not appear as a
PCI
modem. I want it to have a modem or Com port interface so an
application
like PC Anywhere can use it. Any help would be appreciated in helping
me
understand what I am missing.

When I create the child device PDO I assign a hardware and device ID for
my
fake modem ports.

status = WdfPdoInitAssignDeviceID(pDeviceInit, &deviceId);
status = WdfPdoInitAddHardwareID(pDeviceInit, &deviceId);

I have the same ID in my .INF and the installer finds it and the install

proceeds fine copying files, etc. I get error code one and traced that
to:
#E262 Controlling Service: Failed to open service “Modem”. Error 1060:
The
specified service does not exist as an installed service.
#E275 Error while installing services. Error 1060: The specified service
does not exist as an installed service.
#E122 Device install failed. Error 1060: The specified service does not
exist as an installed service.

So I would love to forget this modem interface and try something easier
like
a Com port interface. I am trying to do this now by following the
serial
example in the kmdf. In the serial.inf that it generates, how does the
system know to make it a com port?

From :
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
In the .inf?

This is a very frustrating experience. Any help would be appreciated.
The
guys from MS seem to have left me out in the cold.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

One problem is that the modem class is available by default on the desktop OS (not sure about server, but probably there, too). But for XP Emedded, it is an optional component, and yours appears not to include it.

I went to MSDN and searched on “XP Embedded modem installation” and turned up a slew of links (most probably not very helpful). I gleaned that much out of the first couple of them. I did find mention of a class installer, but not what would need to be done to ad it after the fact. But that might be a good way to proceed- expertise on this aspect of things might be a bit thin.

Can’t speak for Doron, but the last time I touched a modem driver, NT4 and Win95 were the latest and greatest…

#I163 Device not started: Device has problem: 0x0a: CM_PROB_FAILED_START.
#I121 Device install of
“{4D36E96D-E325-11CE-BFC1-08002BE10318}\FAKEMODEM\4&3737BB5D&2&01” finished
successfully.

I added the section in below. The install looked like it worked, but says
the device not started. I have DebugView running on the system and I can
not see where it tried to call any of my code in the driver.

Just to be clear, I have a separate .inf based on the serial.inf from the
serial example in the kmdf. I added the below line in as you suggested.

I have not added the SerialDoExternalNaming code in yet.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Not sure what you mean by being left out in the cold…if you want
somebody to dial out over your com port, you need to expose a modem.
Let’s get you going with straight up com ports though.

> In the serial.inf that it generates, how does the system know to make
it a com port?
The class in the INF is the first step. The class contains both COM and
LPT ports. You must also specify the COM subtype (which is a value
named “PortSubClass” in the registry) so that the ports class installer
knows you are a com port and gives you a COMX name. To do this, you
must also copy this section

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

Into your INF and wire in the call to the ComPort.AddReg in the right
section (this was taken from %windir%\inf\msports.inf, you can look
there for its usage). That is the only thing that the installer needs.
After that, everything else depends on the driver. You must create the
symbolic link, create the device interface and write the correct value
to the SERIALCOMM key (see SerialDoExternalNaming for the all the
details).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Monday, May 07, 2007 1:19 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] advice on driver implementation

I have a piece of PCI hardware that I wrote a driver for in KMDF. It
works
great, install, .inf, functionality, etc. The piece of PCI hardware
also
has a DSP on it that supports 4 fax modems and 1 data modem. I want
this
driver also to appear as a Com port or a modem. If a Com port is easier

then I want it to appear as a Com port, I don’t really care.

I started with the fakemodem because my hardware does not appear as a
PCI
modem. I want it to have a modem or Com port interface so an
application
like PC Anywhere can use it. Any help would be appreciated in helping
me
understand what I am missing.

When I create the child device PDO I assign a hardware and device ID for
my
fake modem ports.

status = WdfPdoInitAssignDeviceID(pDeviceInit, &deviceId);
status = WdfPdoInitAddHardwareID(pDeviceInit, &deviceId);

I have the same ID in my .INF and the installer finds it and the install

proceeds fine copying files, etc. I get error code one and traced that
to:
#E262 Controlling Service: Failed to open service “Modem”. Error 1060:
The
specified service does not exist as an installed service.
#E275 Error while installing services. Error 1060: The specified service
does not exist as an installed service.
#E122 Device install failed. Error 1060: The specified service does not
exist as an installed service.

So I would love to forget this modem interface and try something easier
like
a Com port interface. I am trying to do this now by following the
serial
example in the kmdf. In the serial.inf that it generates, how does the
system know to make it a com port?

From :
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
In the .inf?

This is a very frustrating experience. Any help would be appreciated.
The
guys from MS seem to have left me out in the cold.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

I can see the com port in the device manager also.

Under the drivers in the properties it shows my driver and the coinstaller.
Should it be showing anything from MS like serial.sys or something?

How can I check for this class on the machine?

“Bob Kjelgaard” wrote in message
news:xxxxx@ntdev…
One problem is that the modem class is available by default on the desktop
OS (not sure about server, but probably there, too). But for XP Emedded, it
is an optional component, and yours appears not to include it.

I went to MSDN and searched on “XP Embedded modem installation” and turned
up a slew of links (most probably not very helpful). I gleaned that much
out of the first couple of them. I did find mention of a class installer,
but not what would need to be done to ad it after the fact. But that might
be a good way to proceed- expertise on this aspect of things might be a bit
thin.

Can’t speak for Doron, but the last time I touched a modem driver, NT4 and
Win95 were the latest and greatest…

Can’t really help you there- the information I was reviewing related to how to build the OS image for an embedded system- apparently there’s a studio type tool and the installer is some sort of selectable component. What I was suggesting is you might try that search and see if there’s more helpful info there [I just scanned the first few items, because I’m headed toward deadline problems at the moment].

Given the error you reported, my ASSUMPTION is that the image was created without complete modem support. You could look for modem.sys, modeminst.*, modemui.* (the first in system32/drivers, the rest in system32).

But as I tried to say, anything involving plug-and-play (on an NT-based system, anyway) and modems is after my time. I’ve never touched XP embedded (a small amount of work on Win CE printing, that’s about it for anything embedded involving windows).

OTOH, if Doron’s suggestions have got you close to working all of that could be a massive waste of time. I really can’t say- just too far outside my useful experience.

I did a new build of XP with every modem thing I could find in it. That
time my install seemed to make it further. I can see in the device manager
where it selected modem.sys, my driver, and the coinstaller as the drivers.

It is having a problem with the registry now. I checked the registry and it
looks like the installer put all the registry settings in from the .inf
file. Any ideas how to debug this?

[2007/05/08 17:47:49 820.3 Driver Install]: @ 17:47:53.161 #T216 Install
Device: Restarting device.
[2007/05/08 17:47:49 820.3 Driver Install]: @ 17:47:53.181 #T217 Install
Device: Restarting device completed.
[2007/05/08 17:47:49 820.3 Driver Install]: @ 17:47:53.181 #I163 Device not
started: Device has problem: 0x13: CM_PROB_REGISTRY.

“Recommended Resolution ? NT-based Systems
This error can result if more than one service is defined for a device,
there is a failure opening the service key, or the driver name can’t be
obtained from the service key.”

Is this registry problem from my running 2 .inf files referencing the same
driver and having the same service info in both .inf files or does this
matter?

The driver is only started once under the service key in the registry.

I found the problem, I had the service name incorrect for the filter driver
registry entry. It was still set to fakemodem and not the service name of
my voice driver. Now after all this, let me see if it works.

Now that my first modem is added in and working. A few questions?

  1. My DeviceAdd call back function gets called a second time after I add
    the PDO for the modem in (the first time was for the FDO). Why is that? I
    already created the device for the PDO.

  2. What would be a good way to detect that this second callback to
    DeviceAdd is for the modem PDO that I created. I am thinking that looking
    in the DRIVER_OBJECT and walking down the device chain might be a good way?
    Just for testing I am returning STATUS_SUCCESS on the second call.

  3. I notice in the WinObj viewer from sysinternals the none of my REAL
    hardware com ports have a symbolic link in the GLOBAL?? area. Got any ideas
    why? This is embedded XP.

  4. You suggested “you read this value (“PortName”) out of the registry
    during EvtDevicePrepareHardware and create the symbolic link then.”.
    EvtDevicePrepareHardware never gets called for this modem PDO, ideas?

  1. if you specified your bus driver as the function driver for the
    modem, you will get your AddDevice called twice. I would think that you
    would implement the serial functionality in another driver so that you
    have localized the complexity to a specific binary.

  2. You are not allowed to walk the device chain in the driver object
    (see the other thread I responded to today about opaque structures).
    Instead, get the enumerator name via WdfFdoInitAllocAndQueryProperty
    (see IoGetDeviceProperty for the property names and buffer types).
    Since you enumerated the PDO, it will have your enumerator value. The
    enumerator value is the first part of the hardware ID, e.g. if you gave
    the device a hw ID of Foo\Bar, the enumerator would be “Foo”.

  3. don’t know, but if the app can open the com port name, does it
    matter?

  4. did you register a EvtDevicePrepareHardware callback on the PDO?
    Functions are registered per WDFDEVICE, not per WDFDRIVER, so you must
    register this function for each device you create. Are you going to
    embed the serial functionality in the PDO you enumerate or in the
    function driver you load on top of the PDO? I would guess the function
    driver you load on the PDO. If so, the function driver should set the
    symbolic link name, not the PDO.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Thursday, May 10, 2007 1:50 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] advice on driver implementation

Now that my first modem is added in and working. A few questions?

  1. My DeviceAdd call back function gets called a second time after I
    add
    the PDO for the modem in (the first time was for the FDO). Why is that?
    I
    already created the device for the PDO.

  2. What would be a good way to detect that this second callback to
    DeviceAdd is for the modem PDO that I created. I am thinking that
    looking
    in the DRIVER_OBJECT and walking down the device chain might be a good
    way?
    Just for testing I am returning STATUS_SUCCESS on the second call.

  3. I notice in the WinObj viewer from sysinternals the none of my REAL
    hardware com ports have a symbolic link in the GLOBAL?? area. Got any
    ideas
    why? This is embedded XP.

  4. You suggested “you read this value (“PortName”) out of the registry
    during EvtDevicePrepareHardware and create the symbolic link then.”.
    EvtDevicePrepareHardware never gets called for this modem PDO, ideas?


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Thanks for the help. One note.

  1. The doc seems to say you can see some of the members of the
    DRIVER_OBJECT. “A driver object is partially opaque”
    Accessible Members
    PDEVICE_OBJECT DeviceObject
    PDRIVER_EXTENSION DriverExtension
    PUNICODE_STRING HardwareDatabase
    PFAST_IO_DISPATCH FastIoDispatch
    PDRIVER_INITIALIZE DriverInit
    PDRIVER_STARTIO DriverStartIo
    PDRIVER_UNLOAD DriverUnload
    PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]

“Doron Holan” wrote in message
news:xxxxx@ntdev…
1) if you specified your bus driver as the function driver for the
modem, you will get your AddDevice called twice. I would think that you
would implement the serial functionality in another driver so that you
have localized the complexity to a specific binary.

2) You are not allowed to walk the device chain in the driver object
(see the other thread I responded to today about opaque structures).
Instead, get the enumerator name via WdfFdoInitAllocAndQueryProperty
(see IoGetDeviceProperty for the property names and buffer types).
Since you enumerated the PDO, it will have your enumerator value. The
enumerator value is the first part of the hardware ID, e.g. if you gave
the device a hw ID of Foo\Bar, the enumerator would be “Foo”.

3) don’t know, but if the app can open the com port name, does it
matter?

4) did you register a EvtDevicePrepareHardware callback on the PDO?
Functions are registered per WDFDEVICE, not per WDFDRIVER, so you must
register this function for each device you create. Are you going to
embed the serial functionality in the PDO you enumerate or in the
function driver you load on top of the PDO? I would guess the function
driver you load on the PDO. If so, the function driver should set the
symbolic link name, not the PDO.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Thursday, May 10, 2007 1:50 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] advice on driver implementation

Now that my first modem is added in and working. A few questions?

1) My DeviceAdd call back function gets called a second time after I
add
the PDO for the modem in (the first time was for the FDO). Why is that?
I
already created the device for the PDO.

2) What would be a good way to detect that this second callback to
DeviceAdd is for the modem PDO that I created. I am thinking that
looking
in the DRIVER_OBJECT and walking down the device chain might be a good
way?
Just for testing I am returning STATUS_SUCCESS on the second call.

3) I notice in the WinObj viewer from sysinternals the none of my REAL
hardware com ports have a symbolic link in the GLOBAL?? area. Got any
ideas
why? This is embedded XP.

4) You suggested “you read this value (“PortName”) out of the registry
during EvtDevicePrepareHardware and create the symbolic link then.”.
EvtDevicePrepareHardware never gets called for this modem PDO, ideas?


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer