advice on driver implementation

I need advice on how to properly implement the following:

I have a PCI device that provides voice compression and it also provides 5
fax modems. I wrote a device driver using KMDF that handles all the voice
compression functionality that works fine. I want the the OS to think that
it has 5 real modem devices and and interface to the voice compression
functionality

I can see how to implement the modems in the fakemodem example. I can also
see how to implement filter drivers, but I don’t know if I need one in this
case

I currently have:

\\.\VoiceInterface
|
/
PCI bus

I want something like the following.

Modem1 Modem2 Modem3 Modem4 Modem5 VoiceInterface
| | | | |
|

/
Pci Bus

What would be the best way to implement this with KMDF?

Thanks,
Greg

Write a bus driver. I know each modem is going to need its own child
stack. As for the voice interfaces, is there an additional driver stack
that you want to load on each interface? Or is it entirely implemented
in your driver and some application just opens up the interface? If it
is entirely in your driver and you do not need any other drivers to load
on top of the voice interface, you can register multiple instances of
the voice interface on your FDO, using a different reference string for
each instance. (This does not work for the modem case b/c you need each
modem to have a COM name and for each to have modem.sys loaded, so each
modem part needs its own stack.)

The toaster sample has an example of a bus driver. I would assume the
list of children you are going to enumerate is fixed or discovered once
during initial start up and does not change dynamically at runtime. If
so, use statbus as the starting point. If the children’s presence
changes dynamically at runtime, use dynambus as the starting point

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Friday, April 27, 2007 11:54 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] advice on driver implementation

I need advice on how to properly implement the following:

I have a PCI device that provides voice compression and it also provides
5
fax modems. I wrote a device driver using KMDF that handles all the
voice
compression functionality that works fine. I want the the OS to think
that
it has 5 real modem devices and and interface to the voice compression
functionality

I can see how to implement the modems in the fakemodem example. I can
also
see how to implement filter drivers, but I don’t know if I need one in
this
case

I currently have:

\\.\VoiceInterface
|
/
PCI bus

I want something like the following.

Modem1 Modem2 Modem3 Modem4 Modem5 VoiceInterface
| | | | |
|

/
Pci Bus

What would be the best way to implement this with KMDF?

Thanks,
Greg


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

Either a set of separate pci function drivers, or a multifunction driver
using the system provided mf.sys facility, or your own bus driver. The
choice depends on how your individual functions are implemented.

Your pci device is supposed to implement individual functions as individual
pci functions: one for voice compression and five for the modems. You write
two KMDF drivers, one for voice and one for modems. I’m guessing this didn’t
happen. Oh well.

Next choice: access to your separate functions can be cleanly partitioned
within the various bars allocated to your single PCI function: mf.sys will
take care of the bus driver business, you write two kmdf drivers again, but
you have to configure your devices to be enumerated by mf.sys. See the ddk
for obscure details. Ask more questions here after the confusion settles in.

Ugh. You can’t cleanly partition the various bars allocated to your single
PCI function. You get to write a bus driver and a set of cooperating
function drivers, one for modems and one for voice. You will have to figure
out how to divide up hardware access responsibility.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-284854-
xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Friday, April 27, 2007 2:54 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] advice on driver implementation

I need advice on how to properly implement the following:

I have a PCI device that provides voice compression and it also
provides 5
fax modems. I wrote a device driver using KMDF that handles all the
voice
compression functionality that works fine. I want the the OS to think
that
it has 5 real modem devices and and interface to the voice compression
functionality

I can see how to implement the modems in the fakemodem example. I can
also
see how to implement filter drivers, but I don’t know if I need one in
this
case

I currently have:

\\.\VoiceInterface
|
/
PCI bus

I want something like the following.

Modem1 Modem2 Modem3 Modem4 Modem5 VoiceInterface
| | | | |
|

/
Pci Bus

What would be the best way to implement this with KMDF?

Thanks,
Greg


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 voice interface will have only one instance.

I can see how the bus driver works from the static toaster example

I can see how the fake modem driver works from the example.

