ntdll: Offset -1 (FILE_WRITE_TO_END_OF_FILE) is supposed to work in NtWriteFile for disk files in overlapped mode.
This commit is contained in:
parent
86d63f1d5a
commit
3cae528eef
@ -980,7 +980,8 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
|
|||||||
|
|
||||||
if (type == FD_TYPE_FILE)
|
if (type == FD_TYPE_FILE)
|
||||||
{
|
{
|
||||||
if (async_write && (!offset || offset->QuadPart < 0))
|
if (async_write &&
|
||||||
|
(!offset || (offset->QuadPart < 0 && offset->QuadPart != (LONGLONG)-1 /* FILE_WRITE_TO_END_OF_FILE */)))
|
||||||
{
|
{
|
||||||
status = STATUS_INVALID_PARAMETER;
|
status = STATUS_INVALID_PARAMETER;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -2426,11 +2426,8 @@ todo_wine
|
|||||||
iob.Information = -1;
|
iob.Information = -1;
|
||||||
offset.QuadPart = (LONGLONG)-1 /* FILE_WRITE_TO_END_OF_FILE */;
|
offset.QuadPart = (LONGLONG)-1 /* FILE_WRITE_TO_END_OF_FILE */;
|
||||||
status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, "DCBA", 4, &offset, NULL);
|
status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, "DCBA", 4, &offset, NULL);
|
||||||
todo_wine
|
|
||||||
ok(status == STATUS_PENDING || status == STATUS_SUCCESS /* before Vista */, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status);
|
ok(status == STATUS_PENDING || status == STATUS_SUCCESS /* before Vista */, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status);
|
||||||
todo_wine
|
|
||||||
ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status);
|
ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status);
|
||||||
todo_wine
|
|
||||||
ok(iob.Information == 4, "expected 4, got %lu\n", iob.Information);
|
ok(iob.Information == 4, "expected 4, got %lu\n", iob.Information);
|
||||||
|
|
||||||
off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT);
|
off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT);
|
||||||
@ -2448,7 +2445,6 @@ todo_wine
|
|||||||
status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL);
|
status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL);
|
||||||
ok(status == STATUS_PENDING || status == STATUS_SUCCESS, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status);
|
ok(status == STATUS_PENDING || status == STATUS_SUCCESS, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status);
|
||||||
ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status);
|
ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status);
|
||||||
todo_wine
|
|
||||||
ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information);
|
ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information);
|
||||||
|
|
||||||
off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT);
|
off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT);
|
||||||
@ -2457,7 +2453,6 @@ todo_wine
|
|||||||
ret = WaitForSingleObject(hfile, 3000);
|
ret = WaitForSingleObject(hfile, 3000);
|
||||||
ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret);
|
ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret);
|
||||||
ok(!memcmp(contents, buf, sizeof(contents) - 4), "file contents mismatch\n");
|
ok(!memcmp(contents, buf, sizeof(contents) - 4), "file contents mismatch\n");
|
||||||
todo_wine
|
|
||||||
ok(!memcmp(buf + sizeof(contents) - 4, "DCBA", 4), "file contents mismatch\n");
|
ok(!memcmp(buf + sizeof(contents) - 4, "DCBA", 4), "file contents mismatch\n");
|
||||||
|
|
||||||
off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT);
|
off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user