You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 39797dcfb250c4b4497fa003ae67b873427daa37.
This commit is contained in:
@@ -1,17 +1,30 @@
|
||||
From 713c458fc172d02e041ffd04542aada8f8313880 Mon Sep 17 00:00:00 2001
|
||||
From 65b27926c9e006f41496c42886d55956047d4b69 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 7 Aug 2014 20:32:19 -0600
|
||||
Subject: server: Add support for setting file disposition information.
|
||||
|
||||
---
|
||||
dlls/ntdll/file.c | 16 ++++++++++++++++
|
||||
dlls/ntdll/tests/file.c | 12 ++----------
|
||||
server/fd.c | 30 ++++++++++++++++++++++++++++++
|
||||
server/file.c | 23 +++++++++++++++++++++++
|
||||
server/file.h | 1 +
|
||||
server/protocol.def | 6 ++++++
|
||||
6 files changed, 78 insertions(+), 10 deletions(-)
|
||||
dlls/kernel32/tests/file.c | 1 -
|
||||
dlls/ntdll/file.c | 16 ++++++++++++++++
|
||||
dlls/ntdll/tests/file.c | 13 ++-----------
|
||||
server/fd.c | 30 ++++++++++++++++++++++++++++++
|
||||
server/file.c | 23 +++++++++++++++++++++++
|
||||
server/file.h | 1 +
|
||||
server/protocol.def | 6 ++++++
|
||||
7 files changed, 78 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
|
||||
index 53d225c..dd64c91 100644
|
||||
--- a/dlls/kernel32/tests/file.c
|
||||
+++ b/dlls/kernel32/tests/file.c
|
||||
@@ -4645,7 +4645,6 @@ todo_wine
|
||||
|
||||
dispinfo.DeleteFile = TRUE;
|
||||
ret = pSetFileInformationByHandle(file, FileDispositionInfo, &dispinfo, sizeof(dispinfo));
|
||||
-todo_wine
|
||||
ok(ret, "setting FileDispositionInfo failed, error %d\n", GetLastError());
|
||||
|
||||
CloseHandle(file);
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index d081750..86063b6 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
@@ -40,10 +53,18 @@ index d081750..86063b6 100644
|
||||
FIXME("Unsupported class (%d)\n", class);
|
||||
io->u.Status = STATUS_NOT_IMPLEMENTED;
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 8ec367b..874aa4d 100644
|
||||
index fed1207..9cb3bd2 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -1471,7 +1471,6 @@ static void test_file_disposition_information(void)
|
||||
@@ -1473,7 +1473,6 @@ static void test_file_disposition_information(void)
|
||||
ok( res == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %x\n", res );
|
||||
fdi2 = 0x100;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi2, sizeof(fdi2), FileDispositionInformation );
|
||||
- todo_wine
|
||||
ok( res == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %x\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1488,7 +1487,6 @@ static void test_file_disposition_information(void)
|
||||
ok( res == STATUS_INVALID_INFO_CLASS || res == STATUS_NOT_IMPLEMENTED, "Unexpected NtQueryInformationFile result (expected STATUS_INVALID_INFO_CLASS, got %x)\n", res );
|
||||
fdi.DoDeleteFile = TRUE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
@@ -51,7 +72,7 @@ index 8ec367b..874aa4d 100644
|
||||
ok( res == STATUS_ACCESS_DENIED, "unexpected FileDispositionInformation result (expected STATUS_ACCESS_DENIED, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1484,11 +1483,9 @@ static void test_file_disposition_information(void)
|
||||
@@ -1501,11 +1499,9 @@ static void test_file_disposition_information(void)
|
||||
ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
|
||||
fdi.DoDeleteFile = TRUE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
@@ -63,7 +84,7 @@ index 8ec367b..874aa4d 100644
|
||||
ok( fileDeleted, "File should have been deleted\n" );
|
||||
DeleteFileA( buffer );
|
||||
|
||||
@@ -1502,6 +1499,7 @@ static void test_file_disposition_information(void)
|
||||
@@ -1519,6 +1515,7 @@ static void test_file_disposition_information(void)
|
||||
ok( res == STATUS_CANNOT_DELETE, "unexpected FileDispositionInformation result (expected STATUS_CANNOT_DELETE, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -71,7 +92,7 @@ index 8ec367b..874aa4d 100644
|
||||
ok( !fileDeleted, "File shouldn't have been deleted\n" );
|
||||
SetFileAttributesA( buffer, FILE_ATTRIBUTE_NORMAL );
|
||||
DeleteFileA( buffer );
|
||||
@@ -1512,11 +1510,9 @@ static void test_file_disposition_information(void)
|
||||
@@ -1529,11 +1526,9 @@ static void test_file_disposition_information(void)
|
||||
ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
|
||||
fdi.DoDeleteFile = TRUE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
@@ -83,7 +104,7 @@ index 8ec367b..874aa4d 100644
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1529,7 +1525,6 @@ static void test_file_disposition_information(void)
|
||||
@@ -1546,7 +1541,6 @@ static void test_file_disposition_information(void)
|
||||
ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
|
||||
fdi.DoDeleteFile = FALSE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
@@ -91,7 +112,7 @@ index 8ec367b..874aa4d 100644
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1544,7 +1539,6 @@ static void test_file_disposition_information(void)
|
||||
@@ -1561,7 +1555,6 @@ static void test_file_disposition_information(void)
|
||||
CloseHandle( handle );
|
||||
fdi.DoDeleteFile = FALSE;
|
||||
res = pNtSetInformationFile( handle2, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
@@ -99,7 +120,7 @@ index 8ec367b..874aa4d 100644
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
CloseHandle( handle2 );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1559,11 +1553,9 @@ static void test_file_disposition_information(void)
|
||||
@@ -1576,11 +1569,9 @@ static void test_file_disposition_information(void)
|
||||
ok( handle != INVALID_HANDLE_VALUE, "failed to open a directory\n" );
|
||||
fdi.DoDeleteFile = TRUE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
@@ -111,7 +132,7 @@ index 8ec367b..874aa4d 100644
|
||||
ok( fileDeleted, "Directory should have been deleted\n" );
|
||||
RemoveDirectoryA( buffer );
|
||||
|
||||
@@ -1576,7 +1568,6 @@ static void test_file_disposition_information(void)
|
||||
@@ -1593,7 +1584,6 @@ static void test_file_disposition_information(void)
|
||||
RemoveDirectoryA( buffer );
|
||||
fdi.DoDeleteFile = FALSE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
@@ -119,7 +140,7 @@ index 8ec367b..874aa4d 100644
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1601,6 +1592,7 @@ static void test_file_disposition_information(void)
|
||||
@@ -1618,6 +1608,7 @@ static void test_file_disposition_information(void)
|
||||
buffer[dirpos] = '\0';
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -169,10 +190,10 @@ index 7c2d717..442e639 100644
|
||||
int get_unix_fd( struct fd *fd )
|
||||
{
|
||||
diff --git a/server/file.c b/server/file.c
|
||||
index 792bbe0..b673bbc 100644
|
||||
index e70304f..098c705 100644
|
||||
--- a/server/file.c
|
||||
+++ b/server/file.c
|
||||
@@ -741,3 +741,26 @@ DECL_HANDLER(unlock_file)
|
||||
@@ -749,3 +749,26 @@ DECL_HANDLER(unlock_file)
|
||||
release_object( file );
|
||||
}
|
||||
}
|
||||
@@ -212,7 +233,7 @@ index b5e0ca7..460656f 100644
|
||||
extern int is_same_file_fd( struct fd *fd1, struct fd *fd2 );
|
||||
extern int is_fd_removable( struct fd *fd );
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 9c4dab4..800f73c 100644
|
||||
index 9e5e416..d71f5ef 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -1200,6 +1200,12 @@ enum server_fd_type
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 6aeab9117090d0cca99eac5fa02363722022dec0 Mon Sep 17 00:00:00 2001
|
||||
From f6318b095ddb9969a7b2b29e2fcbad3ea02ccefb Mon Sep 17 00:00:00 2001
|
||||
From: Qian Hong <qhong@codeweavers.com>
|
||||
Date: Fri, 17 Apr 2015 00:59:02 +0800
|
||||
Subject: ntdll/tests: Added tests to set disposition on file which is mapped
|
||||
@@ -9,10 +9,10 @@ Subject: ntdll/tests: Added tests to set disposition on file which is mapped
|
||||
1 file changed, 70 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 1e7edc3..89f70de 100644
|
||||
index 0bdd22f..fc6fc33 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -1455,11 +1455,12 @@ static void test_file_disposition_information(void)
|
||||
@@ -1455,12 +1455,13 @@ static void test_file_disposition_information(void)
|
||||
{
|
||||
char tmp_path[MAX_PATH], buffer[MAX_PATH + 16];
|
||||
DWORD dirpos;
|
||||
@@ -22,11 +22,12 @@ index 1e7edc3..89f70de 100644
|
||||
IO_STATUS_BLOCK io;
|
||||
FILE_DISPOSITION_INFORMATION fdi;
|
||||
BOOL fileDeleted;
|
||||
DWORD fdi2;
|
||||
+ void *ptr;
|
||||
|
||||
GetTempPathA( MAX_PATH, tmp_path );
|
||||
|
||||
@@ -1623,6 +1624,74 @@ static void test_file_disposition_information(void)
|
||||
@@ -1640,6 +1641,74 @@ static void test_file_disposition_information(void)
|
||||
todo_wine
|
||||
ok( !fileDeleted, "Directory shouldn't have been deleted\n" );
|
||||
RemoveDirectoryA( buffer );
|
||||
|
Reference in New Issue
Block a user