[PATCH 1/4] dpinst: New stub program.

Zebediah Figura zfigura at codeweavers.com
Mon Feb 7 23:36:07 CST 2022


This program is not shipped by Windows. Rather, it is a redistributable
component shipped with some drivers, which appears to be a thin wrapper over the
undocumented DriverStore* APIs exported from setupapi. Since the behaviour of
this program is much easier to determine and implement, it seems much more
worthwhile to do so despite not being an OS component.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42424
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
There is a snag, though, which is that Wine's default load order is
"native,builtin" for the main EXE when loaded with an absolute path, as will
pretty much always be the case for dpinst.exe. As such anyone who intends to
install a package that requires it will need to manually set the program to
prefer builtin. Ideally this wouldn't be necessary, but it's not clear to me how
to avoid it:

* Set *dpinst.exe to have a default override of builtin,native in the
  DllOverrides key? There's no precedent for this, though.

* Introduce an analog of the --prefer-native switch? Seems excessive for
  something that would so rarely useful.

 configure.ac                  |  2 ++
 loader/wine.inf.in            |  1 +
 programs/dpinst/Makefile.in   |  4 ++++
 programs/dpinst/dpinst.c      | 35 +++++++++++++++++++++++++++++++++++
 programs/dpinst64/Makefile.in |  5 +++++
 5 files changed, 47 insertions(+)
 create mode 100644 programs/dpinst/Makefile.in
 create mode 100644 programs/dpinst/dpinst.c
 create mode 100644 programs/dpinst64/Makefile.in

diff --git a/configure.ac b/configure.ac
index e51e114c45e..33d2ba15ebf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3547,6 +3547,8 @@ WINE_CONFIG_MAKEFILE(programs/conhost/tests)
 WINE_CONFIG_MAKEFILE(programs/control)
 WINE_CONFIG_MAKEFILE(programs/cscript)
 WINE_CONFIG_MAKEFILE(programs/dism)
+WINE_CONFIG_MAKEFILE(programs/dpinst,,[test "x$enable_win64" = xyes])
+WINE_CONFIG_MAKEFILE(programs/dpinst64,enable_dpinst,[test "x$enable_win64" = xno])
 WINE_CONFIG_MAKEFILE(programs/dplaysvr)
 WINE_CONFIG_MAKEFILE(programs/dpnsvr)
 WINE_CONFIG_MAKEFILE(programs/dpvsetup)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 0e488d87dcb..4ad9dc09efd 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -2646,6 +2646,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
 11,,services.exe,-
 11,,spoolsv.exe,-
 11,,winemenubuilder.exe,-
+11,,dpinst.exe,-
 ; registration order matters for these
 11,,msxml.dll
 11,,msxml2.dll
diff --git a/programs/dpinst/Makefile.in b/programs/dpinst/Makefile.in
new file mode 100644
index 00000000000..bd97b860ce7
--- /dev/null
+++ b/programs/dpinst/Makefile.in
@@ -0,0 +1,4 @@
+MODULE    = dpinst.exe
+EXTRADLLFLAGS = -mconsole -municode
+
+C_SRCS = dpinst.c
diff --git a/programs/dpinst/dpinst.c b/programs/dpinst/dpinst.c
new file mode 100644
index 00000000000..52b4119760b
--- /dev/null
+++ b/programs/dpinst/dpinst.c
@@ -0,0 +1,35 @@
+/*
+ * Driver Store installer replacement
+ *
+ * Copyright 2022 Zebediah Figura
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "windef.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(dpinst);
+
+int __cdecl wmain(int argc, WCHAR *argv[])
+{
+    int i;
+
+    for (i = 0; i < argc; i++)
+        FIXME(" %s", debugstr_w(argv[i]));
+    FIXME("\n");
+
+    return 0;
+}
diff --git a/programs/dpinst64/Makefile.in b/programs/dpinst64/Makefile.in
new file mode 100644
index 00000000000..f79ed3e0dba
--- /dev/null
+++ b/programs/dpinst64/Makefile.in
@@ -0,0 +1,5 @@
+MODULE    = dpinst64.exe
+EXTRADLLFLAGS = -mconsole -municode
+PARENTSRC = ../dpinst
+
+C_SRCS = dpinst.c
-- 
2.34.1




More information about the wine-devel mailing list