From: Stefan Brüns <stefan.bruens@rwth-aachen.de> Msports is typically only used by driver implementations, but may be called to enumerate serial ports. Without the stub implemenations, the application would crash:
wine: Call from 7BC57297 to unimplemented function msports.dll.ComDBOpen, aborting
Return ERROR_ACCESS_DENIED (the only valid error code), and return an invalid handle. Also add ComDBClose, in case the application unconditionally tries to close the handle. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59172 --- 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..89fa1230eba --- /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 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9829