PC Review


Reply
Thread Tools Rate Thread

How can I retrieve one character from a file using ZwReadFile

 
 
rohanm79@gmail.com
Guest
Posts: n/a
 
      23rd Sep 2006
I am new to device driver programming. I want to read the contents of a
file character-by-character using ZwReadFile and then do a logical
comparison between the character that was read and a constant
character.

The method I am using is shown below

ntStatusOfFile = ZwReadFile( hFile, NULL,NULL,
NULL,&IoStatusBlock,pDataBuf,uReadSize,
NULL,NULL);
memcpy(ch, *pDataBuf,1);
DbgPrint("Read from file - %c",ch);
if (ch == 's' )
DbgPrint("Hallelujah!!");

ch is of type char, pDataBuf is of type PCHAR and uReadSize is set to
1.

The first DbgPrint statement tells me that character stored in ch is s.
But when I do the comparison, it is not printing "Hallelujah".

Any ideas why??

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Usin ZwReadFile in winxp breeze.joy@gmail.com Windows XP General 1 6th Oct 2006 05:37 AM
Using ZwReadFile in winxp breeze.joy@gmail.com Windows XP New Users 0 6th Oct 2006 05:09 AM
Using ZwReadFile in winxp breeze.joy@gmail.com Windows XP Help 0 6th Oct 2006 05:05 AM
How to retrieve character from a string for excel? =?Utf-8?B?RXJpYw==?= Microsoft Excel Worksheet Functions 3 4th Sep 2006 11:22 AM
How to retrieve character from a string for excel? =?Utf-8?B?RXJpYw==?= Microsoft Excel Misc 1 4th Sep 2006 08:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:58 AM.