Skip to content

Commit

Permalink
Wine Staging 41cb9f5, wine-tkg-git 61e4979.
Browse files Browse the repository at this point in the history
The config has been updated to allow easier debugging.
  • Loading branch information
openglfreak committed Feb 12, 2021
1 parent 5bb36f0 commit 9a01ee0
Show file tree
Hide file tree
Showing 90 changed files with 8,384 additions and 5,772 deletions.
14 changes: 7 additions & 7 deletions ps0003-p0001-server-Implement-thread-priorities-on-Linux.mypatch
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,13 @@ index 942a8ff8389..6b53b518d98 100644
if (req->mask & SET_THREAD_INFO_AFFINITY)
{
@@ -1450,6 +1584,7 @@ DECL_HANDLER(init_thread)
process->unix_pid = -1; /* can happen with linuxthreads */
init_thread_context( current );
generate_debug_event( current, DbgCreateThreadStateChange, &req->entry );
+ set_thread_priority( current, current->process->priority, current->priority );
if (!process->cpu_override.cpu_count)
set_thread_affinity( current, current->affinity );
}

init_thread_context( current );
generate_debug_event( current, DbgCreateThreadStateChange, &req->entry );
+ set_thread_priority( current, current->process->priority, current->priority );
if (!process->cpu_override.cpu_count)
set_thread_affinity( current, current->affinity );

diff --git a/server/thread.h b/server/thread.h
index 650bc44628d..4eb94b4d03b 100644
--- a/server/thread.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ index a0acbf9deb7..de9fdcf0347 100644

/* ### protocol_version begin ### */

-#define SERVER_PROTOCOL_VERSION 662
+#define SERVER_PROTOCOL_VERSION 663
-#define SERVER_PROTOCOL_VERSION 675
+#define SERVER_PROTOCOL_VERSION 676

/* ### protocol_version end ### */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ index 11d43f6b953..e63db31985a 100644
+ return create_fd_from_unix_fd( fd_user_ops, unix_fd, user, options, NULL );
+}
+
void set_unix_name_of_fd( struct fd *fd, const struct stat *fd_st )
/* retrieve the object that is using an fd */
void *get_fd_user( struct fd *fd )
{
#ifdef __linux__
diff --git a/server/file.c b/server/file.c
index 78eb25443c4..80461c6c27b 100644
--- a/server/file.c
Expand Down Expand Up @@ -186,9 +186,9 @@ index c798daed5dd..2f70b8d2059 100644
int unix_fd, struct object *user, unsigned int options );
+extern struct fd *create_fd_from_unix_fd( const struct fd_ops *fd_user_ops,
+ int unix_fd, struct object *user, unsigned int options, const char *unix_name );
extern void set_unix_name_of_fd( struct fd *fd, const struct stat *fd_st );
extern struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sharing,
unsigned int options );
extern struct fd *get_fd_object_for_mapping( struct fd *fd, unsigned int access, unsigned int sharing );
@@ -160,7 +162,7 @@ extern const char *get_timeout_str( timeout_t timeout );
extern struct file *get_file_obj( struct process *process, obj_handle_t handle,
unsigned int access );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
#Subject: [PATCH v3 resend 4/4] kernelbase: Reimplement GetVolumeInformation on top of GetVolumeInformationByHandle.
Message-Id: <CAEU2+vr5jGk7KCy2R1oXT9vZ04U2OXG5rK-mzFFYtLhqok+DUQ@mail.gmail.com>
Date: Tue, 8 Sep 2020 14:02:32 -0600
#Subject: [PATCH v6 5/5] kernelbase: Reimplement GetVolumeInformation on top of GetVolumeInformationByHandle.
Message-Id: <CAEU2+vrAcFN5oXJvunL0umLXW4W0je0K41cEfEtPkAkDre=StQ@mail.gmail.com>
Date: Sat, 6 Feb 2021 11:26:05 -0700

This patch removes the volume querying information duplication in
kernelbase by re-implementing GetVolumeInformation using
GetVolumeInformationByHandle (itself implemented with
NtQueryVolumeInformationFile).

v6: No change
v5: Rebase against 1b1b6c5f7d28768feb853eefd015aa714b819ed4
v4: Reordered (no content change)
v3: No change
v2: Reordered (no content change)

