From 66f6b786591e0d187967a26e9c9a1a8543ca91f1 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 1 Oct 2009 19:45:07 +0200 Subject: [PATCH] setupapi: Make setupx.dll into a stand-alone 16-bit module. --- .gitignore | 1 - configure | 9 +++++++++ configure.ac | 1 + dlls/Makefile.in | 4 ---- dlls/setupapi/Makefile.in | 8 -------- dlls/setupapi/stubs.c | 19 ------------------- dlls/setupx.dll16/Makefile.in | 18 ++++++++++++++++++ dlls/{setupapi => setupx.dll16}/devinst16.c | 0 dlls/{setupapi => setupx.dll16}/infparse.c | 1 - .../setupx.spec => setupx.dll16/setupx.dll16.spec} | 0 dlls/{setupapi => setupx.dll16}/setupx16.h | 0 dlls/{setupapi => setupx.dll16}/setupx_main.c | 19 ++++++++++++++++++- dlls/{setupapi => setupx.dll16}/virtcopy.c | 21 +++++++++++++++++---- 13 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 dlls/setupx.dll16/Makefile.in rename dlls/{setupapi => setupx.dll16}/devinst16.c (100%) rename dlls/{setupapi => setupx.dll16}/infparse.c (99%) rename dlls/{setupapi/setupx.spec => setupx.dll16/setupx.dll16.spec} (100%) rename dlls/{setupapi => setupx.dll16}/setupx16.h (100%) rename dlls/{setupapi => setupx.dll16}/setupx_main.c (96%) rename dlls/{setupapi => setupx.dll16}/virtcopy.c (97%) diff --git a/.gitignore b/.gitignore index 6c9437e8bf3..5d498c83da8 100644 --- a/.gitignore +++ b/.gitignore @@ -115,7 +115,6 @@ dlls/rpcrt4/epm_c.c dlls/rpcrt4/tests/server.h dlls/rpcrt4/tests/server_c.c dlls/rpcrt4/tests/server_s.c -dlls/setupx.dll16 dlls/shdocvw/shdocvw_v1.tlb dlls/stdole2.tlb/std_ole_v2.tlb dlls/stdole32.tlb/std_ole_v1.tlb diff --git a/configure b/configure index a68d6e8dea7..c16637c659b 100755 --- a/configure +++ b/configure @@ -16444,6 +16444,14 @@ dlls/setupapi/tests/Makefile: dlls/setupapi/tests/Makefile.in dlls/Maketest.rule ac_config_files="$ac_config_files dlls/setupapi/tests/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ + dlls/setupx.dll16/Makefile" +test "x$enable_win16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ + setupx.dll16" +ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS +dlls/setupx.dll16/Makefile: dlls/setupx.dll16/Makefile.in dlls/Makedll.rules" +ac_config_files="$ac_config_files dlls/setupx.dll16/Makefile" + +ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/sfc/Makefile" test "x$enable_sfc" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ sfc" @@ -19068,6 +19076,7 @@ do "dlls/serialui/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/serialui/tests/Makefile" ;; "dlls/setupapi/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/setupapi/Makefile" ;; "dlls/setupapi/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/setupapi/tests/Makefile" ;; + "dlls/setupx.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/setupx.dll16/Makefile" ;; "dlls/sfc/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/sfc/Makefile" ;; "dlls/sfc_os/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/sfc_os/Makefile" ;; "dlls/shdoclc/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/shdoclc/Makefile" ;; diff --git a/configure.ac b/configure.ac index 49aaa07397c..6210c2f4f6b 100644 --- a/configure.ac +++ b/configure.ac @@ -2418,6 +2418,7 @@ WINE_CONFIG_MAKEFILE([dlls/serialui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_D WINE_CONFIG_MAKEFILE([dlls/serialui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/setupapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/setupapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) +WINE_CONFIG_MAKEFILE([dlls/setupx.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16]) WINE_CONFIG_MAKEFILE([dlls/sfc/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/sfc_os/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/shdoclc/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index 60dc2ba7e50..8dcfdab85ef 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -22,7 +22,6 @@ WIN16_FILES = \ gdi.exe16 \ krnl386.exe16 \ mmsystem.dll16 \ - setupx.dll16 \ user.exe16 \ wprocs.dll16 @@ -43,9 +42,6 @@ gdi.exe16: krnl386.exe16: echo "kernel32.dll" >$@ -setupx.dll16: - echo "setupapi.dll" >$@ - user.exe16: echo "user32.dll" >$@ diff --git a/dlls/setupapi/Makefile.in b/dlls/setupapi/Makefile.in index 971a5421ed9..b72c61206db 100644 --- a/dlls/setupapi/Makefile.in +++ b/dlls/setupapi/Makefile.in @@ -23,14 +23,6 @@ C_SRCS = \ stringtable.c \ stubs.c -C_SRCS16 = \ - devinst16.c \ - infparse.c \ - setupx_main.c \ - virtcopy.c - -SPEC_SRCS16 = setupx.spec - RC_SRCS = \ Bg.rc \ Cs.rc \ diff --git a/dlls/setupapi/stubs.c b/dlls/setupapi/stubs.c index 7ba85b6ad89..1b217dbcc6d 100644 --- a/dlls/setupapi/stubs.c +++ b/dlls/setupapi/stubs.c @@ -33,25 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(setupapi); /*********************************************************************** - * TPWriteProfileString (SETUPX.62) - */ -BOOL WINAPI TPWriteProfileString16( LPCSTR section, LPCSTR entry, LPCSTR string ) -{ - FIXME( "%s %s %s: stub\n", debugstr_a(section), debugstr_a(entry), debugstr_a(string) ); - return TRUE; -} - - -/*********************************************************************** - * suErrorToIds (SETUPX.61) - */ -DWORD WINAPI suErrorToIds16( WORD w1, WORD w2 ) -{ - FIXME( "%x %x: stub\n", w1, w2 ); - return 0; -} - -/*********************************************************************** * CM_Connect_MachineA (SETUPAPI.@) */ CONFIGRET WINAPI CM_Connect_MachineA(PCSTR name, PHMACHINE machine) diff --git a/dlls/setupx.dll16/Makefile.in b/dlls/setupx.dll16/Makefile.in new file mode 100644 index 00000000000..78aca1697aa --- /dev/null +++ b/dlls/setupx.dll16/Makefile.in @@ -0,0 +1,18 @@ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = setupx.dll16 +IMPORTS = setupapi user32 advapi32 kernel32 + +EXTRADLLFLAGS = -Wb,--subsystem,win16,--main-module,setupapi.dll + +C_SRCS = \ + devinst16.c \ + infparse.c \ + setupx_main.c \ + virtcopy.c + +@MAKE_DLL_RULES@ + +@DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/setupapi/devinst16.c b/dlls/setupx.dll16/devinst16.c similarity index 100% rename from dlls/setupapi/devinst16.c rename to dlls/setupx.dll16/devinst16.c diff --git a/dlls/setupapi/infparse.c b/dlls/setupx.dll16/infparse.c similarity index 99% rename from dlls/setupapi/infparse.c rename to dlls/setupx.dll16/infparse.c index 50aca20e08a..d6cbed0085b 100644 --- a/dlls/setupapi/infparse.c +++ b/dlls/setupx.dll16/infparse.c @@ -38,7 +38,6 @@ #include "winnls.h" #include "setupapi.h" #include "setupx16.h" -#include "setupapi_private.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(setupapi); diff --git a/dlls/setupapi/setupx.spec b/dlls/setupx.dll16/setupx.dll16.spec similarity index 100% rename from dlls/setupapi/setupx.spec rename to dlls/setupx.dll16/setupx.dll16.spec diff --git a/dlls/setupapi/setupx16.h b/dlls/setupx.dll16/setupx16.h similarity index 100% rename from dlls/setupapi/setupx16.h rename to dlls/setupx.dll16/setupx16.h diff --git a/dlls/setupapi/setupx_main.c b/dlls/setupx.dll16/setupx_main.c similarity index 96% rename from dlls/setupapi/setupx_main.c rename to dlls/setupx.dll16/setupx_main.c index 06903336683..de3a3975327 100644 --- a/dlls/setupapi/setupx_main.c +++ b/dlls/setupx.dll16/setupx_main.c @@ -66,7 +66,6 @@ #include "winnls.h" #include "setupapi.h" #include "setupx16.h" -#include "setupapi_private.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(setupapi); @@ -95,6 +94,24 @@ DWORD WINAPI SURegQueryValueEx( HKEY hkey, LPSTR lpszValueName, lpbData, lpcbData ); } +/*********************************************************************** + * TPWriteProfileString (SETUPX.62) + */ +BOOL WINAPI TPWriteProfileString16( LPCSTR section, LPCSTR entry, LPCSTR string ) +{ + FIXME( "%s %s %s: stub\n", debugstr_a(section), debugstr_a(entry), debugstr_a(string) ); + return TRUE; +} + + +/*********************************************************************** + * suErrorToIds (SETUPX.61) + */ +DWORD WINAPI suErrorToIds16( WORD w1, WORD w2 ) +{ + FIXME( "%x %x: stub\n", w1, w2 ); + return 0; +} /*********************************************************************** * InstallHinfSection (SETUPX.527) diff --git a/dlls/setupapi/virtcopy.c b/dlls/setupx.dll16/virtcopy.c similarity index 97% rename from dlls/setupapi/virtcopy.c rename to dlls/setupx.dll16/virtcopy.c index 2506a6a29bd..a15f1a1d2b1 100644 --- a/dlls/setupapi/virtcopy.c +++ b/dlls/setupx.dll16/virtcopy.c @@ -31,11 +31,20 @@ #include "winnls.h" #include "setupapi.h" #include "setupx16.h" -#include "setupapi_private.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(setupapi); +/* copied from setupapi */ +#define COPYFILEDLGORD 1000 +#define SOURCESTRORD 500 +#define DESTSTRORD 501 +#define PROGRESSORD 502 + +#define REG_INSTALLEDFILES "System\\CurrentControlSet\\Control\\InstalledFiles" +#define REGPART_RENAME "\\Rename" +#define REG_VERSIONCONFLICT "Software\\Microsoft\\VersionConflictManager" + static FARPROC16 VCP_Proc = NULL; static LPARAM VCP_MsgRef = 0; @@ -43,6 +52,8 @@ static BOOL VCP_opened = FALSE; static VCPSTATUS vcp_status; +static HMODULE SETUPAPI_hInstance; + static WORD VCP_Callback( LPVOID obj, UINT16 msg, WPARAM16 wParam, LPARAM lParam, LPARAM lParamRef ) { WORD args[8]; @@ -214,10 +225,10 @@ static RETERR16 VCP_VirtnodeCreate(const VCPFILESPEC *vfsSrc, const VCPFILESPEC vn_num += 20; if (pvnlist) pvnlist = HeapReAlloc(heap, HEAP_ZERO_MEMORY, pvnlist, - sizeof(LPVIRTNODE *) * vn_num); + sizeof(LPVIRTNODE *) * vn_num); else - pvnlist = HeapAlloc(heap, HEAP_ZERO_MEMORY, - sizeof(LPVIRTNODE *) * vn_num); + pvnlist = HeapAlloc(heap, HEAP_ZERO_MEMORY, + sizeof(LPVIRTNODE *) * vn_num); } pvnlist[vn_last] = HeapAlloc(heap, HEAP_ZERO_MEMORY, sizeof(VIRTNODE)); lpvn = pvnlist[vn_last]; @@ -584,6 +595,8 @@ static void VCP_UI_RegisterProgressClass(void) wndClass.lpszClassName = "setupx_progress"; RegisterClassA (&wndClass); + + SETUPAPI_hInstance = LoadLibraryA( "setupapi.dll" ); } static RETERR16 VCP_UI_NodeCompare(LPVIRTNODE vn1, LPVIRTNODE vn2) -- 2.11.4.GIT