G
Guest
I wrote a simple virtual device driver int15.sys, Is C# support load the
device driver from AP?
device driver from AP?
Steve said:I wrote a simple virtual device driver int15.sys, Is C# support load the
device driver from AP?
I wrote a simple virtual device driver int15.sys, Is C# support load the
device driver from AP?
Richard Blewett said:Nope, yoou can interact directly with them vice the DeviceIOControl API. I've done this in the past to write to area of the physical disk that win32 doesn't support.
So I guess to be able to interact with a device driver from C# you'd have to P/Invoke to DeviceIOControl
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>
I wrote a simple virtual device driver int15.sys, Is C# support load the
device driver from AP?
Aren't drivers used by the OS (windows) ? So how did you plan to use this
driver?
Frans.
--
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004
[microsoft.public.dotnet.languages.csharp]
Richard Blewett said:Nope, yoou can interact directly with them vice the DeviceIOControl API. I've done this in the past to write to area of the physical disk that win32 doesn't support.
So I guess to be able to interact with a device driver from C# you'd have to P/Invoke to DeviceIOControl
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>
I wrote a simple virtual device driver int15.sys, Is C# support load the
device driver from AP?
Aren't drivers used by the OS (windows) ? So how did you plan to use this
driver?
Frans.
--
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004
[microsoft.public.dotnet.languages.csharp]
Richard Blewett said:Can you not use CreateFile to open the device?
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>
Yes, you are right, after I load device driver, I can use DeviceIOControl, I
wrote a virtual device driver, int15h.sys,
the purpose of this device driver is provide a interface to BIOS int15h, we
also modify the BIOS int15h, support
wireless/bluetooth power on/off, AP through virtual device driver, can power
on/off PC system wireless/bluetooth.
I need to load int15h.sys before I use DeviceIOControl, in C++, I found some
API
int SCManager = OpenSCManager(null, null, SC_MANAGER_ALL_ACCESS);
GetServiceName(Path, Driver, DeviceName);
int dwStatus = DriverInstall(SCManager, Path, Driver);
int dwStatus1 = DriverStart(SCManager, Driver);
can load the driver, my question is "Can C# support load device driver?"
Richard Blewett said:Nope, yoou can interact directly with them vice the DeviceIOControl API. I've done this in the past to write to area of the physical disk that win32 doesn't support.
So I guess to be able to interact with a device driver from C# you'd have to P/Invoke to DeviceIOControl
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>
I wrote a simple virtual device driver int15.sys, Is C# support load the
device driver from AP?
Aren't drivers used by the OS (windows) ? So how did you plan to use this
driver?
Frans.
--
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004
[microsoft.public.dotnet.languages.csharp]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004
[microsoft.public.dotnet.languages.csharp]
Richard said:Nope, yoou can interact directly with them vice the DeviceIOControl API.
I've done this in the past to write to area of the physical disk that win32
doesn't support.
So I guess to be able to interact with a device driver from C# you'd have
to P/Invoke to DeviceIOControl
Nope, yoou can interact directly with them vice the DeviceIOControl API.
I've done this in the past to write to area of the physical disk that win32
doesn't support.
So I guess to be able to interact with a device driver from C# you'd have
to P/Invoke to DeviceIOControl
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<xn0dnlt0
(e-mail address removed)>
Aren't drivers used by the OS (windows) ? So how did you plan to use this
driver?
Steve said: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);
Willy Denoyette said:Steve said: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.
Richard said:DeviceIOControl is simply a way of passing "op-codes" to a kernel mode
device driver and retrieving the results. You obviously can't write a
device driver in C# but you can interrogate a device driver via pinvoke.
Steve said: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.
: