Alexandre Julliard : ntdll: Implement FSCTL_GET_OBJECT_ID to retrieve a file id.
Alexandre Julliard
julliard at winehq.org
Mon Jun 22 15:55:57 CDT 2020
Module: wine
Branch: master
Commit: 251335cdf35d4ff1fcae9c73f77136c9b85e7d96
URL: https://source.winehq.org/git/wine.git/?a=commit;h=251335cdf35d4ff1fcae9c73f77136c9b85e7d96
Author: Alexandre Julliard <julliard at winehq.org>
Date: Sun Jun 21 16:25:59 2020 +0200
ntdll: Implement FSCTL_GET_OBJECT_ID to retrieve a file id.
It can be used instead of FileIdInformation to avoid depending on
mountmgr.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/unix/file.c | 23 +++++++++++++++++++++++
include/winternl.h | 15 +++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index ca6899b50f..bf1354f46e 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5666,6 +5666,29 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
}
break;
}
+
+ case FSCTL_GET_OBJECT_ID:
+ {
+ FILE_OBJECTID_BUFFER *info = out_buffer;
+ int fd, needs_close;
+ struct stat st;
+
+ io->Information = 0;
+ if (out_size >= sizeof(*info))
+ {
+ status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL );
+ if (status) break;
+ fstat( fd, &st );
+ if (needs_close) close( fd );
+ memset( info, 0, sizeof(*info) );
+ memcpy( info->ObjectId, &st.st_dev, sizeof(st.st_dev) );
+ memcpy( info->ObjectId + 8, &st.st_ino, sizeof(st.st_ino) );
+ io->Information = sizeof(*info);
+ }
+ else status = STATUS_BUFFER_TOO_SMALL;
+ break;
+ }
+
case FSCTL_SET_SPARSE:
TRACE("FSCTL_SET_SPARSE: Ignoring request\n");
io->Information = 0;
diff --git a/include/winternl.h b/include/winternl.h
index 0957561063..3ff15f28c1 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -744,6 +744,21 @@ typedef struct _FILE_PIPE_LOCAL_INFORMATION {
#define FILE_PIPE_CONNECTED_STATE 0x00000003
#define FILE_PIPE_CLOSING_STATE 0x00000004
+typedef struct _FILE_OBJECTID_BUFFER
+{
+ BYTE ObjectId[16];
+ union
+ {
+ struct
+ {
+ BYTE BirthVolumeId[16];
+ BYTE BirthObjectId[16];
+ BYTE DomainId[16];
+ } DUMMYSTRUCTNAME;
+ BYTE ExtendedInfo[48];
+ } DUMMYUNIONNAME;
+} FILE_OBJECTID_BUFFER, *PFILE_OBJECTID_BUFFER;
+
typedef struct _FILE_OBJECTID_INFORMATION {
LONGLONG FileReference;
UCHAR ObjectId[16];
More information about the wine-cvs
mailing list