HOWTO: Mark a Device Configured Through VendorInstaller DLL

Last reviewed: October 21, 1997
Article ID: Q175419
The information in this article applies to:
  • Windows 95 Device Driver Kit (DDK), version 4.0

SUMMARY

The registry key for the device being called is passed to the VendorInstaller code on its command line. A VendorInstaller should mark the devnode key as configured. The sample code below describes how to mark the devnode configured.

MORE INFORMATION

Sample Code

   extern "C" VOID PASCAL  ScheduleInstallation(HWND hwndParent,
                               HINSTANCE hDllInst,
                               LPSTR lpstrCmdLine, int nCmdShow)
   {
       HKEY                  hkPlugNPlay;
       DWORD                 dw0 = 0;

       /*
       We now truncate lpstrCmdLine so it holds just the registry key we
       need.
       */

       for   (LPSTR lpstrSource = lpstrCmdLine;
              *lpstrSource && *lpstrSource != ' ';
              lpstrSource++)
       ;
       if    (*lpstrSource)  *lpstrSource++ ='\0';

       if    (ERROR_SUCCESS != RegOpenKey(HKEY_LOCAL_MACHINE, lpstrCmdLine,
                 &hkPlugNPlay))
       {
         return;
       }

       if    (*lpstrSource) *(--lpstrSource) = ' ';  //  restore the blank

       //    We must mark as installed now, so we don't do all
       //    this once more in the event of a reboot.

       RegSetValueEx(hkPlugNPlay, "ConfigFlags", 0, REG_BINARY, (LPBYTE)
           &dw0, sizeof DWORD);
       RegCloseKey(hkPlugNPlay);

       BeginInstallation(hwndParent, hDllInst, lpstrCmdLine, nCmdShow);
       return;
   }
Keywords          : ntddkprnt
Version           : WINDOWS:4.0
Platform          : WINDOWS
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 21, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.