Best,
Erich

From b2b78f771ea781668504204b5ce0595500edf012 Mon Sep 17 00:00:00 2001
From ca214462c58c706ada239bb11a39bb44fa7f6541 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Fri, 15 May 2020 22:07:10 -0600
Subject: kernelbase: Reimplement GetVolumeInformation on top of
Expand All @@ -20,14 +26,14 @@ Subject: kernelbase: Reimplement GetVolumeInformation on top of
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/kernel32/tests/volume.c | 40 +++
dlls/kernelbase/volume.c | 597 +------------------------------------------
2 files changed, 46 insertions(+), 591 deletions(-)
dlls/kernelbase/volume.c | 595 +----------------------------------
2 files changed, 46 insertions(+), 589 deletions(-)

diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c
index ead06764a11..7db5f14feca 100644
index 5199a4992d8..6f8884c7bc8 100644
--- a/dlls/kernel32/tests/volume.c
+++ b/dlls/kernel32/tests/volume.c
@@ -1491,6 +1491,8 @@ static void test_GetVolumeInformationByHandle(void)
@@ -1522,6 +1522,8 @@ static void test_GetVolumeInformationByHandle(void)
FILE_FS_VOLUME_INFORMATION *volume_info = (void *)buffer;
DWORD serial, filename_len, flags;
WCHAR label[20], fsname[20];
Expand All @@ -36,13 +42,13 @@ index ead06764a11..7db5f14feca 100644
IO_STATUS_BLOCK io;
HANDLE file;
NTSTATUS status;
@@ -1547,6 +1549,44 @@ static void test_GetVolumeInformationByHandle(void)
@@ -1578,6 +1580,44 @@ static void test_GetVolumeInformationByHandle(void)
"expected label length %u, got %u\n", volume_info->VolumeLabelLength / sizeof(WCHAR), wcslen( label ));

CloseHandle( file );
+
+ /* get the unique volume name for the windows drive */
+ ret = pGetVolumeNameForVolumeMountPointA(Root_Slash, volume, MAX_PATH);
+ ret = GetVolumeNameForVolumeMountPointA(Root_Slash, volume, MAX_PATH);
+ ok(ret == TRUE, "GetVolumeNameForVolumeMountPointA failed\n");
+
+ /* try again with unique volume name */
Expand Down Expand Up @@ -82,11 +88,11 @@ index ead06764a11..7db5f14feca 100644

START_TEST(volume)
diff --git a/dlls/kernelbase/volume.c b/dlls/kernelbase/volume.c
index 53cc0d49b65..3c4e2fd2ec1 100644
index 7daf9c98823..3c4e2fd2ec1 100644
--- a/dlls/kernelbase/volume.c
+++ b/dlls/kernelbase/volume.c
@@ -149,500 +149,6 @@ static DWORD get_mountmgr_drive_type( LPCWSTR root )
return data.type;
return data.type;
}

-/* get the label by reading it from a file at the root of the filesystem */
Expand Down Expand Up @@ -586,7 +592,7 @@ index 53cc0d49b65..3c4e2fd2ec1 100644

