From: Uwe Sieber Uwe on

I need a PPP connection thru a COM port.
Going thru the New Connection Wizard and selecting
a COM port, XP installs a new modem "Communications cable
between two computers" which is then used by a new
"Direct" RAS connection.

Setting up the RAS connection was easy by means
of RasSetEntryProperties.

But how to install the "Communications cable
between two computers" modem without user interaction?

I've found an answer in the InstallFAQ.doc document, under
"What is a root-enumerated driver and how do I install one
programmatically?"
http://www.microsoft.com/whdc/driver/install/installfaq.mspx

I have done a told there:
1. Call SetupDiCreateDeviceInfoList to create an HDEVINFO handle.
2. Call SetupDiCreateDeviceInfo with the ClassGuid of the devnode you
want to create to create a SP_DEVINFO_DATA.
3. Call SetupDiSetDeviceRegistryProperty with SPDRP_HARDWAREID on
the HDEVINFO and SP_DEVINFO_DATA to give your device a
hardware ID.
4. Call SetupDiCallClassInstaller with DIF_REGISTERDEVICE to register
your device.
5. Call UpdateDriverForPlugAndPlayDevices with the INF containing the
driver for the device and the hardware ID used in step 3 to install
drivers on the devnode.

UpdateDriverForPlugAndPlayDevices fails with ERROR_NO_SUCH_DEVINST unless
there was already a PNPC031 device installed which drivers it can
update.

Here is my simple test project:
http://www.uwe-sieber.de/temp/installmodem.zip

Any hints?


Uwe



















From: Pavel A. on
> UpdateDriverForPlugAndPlayDevices fails with ERROR_NO_SUCH_DEVINST unless
> there was already a PNPC031 device installed which drivers it can
> update.

So, need to install PNPC031 first?

-- pa

"Uwe Sieber" <Uwe Sieber(a)discussions.microsoft.com> wrote in message
news:E755D2A5-3BA4-4326-9E10-109C837A56B6(a)microsoft.com...
>
> I need a PPP connection thru a COM port.
> Going thru the New Connection Wizard and selecting
> a COM port, XP installs a new modem "Communications cable
> between two computers" which is then used by a new
> "Direct" RAS connection.
>
> Setting up the RAS connection was easy by means
> of RasSetEntryProperties.
>
> But how to install the "Communications cable
> between two computers" modem without user interaction?
>
> I've found an answer in the InstallFAQ.doc document, under
> "What is a root-enumerated driver and how do I install one
> programmatically?"
> http://www.microsoft.com/whdc/driver/install/installfaq.mspx
>
> I have done a told there:
> 1. Call SetupDiCreateDeviceInfoList to create an HDEVINFO handle.
> 2. Call SetupDiCreateDeviceInfo with the ClassGuid of the devnode you
> want to create to create a SP_DEVINFO_DATA.
> 3. Call SetupDiSetDeviceRegistryProperty with SPDRP_HARDWAREID on
> the HDEVINFO and SP_DEVINFO_DATA to give your device a
> hardware ID.
> 4. Call SetupDiCallClassInstaller with DIF_REGISTERDEVICE to register
> your device.
> 5. Call UpdateDriverForPlugAndPlayDevices with the INF containing the
> driver for the device and the hardware ID used in step 3 to install
> drivers on the devnode.
>
> UpdateDriverForPlugAndPlayDevices fails with ERROR_NO_SUCH_DEVINST unless
> there was already a PNPC031 device installed which drivers it can
> update.
>
> Here is my simple test project:
> http://www.uwe-sieber.de/temp/installmodem.zip
>
> Any hints?
>
>
> Uwe
>


From: Uwe Sieber on


"Pavel A." wrote:

> > UpdateDriverForPlugAndPlayDevices fails with ERROR_NO_SUCH_DEVINST unless
> > there was already a PNPC031 device installed which drivers it can
> > update.
>
> So, need to install PNPC031 first?

What exactly you mean with "install"?
Enum\Root\PNPC031\0000 is created when calling DIF_REGISTERDEVICE.

Calling
SetupDiInstallDevice(DeviceInfoSet, &DeviceInfoData);
returns ERROR_NO_ASSOCIATED_SERVICE.

Successfully calling DIF_SELECTDEVICE and DIF_INSTALLDEVICEFILES before
SetupDiInstallDevice make it return ERROR_DEVINFO_NOT_REGISTERED.


Thanks,

Uwe



From: Pavel A. on
"Uwe Sieber" <UweSieber(a)discussions.microsoft.com> wrote in message
news:8ACA7D07-9865-4DC5-BB49-F16177D674CB(a)microsoft.com...
>
>
> "Pavel A." wrote:
>
>> > UpdateDriverForPlugAndPlayDevices fails with ERROR_NO_SUCH_DEVINST
>> > unless
>> > there was already a PNPC031 device installed which drivers it can
>> > update.
>>
>> So, need to install PNPC031 first?
>
> What exactly you mean with "install"?
> Enum\Root\PNPC031\0000 is created when calling DIF_REGISTERDEVICE.

IIRC, modem drivers are filters of physical port devices (serial or other).
If the port device has not been correctly installed, chances that the filter
will successfully install on it are slim.
Now, it looks that the "Communications cable" is a special case, since it
is
installed not as modem, from the modem control panel, but from the network
connections.
And, the modem driver is installed not on the physical com port, but on some
special "Root modem" device - PNPC031 - which is somehow mapped onto
the real com port device.
So it looks like some trickery of the modem class installer and network
installer.

Maybe it would be easier to install a similar null modem directly on the
physical com port, without the "root modem", and then configure it for
network usage.

Regards,
Pavel

> Calling
> SetupDiInstallDevice(DeviceInfoSet, &DeviceInfoData);
> returns ERROR_NO_ASSOCIATED_SERVICE.
>
> Successfully calling DIF_SELECTDEVICE and DIF_INSTALLDEVICEFILES before
> SetupDiInstallDevice make it return ERROR_DEVINFO_NOT_REGISTERED.
>
>
> Thanks,
>
> Uwe
>
>
>