I also wrote a device driver for the voice interface with KMDF.

Can you give me some pointers on how to tie all this together.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Write a bus driver. I know each modem is going to need its own child
stack. As for the voice interfaces, is there an additional driver stack
that you want to load on each interface? Or is it entirely implemented
in your driver and some application just opens up the interface? If it
is entirely in your driver and you do not need any other drivers to load
on top of the voice interface, you can register multiple instances of
the voice interface on your FDO, using a different reference string for
each instance. (This does not work for the modem case b/c you need each
modem to have a COM name and for each to have modem.sys loaded, so each
modem part needs its own stack.)

The toaster sample has an example of a bus driver. I would assume the
list of children you are going to enumerate is fixed or discovered once
during initial start up and does not change dynamically at runtime. If
so, use statbus as the starting point. If the children’s presence
changes dynamically at runtime, use dynambus as the starting point

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Coleson
Sent: Friday, April 27, 2007 11:54 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] advice on driver implementation

I need advice on how to properly implement the following:

I have a PCI device that provides voice compression and it also provides
5
fax modems. I wrote a device driver using KMDF that handles all the
voice
compression functionality that works fine. I want the the OS to think
that
it has 5 real modem devices and and interface to the voice compression
functionality

I can see how to implement the modems in the fakemodem example. I can
also
see how to implement filter drivers, but I don’t know if I need one in
this
case

I currently have:

\\.\VoiceInterface
|
/
PCI bus

I want something like the following.

Modem1 Modem2 Modem3 Modem4 Modem5 VoiceInterface
| | | | |
|
-------------------------------------------------------
/
Pci Bus

What would be the best way to implement this with KMDF?

Thanks,
Greg


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 believe a sketch of the basic idea would be:

(1) In EvtDeviceAdd for the voice interface, create a static child list with your 5 modem PDOs. You can use an arbitrary hardware ID for these (e.g., no need to make them look like PCI Devices).
(2) Tweak fakemodem to suit your needs, and make it the function driver for the made up ID.
(3) You can have a single INF file with the PCI ID of the real device tied to the voice interface driver, and your “out of thin air” ID matched to your modem driver. That makes it one package with two drivers, the INF and the KMDF coinstaller.

When your voice device is loaded, KMDF will report the 5 modems, so having them in the same INF makes the packaging pretty easy (IMO).

That may be enough, but when the PCI device is removed or disabled, it’s going to surprise remove the modem PDOs. I’m guessing that’s what you want, anyway, but if it isn’t, then you probably need to ask for specific advice.

Oh, and you may also need to do some power callbacks to support the modem PDOs (for instance, if the modem can wake the machine).

I’ve made a few drivers that work like this (dynamic rather than static, but that’s about all the difference), went with the bare minimum of additional code, and they’ve suited my purposes fine.

-----Original Message-----

The voice interface will have only one instance.

I can see how the bus driver works from the static toaster example

I can see how the fake modem driver works from the example.

I also wrote a device driver for the voice interface with KMDF.

Can you give me some pointers on how to tie all this together.

Oops- it occurred to me that you probably want to do the reporting at EvtPrepareHardware- all the resources are there, an dpower is on, etc. Doron would of course have better advice…

If you have a fixed number of PDOs (5 in this case) regardless of the
hw, adding the PDOs during EvtDriverDeviceAdd is the best place. If you
need to create the PDOs based on hw state/capabilities, do in
EvtDeviceSelfManagedIoInit. EvtDevicePrepareHardware can be called
multiple times (paired with EvtDeviceReleaseHardware) which would mean
you would have to track state. EvtDeviceSelfManagedIoInit is only
called once for the lifetime of a FDO.

As for the INF advise Robert gave, I would have to disagree. You need
the modems to be in their own device class. You don’t want the parent
FDO to be in the modem device class though. This means you should have
1 INF for the FDO, and another INF for the modem PDOs. The device class
of the INF for the FDO can be anything you want, the PDO’s INF device
class must be the modem device class.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@microsoft.com
Sent: Monday, April 30, 2007 6:23 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] advice on driver implementation

