Hi,
i ve written a ioctl for access by IRP_MJ_DEVICE_CONTROL inside my driver
code. the definition for this IOCTL
is in a header file that also includes ntddk.h .
now the problem is when i want to do deviceiocontrol from user mode program
i ve to include this header file and thereby ntddk.h . since i dont compile
my user mode program from ddk i start getting a bunch of errors. is there a
way out of this?
kutty
“Kutty Banerjee” wrote in message news:xxxxx@ntdev…
> Hi,
> i ve written a ioctl for access by IRP_MJ_DEVICE_CONTROL inside my driver
> code. the definition for this IOCTL
> is in a header file that also includes ntddk.h .
>
> now the problem is when i want to do deviceiocontrol from user mode
program
> i ve to include this header file and thereby ntddk.h . since i dont
compile
> my user mode program from ddk i start getting a bunch of errors. is there
a
> way out of this?
>
Put your IOCTL definitions in a separate header file - say “MyIoctls.h”.
For DDK builds, include MyIoclts.h header in your precomp.h after the
include of ntddk.h.
For user-mode application builds, include MyIoctls.h at an appropriate place
depending on the type of application, etc. Could be in the apps precomp.h
(sometimes named stdafx.h, or whatever…).
If you get complaints about missing CTL_CODE definition when building your
application you can add these preprocessor commands in MyIoctl.h:
#ifdef _WINDOWS
#include <winioctl.h>
#endif
This will drag in WinIoctl.h (which contains the CTL_CODE MACRO definition)
if you are building an application. It will be ignored if you are building a
driver.
Hope this helps.
Thomas F. Divine
http://www.rawether.net</winioctl.h>
Include WINIOCTL.H in user mode code.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Kutty Banerjee”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Sunday, July 11, 2004 4:04 AM
Subject: [ntdev] device control code in header file
> Hi,
> i ve written a ioctl for access by IRP_MJ_DEVICE_CONTROL inside my driver
> code. the definition for this IOCTL
> is in a header file that also includes ntddk.h .
>
> now the problem is when i want to do deviceiocontrol from user mode program
> i ve to include this header file and thereby ntddk.h . since i dont compile
> my user mode program from ddk i start getting a bunch of errors. is there a
> way out of this?
>
> kutty
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com