Compile error in Xp while creating work item.

hi,
i am writing a file system driver. i am trying to create a worker thread for single execution.
i am successfully able to do it windows vista, but it is throwing a compile time error where i have used the function “IoInitializeWorkItem( )”.
the message is it is undefined.
can anybody please tell me that what could be the problem?
do i need to include any specific header in xp more? or do i need to define anything?
thanks,
hitesh ughreja

You are doing something wrong. Of course you say you try it in Vista and
then in XP without any details about the shortcut you are using to create
the build environment. It has been available since Windows 2000. Look at
the floppy driver which uses a similar technique to send all IRPs requiring
access to the drive to a single thread. I don’t remember if they use work
items or some other method, but it worked that way even in NT4.

wrote in message news:xxxxx@ntfsd…
> hi,
> i am writing a file system driver. i am trying to create a worker thread
> for single execution.
> i am successfully able to do it windows vista, but it is throwing a
> compile time error where i have used the function
> “IoInitializeWorkItem( )”.
> the message is it is undefined.
> can anybody please tell me that what could be the problem?
> do i need to include any specific header in xp more? or do i need to
> define anything?
> thanks,
> hitesh ughreja
>

Try reading the WDK documentation and doing some homework before posting.

The comments section for IoInitializeWorkItem includes the following text.

“This routine is available on Windows Vista and later versions of the
operating system.”

To use WorkItems on XP, use the functions IoAllocateWorkItem,
IoQueueWorkItem and eventually IoFreeWorkItem.

Also try reading the archives regarding which build environment to
use depending upon the oldest O/S you want to support. If you want a
single driver to support all systems from XP onwards then build in
the XP build environment.

Mark.

At 07:04 25/06/2008, xxxxx@yahoo.co.in wrote:

hi,
i am writing a file system driver. i am trying to create a worker
thread for single execution.
i am successfully able to do it windows vista, but it is throwing a
compile time error where i have used the function “IoInitializeWorkItem( )”.
the message is it is undefined.
can anybody please tell me that what could be the problem?
do i need to include any specific header in xp more? or do i need to
define anything?
thanks,
hitesh ughreja

You need to read the documentation - ‘IoInitializeWorkItem’ is not available pre-vista.

If you haven’t read the ‘System Worker Threads’ docs closely, you should, because there are subtle differences between the ‘Ex’
versions and the ‘Io’ versions, and the misuse of both (particularly the former) causes a lot of crashes. Unfortunately, the docs
don’t say much about the ‘Ex’ variants, perhaps because their use is no longer encouraged, but whatever the reason, MSFT is not
doing themselves any favors by providing so little documentation, especially if one doesn’t know to look in the IFS in addition to
the KRM.

Good luck,

mm

xxxxx@yahoo.co.in wrote:

hi,
i am writing a file system driver. i am trying to create a worker thread for single execution.
i am successfully able to do it windows vista, but it is throwing a compile time error where i have used the function “IoInitializeWorkItem( )”.
the message is it is undefined.
can anybody please tell me that what could be the problem?
do i need to include any specific header in xp more? or do i need to define anything?
thanks,
hitesh ughreja