Commit 8f5d90b4 authored by Christian Gmeiner's avatar Christian Gmeiner Committed by Alexandre Julliard

setupapi: Implement SetupDiCreateDeviceInfoListExW.

parent 682679b0
......@@ -7,7 +7,7 @@ MODULE = setupapi.dll
IMPORTLIB = libsetupapi.$(IMPLIBEXT)
IMPORTS = user32 version advapi32 rpcrt4 kernel32 ntdll
DELAYIMPORTS = shell32
EXTRALIBS = $(LIBUNICODE)
EXTRALIBS = $(LIBUNICODE) -luuid
C_SRCS = \
devinst.c \
......
Makefile
devinst.ok
parser.ok
query.ok
stringtable.ok
......
......@@ -6,6 +6,7 @@ TESTDLL = setupapi.dll
IMPORTS = setupapi kernel32
CTESTS = \
devinst.c \
parser.c \
query.c \
stringtable.c
......
/*
* Devinst tests
*
* Copyright 2006 Christian Gmeiner
*
* 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 <assert.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "setupapi.h"
#include "wine/test.h"
static void test_Device_Info_List(void)
{
HDEVINFO devlist;
BOOL ret;
DWORD error;
static const WCHAR machine[] = { 'd','u','m','m','y',0 };
SetLastError(0xdeadbeef);
/* create empty DeviceInfoList, but set Reserved to a value, which is not NULL */
devlist = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, "NotNull");
error = GetLastError();
ok(devlist == INVALID_HANDLE_VALUE, "SetupDiCreateDeviceInfoListExW failed : %p %ld (expected %p)\n", devlist, error, INVALID_HANDLE_VALUE);
ok(error == ERROR_INVALID_PARAMETER, "GetLastError returned wrong value : %ld, (expected %d)", error, ERROR_INVALID_PARAMETER);
SetLastError(0xdeadbeef);
/* create empty DeviceInfoList, but set MachineName to something */
devlist = SetupDiCreateDeviceInfoListExW(NULL, NULL, machine, NULL);
error = GetLastError();
ok(devlist == INVALID_HANDLE_VALUE, "SetupDiCreateDeviceInfoListExW failed : %p %ld (expected %p)\n", devlist, error, INVALID_HANDLE_VALUE);
ok(error == ERROR_INVALID_MACHINENAME, "GetLastError returned wrong value : %ld, (expected %d)", error, ERROR_INVALID_MACHINENAME);
/* create empty DeviceInfoList */
devlist = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL);
ok(devlist && devlist != INVALID_HANDLE_VALUE, "SetupDiCreateDeviceInfoListExW failed : %p %ld (expected != %p)\n", devlist, error, INVALID_HANDLE_VALUE);
/* destroy DeviceInfoList */
ret = SetupDiDestroyDeviceInfoList(devlist);
ok(ret, "SetupDiDestroyDeviceInfoList failed : %ld", error);
}
START_TEST(devinst)
{
test_Device_Info_List();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment