[PATCH v2 0/2] MR11307: dnsapi: add stub for DnsStartMulticastQuery and DnsStopMulticastQuery
This prevents Formlabs Preform software from crashing on startup with: `wine: Call from 00006FFFFFF5C540 to unimplemented function DNSAPI.dll.DnsStartMulticastQuery, aborting` On exit it calls `DnsStopMulticastQuery` as well. Definitions have been taken from mingw's windns.h, which is public domain. -- v2: dnsapi: Add stub DnsStopMulticastQuery(). dnsapi: Add stub DnsStartMulticastQuery(). https://gitlab.winehq.org/wine/wine/-/merge_requests/11307
From: Stefan Riesenberger <stefan.riesenberger@gmail.com> --- dlls/dnsapi/dnsapi.spec | 1 + dlls/dnsapi/main.c | 10 ++++++++++ include/windns.h | 27 +++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/dlls/dnsapi/dnsapi.spec b/dlls/dnsapi/dnsapi.spec index a8ffa40a0ae..3e5eea68d4a 100644 --- a/dlls/dnsapi/dnsapi.spec +++ b/dlls/dnsapi/dnsapi.spec @@ -112,6 +112,7 @@ @ stub DnsServiceNotificationRegister_W @ stub DnsSetMaxNumberOfAddressesToRegister @ stub DnsStatusString +@ stdcall DnsStartMulticastQuery(ptr ptr) @ stub DnsStringCopyAllocateEx @ stub DnsUnicodeToUtf8 @ stub DnsUpdate diff --git a/dlls/dnsapi/main.c b/dlls/dnsapi/main.c index 9b057a09a05..f54928a81c8 100644 --- a/dlls/dnsapi/main.c +++ b/dlls/dnsapi/main.c @@ -243,3 +243,13 @@ DNS_STATUS WINAPI DnsServiceBrowse( PDNS_SERVICE_BROWSE_REQUEST request, PDNS_SE FIXME( "(%p, %p) stub\n", request, cancel ); return ERROR_SUCCESS; } + +/****************************************************************************** + * DnsStartMulticastQuery [DNSAPI.@] + * + */ +DNS_STATUS WINAPI DnsStartMulticastQuery(MDNS_QUERY_REQUEST *request, MDNS_QUERY_HANDLE *handle) +{ + FIXME( "(%p, %p) stub\n", request, handle ); + return ERROR_SUCCESS; +} diff --git a/include/windns.h b/include/windns.h index 87e8dad37da..0f95a386d2e 100644 --- a/include/windns.h +++ b/include/windns.h @@ -781,6 +781,32 @@ typedef struct _DNS_SERVICE_CANCEL void *reserved; } DNS_SERVICE_CANCEL, *PDNS_SERVICE_CANCEL; +typedef struct _MDNS_QUERY_HANDLE +{ + WCHAR nameBuf[DNS_MAX_NAME_BUFFER_LENGTH]; + WORD wType; + PVOID pSubscription; + PVOID pWnfCallbackParams; + ULONG stateNameData[2]; +} MDNS_QUERY_HANDLE, *PMDNS_QUERY_HANDLE; + +typedef void WINAPI MDNS_QUERY_CALLBACK(PVOID,PMDNS_QUERY_HANDLE,PDNS_QUERY_RESULT); +typedef MDNS_QUERY_CALLBACK *PMDNS_QUERY_CALLBACK; + +typedef struct _MDNS_QUERY_REQUEST +{ + ULONG Version; + ULONG ulRefCount; + PCWSTR Query; + WORD QueryType; + ULONG64 QueryOptions; + ULONG InterfaceIndex; + PMDNS_QUERY_CALLBACK pQueryCallback; + PVOID pQueryContext; + BOOL fAnswerReceived; + ULONG ulResendCount; +} MDNS_QUERY_REQUEST, *PMDNS_QUERY_REQUEST; + DNS_STATUS WINAPI DnsAcquireContextHandle_A(DWORD,PVOID,PHANDLE); DNS_STATUS WINAPI DnsAcquireContextHandle_W(DWORD,PVOID,PHANDLE); #define DnsAcquireContextHandle WINELIB_NAME_AW(DnsAcquireContextHandle_) @@ -820,6 +846,7 @@ DNS_STATUS WINAPI DnsValidateName_UTF8(PCSTR,DNS_NAME_FORMAT); BOOL WINAPI DnsWriteQuestionToBuffer_W(PDNS_MESSAGE_BUFFER,PDWORD,PCWSTR,WORD,WORD,BOOL); BOOL WINAPI DnsWriteQuestionToBuffer_UTF8(PDNS_MESSAGE_BUFFER,PDWORD,PCSTR,WORD,WORD,BOOL); BOOL WINAPI DnsGetCacheDataTable(PDNS_CACHE_ENTRY*); +DNS_STATUS WINAPI DnsStartMulticastQuery(PMDNS_QUERY_REQUEST,PMDNS_QUERY_HANDLE); #ifdef __cplusplus } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11307
From: Stefan Riesenberger <stefan.riesenberger@gmail.com> --- dlls/dnsapi/dnsapi.spec | 1 + dlls/dnsapi/main.c | 10 ++++++++++ include/windns.h | 1 + 3 files changed, 12 insertions(+) diff --git a/dlls/dnsapi/dnsapi.spec b/dlls/dnsapi/dnsapi.spec index 3e5eea68d4a..50113eef89f 100644 --- a/dlls/dnsapi/dnsapi.spec +++ b/dlls/dnsapi/dnsapi.spec @@ -113,6 +113,7 @@ @ stub DnsSetMaxNumberOfAddressesToRegister @ stub DnsStatusString @ stdcall DnsStartMulticastQuery(ptr ptr) +@ stdcall DnsStopMulticastQuery(ptr) @ stub DnsStringCopyAllocateEx @ stub DnsUnicodeToUtf8 @ stub DnsUpdate diff --git a/dlls/dnsapi/main.c b/dlls/dnsapi/main.c index f54928a81c8..083334ecb83 100644 --- a/dlls/dnsapi/main.c +++ b/dlls/dnsapi/main.c @@ -253,3 +253,13 @@ DNS_STATUS WINAPI DnsStartMulticastQuery(MDNS_QUERY_REQUEST *request, MDNS_QUERY FIXME( "(%p, %p) stub\n", request, handle ); return ERROR_SUCCESS; } + +/****************************************************************************** + * DnsStopMulticastQuery [DNSAPI.@] + * + */ +DNS_STATUS WINAPI DnsStopMulticastQuery(MDNS_QUERY_HANDLE *handle) +{ + FIXME( "(%p) stub\n", handle ); + return ERROR_SUCCESS; +} diff --git a/include/windns.h b/include/windns.h index 0f95a386d2e..fcde164c9f9 100644 --- a/include/windns.h +++ b/include/windns.h @@ -847,6 +847,7 @@ BOOL WINAPI DnsWriteQuestionToBuffer_W(PDNS_MESSAGE_BUFFER,PDWORD,PCWSTR,WORD,WO BOOL WINAPI DnsWriteQuestionToBuffer_UTF8(PDNS_MESSAGE_BUFFER,PDWORD,PCSTR,WORD,WORD,BOOL); BOOL WINAPI DnsGetCacheDataTable(PDNS_CACHE_ENTRY*); DNS_STATUS WINAPI DnsStartMulticastQuery(PMDNS_QUERY_REQUEST,PMDNS_QUERY_HANDLE); +DNS_STATUS WINAPI DnsStopMulticastQuery(PMDNS_QUERY_HANDLE); #ifdef __cplusplus } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11307
On Thu Jul 9 20:32:43 2026 +0000, Connor McAdams wrote:
This could probably be split into two separate commits, one for each stub. Commit titles should be capitalized and end with punctuation, i.e: `dnsapi: Add stub DnsStartMulticastQuery().` The function argument variable names should follow the [style guidelines](https://gitlab.winehq.org/wine/wine/-/wikis/Wine-Developer's-Guide/Coding-Practice#some-notes-about-style), in particular the parts about avoiding Hungarian notation and pointer declarations. Thanks for the pointers! Hopefully resolved all the style problems now.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/11307#note_145341
This looks fine to me code wise. I didn't notice initially, but the commit messages should probably be `dnsapi: Add {function}() stub.` instead of `dnsapi: Add stub {function}().`. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11307#note_145410
participants (3)
-
Connor McAdams (@cmcadams) -
Stefan Riesenberger -
Stefan Riesenberger (@Riesi)