Re: Is C# support load device driver?
From: Steve (Steve_at_discussions.microsoft.com)
Date: 09/24/04
- Next message: John Price: "Re: Fastest way to search text file for string"
- Previous message: Steve Teeples: "communicate with progressbar"
- In reply to: Willy Denoyette [MVP]: "Re: Is C# support load device driver?"
- Next in thread: Willy Denoyette [MVP]: "Re: Is C# support load device driver?"
- Reply: Willy Denoyette [MVP]: "Re: Is C# support load device driver?"
- Messages sorted by: [ date ] [ thread ]
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.
>
>
>
- Next message: John Price: "Re: Fastest way to search text file for string"
- Previous message: Steve Teeples: "communicate with progressbar"
- In reply to: Willy Denoyette [MVP]: "Re: Is C# support load device driver?"
- Next in thread: Willy Denoyette [MVP]: "Re: Is C# support load device driver?"
- Reply: Willy Denoyette [MVP]: "Re: Is C# support load device driver?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|