ntdll: Perform the offset checks also for a serial device.
This commit is contained in:
parent
96e32da5c9
commit
084f4b643c
|
@ -2153,20 +2153,14 @@ todo_wine
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = ReadFile(hcom, buf, 0, &bytes, NULL);
|
ret = ReadFile(hcom, buf, 0, &bytes, NULL);
|
||||||
ok(!ret, "ReadFile should fail\n");
|
ok(!ret, "ReadFile should fail\n");
|
||||||
todo_wine
|
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
ok(bytes == 0, "bytes %u\n", bytes);
|
ok(bytes == 0, "bytes %u\n", bytes);
|
||||||
|
|
||||||
iob.Status = -1;
|
iob.Status = -1;
|
||||||
iob.Information = -1;
|
iob.Information = -1;
|
||||||
status = pNtReadFile(hcom, 0, NULL, NULL, &iob, buf, 0, NULL, NULL);
|
status = pNtReadFile(hcom, 0, NULL, NULL, &iob, buf, 0, NULL, NULL);
|
||||||
todo_wine
|
|
||||||
ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#x\n", status);
|
ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#x\n", status);
|
||||||
/* FIXME: Remove once Wine is fixed */
|
|
||||||
if (status == STATUS_PENDING) WaitForSingleObject(hcom, TIMEOUT);
|
|
||||||
todo_wine
|
|
||||||
ok(iob.Status == -1, "expected -1, got %#x\n", iob.Status);
|
ok(iob.Status == -1, "expected -1, got %#x\n", iob.Status);
|
||||||
todo_wine
|
|
||||||
ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information);
|
ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information);
|
||||||
|
|
||||||
for (i = -20; i < 20; i++)
|
for (i = -20; i < 20; i++)
|
||||||
|
@ -2187,11 +2181,8 @@ todo_wine
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
todo_wine
|
|
||||||
ok(status == STATUS_INVALID_PARAMETER, "%d: expected STATUS_INVALID_PARAMETER, got %#x\n", i, status);
|
ok(status == STATUS_INVALID_PARAMETER, "%d: expected STATUS_INVALID_PARAMETER, got %#x\n", i, status);
|
||||||
todo_wine
|
|
||||||
ok(iob.Status == -1, "%d: expected -1, got %#x\n", i, iob.Status);
|
ok(iob.Status == -1, "%d: expected -1, got %#x\n", i, iob.Status);
|
||||||
todo_wine
|
|
||||||
ok(iob.Information == -1, "%d: expected -1, got %ld\n", i, iob.Information);
|
ok(iob.Information == -1, "%d: expected -1, got %ld\n", i, iob.Information);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -632,6 +632,14 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (type == FD_TYPE_SERIAL)
|
||||||
|
{
|
||||||
|
if (!(options & (FILE_SYNCHRONOUS_IO_ALERT | FILE_SYNCHRONOUS_IO_NONALERT)) && (!offset || offset->QuadPart < 0))
|
||||||
|
{
|
||||||
|
status = STATUS_INVALID_PARAMETER;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue