mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
Fix bugs in GetBinaryType reported by songlei@qihoo.net
svn path=/trunk/; revision=26158
This commit is contained in:
parent
b54c8f6b9b
commit
2ac1a08519
1 changed files with 2 additions and 2 deletions
|
@ -157,7 +157,7 @@ InternalGetBinaryType(HANDLE hFile)
|
|||
{
|
||||
IMAGE_FILE_HEADER FileHeader;
|
||||
if(!ReadFile(hFile, &FileHeader, sizeof(IMAGE_FILE_HEADER), &Read, NULL) ||
|
||||
(Read == sizeof(IMAGE_FILE_HEADER)))
|
||||
(Read != sizeof(IMAGE_FILE_HEADER)))
|
||||
{
|
||||
return BINARY_DOS;
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ InternalGetBinaryType(HANDLE hFile)
|
|||
IMAGE_OS2_HEADER ne;
|
||||
if((SetFilePointer(hFile, Header.mz.e_lfanew, NULL, FILE_BEGIN) == 1) ||
|
||||
!ReadFile(hFile, &ne, sizeof(IMAGE_OS2_HEADER), &Read, NULL) ||
|
||||
(Read == sizeof(IMAGE_OS2_HEADER)))
|
||||
(Read != sizeof(IMAGE_OS2_HEADER)))
|
||||
{
|
||||
/* Couldn't read header, so abort. */
|
||||
return BINARY_DOS;
|
||||
|
|
Loading…
Reference in a new issue