Remove useless calls to IsBadReadPtr from ReadFile and WriteFile.
This commit is contained in:
parent
c329cc4f9c
commit
b3d647384c
|
@ -358,11 +358,6 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
|
||||||
if (bytesRead) *bytesRead = 0; /* Do this before anything else */
|
if (bytesRead) *bytesRead = 0; /* Do this before anything else */
|
||||||
if (!bytesToRead) return TRUE;
|
if (!bytesToRead) return TRUE;
|
||||||
|
|
||||||
if (IsBadReadPtr(buffer, bytesToRead))
|
|
||||||
{
|
|
||||||
SetLastError(ERROR_WRITE_FAULT); /* FIXME */
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (is_console_handle(hFile))
|
if (is_console_handle(hFile))
|
||||||
return ReadConsoleA(hFile, buffer, bytesToRead, bytesRead, NULL);
|
return ReadConsoleA(hFile, buffer, bytesToRead, bytesRead, NULL);
|
||||||
|
|
||||||
|
@ -441,12 +436,6 @@ BOOL WINAPI WriteFile( HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
|
||||||
if (is_console_handle(hFile))
|
if (is_console_handle(hFile))
|
||||||
return WriteConsoleA(hFile, buffer, bytesToWrite, bytesWritten, NULL);
|
return WriteConsoleA(hFile, buffer, bytesToWrite, bytesWritten, NULL);
|
||||||
|
|
||||||
if (IsBadReadPtr(buffer, bytesToWrite))
|
|
||||||
{
|
|
||||||
SetLastError(ERROR_READ_FAULT); /* FIXME */
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (overlapped)
|
if (overlapped)
|
||||||
{
|
{
|
||||||
offset.u.LowPart = overlapped->Offset;
|
offset.u.LowPart = overlapped->Offset;
|
||||||
|
|
Loading…
Reference in New Issue