Problem with SetupDiCreateDerviceInfo on Win98/ME

I’m trying to make an installer for a root-enumerated driver that I’ve
built. The installer.exe example in the DDK will work quite nicely to load
the driver on W2K and XP.

But I also need to load this device on 98/ME. The driver in fact works just
fine on these operating systems if I install it using the Add New Hardware
applet, so I know the driver works on these systems.

However, when I run the installer.exe program, SetupDiCreateDerviceInfo
fails with error 0xd “The data is invalid”. This is a standard error code
and not a setup error code, and isn’t documented as one of the likely
returns from this function. I’ve tried playing with all of the parameters
to the function in every way I can think of, and can’t make the error go
away or change into much of anything else. I’m obviously missing something
basic, but I have no idea what.

If it makes a difference, the driver is actually a KS driver that opens a
USB serial port driver to convert from/to Serial to MIDI data. So the
device class is Media. I’ve validated that I have the class name right and
the guid right. (This probably ought to be a software enumerated driver
rather than a root driver, but I’ve been able to find any documentation on
how to install a sw KS Audio driver; and it works as a root driver.)

A second problem I’m going to hit once I get past this one is that
UpdateDriverForPlugAndPlayDevices doesn’t exist on Win98. I assume that I
should probably try using SetupDiInstallDevice instead? However, I still
would seem to need the results from SetupDiCreateDeviceInfo to make this
work. Or is there a better way?

Thanks for any and all suggestions!

Loren

Hi Loren,

         To make portable driver installer use Configuration managre interfaces.

Good Luck,



From: “Loren Wilton”

>Reply-To: “NT Developers Interest List”
>To: “NT Developers Interest List”
>Subject: [ntdev] Problem with SetupDiCreateDerviceInfo on Win98/ME
>Date: Sun, 4 May 2003 20:02:47 -0700
>
>I’m trying to make an installer for a root-enumerated driver that I’ve
>built. The installer.exe example in the DDK will work quite nicely to load
>the driver on W2K and XP.
>
>But I also need to load this device on 98/ME. The driver in fact works just
>fine on these operating systems if I install it using the Add New Hardware
>applet, so I know the driver works on these systems.
>
>However, when I run the installer.exe program, SetupDiCreateDerviceInfo
>fails with error 0xd “The data is invalid”. This is a standard error code
>and not a setup error code, and isn’t documented as one of the likely
>returns from this function. I’ve tried playing with all of the parameters
>to the function in every way I can think of, and can’t make the error go
>away or change into much of anything else. I’m obviously missing something
>basic, but I have no idea what.
>
>If it makes a difference, the driver is actually a KS driver that opens a
>USB serial port driver to convert from/to Serial to MIDI data. So the
>device class is Media. I’ve validated that I have the class name right and
>the guid right. (This probably ought to be a software enumerated driver
>rather than a root driver, but I’ve been able to find any documentation on
>how to install a sw KS Audio driver; and it works as a root driver.)
>
>A second problem I’m going to hit once I get past this one is that
>UpdateDriverForPlugAndPlayDevices doesn’t exist on Win98. I assume that I
>should probably try using SetupDiInstallDevice instead? However, I still
>would seem to need the results from SetupDiCreateDeviceInfo to make this
>work. Or is there a better way?
>
>Thanks for any and all suggestions!
>
> Loren
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Visit Latin America. Discover! Explore! Experience it!

Loren Wilton wrote:

However, when I run the installer.exe program, SetupDiCreateDerviceInfo
fails with error 0xd “The data is invalid”. This is a standard error code
and not a setup error code, and isn’t documented as one of the likely
returns from this function. I’ve tried playing with all of the parameters
to the function in every way I can think of, and can’t make the error go
away or change into much of anything else. I’m obviously missing something
basic, but I have no idea what.

I think the basic problem you’re having is that 98/Me setup programs
have to be 16-bit. There seems to be just enough of the setupapi.dll API
present to support enumeration of registered interfaces.

I managed to cobble together a 16-bit version of my FASTINST utility by
trial and error. The source code is on the disc that accompanies my WDM
book. IIRC, someone from Microsoft recently posted, on one of the kernel
programming newsgroups, a sample of code that uses the 16-bit APIs too
– I thought I printed this out so I could refer to it forever, but I
seem to have forgotten which stack of paper I put the printout in.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com

I do this using a 16-bit installer program. In a nutshell, it calls:

  • DiCreateDeviceInfo
  • DiBuildClassDrvList
  • DiCallClassInstaller on the correct device in the list
  • DiDestroyDeviceInfoList

There are some other picky details, such as handling the .inf file
location of you don’t want the end-user prompted for a disk, and making
sure the inf is included in the device info database.

I just kind of figured this out on my own; I don’t know if there is an
officially-blessed way to do this.

-sd

On Mon, 2003-05-05 at 05:08, Walter Oney wrote:

Loren Wilton wrote:
> However, when I run the installer.exe program, SetupDiCreateDerviceInfo
> fails with error 0xd “The data is invalid”. This is a standard error code
> and not a setup error code, and isn’t documented as one of the likely
> returns from this function. I’ve tried playing with all of the parameters
> to the function in every way I can think of, and can’t make the error go
> away or change into much of anything else. I’m obviously missing something
> basic, but I have no idea what.

I think the basic problem you’re having is that 98/Me setup programs
have to be 16-bit. There seems to be just enough of the setupapi.dll API
present to support enumeration of registered interfaces.

I managed to cobble together a 16-bit version of my FASTINST utility by
trial and error. The source code is on the disc that accompanies my WDM
book. IIRC, someone from Microsoft recently posted, on one of the kernel
programming newsgroups, a sample of code that uses the 16-bit APIs too
– I thought I printed this out so I could refer to it forever, but I
seem to have forgotten which stack of paper I put the printout in.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com


You are currently subscribed to ntdev as: xxxxx@positivenetworks.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


Steve Dispensa
Chief Technology Officer
Positive Networks, Inc.