Move parport and usbhub drivers to mountmgr.sys (eterbug #4301).
authorAlexander Morozov <amorozov@etersoft.ru>
Thu, 3 Mar 2011 18:22:27 +0000 (21:22 +0300)
committerTest Robot <wine-patches-test@office.etersoft.ru>
Fri, 4 Mar 2011 14:40:21 +0000 (17:40 +0300)
17 files changed:
configure
configure.ac
dlls/hal/hal.c
dlls/mountmgr.sys/Makefile.in
dlls/mountmgr.sys/device.c
dlls/mountmgr.sys/mountmgr.c
dlls/mountmgr.sys/mountmgr.h
dlls/mountmgr.sys/mountmgr.sys.spec
dlls/mountmgr.sys/parport.c [moved from dlls/parport.sys/parport.c with 92% similarity]
dlls/mountmgr.sys/usbhub.c [moved from dlls/usbhub.sys/usbhub.c with 99% similarity]
dlls/ntoskrnl.exe/instr.c
dlls/parport.sys/Makefile.in [deleted file]
dlls/parport.sys/parport.sys.spec [deleted file]
dlls/usbhub.sys/Makefile.in [deleted file]
dlls/usbhub.sys/usbhub.sys.spec [deleted file]
programs/services/services.c
tools/wine.inf.in

index 47d7c0495a09c26570bdddf3802c11fd6a4fcdc4..80c5c7d6475e2fd92cc5e6bebe1e402e20220221 100755 (executable)
--- a/configure
+++ b/configure
@@ -15539,7 +15539,6 @@ wine_fn_config_dll openal32 enable_openal32
 wine_fn_config_dll opencl enable_opencl
 wine_fn_config_dll opengl32 enable_opengl32 implib
 wine_fn_config_test dlls/opengl32/tests opengl32_test
-wine_fn_config_dll parport.sys enable_parport_sys implib
 wine_fn_config_dll pdh enable_pdh implib
 wine_fn_config_test dlls/pdh/tests pdh_test
 wine_fn_config_dll pidgen enable_pidgen
@@ -15633,7 +15632,6 @@ wine_fn_config_dll url enable_url implib
 wine_fn_config_dll urlmon enable_urlmon implib
 wine_fn_config_test dlls/urlmon/tests urlmon_test
 wine_fn_config_dll usbd.sys enable_usbd_sys implib
-wine_fn_config_dll usbhub.sys enable_usbhub_sys
 wine_fn_config_dll user.exe16 enable_win16
 wine_fn_config_dll user32 enable_user32 po,implib
 wine_fn_config_test dlls/user32/tests user32_test
index 1a80dc9584e9420f20fe93bf4e290c55e1371703..32eb80e468f8baf770689e1fc873fcf43e69d5d7 100644 (file)
@@ -2734,7 +2734,6 @@ WINE_CONFIG_DLL(openal32)
 WINE_CONFIG_DLL(opencl)
 WINE_CONFIG_DLL(opengl32,,[implib])
 WINE_CONFIG_TEST(dlls/opengl32/tests)
-WINE_CONFIG_DLL(parport.sys,,[implib])
 WINE_CONFIG_DLL(pdh,,[implib])
 WINE_CONFIG_TEST(dlls/pdh/tests)
 WINE_CONFIG_DLL(pidgen)
@@ -2828,7 +2827,6 @@ WINE_CONFIG_DLL(url,,[implib])
 WINE_CONFIG_DLL(urlmon,,[implib])
 WINE_CONFIG_TEST(dlls/urlmon/tests)
 WINE_CONFIG_DLL(usbd.sys,,[implib])
-WINE_CONFIG_DLL(usbhub.sys)
 WINE_CONFIG_DLL(user.exe16,enable_win16)
 WINE_CONFIG_DLL(user32,,[po,implib])
 WINE_CONFIG_TEST(dlls/user32/tests)
index d1f37648ed169699547f8f2096f3b2ff62f79401..7d1a23ab5836f09f4112a22c4321aa4dea9c749d 100644 (file)
@@ -194,14 +194,14 @@ void WINAPI KeStallExecutionProcessor(ULONG MicroSeconds)
 
 static void init_parport(void)
 {
-    static const WCHAR parportW[] = {'p','a','r','p','o','r','t','.','s','y','s',0};
+    static const WCHAR mountmgrW[] = {'m','o','u','n','t','m','g','r','.','s','y','s',0};
 
-    HMODULE parport = GetModuleHandleW( parportW );
+    HMODULE mountmgr = GetModuleHandleW( mountmgrW );
 
-    if (parport)
+    if (mountmgr)
     {
-        pp_read = (void *)GetProcAddress( parport, "__wine_read_parport" );
-        pp_write = (void *)GetProcAddress( parport, "__wine_write_parport" );
+        pp_read = (void *)GetProcAddress( mountmgr, "__wine_read_parport" );
+        pp_write = (void *)GetProcAddress( mountmgr, "__wine_write_parport" );
     }
     if (!pp_read || !pp_write)
         ERR( "failed to load parport functions\n" );
index c4605e4f81917a0a2a06c96728668c1f9e81835b..14b033f1ef642e9a69cd38fb28848035ae9bb8f1 100644 (file)
@@ -3,12 +3,15 @@ IMPORTS   = uuid advapi32 ntoskrnl.exe setupapi
 DELAYIMPORTS = user32
 EXTRADLLFLAGS = -Wb,--subsystem,native
 EXTRADEFS = @HALINCL@
-EXTRALIBS = @DISKARBITRATIONLIB@
+EXTRAINCL = @USBINCL@
+EXTRALIBS = @DISKARBITRATIONLIB@ @USBLIBS@ @IEEE1284LIBS@
 
 C_SRCS = \
        device.c \
        diskarb.c \
        hal.c \
-       mountmgr.c
+       mountmgr.c \
+       parport.c \
+       usbhub.c
 
 @MAKE_DLL_RULES@
index ed8e8c6ee44e2f13c689f62dac0d2f026ae061a5..8142c9305fc928dc855fbee1cbd90149755676a2 100644 (file)
@@ -29,8 +29,6 @@
 #include <sys/types.h>
 #include <dirent.h>
 
-#define INITGUID
-
 #include "mountmgr.h"
 #include "winreg.h"
 #include "winuser.h"
index c6dca131e994e030c4d7b17e1712ef15d7a1a45a..191d9699a1d0acff1a78b01e85ea83d5770c84c2 100644 (file)
@@ -445,6 +445,8 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
     static const WCHAR device_mountmgrW[] = {'\\','D','e','v','i','c','e','\\','M','o','u','n','t','P','o','i','n','t','M','a','n','a','g','e','r',0};
     static const WCHAR link_mountmgrW[] = {'\\','?','?','\\','M','o','u','n','t','P','o','i','n','t','M','a','n','a','g','e','r',0};
     static const WCHAR harddiskW[] = {'\\','D','r','i','v','e','r','\\','H','a','r','d','d','i','s','k',0};
+    static const WCHAR parportW[] = {'\\','D','r','i','v','e','r','\\','P','a','r','p','o','r','t',0};
+    static const WCHAR usbhubW[] = {'\\','D','r','i','v','e','r','\\','u','s','b','h','u','b',0};
     static const WCHAR devicemapW[] = {'H','A','R','D','W','A','R','E','\\','D','E','V','I','C','E','M','A','P',0};
     static const WCHAR parallelW[] = {'P','A','R','A','L','L','E','L',' ','P','O','R','T','S',0};
     static const WCHAR serialW[] = {'S','E','R','I','A','L','C','O','M','M',0};
@@ -486,6 +488,12 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
     RtlInitUnicodeString( &nameW, harddiskW );
     status = IoCreateDriver( &nameW, harddisk_driver_entry );
 
+    RtlInitUnicodeString( &nameW, parportW );
+    status = IoCreateDriver( &nameW, parport_driver_entry );
+
+    RtlInitUnicodeString( &nameW, usbhubW );
+    status = IoCreateDriver( &nameW, usbhub_driver_entry );
+
     if (automount_enabled())
     {
         initialize_hal();
index 6d29c2fa899bbdf7a1647bde4a8fd38405bad747..ba62543c27c5a679af5f8165e1ba1ede61c97420 100644 (file)
 #define WINE_MOUNTMGR_EXTENSIONS
 #include "ntddstor.h"
 #include "ntddcdrm.h"
+#include "ntddpar.h"
 #include "ddk/wdm.h"
 #include "ddk/mountmgr.h"
 
 extern void initialize_hal(void);
 extern void initialize_diskarbitration(void);
 
+extern NTSTATUS WINAPI usbhub_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path );
+extern NTSTATUS WINAPI parport_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path );
+
 /* device functions */
 
 enum device_type
index 76421d7e35b494d3bcc24aa5b22a07c22d8b0f69..4848c4ab686b4eff0a88ebc6de18ea7bf6d07025 100644 (file)
@@ -1 +1,8 @@
-# nothing to export
+################################################################
+# Wine internal extensions
+#
+# All functions must be prefixed with '__wine_' (for internal functions)
+# or 'wine_' (for user-visible functions) to avoid namespace conflicts.
+
+@ cdecl __wine_read_parport(ptr)
+@ cdecl __wine_write_parport(ptr long)
similarity index 92%
rename from dlls/parport.sys/parport.c
rename to dlls/mountmgr.sys/parport.c
index 903ee741e934726b8cf918d014c0c47af667bc34..4f460d09a168f20eb9a64de79be9addd77eb36e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009 Alexander Morozov for Etersoft
+ * Copyright 2009 - 2011 Alexander Morozov for Etersoft
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
 
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
-#define INITGUID
-
-#include "ntstatus.h"
-#define WIN32_NO_STATUS
-#include "windef.h"
-#include "winternl.h"
-#include "winioctl.h"
-#include "winbase.h"
-#include "winuser.h"
+
+#include "mountmgr.h"
 #include "winreg.h"
+#include "winuser.h"
 #include "setupapi.h"
-#include "ntddpar.h"
-#include "ddk/ntddk.h"
 #include "ddk/parallel.h"
 #include "wine/unicode.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(parport);
 
-
 #ifdef HAVE_LIBIEEE1284
 static const WCHAR device_idW[] = {'A','C','P','I','\\',
                                    'P','N','P','0','4','0','0','\\','%','d',0};
@@ -358,31 +349,8 @@ void CDECL __wine_write_parport( UCHAR *port, UCHAR value )
 #endif
 }
 
