File 0008-msports-Add-stub-implementations-for-ComDBOpen-ComDB.patch of Package wine

From 9e6d0fc7f49db8803dd7a38046f58e52a518e56c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 21 Dec 2025 16:33:38 +0100
Subject: [PATCH 8/8] msports: Add stub implementations for
 ComDBOpen/ComDBClose

Msports is typically only used by driver implementations, but may be
called to enumerate serial ports. Without the stub implemenations, the
application would crash.
---
 dlls/msports/Makefile.in  |  3 +++
 dlls/msports/msports.c    | 39 +++++++++++++++++++++++++++++++++++++++
 dlls/msports/msports.spec |  4 ++--
 3 files changed, 44 insertions(+), 2 deletions(-)
 create mode 100644 dlls/msports/msports.c

diff --git a/dlls/msports/Makefile.in b/dlls/msports/Makefile.in
index 17e4804d51f..45cfdb9f23e 100644
--- a/dlls/msports/Makefile.in
+++ b/dlls/msports/Makefile.in
@@ -1,3 +1,6 @@
 MODULE    = msports.dll
 
 EXTRADLLFLAGS = -Wb,--prefer-native
+
+SOURCES = \
+	msports.c
diff --git a/dlls/msports/msports.c b/dlls/msports/msports.c
new file mode 100644
index 00000000000..f9caa64e638
--- /dev/null
+++ b/dlls/msports/msports.c
@@ -0,0 +1,39 @@
+/*
+ * Microsoft Serial Controller Driver API implementation
+ *
+ * Copyright 2025 Stefan BrĂ¼ns
+ *
+ * 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(msports);
+
+DECLARE_HANDLE(HCOMDB);
+
+LONG WINAPI ComDBClose(HCOMDB hComDB)
+{
+    FIXME("ComDBClose: stub\n");
+    return ERROR_INVALID_PARAMETER;
+}
+
+LONG WINAPI ComDBOpen(HCOMDB *phComDB)
+{
+    FIXME("ComDBOpen: stub\n");
+    phComDB = INVALID_HANDLE_VALUE;
+    return ERROR_ACCESS_DENIED;
+}
diff --git a/dlls/msports/msports.spec b/dlls/msports/msports.spec
index bb4b9c93501..8e8588cfbfc 100644
--- a/dlls/msports/msports.spec
+++ b/dlls/msports/msports.spec
@@ -1,8 +1,8 @@
 @ stub ComDBClaimNextFreePort
 @ stub ComDBClaimPort
-@ stub ComDBClose
+@ stdcall ComDBClose(long)
 @ stub ComDBGetCurrentPortUsage
-@ stub ComDBOpen
+@ stdcall ComDBOpen(ptr)
 @ stub ComDBReleasePort
 @ stub ComDBResizeDatabase
 @ stub ParallelPortPropPageProvider
-- 
2.52.0

openSUSE Build Service is sponsored by