Greetings,
I am working on the osrusbfx2 development kit and learning along the
way…
The testapp (console app) provides a way to write to the device and read
to the device but it appears that a person needs to put the console app
in the read mode (osrusbfx2.exe -r 8) to get data from the device???
How would I go about changing the testapp so that if/when the osrusbfx2
board sent data to the host, I could capture the interrupt? When
the host receives the interrupt, I would do some kind of printf so I can
tell that the board has sent data and I need to read the data??
Any ideas?
- Julia Merritt
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Wednesday, November 17, 2010 9:58 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Synchronous call using ZwFsControlFile.
I’m looking at an issue where my driver has problem executing
FSCTL_LOCK_VOLUME control code. The drive does issue
FSCTL_DISMOUNT_VOLUME command (kind of dangerous, but don’t have other
option) and the try to lock it. It appears that FSCTL_DISMOUNT_VOLUME
causes other drivers to do FLUSH, so I endup having open handle. I want
to handle this situation by doing synchronous call
ZwFsControlFile(FSCTL_DISMOUNT_VOLUME) and wondering how I do that . My
existing code is
status = ZwCreateFile( &(pVolumeExtension->hVolume),
SYNCHRONIZE|GENERIC_READ|GENERIC_WRITE,
&ObjectAttributes,
&IoStatus,
NULL,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ | FILE_SHARE_WRITE, // 0,
FILE_OPEN_IF,
FILE_SYNCHRONOUS_IO_NONALERT | FILE_WRITE_THROUGH |
FILE_NO_INTERMEDIATE_BUFFERING,
NULL,
0);
status = ZwFsControlFile( pVolumeExtension->hVolume,
NULL, NULL,
NULL, &IoStatus,
FSCTL_DISMOUNT_VOLUME,
NULL, 0, NULL, 0 );
What should be my next step. Documents say that I can wait on
FileHandle, but now sure how can I do that. Do I need to define and pass
handle to an kEvent to ZwFsControlFile() and then call
KeWaitForSingleObject(). Are args to ZwCreateFile() OK. I want to make
sure that DISMOUNT has been completed all the way down to file system.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer