Okay, stupid question, but I think I’m due for a sanity check. For the
purposes of avoiding AV interop issues, I’m moving the
FSCTL_SET_ZERO_DATA part of my file release into the post-operation
callback for a successful FSCTL_SET_REPARSE_POINT. The post op is
synchronized already because I need to access data in the paged pool,
etc.
When I call FltDeviceIoControlFile, I’m getting back
STATUS_INVALID_PARAMETER. Okay, this page
(http://msdn.microsoft.com/en-us/library/cc232054.aspx) says that that
means one of the following:
The handle is not to a file
or input buffer length is not equal to the size of a
FILE_ZERO_DATA_INFORMATION structure
or the given FileOffset is less than zero
or the given BeyondFinalZero is less than zero
or the given FileOffset is greater than the given BeyondFinalZero.
My file object is a file (type is 5 in the file_object struct)
input buffer size is 16, which is the size of 2 LARGE_INTEGERs, so I
would expect this to be right
I’m setting FileOffset to 0
I’m setting BeyondFinalZero to the file’s EndOfFile (which I’ve
double-checked to be right)
Between the above two, that should cover FO < BFZ
Additionally, the SPARSE flag is set on the file, and there are no user
mapped sections on the file. Would anybody like to offer up any ideas?
zdi.FileOffset.QuadPart = 0;
zdi.BeyondFinalZero.QuadPart = info.EndOfFile.QuadPart;
status = FltDeviceIoControlFile (rel_objs->Instance, fileo,
FSCTL_SET_ZERO_DATA, &zdi, zdi_size, NULL, 0,
&unused);
Thanks,
~Eric