Oops- it occurred to me that you probably want to do the reporting at
EvtPrepareHardware- all the resources are there, an dpower is on, etc.
Doron would of course have better advice…


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

My apologies about the INF advice - the device class issues occurred to me late in the evening (I’ve been focusing on software-only drivers for which I just make up my own class a lot of late), but I decided that by then someone would have corrected me (or it could wait for the morning).

Doron,

There are many pieces of this that I am not clear on.

  1. Do I need to do any of these if I want the modem PDOs.

//
// Note same string is used to initialize hardware id too
//
status = WdfPdoInitAddHardwareID(pDeviceInit, &deviceId);
if (!NT_SUCCESS(status)) {
goto Cleanup;
}

status = WdfPdoInitAddCompatibleID(pDeviceInit, &compatId);
if (!NT_SUCCESS(status)) {
goto Cleanup;
}

status = WdfPdoInitAssignInstanceID(pDeviceInit, &buffer);
if (!NT_SUCCESS(status)) {
goto Cleanup;
}

So I just follow the install for the fake modem in the fakemodem.htm?
Can I just skip the copyfile section in the .inf because I already have the
WDF files and my driver already on the system from the install of my voice
driver PDO on the PCI bus?
To install the bus driver on Windows XP and Windows Server 2003:

1… Double-click the ‘Add Hardware’ wizard in Control Panel.
2… At the ‘Welcome to the Add Hardware Wizard’, click ‘Next’.
3… Select ‘Yes, I have already connected the hardware’, then click Next.
4… Select ‘Add a new hardware device’ from the list, then click Next.
5… Select ‘Install the hardware that I manually select from a
list(Advanced),’ and then click next.
6… Select ‘Modems’, then click Next.
7… Check the box which says “Don’t detect my modems; I will select it
from a list.”, then click Next.
8… Click ‘Have Disk’, make sure that 'A:' is in the “Copy manufacturer’s
files from:” box, and click OK.
9… Click on the desired entry, and then click Next.
10… At ‘The wizard is ready to install your hardware’, click Next.
11… Click Finish at ‘Completing the Add/Remove Hardware Wizard.’
3) I have the PDO created for the modem in the AddDevice call. All the PDO
creation works fine when I try to WdfDeviceCreateSymbolicLink that call
complains with this error. I am calling it with the device handle from the
child PDO create.

//
// MessageId: STATUS_INVALID_DEVICE_STATE
//
// MessageText:
//
// The device is not in a valid state to perform this request.
//
#define STATUS_INVALID_DEVICE_STATE ((NTSTATUS)0xC0000184L)

Ideas?

Thanks,
Greg

“Doron Holan” wrote in message
news:xxxxx@ntdev…
If you have a fixed number of PDOs (5 in this case) regardless of the
hw, adding the PDOs during EvtDriverDeviceAdd is the best place. If you
need to create the PDOs based on hw state/capabilities, do in
EvtDeviceSelfManagedIoInit. EvtDevicePrepareHardware can be called
multiple times (paired with EvtDeviceReleaseHardware) which would mean
you would have to track state. EvtDeviceSelfManagedIoInit is only
called once for the lifetime of a FDO.

As for the INF advise Robert gave, I would have to disagree. You need
the modems to be in their own device class. You don’t want the parent
FDO to be in the modem device class though. This means you should have
1 INF for the FDO, and another INF for the modem PDOs. The device class
of the INF for the FDO can be anything you want, the PDO’s INF device
class must be the modem device class.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@microsoft.com
Sent: Monday, April 30, 2007 6:23 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] advice on driver implementation

