[PATCH] setupapi: Return CR_NO_SUCH_DEVNODE from CM_Get_Parent stub.
From: Tim Wanders <timwanders241(a)gmail.com> Fixes: https://bugs.winehq.org/show_bug.cgi?id=43831 Returning CR_SUCCESS assumes that the return value will be valid. This causes crashes in programs which only check the return. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/setupapi/stubs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/setupapi/stubs.c b/dlls/setupapi/stubs.c index 990974d9b9..7c3413a7cc 100644 --- a/dlls/setupapi/stubs.c +++ b/dlls/setupapi/stubs.c @@ -180,8 +180,9 @@ CONFIGRET WINAPI CM_Get_Device_ID_List_SizeW( PULONG pulLen, PCWSTR pszFilter, DWORD WINAPI CM_Get_Parent(PDEVINST pdnDevInst, DEVINST dnDevInst, ULONG ulFlags) { FIXME("%p 0x%08x 0x%08x stub\n", pdnDevInst, dnDevInst, ulFlags); - *pdnDevInst = dnDevInst; - return CR_SUCCESS; + if(pdnDevInst) + *pdnDevInst = 0; + return CR_NO_SUCH_DEVNODE; } /*********************************************************************** -- 2.16.2
participants (1)
-
Alistair Leslie-Hughes