-2

I'm developing an app which communicates with a device driver. How do I call a function like this

VOID TchBklSetIntensity(BKL_CONTEXT* BklContext,ULONG Intensity)

in C# user-mode application?

ryanyuyu
  • 6,366
  • 10
  • 48
  • 53
Clocker
  • 21
  • 2
  • 7
  • The driver has to explicitly expose it. If not through normal read/write then through an ioctl, you'd pinvoke DeviceIoControl() in your C# program. – Hans Passant Oct 26 '15 at 14:03

1 Answers1

0

A driver is isolated from user land space and those functions of the device driver exists within the realm of the kernel.

However, there is usually, an accompanying libary that talks to the driver, via opening a specially designated filename, like this: XXXXX in which the library writes a certain byte sequence to that file, to talk to the driver. That API code would be then accessible by user land space, high level code such as, in this case, C#.

For an example, reserved filenames such as, classi one is NUL which is a reserved filename (can be nul), in which redirecting to it is equivalent to Unix/Linux /dev/null.

t0mm13b
  • 34,087
  • 8
  • 78
  • 110