/***********************************************************************
* GetVolumeInformationW (kernelbase.@)
@@ -658,9 +162,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetVolumeInformationW( LPCWSTR root, LPWSTR label,
@@ -656,9 +162,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetVolumeInformationW( LPCWSTR root, LPWSTR label,
UNICODE_STRING nt_name;
IO_STATUS_BLOCK io;
OBJECT_ATTRIBUTES attr;
Expand All @@ -596,7 +602,7 @@ index 53cc0d49b65..3c4e2fd2ec1 100644
BOOL ret = FALSE;

if (!root) root = L"\\";
@@ -683,8 +185,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetVolumeInformationW( LPCWSTR root, LPWSTR label,
@@ -681,8 +185,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetVolumeInformationW( LPCWSTR root, LPWSTR label,
goto done;
}

Expand All @@ -605,7 +611,7 @@ index 53cc0d49b65..3c4e2fd2ec1 100644
attr.Length = sizeof(attr);
attr.RootDirectory = 0;
attr.Attributes = OBJ_CASE_INSENSITIVE;
@@ -692,99 +192,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetVolumeInformationW( LPCWSTR root, LPWSTR label,
@@ -690,99 +192,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetVolumeInformationW( LPCWSTR root, LPWSTR label,
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;

Expand Down Expand Up @@ -711,3 +717,7 @@ index 53cc0d49b65..3c4e2fd2ec1 100644

done:
RtlFreeUnicodeString( &nt_name );

--
2.17.1

Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
#Subject: [PATCH v3 resend 2/4] mountmgr: Add support for IRP_MJ_QUERY_VOLUME_INFORMATION.
Message-Id: <CAEU2+vqA_LGW78oxm9Hq7xiXEjHJ6bYRFo9hnWL2_jnOhB729A@mail.gmail.com>
Date: Tue, 8 Sep 2020 14:01:48 -0600
#Subject: [PATCH v6 4/5] mountmgr: Add support for volume information queries.
Message-Id: <CAEU2+vpu4-kqHia0UmqxZRPK5bB0+YSaDVV0BNtn9JHE5CPf8Q@mail.gmail.com>
Date: Sat, 6 Feb 2021 11:25:43 -0700

This patch allows the mountmgr to handle the volume information
request IRP, allowing volume information to be queried from the
mountmgr.
mountmgr by ntdll.

v6: Have harddisk_query_volume return the same status as the IoStatus.
v5: No change
v4: Reordered (no content change)
v3: Use SystemBuffer instead of UserBuffer (see
8e98dcd42e13bfeb5a2397ff9bf1c7f63c224e23)
v2: Per Zeb's request, now storing the volume with the disk_device so
Expand All @@ -15,29 +18,29 @@ that the lookup doesn't require a search.
Best,
Erich

From 3ac8c619d6184f514f2ea54742b62f7b5f414c0b Mon Sep 17 00:00:00 2001
From 547dd1c1aa8f93bf2f3d194a371b16fc504acacc Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Fri, 12 Jun 2020 14:48:25 -0600
Subject: mountmgr: Add support for IRP_MJ_QUERY_VOLUME_INFORMATION.
Subject: mountmgr.sys: Add support for volume information queries.

Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/mountmgr.sys/device.c | 122 +++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 118 insertions(+), 4 deletions(-)
dlls/mountmgr.sys/device.c | 123 +++++++++++++++++++++++++++++++++++--
1 file changed, 119 insertions(+), 4 deletions(-)

diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index c8af6856043..b694dd10238 100644
index c9cee002bc0..dd2c7d70759 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -94,6 +94,7 @@ struct disk_device
@@ -91,6 +91,7 @@ struct disk_device
char *unix_device; /* unix device path */
char *unix_mount; /* unix mount point path */
char *serial; /* disk serial number */
+ struct volume *volume; /* associated volume */
};

struct volume
@@ -749,7 +750,7 @@ static DWORD VOLUME_GetAudioCDSerial( const CDROM_TOC *toc )
@@ -746,7 +747,7 @@ static DWORD VOLUME_GetAudioCDSerial( const CDROM_TOC *toc )


