From 55b5e3a727a6a7d108fbbc3ebefe22ec84d70f7e Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 28 Sep 2009 19:56:10 +0200 Subject: [PATCH] kernel32: Make system.drv into a stand-alone 16-bit module. --- .gitignore | 1 - configure | 9 +++++++++ configure.ac | 1 + dlls/Makefile.in | 3 +-- dlls/kernel32/Makefile.in | 2 -- dlls/system.drv16/Makefile.in | 13 +++++++++++++ dlls/{kernel32 => system.drv16}/system.c | 8 +++++++- .../system.drv16.spec} | 0 8 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 dlls/system.drv16/Makefile.in rename dlls/{kernel32 => system.drv16}/system.c (96%) rename dlls/{kernel32/system.drv.spec => system.drv16/system.drv16.spec} (100%) diff --git a/.gitignore b/.gitignore index f439b356d3d..45362c3aaa3 100644 --- a/.gitignore +++ b/.gitignore @@ -119,7 +119,6 @@ dlls/setupx.dll16 dlls/shdocvw/shdocvw_v1.tlb dlls/stdole2.tlb/std_ole_v2.tlb dlls/stdole32.tlb/std_ole_v1.tlb -dlls/system.drv16 dlls/toolhelp.dll16 dlls/user.exe16 dlls/ver.dll16 diff --git a/configure b/configure index 2c8e4e53ec5..b2cbd879430 100755 --- a/configure +++ b/configure @@ -16657,6 +16657,14 @@ ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/sxs/Makefile: dlls/sxs/Makefile.in dlls/Makedll.rules" ac_config_files="$ac_config_files dlls/sxs/Makefile" +ALL_MAKEFILES="$ALL_MAKEFILES \\ + dlls/system.drv16/Makefile" +test "x$enable_win16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ + system.drv16" +ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS +dlls/system.drv16/Makefile: dlls/system.drv16/Makefile.in dlls/Makedll.rules" +ac_config_files="$ac_config_files dlls/system.drv16/Makefile" + ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/t2embed/Makefile" test "x$enable_t2embed" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ @@ -19045,6 +19053,7 @@ do "dlls/strmiids/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/strmiids/Makefile" ;; "dlls/svrapi/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/svrapi/Makefile" ;; "dlls/sxs/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/sxs/Makefile" ;; + "dlls/system.drv16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/system.drv16/Makefile" ;; "dlls/t2embed/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/t2embed/Makefile" ;; "dlls/tapi32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/tapi32/Makefile" ;; "dlls/traffic/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/traffic/Makefile" ;; diff --git a/configure.ac b/configure.ac index b77357371a3..5fb8e9b2258 100644 --- a/configure.ac +++ b/configure.ac @@ -2443,6 +2443,7 @@ WINE_CONFIG_MAKEFILE([dlls/stress.dll16/Makefile],[dlls/Makedll.rules],[dlls],[A WINE_CONFIG_MAKEFILE([dlls/strmiids/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS]) WINE_CONFIG_MAKEFILE([dlls/svrapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/sxs/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/system.drv16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16]) WINE_CONFIG_MAKEFILE([dlls/t2embed/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/tapi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/traffic/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index de007a7ef9b..78be3377275 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -23,7 +23,6 @@ WIN16_FILES = \ krnl386.exe16 \ mmsystem.dll16 \ setupx.dll16 \ - system.drv16 \ toolhelp.dll16 \ user.exe16 \ ver.dll16 \ @@ -45,7 +44,7 @@ commdlg.dll16: gdi.exe16: echo "gdi32.dll" >$@ -krnl386.exe16 system.drv16 toolhelp.dll16: +krnl386.exe16 toolhelp.dll16: echo "kernel32.dll" >$@ setupx.dll16: diff --git a/dlls/kernel32/Makefile.in b/dlls/kernel32/Makefile.in index 299f3247e8f..a64b699d3a5 100644 --- a/dlls/kernel32/Makefile.in +++ b/dlls/kernel32/Makefile.in @@ -11,7 +11,6 @@ EXTRADLLFLAGS = -Wb,-F,KERNEL32.dll -Wl,--image-base,0x7b800000 SPEC_SRCS16 = \ krnl386.exe.spec \ - system.drv.spec \ toolhelp.spec C_SRCS = \ @@ -55,7 +54,6 @@ C_SRCS = \ string.c \ sync.c \ syslevel.c \ - system.c \ tape.c \ task.c \ thread.c \ diff --git a/dlls/system.drv16/Makefile.in b/dlls/system.drv16/Makefile.in new file mode 100644 index 00000000000..2fa90cf6529 --- /dev/null +++ b/dlls/system.drv16/Makefile.in @@ -0,0 +1,13 @@ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = system.drv16 +IMPORTS = kernel32 +EXTRADLLFLAGS = -Wb,--subsystem,win16 + +C_SRCS = system.c + +@MAKE_DLL_RULES@ + +@DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/kernel32/system.c b/dlls/system.drv16/system.c similarity index 96% rename from dlls/kernel32/system.c rename to dlls/system.drv16/system.c index 9395d83302a..46ab04ec93d 100644 --- a/dlls/kernel32/system.c +++ b/dlls/system.drv16/system.c @@ -122,6 +122,7 @@ static void SYSTEM_StopTicks(void) DWORD WINAPI InquireSystem16( WORD code, WORD arg ) { WORD drivetype; + WCHAR root[3]; switch(code) { @@ -129,7 +130,12 @@ DWORD WINAPI InquireSystem16( WORD code, WORD arg ) return SYS_TIMER_RATE; case 1: /* Get drive type */ - drivetype = GetDriveType16( arg ); + root[0] = 'A' + arg; + root[1] = ':'; + root[2] = 0; + drivetype = GetDriveTypeW( root ); + if (drivetype == DRIVE_CDROM) drivetype = DRIVE_REMOTE; + else if (drivetype == DRIVE_NO_ROOT_DIR) drivetype = DRIVE_UNKNOWN; return MAKELONG( drivetype, drivetype ); case 2: /* Enable one-drive logic */ diff --git a/dlls/kernel32/system.drv.spec b/dlls/system.drv16/system.drv16.spec similarity index 100% rename from dlls/kernel32/system.drv.spec rename to dlls/system.drv16/system.drv16.spec