Microsoft KB Archive/169580: Difference between revisions

From BetaArchive Wiki
m (Text replacement - "<" to "<")
m (Text replacement - ">" to ">")
 
Line 76: Line 76:
<br />
<br />
DIREG_DEV<br />
DIREG_DEV<br />
Create a hardware registry key for the device. This is a key that exists in the \\HKLM\\ENUM branch specified by lpdi-&gt;lpszRegSubkey. If lpdi-&gt;lpszRegSubkey is NULL, then the key will be created in \\HKLM\\ENUM\\ROOT\\lpdi-&gt;szClassName.<br />
Create a hardware registry key for the device. This is a key that exists in the \\HKLM\\ENUM branch specified by lpdi->lpszRegSubkey. If lpdi->lpszRegSubkey is NULL, then the key will be created in \\HKLM\\ENUM\\ROOT\\lpdi->szClassName.<br />
<br />
<br />
DIREG_DRV<br />
DIREG_DRV<br />
Create a software, or driver, registry key for the device. This is a key that is in \\HKLM\\System\\CurrentControlSet\\Services\\Class\\ lpdi-&gt;szClassName.
Create a software, or driver, registry key for the device. This is a key that is in \\HKLM\\System\\CurrentControlSet\\Services\\Class\\ lpdi->szClassName.


The sample will accept several command line arguments:<br />
The sample will accept several command line arguments:<br />
<br />
<br />
Ipinst [-a[idstring]] [-<h|?&gt;] [-f<logfile&gt;] [-m[d|idstring]] [- p<COM1|COM2&gt;] [-r] [-s] [-v]<br />
Ipinst [-a[idstring]] [-<h|?>] [-f<logfile>] [-m[d|idstring]] [- p<COM1|COM2>] [-r] [-s] [-v]<br />
<br />
<br />
-a[PnP ID String]<br />
-a[PnP ID String]<br />
Line 89: Line 89:
Install adapter. A PnP ID String can be specified. If no adapter is specified or detected, the user must select one.<br />
Install adapter. A PnP ID String can be specified. If no adapter is specified or detected, the user must select one.<br />
<br />
<br />
-f<log file name&gt;<br />
-f<log file name><br />
<br />
<br />
Specify a log file. If the log file name is NULL, then the default is Ipdetect.txt.<br />
Specify a log file. If the log file name is NULL, then the default is Ipdetect.txt.<br />
<br />
<br />
-<h|?&gt;<br />
-<h|?><br />
<br />
<br />
Display usage information.<br />
Display usage information.<br />
Line 101: Line 101:
Install modem. A PnP ID or Unimodem String can be specified. If no modem is specified or detected, the Modem Wizard is invoked.<br />
Install modem. A PnP ID or Unimodem String can be specified. If no modem is specified or detected, the Modem Wizard is invoked.<br />
<br />
<br />
-p<COM1|COM2&gt;<br />
-p<COM1|COM2><br />
<br />
<br />
Attach modem to COM1 or COM2. The default is COM1. This is to be used with the 'm' option to attach the installed modem to the specified port. This is mainly for legacy modems with valid Unimodem ID's.<br />
Attach modem to COM1 or COM2. The default is COM1. This is to be used with the 'm' option to attach the installed modem to the specified port. This is mainly for legacy modems with valid Unimodem ID's.<br />

Latest revision as of 19:42, 20 July 2020

HOWTO: Install Networking Components Programmatically

Q169580



The information in this article applies to:


  • Microsoft Win32 Device Driver Kit (DDK) Windows 95





SUMMARY

Many cutting-edge software products require Internet or network access. Therefore, installation applications need to verify that critical networking components are installed, and possibly initiate installation of these components when necessary. Programmatic detection and installation of networking components can be accomplished using a 16-bit protected mode Setup API on Windows 95. This API is documented in DevInst.Doc in the Win95 DDK.



MORE INFORMATION

DevInst.doc, from the Windows 95 DDK, documents the Setup API itself and the parameters for each API call without illuminating any of the implementation details for installing a device. You can download a sample MFC application from the Microsoft Software Library or from the Microsoft OEM/IHV DDK home page at:

http://msdn.microsoft.com/support/

Follow the links to the WinDDK Samples page. The sample is a MSVC 1.52 MFC application. You should not try to install PCMCIA or PCI devices with this application. These devices are installed when they are inserted for the first time or during boot time. The sample makes use of DiCreateDevRegKey:


   RETERR DiCreateDevRegKey( LPDEVICEINFO lpdi,
                             LPHKEY       lphKey,
                             HINF         hInf,
                             LPCSTR       lpszInfSection,
                             int          iFlags ) 


Create a unique registry key under the class of the associated device.

It returns OK if it has been successful; otherwise, an ERR_DI_xxx error code will be returned. If the return is OK, the lphKey will point to a valid handle to the created key. It is the caller's responsibility to close the returned registry key.

lpdi


  • Pointer to a DEVICE_INFO structure for a device that is being installed.

lphKey


  • Pointer to receive the address of the created registry key handle.

hInf


  • Handle to an opened INF file. hInf and lpszInfSection are rarely used. These would be necessary only if some special information had to be added to the registry when the key is first created.

lpcInfSection


  • Section of the INF file to be executed using the newly-created registry key.

iFlags


  • Indicates which type of registry key to create:


DIREG_DEV
Create a hardware registry key for the device. This is a key that exists in the \\HKLM\\ENUM branch specified by lpdi->lpszRegSubkey. If lpdi->lpszRegSubkey is NULL, then the key will be created in \\HKLM\\ENUM\\ROOT\\lpdi->szClassName.

DIREG_DRV
Create a software, or driver, registry key for the device. This is a key that is in \\HKLM\\System\\CurrentControlSet\\Services\\Class\\ lpdi->szClassName.

The sample will accept several command line arguments:

Ipinst [-a[idstring]] [-<h|?>] [-f<logfile>] [-m[d|idstring]] [- p<COM1|COM2>] [-r] [-s] [-v]

-a[PnP ID String]

Install adapter. A PnP ID String can be specified. If no adapter is specified or detected, the user must select one.

-f<log file name>

Specify a log file. If the log file name is NULL, then the default is Ipdetect.txt.

-<h|?>

Display usage information.

-m[d|Modem PnP String|Unimodem ID String]

Install modem. A PnP ID or Unimodem String can be specified. If no modem is specified or detected, the Modem Wizard is invoked.

-p<COM1|COM2>

Attach modem to COM1 or COM2. The default is COM1. This is to be used with the 'm' option to attach the installed modem to the specified port. This is mainly for legacy modems with valid Unimodem ID's.

-r

Install remote networking. This includes RNA, Dial Up Adapter, and related RAS components.

-s

Show application. By default, the application runs hidden. The application will show up on the desktop only if the 's', 'h' or '?' options are used.

-v

Emit verbose messages to logfile. The contents of the logfile show up on the document client area when the application is visible.



REFERENCES

DDpr.Hlp, DevInst.Doc, Network.Doc

Additional query words:

Keywords : kbnetwork kbsetup kbAPI kbRAS kbSDKPlatform kbGrpDSNet
Issue type : kbhowto
Technology : kbAudDeveloper kbWin95search kbWinDDKSearch kbWin32sSearch kbWin32DDK95 kbWin32DDKSearch


Last Reviewed: November 11, 1999
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.