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??
|