CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    10

    Network Adapter API

    So I am installing a driver for a USB network adapter. Is there a similar set of API's to uninstall a network adapter like printers. For example DeletePrinterDriverEx, is there a DeleteNetworkDriverEx somewhere? I haven't had luck finding anything.

  2. #2
    Join Date
    Mar 2009
    Location
    Riga, Latvia
    Posts
    128

    Re: Network Adapter API

    How about using a console?

    Try to execute:
    Code:
    net use [drive] /delete /yes
    via WinExec()

    Source:
    http://support.microsoft.com/kb/308582

  3. #3
    Join Date
    Aug 2009
    Posts
    10

    Re: Network Adapter API

    It's not a network drive. It is a device that uses a network adapter to act like a network device. Almost like installing a printer as a network printer but it connects via USB for example. When it is installed it shows up in the Device Manager as a Network Adapter.

  4. #4
    Join Date
    Aug 2009
    Posts
    10

    Re: Network Adapter API

    So I did an EnumServiceStatus and found the driver service. But just doind a DeleteService wont uninstall the driver will it? Thanks for all the help...
    Last edited by rjbez; August 6th, 2009 at 03:40 PM. Reason: different question.

  5. #5
    Join Date
    Nov 2003
    Posts
    1,902

  6. #6
    Join Date
    Aug 2009
    Posts
    10

    Re: Network Adapter API

    I need something that will be packaged into an application that is going to uninstall the entire driver. DevCon says it is to only be used for debugging purposes...I'm looking for something that is standard in the WDK/SDK (VS). If you do:

    OpenSCManager
    EnumServiceStats (SERVICE_DRIVER)
    OpenService
    QueryServiceStatus(service, &status);
    ControlService(service, SERVICE_CONTROL_STOP, &status);
    DeleteService(service);

    will it 'uninstall' the driver service or just delete it from the services list? Is this a safe way to does this?

  7. #7
    Join Date
    Nov 2003
    Posts
    1,902

    Re: Network Adapter API

    Note The source code for DevCon is also available in the Windows DDK (which is available from http://www.microsoft.com/whdc/devtools/ddk/default.mspx (http://www.microsoft.com/whdc/devtools/ddk/default.mspx) ) under DDK root\Src\Setup\Devcon, along with documentation.
    gg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured