Re: Is C# support load device driver?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Steve (Steve_at_discussions.microsoft.com)
Date: 09/24/04


Date: Fri, 24 Sep 2004 15:27:01 -0700

All,

Thanks for the help about this issue.

Willy,

I think you answer my question, for I am new in C#, I will try figure out
how to implement based on your suggestion, really appreciated.

"Willy Denoyette [MVP]" wrote:

>
> "Steve" <Steve@discussions.microsoft.com> wrote in message
> news:D41C68E4-D18C-4556-B36A-F2C8B86297CD@microsoft.com...
> > Yes, before DeviceIOControl, use CreateFile to get a handle.
> > if not support load driver in C#, is anyone know the dllentry for
> > GetServiceName
> > DriverInstall
> > DriverStart
> > For I only found OpenSCManager from MSDN
> > [DllImport("advapi32.dll")]
> > int SCManager = OpenSCManager(null, null, SC_MANAGER_ALL_ACCESS);
> >
>
>
> Drivers are no different than services in Windows, they are controled
> (loaded, unloaded etc..) by the SCM, but before you can do this they need to
> be installed/registered into the SC database (Registry). You can do this
> from C# using the System.Management classes (and the WMI class
> Win32_BaseService).
> First you have to create a Win32_BaseService class describing your driver
> (supplying stuff like PathName="\Mydrivers\MyDriver.sys") by calling
> "Create" on the Win32_BaseService WMI Class.
> Once you have this (registration) done you can call any of the methods like
> "StartService", "StopService", "ChangeService" on an instance of this WMI
> class.
>
> Willy.
>
>
>



Relevant Pages

  • IRC Packets being generated. Dont know where from...
    ... *Registry value not found* ... Autorun entries from Registry: ... Enumerating ICQ Agent Autostart apps: ... RAS Asynchronous Media Driver: System32\DRIVERS\asyncmac.sys (manual ...
    (microsoft.public.security.virus)
  • hijack this startup - can someone tell me the hack i am experienci
    ... *Registry value not found* ... Enumerating ICQ Agent Autostart apps: ... Intel82801 Audio Driver Install Service: ... Application Management: %SystemRoot%\system32\svchost.exe -k netsvcs (manual ...
    (microsoft.public.windowsxp.security_admin)
  • Re: BSOD Error 0x000000B8
    ... *Registry value not found* ... Enumerating ICQ Agent Autostart apps: ... ADI UAA Function Driver for High Definition Audio Service: ... Application Management: %SystemRoot%\system32\svchost.exe -k netsvcs ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: DVD/RW Gone!!!
    ... Start Registry Editor. ... consult with the software vendor for assistance. ... > Get Windows XP Service Pack 2 with Advanced Security Technologies: ... > | load the device driver for this hardware. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Replacements for corrupted ATAPI drivers
    ... > say that the driver is corrupted. ... > that it uses the windows drivers. ... Do NOT be afraid of the registry hack here. ... Select 'Windows Utilities' and scroll down to 'Restore CD/DVD drives to ...
    (microsoft.public.windowsxp.general)