Oops- it occurred to me that you probably want to do the reporting at
EvtPrepareHardware- all the resources are there, an dpower is on, etc.
Doron would of course have better advice…


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

  1. you need a hardware ID and an instance ID, you can skip the
    compatible ID

  2. ignore how fakemodem is installed b/c that is a root enumerated
    device. The steps in fakemodem talk about adding a device that the
    machine cannot detect, while your PDOs are detectable devices. When you
    enumerate the modem PDO, you will get a found new hardware popup and
    will be asked for the INF. If you know KMDF is already on the machine,
    then there is no need to specify the kmdf coinstaller again in the modem
    INF.

  3. what symbolic link name are you trying to create? A COM name? If
    so, you don’t use a hardcoded com name, instead, the ports class
    installer will assign you a name. you read this value (“PortName”) out
    of the registry during EvtDevicePrepareHardware and create the symbolic
    link then. You are getting this error b/c the PDO you created is not
    yet a real PDO as recognized by the OS. As such, we cannot query for
    the PDO’s name (which was autogenerated by the OS) until it is a
    recognized PDO

d

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

Doron,

There are many pieces of this that I am not clear on.

  1. Do I need to do any of these if I want the modem PDOs.

//
// Note same string is used to initialize hardware id too
//
status = WdfPdoInitAddHardwareID(pDeviceInit, &deviceId);
if (!NT_SUCCESS(status)) {
goto Cleanup;
}

status = WdfPdoInitAddCompatibleID(pDeviceInit, &compatId);
if (!NT_SUCCESS(status)) {
goto Cleanup;
}

status = WdfPdoInitAssignInstanceID(pDeviceInit, &buffer);
if (!NT_SUCCESS(status)) {
goto Cleanup;
}

So I just follow the install for the fake modem in the fakemodem.htm?
Can I just skip the copyfile section in the .inf because I already have
the
WDF files and my driver already on the system from the install of my
voice
driver PDO on the PCI bus?
To install the bus driver on Windows XP and Windows Server 2003:

1… Double-click the ‘Add Hardware’ wizard in Control Panel.
2… At the ‘Welcome to the Add Hardware Wizard’, click ‘Next’.
3… Select ‘Yes, I have already connected the hardware’, then click
Next.
4… Select ‘Add a new hardware device’ from the list, then click Next.
5… Select ‘Install the hardware that I manually select from a
list(Advanced),’ and then click next.
6… Select ‘Modems’, then click Next.
7… Check the box which says "Don’t detect my modems; I will select it

from a list.", then click Next.
8… Click ‘Have Disk’, make sure that 'A:' is in the “Copy
manufacturer’s
files from:” box, and click OK.
9… Click on the desired entry, and then click Next.
10… At ‘The wizard is ready to install your hardware’, click Next.
11… Click Finish at ‘Completing the Add/Remove Hardware Wizard.’
3) I have the PDO created for the modem in the AddDevice call. All the
PDO
creation works fine when I try to WdfDeviceCreateSymbolicLink that call
complains with this error. I am calling it with the device handle from
the
child PDO create.

//
// MessageId: STATUS_INVALID_DEVICE_STATE
//
// MessageText:
//
// The device is not in a valid state to perform this request.
//
#define STATUS_INVALID_DEVICE_STATE ((NTSTATUS)0xC0000184L)

Ideas?

Thanks,
Greg

“Doron Holan” wrote in message
news:xxxxx@ntdev…
If you have a fixed number of PDOs (5 in this case) regardless of the
hw, adding the PDOs during EvtDriverDeviceAdd is the best place. If you
need to create the PDOs based on hw state/capabilities, do in
EvtDeviceSelfManagedIoInit. EvtDevicePrepareHardware can be called
multiple times (paired with EvtDeviceReleaseHardware) which would mean
you would have to track state. EvtDeviceSelfManagedIoInit is only
called once for the lifetime of a FDO.

As for the INF advise Robert gave, I would have to disagree. You need
the modems to be in their own device class. You don’t want the parent
FDO to be in the modem device class though. This means you should have
1 INF for the FDO, and another INF for the modem PDOs. The device class
of the INF for the FDO can be anything you want, the PDO’s INF device
class must be the modem device class.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@microsoft.com
Sent: Monday, April 30, 2007 6:23 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] advice on driver implementation

Oops- it occurred to me that you probably want to do the reporting at
EvtPrepareHardware- all the resources are there, an dpower is on, etc.
Doron would of course have better advice…


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

