From a0007a83d002dd7dc51d81c172eacbf68225d5d5 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Wed, 28 Oct 2009 14:59:10 +0300 Subject: [PATCH] mountmgr.sys: Add support for WINEAUTOMOUNT=no (eterbug #4327). --- dlls/mountmgr.sys/mountmgr.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c index 62daa21f87..609ed3f836 100644 --- a/dlls/mountmgr.sys/mountmgr.c +++ b/dlls/mountmgr.sys/mountmgr.c @@ -19,6 +19,7 @@ */ #include +#include #include #define NONAMELESSUNION @@ -430,6 +431,13 @@ static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp ) return status; } +static int automount_enabled(void) +{ + char *automount = getenv( "WINEAUTOMOUNT" ); + if (automount && !strcmp( automount, "no" )) return 0; + return 1; +} + /* main entry point for the mount point manager driver */ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) { @@ -462,8 +470,10 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) RtlInitUnicodeString( &nameW, harddiskW ); status = IoCreateDriver( &nameW, harddisk_driver_entry ); - initialize_hal(); - initialize_diskarbitration(); - + if (automount_enabled()) + { + initialize_hal(); + initialize_diskarbitration(); + } return status; } -- 2.33.8