-static void WINAPI parport_unload( DRIVER_OBJECT *driver )
-{
-#ifdef HAVE_LIBIEEE1284
-    DEVICE_OBJECT *device = driver->DeviceObject, *device2;
-    struct ParPortExtension *ppe;
-
-    while (device)
-    {
-        device2 = device->NextDevice;
-        ppe = device->DeviceExtension;
-        if (ppe->interface.Buffer)
-        {
-            IoSetDeviceInterfaceState( &ppe->interface, FALSE );
-            RtlFreeUnicodeString( &ppe->interface );
-        }
-        IoDeleteDevice( device );
-        device = device2;
-    }
-    ieee1284_free_ports( &pp_list );
-#endif
-}
-
-NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
+NTSTATUS WINAPI parport_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
 {
-    driver->DriverUnload = parport_unload;
 #ifdef HAVE_LIBIEEE1284
     driver->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = parport_ioctl;
     driver->MajorFunction[IRP_MJ_PNP] = parport_pnp;
similarity index 99%
rename from dlls/usbhub.sys/usbhub.c
rename to dlls/mountmgr.sys/usbhub.c
index 2bed71527edef8820769a250cffe6f2aebca8cd9..2ec236e4312864f919f49da57e136096f987e870 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2009 Alexander Morozov for Etersoft
+ * Copyright 2008 - 2011 Alexander Morozov for Etersoft
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -21,7 +21,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 
 #ifdef HAVE_LIBUSB_H
 #include <libusb.h>
 #define NONAMELESSSTRUCT
 #define INITGUID
 
-#include "ntstatus.h"
-#define WIN32_NO_STATUS
-#include "windef.h"
-#include "winbase.h"
-#include "winternl.h"
-#include "winioctl.h"
+#include "mountmgr.h"
 #include "winreg.h"
 #include "winsvc.h"
 #include "winuser.h"
 #include "setupapi.h"
 #include "cfgmgr32.h"
 #include "devguid.h"
-#include "ddk/ntddk.h"
 #define WINE_USBHUB_EXTENSIONS
 #include "ddk/usbdrivr.h"
 #include "ddk/usbioctl.h"
@@ -1714,7 +1707,7 @@ end:
 
 #endif
 
-NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
+NTSTATUS WINAPI usbhub_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
 {
 #ifdef HAVE_LIBUSB
     HANDLE thread;
index 53e79fb80e5dcd8e5995fcfa0de35f2b7a15f0d3..7accf3e21fea3c3594e0e0eaf0f3cec9714cb256 100644 (file)
@@ -253,14 +253,14 @@ static BYTE *INSTR_GetOperandAddr( CONTEXT *context, BYTE *instr,
  */
 static void init_parport(void)
 {
-    static const WCHAR parportW[] = {'p','a','r','p','o','r','t','.','s','y','s',0};
+    static const WCHAR mountmgrW[] = {'m','o','u','n','t','m','g','r','.','s','y','s',0};
 
-    HMODULE parport = GetModuleHandleW( parportW );
+    HMODULE mountmgr = GetModuleHandleW( mountmgrW );
 
-    if (parport)
+    if (mountmgr)
     {
-        pp_read = (void *)GetProcAddress( parport, "__wine_read_parport" );
-        pp_write = (void *)GetProcAddress( parport, "__wine_write_parport" );
+        pp_read = (void *)GetProcAddress( mountmgr, "__wine_read_parport" );
+        pp_write = (void *)GetProcAddress( mountmgr, "__wine_write_parport" );
     }
     if (!pp_read || !pp_write)
         ERR( "failed to load parport functions\n" );
diff --git a/dlls/parport.sys/Makefile.in b/dlls/parport.sys/Makefile.in
deleted file mode 100644 (file)
index c59e329..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-MODULE    = parport.sys
-IMPORTLIB = parport.sys
-IMPORTS   = ntoskrnl.exe setupapi
-EXTRADLLFLAGS = -Wb,--subsystem,native
-EXTRALIBS = @IEEE1284LIBS@
-
-C_SRCS = \
-       parport.c
-
-@MAKE_DLL_RULES@
diff --git a/dlls/parport.sys/parport.sys.spec b/dlls/parport.sys/parport.sys.spec
deleted file mode 100644 (file)
index 4848c4a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-################################################################
-# Wine internal extensions
-#
-# All functions must be prefixed with '__wine_' (for internal functions)
-# or 'wine_' (for user-visible functions) to avoid namespace conflicts.
-
-@ cdecl __wine_read_parport(ptr)
-@ cdecl __wine_write_parport(ptr long)
diff --git a/dlls/usbhub.sys/Makefile.in b/dlls/usbhub.sys/Makefile.in
deleted file mode 100644 (file)
index 7594887..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-MODULE    = usbhub.sys
-IMPORTS   = ntoskrnl.exe advapi32 setupapi
-EXTRADLLFLAGS = -Wb,--subsystem,native
-EXTRAINCL = @USBINCL@
-EXTRALIBS = @USBLIBS@
-
-C_SRCS = \
-       usbhub.c
-
-@MAKE_DLL_RULES@
diff --git a/dlls/usbhub.sys/usbhub.sys.spec b/dlls/usbhub.sys/usbhub.sys.spec
deleted file mode 100644 (file)
index 76421d7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-# nothing to export
index 12b44375309a24a3b9e270f2c81f5f5fb2c0fc40..9743c25027af3dead22a41c3a9bece7f396516f7 100644 (file)
@@ -254,7 +254,7 @@ static void scmdatabase_autostart_services(struct scmdatabase *db)
 #ifdef HAVE_LIBUSB
     static const WCHAR usbhub_started_event[] = {'_','_','w','i','n','e',
         '_','U','s','b','h','u','b','S','t','a','r','t','e','d',0};
-    static const WCHAR usbhub[] = {'U','s','b','h','u','b',0};
+    static const WCHAR mountmgr[] = {'M','o','u','n','t','M','g','r',0};
 #endif
     struct service_entry **services_list;
     unsigned int i = 0;
@@ -302,7 +302,7 @@ static void scmdatabase_autostart_services(struct scmdatabase *db)
         argv[0] = service->name;
         argv[1] = NULL;
 #ifdef HAVE_LIBUSB
-        if (!strcmpW(service->name, usbhub))
+        if (!strcmpW(service->name, mountmgr))
             event = CreateEventW(NULL, TRUE, FALSE, usbhub_started_event);
 #endif
         err = service_start(service, 1, argv);
index 395c6db09d192801f5bc42a56804bbcde121c0c7..8f94c0622ad639508d00727acddcb6bafff89052 100644 (file)
@@ -127,17 +127,13 @@ AddReg=\
 
 [DefaultInstall.Services]
 AddService=MountMgr,0x800,MountMgrService
-AddService=Parport,0,ParPortService
 AddService=Spooler,0,SpoolerService
-AddService=Usbhub,0,UsbhubService
 AddService=TermService,0,TerminalServices
 AddService=PlugPlay,0,PlugPlayService
 
 [DefaultInstall.NT.Services]
 AddService=MountMgr,0x800,MountMgrService
-AddService=Parport,0,ParPortService
 AddService=Spooler,0,SpoolerService
-AddService=Usbhub,0,UsbhubService
 AddService=TermService,0,TerminalServices
 AddService=PlugPlay,0,PlugPlayService
 
@@ -2608,8 +2604,6 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
 11,,notepad.exe
 11,,winetest.exe,-
 12,,mountmgr.sys
-12,,parport.sys
-12,,usbhub.sys
 10,Microsoft.NET\Framework\v1.1.4322,aspnet_regiis.exe
 10,Microsoft.NET\Framework\v1.1.4322,ngen.exe
 10,Microsoft.NET\Framework\v1.1.4322,fusion.dll
@@ -3010,12 +3004,6 @@ ServiceType=1
 StartType=2
 ErrorControl=1
 
-[ParPortService]
-ServiceBinary="%12%\parport.sys"
-ServiceType=1
-StartType=2
-ErrorControl=1
-
 [SpoolerService]
 Description="Loads files to memory for later printing"
 DisplayName="Print Spooler"
@@ -3025,12 +3013,6 @@ StartType=4
 ErrorControl=1
 LoadOrderGroup="SpoolerGroup"
 
-[UsbhubService]
-ServiceBinary="%12%\usbhub.sys"
-ServiceType=1
-StartType=2
-ErrorControl=1
-
 [TerminalServices]
 Description="Remote desktop access"
 DisplayName="Terminal Services"