Hello. I'm using CreateFileA and ReadFile in Visual C++ 2008 to open and read an ASCII text file into memory. This works okay (I can view its contents in memory), but with one exception. For some reason the TAB characters (0x09) are being changed to NULLs (0x00). Needless to say, this is wreaking havoc when I try to parse the file. Does anybody know what might be causing this, or how I can fix it?
This is how I'm opening the file:
hHandle = CreateFileA( pPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
GetFileSizeEx( hHandle, &tFileSize );
pBuf = (UINT8 *)malloc( tFileSize.LowPart );
ReadFile( hHandle, pBuf, tFileSize.LowPart, &dwBytesRead, NULL );
My project code has robust error-handling, and I'm not getting any errors. Any suggestions would be appreciated.
Thanks.