[Wine-patches] [eterhack] mountmgr.sys: Add support for WINEAUTOMOUNT=no (eterbug #4327).

Alexander Morozov amorozov на etersoft.ru
Ср Окт 28 15:53:08 MSK 2009


----------- следующая часть -----------
From 31ec2f74fdae59a3fd8ac63aac645e06eb0bbc8d Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Wed, 28 Oct 2009 14:59:10 +0300
Subject: [eterhack] mountmgr.sys: Add support for WINEAUTOMOUNT=no (eterbug #4327).

---
 dlls/mountmgr.sys/mountmgr.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c
index 8dd6054..4b59dbd 100644
--- a/dlls/mountmgr.sys/mountmgr.c
+++ b/dlls/mountmgr.sys/mountmgr.c
@@ -19,6 +19,7 @@
  */
 
 #include <stdarg.h>
+#include <stdlib.h>
 #include <unistd.h>
 
 #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;
 }
-- 
1.6.4.4



Подробная информация о списке рассылки Wine-patches