reactos/modules/rostests/winetests/setupapi/coinst.c
winesync 07366f19d6
[WINESYNC] setupapi/tests: Change return values from coinst functions.
As co_error and class_error both return 0xdeadbeef, use of 0xdeadbeef as
a canary value as well can lead to ambiguous tests results.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id cfde18c4904cd76eff40336e064cba86b9831633 by Jeff Smith <whydoubt@gmail.com>
2024-02-20 16:40:24 +01:00

72 lines
2.1 KiB
C

/*
* Test co-installer and class installer DLL
*
* Copyright 2018 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 <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "setupapi.h"
unsigned int callback_count;
DI_FUNCTION last_message;
DWORD WINAPI class_success(DI_FUNCTION function, HDEVINFO set, SP_DEVINFO_DATA *device)
{
callback_count++;
last_message = function;
return ERROR_SUCCESS;
}
DWORD WINAPI ClassInstall(DI_FUNCTION function, HDEVINFO set, SP_DEVINFO_DATA *device)
{
return class_success(function, set, device);
}
DWORD WINAPI class_default(DI_FUNCTION function, HDEVINFO set, SP_DEVINFO_DATA *device)
{
return ERROR_DI_DO_DEFAULT;
}
DWORD WINAPI class_error(DI_FUNCTION function, HDEVINFO set, SP_DEVINFO_DATA *device)
{
return 0xdeadc0de;
}
DWORD WINAPI co_success(DI_FUNCTION function, HDEVINFO set, SP_DEVINFO_DATA *device,
COINSTALLER_CONTEXT_DATA *context)
{
callback_count++;
last_message = function;
return ERROR_SUCCESS;
}
DWORD WINAPI CoDeviceInstall(DI_FUNCTION function, HDEVINFO set, SP_DEVINFO_DATA *device,
COINSTALLER_CONTEXT_DATA *context)
{
return co_success(function, set, device, context);
}
DWORD WINAPI co_error(DI_FUNCTION function, HDEVINFO set, SP_DEVINFO_DATA *device,
COINSTALLER_CONTEXT_DATA *context)
{
return 0xdeadc0de;
}