Doron may be a bit late today- but I believe I can answer those questions for you.

  1. You probably don’t need the compatible IDs [unless you want some other modem driver to install on your stack for some reason]. You do want a Hardware ID so you can use it in your modem’s INF file. Then plug-and-play will install the modem drivers for you. Instance IDs you also want- for one thing that lets you know which modem is on which PDO, if nothing else (the device ID is a combo of HW ID and Instance ID, with some additional instance glue added by the OS in most cases where multiple instances of a bus can exist).

  2. The modem devices will be installed by plug and play- you do not need nor want the Add Hardware Wizard. It should all work when you plug in the device as long as both packages (INFs, drivers, and catalog) are there. You should include the coinstaller copyfiles directive and the associated sections in both INFs.

  3. You should be calling that DDI from the modem FDO, not the PDO.

Also, just to make sure I didn’t misunderstand- the bus driver function / static child list is taking place inside the VOICE driver.

I am getting this error when I try to load my .inf.

This device is not configured correctly. (Code 1).

I looked this up on the MSDN site and the explanation did not give me enough
info to help. Is there a way to get more information about what it wants or
does not want? I ran it through chkinf and that did not help.

I noticed in the WDK doc on .inf “(exceptions are INF files for modems and
display monitors)” that I might not need DDInstall.Services Section ,but
that was not the issue.

Ideas?

[Version]
Signature=“$WINDOWS NT$”
Class=Modem
ClassGUID={4D36E96D-E325-11CE-BFC1-08002BE10318}
Provider=%Mfg%
DriverVer=04/30/2007,6.0.6000.16386

;INF files that are not distributed with the OS should contain the following
line:
CatalogFile=KmdfSamples.cat

;INF files that are to be distributed with the OS that load a service and or
files on the CD, should contain the following line:
;Layoutfile=layout.inf

;----------------------------------------------------------------------------------------------------------------------------;
Below is list of manufacturers that will appear in the
; Install New Modem wizard’s list of manufacturers as well as define what
sections to install ID’s from
; The vendor will be required to change the provider key before a
; driver submission is made

[Manufacturer]
%Generic% = Generic,NTx86

;-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
;This section references the INF-writer-defined DDInstall and
DDInstall.Services sections for the Modem device, and specifies the hardware
identifier for the Modem device.

; Following section is meant for Windows 2000 as it
; cannot parse decorated model sections
[Generic]
%ModemX% = ModemX, {4D36E96D-E325-11CE-BFC1-08002BE10318}\fakemodem

; Decorated model section take precedence over undecorated
; ones on XP and later.
[Generic.NTx86]
%ModemX% = ModemX, {4D36E96D-E325-11CE-BFC1-08002BE10318}\fakemodem

;-------------------------------------------------------------------------------------------------------
; For detailed explanation of DDInstall.Services section, please reference
DDK.
; Installation section references other INF sections to be installed for a
specific modem.
; The AddReg line points to sections of the INF file that list registry
entries to be added when
; installing this modem. For example, the line below instructs the
installer to add the registry
; entries listed in the following sections of this INF file:
; [All], [MfgAddReg], [ExtraCRLFResponses], [ModemX.AddReg], [INTERNAL]
; It is not necessary to break up the registry additions into different
sections in the
; INF. However, breaking out common entries into sections can help to
reduce the size of
; the INF if multiple modems are installed from the same INF and have common
registry
; entries.

[ModemX.NT]
CopyFiles = CopyFileSection
AddReg = All, MfgAddReg, ExtraCRLFResponses, ModemX.AddReg, INTERNAL

;[ModemX.NT.Services]
AddService = wdfdio, 0x00000000, FakeModm_Service_Inst,
FakeModm_Logging_Inst

;[ModemX.NT.HW]
;AddReg = LowerFilterAddReg

;[LowerFilterAddReg]
;HKR,“LowerFilters”,0x00010000,fakemdm

[FakeModm_Service_Inst]
DisplayName = %ModemX%
ServiceType = 1
StartType = 3
ErrorControl = 0
ServiceBinary = %12%\wdfdio.sys

