Hello All!
The following code doesn’t work and I really don’t understand why:
STARTING_VCN_INPUT_BUFFER StartingVcn;
RETRIEVAL_POINTERS_BUFFER RetrievalPtr;
RtlInitUnicodeString( &FileName, L"\??\F:\test.dat" );
InitializeObjectAttributes( &ObjectAttributes, &FileName, OBJ_KERNEL_HANDLE,
NULL, NULL );
Status = IoCreateFile( &hFile, FILE_ALL_ACCESS, &ObjectAttributes,
&IoStatusBlock, NULL, 0, 0, FILE_OPEN, 0, NULL, 0, CreateFileTypeNone, NULL,
IO_NO_PARAMETER_CHECKING );
StartingVcn.StartingVcn.QuadPart = 0;
Status = ZwFsControlFile( hFile, NULL, NULL, NULL, &IoStatusBlock,
FSCTL_GET_RETRIEVAL_POINTERS, &StartingVcn,
sizeof(STARTING_VCN_INPUT_BUFFER), &RetrievalPtr,
sizeof(RETRIEVAL_POINTERS_BUFFER) );
DbgPrint(“Status = 0x%08X, Extents number: %d, StartingVcn: %d\n”,
RetrievalPtr.ExtentCount, RetrievalPtr.StartingVcn.LowPart );
Status = 0x00000001, Extents number: 0, StartingVcn: 0
The file really does exist on F: volume and it has no attributes. So I do
not understand why ZwFsControlFile returns STATUS_WAIT_1
Thanks, regards,
Mike