Module: wine Branch: master Commit: 808d4a77f7d719b2985e1df9c996a427606cb079 URL: https://source.winehq.org/git/wine.git/?a=commit;h=808d4a77f7d719b2985e1df9c...
Author: Rémi Bernon rbernon@codeweavers.com Date: Thu May 5 14:20:01 2022 +0200
mountmgr.sys: Avoid passing a stack pointer to the run_loop thread.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/mountmgr.sys/mountmgr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c index 1f9bd56a384..66034621b44 100644 --- a/dlls/mountmgr.sys/mountmgr.c +++ b/dlls/mountmgr.sys/mountmgr.c @@ -609,7 +609,8 @@ static DWORD WINAPI device_op_thread( void *arg )
static DWORD WINAPI run_loop_thread( void *arg ) { - return MOUNTMGR_CALL( run_loop, arg ); + struct run_loop_params params = {.op_thread = arg, .op_apc = device_op}; + return MOUNTMGR_CALL( run_loop, ¶ms ); }
@@ -624,7 +625,7 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) DEVICE_OBJECT *device; HKEY devicemap_key; NTSTATUS status; - struct run_loop_params params; + HANDLE thread;
TRACE( "%s\n", debugstr_w(path->Buffer) );
@@ -655,9 +656,8 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) RtlInitUnicodeString( &nameW, L"\Driver\Harddisk" ); status = IoCreateDriver( &nameW, harddisk_driver_entry );
- params.op_thread = CreateThread( NULL, 0, device_op_thread, NULL, 0, NULL ); - params.op_apc = device_op; - CloseHandle( CreateThread( NULL, 0, run_loop_thread, ¶ms, 0, NULL )); + thread = CreateThread( NULL, 0, device_op_thread, NULL, 0, NULL ); + CloseHandle( CreateThread( NULL, 0, run_loop_thread, thread, 0, NULL ));
#ifdef _WIN64 /* create a symlink so that the Wine port overrides key can be edited with 32-bit reg or regedit */