;--------------------------------------------------------------------------------------------------------------------
; An event-log-install-section

[FakeModm_Logging_Inst]
AddReg = FakeModm_Logging_Inst_AddReg

[FakeModm_Logging_Inst_AddReg]
HKR,EventMessageFile,0x00020000,“%%SystemRoot%%\System32\IoLogMsg.dll;%%SystemRoot%%\System32\drivers\wdfdio.sys”
HKR,TypesSupported,0x00010001,7

[SourceDisksNames]
99=%FakeDisk%, disk1,“”

[SourceDisksFiles]
wdfdio.sys = 99

;-------------------------------------------------------------------------------------------------------------------
; Section used to copy files required for device to function

[CopyFileSection]
wdfdio.sys

;--------------------------------------------------------------------------------------------------------------------------
; This section lists the Default location to copy the files listed in the
copyfiles directive
; 12 = %Windows%\System32\Drivers

[DestinationDirs]
CopyFileSection=12
DefaultDestDir=12

“Doron Holan” wrote in message
news:xxxxx@ntdev…
1) you need a hardware ID and an instance ID, you can skip the
compatible ID

2) ignore how fakemodem is installed b/c that is a root enumerated
device. The steps in fakemodem talk about adding a device that the
machine cannot detect, while your PDOs are detectable devices. When you
enumerate the modem PDO, you will get a found new hardware popup and
will be asked for the INF. If you know KMDF is already on the machine,
then there is no need to specify the kmdf coinstaller again in the modem
INF.

3) what symbolic link name are you trying to create? A COM name? If
so, you don’t use a hardcoded com name, instead, the ports class
installer will assign you a name. you read this value (“PortName”) out
of the registry during EvtDevicePrepareHardware and create the symbolic
link then. You are getting this error b/c the PDO you created is not
yet a real PDO as recognized by the OS. As such, we cannot query for
the PDO’s name (which was autogenerated by the OS) until it is a
recognized PDO

d

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

Doron,

There are many pieces of this that I am not clear on.

1) Do I need to do any of these if I want the modem PDOs.

//
// Note same string is used to initialize hardware id too
//
status = WdfPdoInitAddHardwareID(pDeviceInit, &deviceId);
if (!NT_SUCCESS(status)) {
goto Cleanup;
}

status = WdfPdoInitAddCompatibleID(pDeviceInit, &compatId);
if (!NT_SUCCESS(status)) {
goto Cleanup;
}

status = WdfPdoInitAssignInstanceID(pDeviceInit, &buffer);
if (!NT_SUCCESS(status)) {
goto Cleanup;
}

2)
So I just follow the install for the fake modem in the fakemodem.htm?
Can I just skip the copyfile section in the .inf because I already have
the
WDF files and my driver already on the system from the install of my
voice
driver PDO on the PCI bus?
To install the bus driver on Windows XP and Windows Server 2003:

1… Double-click the ‘Add Hardware’ wizard in Control Panel.
2… At the ‘Welcome to the Add Hardware Wizard’, click ‘Next’.
3… Select ‘Yes, I have already connected the hardware’, then click
Next.
4… Select ‘Add a new hardware device’ from the list, then click Next.
5… Select ‘Install the hardware that I manually select from a
list(Advanced),’ and then click next.
6… Select ‘Modems’, then click Next.
7… Check the box which says “Don’t detect my modems; I will select it

from a list.”, then click Next.
8… Click ‘Have Disk’, make sure that 'A:' is in the “Copy
manufacturer’s
files from:” box, and click OK.
9… Click on the desired entry, and then click Next.
10… At ‘The wizard is ready to install your hardware’, click Next.
11… Click Finish at ‘Completing the Add/Remove Hardware Wizard.’
3) I have the PDO created for the modem in the AddDevice call. All the
PDO
creation works fine when I try to WdfDeviceCreateSymbolicLink that call
complains with this error. I am calling it with the device handle from
the
child PDO create.

