Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6502

Getting an "Unrecognized Symbol" error for the CTL_CODE macro

$
0
0

I'm trying to define a custom CTL_CODE and masking that under another macro(as shown below). That pre-processor code is in the CPP file for my driver. It may be important to note that both, my client and driver, are under the same solution but are 2 separate projects. The driver is an empty wdm driver and the client is a windows console desktop app.

#define PRIORITY_BOOSTER_DEVICE 0x8000#define IOCTL_PRIORITY_BOOSTER_SET_PRIORITY CTL_CODE(PRIORITY_BOOSTER_DEVICE, \0x800, METHOD_NEITHER, FILE_ANY_ACCESS)

However, in my client, when I try to use 'IOCTL_PRIORITY_BOOSTER_SET_PRIORITY' for my DeviceIoControl call, I get an error "unrecognized token". I've pasted my DeviceIoControl call below. After some experimenting, Visual Studio is pointing the error at the 'CTL_CODE' macro itself. I'm very dumbfounded because this poses no issue in the driver project but does in the client project. Furthermore, I don't know why the issues lies with the CTL_CODE macro itself. I'd assume that the macro is defined in the WDK dependency which I had to install. Any help would be immensely appreciate as I have been struggling with this issue for quite a while and haven't found very much coverage, if any, on it elsewhere.

BOOL success = DeviceIoControl(hDevice,       IOCTL_PRIORITY_BOOSTER_SET_PRIORITY,&data,      sizeof(data),      nullptr,       0,&returned,      nullptr);

Happy to add more information as requested.


Viewing all articles
Browse latest Browse all 6502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>