tags:

views:

220

answers:

1

I am trying to write to a HiD driver in C# (V studio 2008) and decided to use the DeviceIoContol function to access the device. I'm however stumped as to what to substitute for the second parameter of this function, trawling the net hasn't yielded anything useful or explanatory so any ideas would be appreciated.

+2  A: 

In general, there are no standard values to pass as the dwIoControlCode. It depends on the device driver implementation, it determines what it will accept and what action it takes. However, many control codes are documented in the MSDN library for drivers written by Microsoft. Look through the MSDN Library index for keywords that start with IOCTL. The first one that is HID device related is IOCTL_HID_ACTIVATE_DEVICE.

Hans Passant