T.V. Raman writes:I've addressed all of themMuch appreciated!except for the one about facets.Re...
By noah_mendelsohn
On 7 Nov 2006 18:01:41 -0800, "Radium" <glucegen1@excite.com> wrote:>WMV compressors aren...
By martin_heffels
I am using ZwQueryInformationFile to obtain the size of a binary file that contains firmware. Probl...
By anonymous
Usually, when I burn a DVD or CD, I select "Verify Written Data". I had to remove and reload Nero 6 ...
By alexethridge
hi -anyone know if I can reliably predict thata process *will not end* after a user presses'sto...
By oliver, 1 Comments
I'm trying to connect my dig camera to the pc but it keeps giving me the message "The file SONY...
By techgirl208, 2 Comments
In my ndis miniport halt handler I'm calling ZwClose() to close a handle to an event. This work...
By anonymous, 7 Comments
I am receiving this message when attempting to deploy to a CE5.0 device using VS 2005 Beta 2. Any su...
By anonymous, 4 Comments
Hello, I couldnt find the solution to this anywhere. I am writing a kernel mode driver that needs to...
By anonymous, 1 Comments
"Horst" <Horst...discussions.microsoft.com> wrote in message
news:187D17EB-9634-44B2-BF15-4A106370CA37...microsoft.com...
> The following snippet shows some calls to ZwCreateFile and ZwReadFile
> which
> work fine on
> 2000,2003, XP. But on Vista ZwReadFile will fail with
> STATUS_INVALID_PARAMETER. It only fails, if
> the file is located on an UDF formated DVD. If file is located on a
> physical
> disk, USB device or CD, everything is ok.
> ntStatus = ZwCreateFile (&hDeviceFile,
> GENERIC_READ | SYNCHRONIZE,
> &oaFileAttributes,
> &IoStatusBlock,
> NULL,
> FILE_ATTRIBUTE_NORMAL |
> FILE_ATTRIBUTE_SYSTEM,
> FILE_SHARE_READ,
> FILE_OPEN,
> FILE_NO_INTERMEDIATE_BUFFERING |
> FILE_SYNCHRONOUS_IO_NONALERT,
> NULL,
> 0);
> if (!NT_SUCCESS (ntStatus))
> {
> goto error;
> }
>
> ntStatus = ZwReadFile (hDeviceFile,
> NULL,
> NULL,
> NULL,
> &IoStatusBlock,
> ReadBuffer,
> FIRST_READ_SIZE, // means 512 * 11 = 5632
> &BaseOffset, //it's 0
> NULL);
> -->> here ntStatus == STATUS_INVALID_PARAMETER
> I checked the Alignment Requirement with
> #if DBG
> //Alignment Requirement
> ntStatus = ZwQueryInformationFile(hDeviceFile,
> &IoStatusBlock,
> &FileAlignmentInfo,
> sizeof (FileAlignmentInfo),
> FileAlignmentInformation);
> #endif
> FileAlignmentInfo shows 1, which means Word Boundary required. I also
> changed GENERIC_READ to
> FILE_READ_DATA|FILE_READ_ATTRIBUTES|FILE_READ_EA but this also changed
> nothing.
> Any ideas?
> Thanks in advance
> Horst
>
matthew | Tues, 20 May 2008 07:39:00 GMT |
It says this in the ZwReadFile documentation:
If the preceding call to ZwCreateFile set the FILE_NO_INTERMEDIATE_BUFFERING
flag in the CreateOptions parameter to ZwCreateFile, the Length and
ByteOffset parameters to ZwReadFile must be multiples of the sector size.
For more information, see ZwCreateFile.
Perhaps the sector size is the issue. I have no idea why the sector size
would change in Vista, but trying a sector size that is a multiple of 2048
should rule this out as the source of the problem. Data sectors on CDs hold
2048 bytes of data.
"Horst" <Horst...discussions.microsoft.com> wrote in message
news:187D17EB-9634-44B2-BF15-4A106370CA37...microsoft.com...
> The following snippet shows some calls to ZwCreateFile and ZwReadFile
> which
> work fine on
> 2000,2003, XP. But on Vista ZwReadFile will fail with
> STATUS_INVALID_PARAMETER. It only fails, if
> the file is located on an UDF formated DVD. If file is located on a
> physical
> disk, USB device or CD, everything is ok.
> ntStatus = ZwCreateFile (&hDeviceFile,
> GENERIC_READ | SYNCHRONIZE,
> &oaFileAttributes,
> &IoStatusBlock,
> NULL,
> FILE_ATTRIBUTE_NORMAL |
> FILE_ATTRIBUTE_SYSTEM,
> FILE_SHARE_READ,
> FILE_OPEN,
> FILE_NO_INTERMEDIATE_BUFFERING |
> FILE_SYNCHRONOUS_IO_NONALERT,
> NULL,
> 0);
> if (!NT_SUCCESS (ntStatus))
> {
> goto error;
> }
>
> ntStatus = ZwReadFile (hDeviceFile,
> NULL,
> NULL,
> NULL,
> &IoStatusBlock,
> ReadBuffer,
> FIRST_READ_SIZE, // means 512 * 11 = 5632
> &BaseOffset, //it's 0
> NULL);
> -->> here ntStatus == STATUS_INVALID_PARAMETER
> I checked the Alignment Requirement with
> #if DBG
> //Alignment Requirement
> ntStatus = ZwQueryInformationFile(hDeviceFile,
> &IoStatusBlock,
> &FileAlignmentInfo,
> sizeof (FileAlignmentInfo),
> FileAlignmentInformation);
> #endif
> FileAlignmentInfo shows 1, which means Word Boundary required. I also
> changed GENERIC_READ to
> FILE_READ_DATA|FILE_READ_ATTRIBUTES|FILE_READ_EA but this also changed
> nothing.
> Any ideas?
> Thanks in advance
> Horst
>
matthew | Tues, 20 May 2008 07:40:00 GMT |
Hello Matthew,
Thanks, it realy works with buffersizes dividable by 2048. But it's only
necessary on UDF formated DVDs on vista.
On a CD the Physical Device Object also says Sector Size 0x800, but you can
use any offset and any buffersize, even on vista. I'm not quite sure, if this
vista udf behaviour is a bug/inconsistancy or a new requirement/stricter use
of that on the vista platform.
"Matthew Carter" wrote:
> It says this in the ZwReadFile documentation:
> If the preceding call to ZwCreateFile set the FILE_NO_INTERMEDIATE_BUFFERING
> flag in the CreateOptions parameter to ZwCreateFile, the Length and
> ByteOffset parameters to ZwReadFile must be multiples of the sector size.
> For more information, see ZwCreateFile.
> Perhaps the sector size is the issue. I have no idea why the sector size
> would change in Vista, but trying a sector size that is a multiple of 2048
> should rule this out as the source of the problem. Data sectors on CDs hold
> 2048 bytes of data.
horst | Tues, 20 May 2008 07:41:00 GMT |