[PATCH 1/2] ntdll: Return a unique volume number from NtQueryInformationFile(FileIdInformation).
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> --- I haven't been able to find any other APIs that return an 8-byte serial number; I suspect it is unique to this information class. dlls/ntdll/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 7dfb0a4800e..5966b1ce648 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -2508,7 +2508,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, else { FILE_ID_INFORMATION *info = ptr; - info->VolumeSerialNumber = 0; /* FIXME */ + info->VolumeSerialNumber = st.st_dev; memset( &info->FileId, 0, sizeof(info->FileId) ); *(ULONGLONG *)&info->FileId = st.st_ino; } -- 2.25.1
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> --- dlls/kernel32/path.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index 31652d3164b..334fc25e873 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -257,21 +257,12 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath, DWORD shortlen static BOOL is_same_file(HANDLE h1, HANDLE h2) { - int fd1; - BOOL ret = FALSE; - if (wine_server_handle_to_fd(h1, 0, &fd1, NULL) == STATUS_SUCCESS) - { - int fd2; - if (wine_server_handle_to_fd(h2, 0, &fd2, NULL) == STATUS_SUCCESS) - { - struct stat stat1, stat2; - if (fstat(fd1, &stat1) == 0 && fstat(fd2, &stat2) == 0) - ret = (stat1.st_dev == stat2.st_dev && stat1.st_ino == stat2.st_ino); - wine_server_release_fd(h2, fd2); - } - wine_server_release_fd(h1, fd1); - } - return ret; + FILE_ID_INFORMATION id1, id2; + IO_STATUS_BLOCK io; + + return !NtQueryInformationFile( h1, &io, &id1, sizeof(id1), FileIdInformation ) + && !NtQueryInformationFile( h2, &io, &id2, sizeof(id2), FileIdInformation ) + && !memcmp( &id1, &id2, sizeof(FILE_ID_INFORMATION) ); } /************************************************************************** -- 2.25.1
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=66390 Your paranoid android. === debiant (32 bit report) === ntdll: file.c:3640: Test failed: expected 00000000, got 00000801 === debiant (32 bit Chinese:China report) === ntdll: file.c:3640: Test failed: expected 00000000, got 00000801 === debiant (32 bit WoW report) === ntdll: file.c:3640: Test failed: expected 00000000, got 00000801 === debiant (64 bit WoW report) === ntdll: file.c:3640: Test failed: expected 00000000, got 00000801
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=66389 Your paranoid android. === debiant (32 bit report) === ntdll: file.c:3640: Test failed: expected 00000000, got 00000801 === debiant (32 bit Chinese:China report) === ntdll: file.c:3640: Test failed: expected 00000000, got 00000801 === debiant (32 bit WoW report) === ntdll: file.c:3640: Test failed: expected 00000000, got 00000801 === debiant (64 bit WoW report) === ntdll: file.c:3640: Test failed: expected 00000000, got 00000801
participants (2)
-
Marvin -
Zebediah Figura