I can find:
#define CTL_CODE( DeviceType, Function, Method, Access ) ( \
((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
in winioctl.h. However, I still can't understand this control code. For instance, what is a DeviceType of 0x8335? I just can't find such DeviceType in this header file. Or did I misunderstand this CTL_CODE macro?
This control code is frequently used in sysinternals handle.exe. It seems to use this control code in DeviceIoControl to query file handle information. I want to integrate this function in my application but I can't figure out how to use this IOCTL. I failed to find helpful information in either Microsoft Learn.
This super user post mentioned this code but very shortly and I still don't know how to use it.
So finally what does this code do and how can I use it in my application?
DeviceControlfunction would solve it? Right now this is too much of an XY problem to be able to write a meaningful answer.0x8335has theCommonbit set. Specifying Device Types also says: "If a type of hardware does not match any of the defined types, specify a value of either FILE_DEVICE_UNKNOWN, or a value within the range of 32768 through 65535."ObQueryNameStringand returns the result to the client.