ZwReadFile() not return requested number of bytes

i read a file from c: drive, it successfuly open but did’t retrive
specified number of bytes
code:
ntStatus=ZwReadFile(
hFile,
NULL,//in
NULL,//in
NULL,//in
&IoStatusBlock,//OUT
&val,//OUT
3, //in //////////requested bytes length
NULL,//in
NULL//in
);

&val is a type of LONG but in IoStatusBlock->Information it return 1. its
mean this function read one byte, while funtion request 3 bytes from
begning of the file. what’s wrong?

Kishwar

The file probably only has 1 byte in it!

Neal Christiansen
Microsoft File System Filter Group

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Kishwar [mailto:xxxxx@yahoo.com]
Sent: Tuesday, January 14, 2003 1:44 AM
To: File Systems Developers

i read a file from c: drive, it successfuly open but did’t retrive
specified number of bytes
code:
ntStatus=ZwReadFile(
hFile,
NULL,//in
NULL,//in
NULL,//in
&IoStatusBlock,//OUT
&val,//OUT
3, //in //////////requested bytes length
NULL,//in
NULL//in
);

&val is a type of LONG but in IoStatusBlock->Information it return 1.
its
mean this function read one byte, while funtion request 3 bytes from
begning of the file. what’s wrong?

Kishwar


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

file doesn’t have just one byte, file contian 4 bytes
any thing else
thanks
Kishwar

ZwReadFile takes an argument “ByteOffet”, if you set it to NULL, it will implicitly use the current byte offet maintained by the IO Manager. Try to set ByteOffet explicitly to 0, and see how many bytes it returns.
Kishwar wrote:file doesn’t have just one byte, file contian 4 bytes
any thing else
thanks
Kishwar


You are currently subscribed to ntfsd as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

same thing, return one byte when i set ByteOffet explicitly to 0. i try
all posibilities i don’t know whats wrong.

thanks
Kishwar