/* create the disk device for a given volume */
Expand All @@ -46,15 +49,15 @@ index c8af6856043..b694dd10238 100644
{
static const WCHAR harddiskvolW[] = {'\\','D','e','v','i','c','e',
'\\','H','a','r','d','d','i','s','k','V','o','l','u','m','e','%','u',0};
@@ -811,6 +812,7 @@ static NTSTATUS create_disk_device( enum device_type type, struct disk_device **
@@ -808,6 +809,7 @@ static NTSTATUS create_disk_device( enum device_type type, struct disk_device **
device->unix_device = NULL;
device->unix_mount = NULL;
device->symlink.Buffer = NULL;
+ device->volume = volume;

if (link_format)
{
@@ -933,7 +935,7 @@ static NTSTATUS create_volume( const char *udi, enum device_type type, struct vo
@@ -930,7 +932,7 @@ static NTSTATUS create_volume( const char *udi, enum device_type type, struct vo
if (!(volume = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*volume) )))
return STATUS_NO_MEMORY;

Expand All @@ -63,7 +66,7 @@ index c8af6856043..b694dd10238 100644
{
if (udi) set_volume_udi( volume, udi );
list_add_tail( &volumes_list, &volume->entry );
@@ -1128,7 +1130,7 @@ static NTSTATUS set_volume_info( struct volume *volume, struct dos_drive *drive,
@@ -1125,7 +1127,7 @@ static NTSTATUS set_volume_info( struct volume *volume, struct dos_drive *drive,

if (type != disk_device->type)
{
Expand All @@ -72,8 +75,8 @@ index c8af6856043..b694dd10238 100644
if (volume->mount)
{
delete_mount_point( volume->mount );
@@ -1829,6 +1831,117 @@ static void query_property( struct disk_device *device, IRP *irp )
}
@@ -1826,6 +1828,118 @@ static NTSTATUS query_property( struct disk_device *device, IRP *irp )
return status;
}

+static NTSTATUS WINAPI harddisk_query_volume( DEVICE_OBJECT *device, IRP *irp )
Expand All @@ -84,15 +87,15 @@ index c8af6856043..b694dd10238 100644
+ struct disk_device *dev = device->DeviceExtension;
+ PIO_STATUS_BLOCK io = &irp->IoStatus;
+ struct volume *volume;
+ NTSTATUS status;
+
+ TRACE( "volume query %x length %u\n", info_class,
+ length );
+ TRACE( "volume query %x length %u\n", info_class, length );
+
+ EnterCriticalSection( &device_section );
+ volume = dev->volume;
+ if (!volume)
+ {
+ io->u.Status = STATUS_BAD_DEVICE_TYPE;
+ status = STATUS_BAD_DEVICE_TYPE;
+ goto done;
+ }
+
Expand All @@ -105,7 +108,7 @@ index c8af6856043..b694dd10238 100644
+
+ if (length < sizeof(FILE_FS_VOLUME_INFORMATION))
+ {
+ io->u.Status = STATUS_INFO_LENGTH_MISMATCH;
+ status = STATUS_INFO_LENGTH_MISMATCH;
+ break;
+ }
+
Expand All @@ -117,7 +120,7 @@ index c8af6856043..b694dd10238 100644
+ memcpy( info->VolumeLabel, volume->label, info->VolumeLabelLength );
+
+ io->Information = offsetof( FILE_FS_VOLUME_INFORMATION, VolumeLabel ) + info->VolumeLabelLength;
+ io->u.Status = STATUS_SUCCESS;
+ status = STATUS_SUCCESS;
+ break;
+ }
+ case FileFsAttributeInformation:
Expand All @@ -133,7 +136,7 @@ index c8af6856043..b694dd10238 100644
+
+ if (length < sizeof(FILE_FS_ATTRIBUTE_INFORMATION))
+ {
+ io->u.Status = STATUS_INFO_LENGTH_MISMATCH;
+ status = STATUS_INFO_LENGTH_MISMATCH;
+ break;
+ }
+
Expand Down Expand Up @@ -172,25 +175,26 @@ index c8af6856043..b694dd10238 100644
+ }
+
+ io->Information = offsetof( FILE_FS_ATTRIBUTE_INFORMATION, FileSystemName ) + info->FileSystemNameLength;
+ io->u.Status = STATUS_SUCCESS;
+ status = STATUS_SUCCESS;
+ break;
+ }
+ default:
+ FIXME("Unsupported volume query %x\n", irpsp->Parameters.QueryVolume.FsInformationClass);
+ io->u.Status = STATUS_NOT_SUPPORTED;
+ status = STATUS_NOT_SUPPORTED;
+ break;
+ }
+
+done:
+ io->u.Status = status;
+ LeaveCriticalSection( &device_section );
+ IoCompleteRequest( irp, IO_NO_INCREMENT );
+ return STATUS_SUCCESS;
+ return status;
+}
+
/* handler for ioctls on the harddisk device */
static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
{
@@ -1926,9 +2039,10 @@ NTSTATUS WINAPI harddisk_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *pa
@@ -1925,9 +2039,10 @@ NTSTATUS WINAPI harddisk_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *pa

harddisk_driver = driver;
driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = harddisk_ioctl;
Expand All @@ -202,3 +206,7 @@ index c8af6856043..b694dd10238 100644

create_drive_devices();


--
2.17.1

Loading

0 comments on commit 9a01ee0

Please sign in to comment.