//
// MessageId: STATUS_INVALID_DEVICE_STATE
//
// MessageText:
//
// The device is not in a valid state to perform this request.
//
#define STATUS_INVALID_DEVICE_STATE ((NTSTATUS)0xC0000184L)

Ideas?

Thanks,
Greg

“Doron Holan” wrote in message
news:xxxxx@ntdev…
If you have a fixed number of PDOs (5 in this case) regardless of the
hw, adding the PDOs during EvtDriverDeviceAdd is the best place. If you
need to create the PDOs based on hw state/capabilities, do in
EvtDeviceSelfManagedIoInit. EvtDevicePrepareHardware can be called
multiple times (paired with EvtDeviceReleaseHardware) which would mean
you would have to track state. EvtDeviceSelfManagedIoInit is only
called once for the lifetime of a FDO.

As for the INF advise Robert gave, I would have to disagree. You need
the modems to be in their own device class. You don’t want the parent
FDO to be in the modem device class though. This means you should have
1 INF for the FDO, and another INF for the modem PDOs. The device class
of the INF for the FDO can be anything you want, the PDO’s INF device
class must be the modem device class.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@microsoft.com
Sent: Monday, April 30, 2007 6:23 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] advice on driver implementation

Oops- it occurred to me that you probably want to do the reporting at
EvtPrepareHardware- all the resources are there, an dpower is on, etc.
Doron would of course have better advice…


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

>>
If you know KMDF is already on the machine,
then there is no need to specify the kmdf coinstaller again in the modem
INF.
<<

While this is true in terms of a working installation, I don’t myself think it’s a best practice, which is why I said otherwise. For one, it just strikes me as a line of thinking that eventually leads to problems a simple bit of discipline could have avoided.

It also makes it harder to use at least one of our (now in beta) tools if you install a KMDF driver without the assistance of the coinstaller.

WdfVerifier will not be able to remotely administer verifier settings (and eventually other debugging-related tasks) for these drivers, unless:

(1) you have already run it on the machine itself, in which case it finds the drivers by binary inspection and adds a Parameters\Wdf key to their associated services.
(2) your INF file uses an AddReg directive itself to add this key.

IMO, this isn’t a question of “good” vs “bad” practice- more “good” and “better”.

You don’t want the line [ModemX.NT.Services] commented out. No driver will install without it.

I see that issue. I left that ; in when I was trying to comment it out to
get it to work. It gets the same error with the line back in. I am just
trying any and all things to try and get to work. I am not familar with how
to make the .infs work for this more complex type of driver.

This .inf is mostly from the fakemodem.inf example.

Any other ideas? Or is there a way to get Windows to give me more info so I
can debug this?

“Bob Kjelgaard” wrote in message
news:xxxxx@ntdev…
You don’t want the line [ModemX.NT.Services] commented out. No driver will
install without it.

Check %windir%\setupapi.log (anything pre-Vista) or %windir%\inf\setupapi.dev.log (Vista). There are some registry settings you can use to make the logs even more verbose than they already are. There’s more on this on MSDN, but this can get you started if you need to do that.

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup

Setting it to 0xFFFF will tell you more than you probably ever want to know (except maybe, “what did I do wrong?”- still have to figure that out yourself)…

Problems like this usually can be solved without modifying that key, though. Look at the end of the file and work your way back until you find your hardware ID, then look at the error messages emitted.

Sorry to be such a goofball- left out the Value name- it is"LogLevel".

Definitely time to go home and unwind…

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

Check %windir%\setupapi.log (anything pre-Vista) or %windir%\inf\setupapi.dev.log (Vista). There are some registry settings you can use to make the logs even more verbose than they already are. There’s more on this on MSDN, but this can get you started if you need to do that.

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup

Setting it to 0xFFFF will tell you more than you probably ever want to know (except maybe, “what did I do wrong?”- still have to figure that out yourself)…

Problems like this usually can be solved without modifying that key, though. Look at the end of the file and work your way back until you find your hardware ID, then look at the error messages emitted.

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.

Would it be easier if I made a fake COM port instead of a fake modem? How
would I do that?

I think I am going home now also and pound some bamboo under my fingernails.