4 * Copyright 2006 Christian Gmeiner
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "wine/test.h"
34 static void test_Device_Info_List(void)
39 static const WCHAR machine[] = { 'd','u','m','m','y',0 };
41 SetLastError(0xdeadbeef);
42 /* create empty DeviceInfoList, but set Reserved to a value, which is not NULL */
43 devlist = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, "NotNull");
45 error = GetLastError();
46 ok(devlist == INVALID_HANDLE_VALUE, "SetupDiCreateDeviceInfoListExW failed : %p %ld (expected %p)\n", devlist, error, INVALID_HANDLE_VALUE);
47 ok(error == ERROR_INVALID_PARAMETER, "GetLastError returned wrong value : %ld, (expected %d)", error, ERROR_INVALID_PARAMETER);
49 SetLastError(0xdeadbeef);
50 /* create empty DeviceInfoList, but set MachineName to something */
51 devlist = SetupDiCreateDeviceInfoListExW(NULL, NULL, machine, NULL);
53 error = GetLastError();
54 ok(devlist == INVALID_HANDLE_VALUE, "SetupDiCreateDeviceInfoListExW failed : %p %ld (expected %p)\n", devlist, error, INVALID_HANDLE_VALUE);
55 ok(error == ERROR_INVALID_MACHINENAME, "GetLastError returned wrong value : %ld, (expected %d)", error, ERROR_INVALID_MACHINENAME);
57 /* create empty DeviceInfoList */
58 devlist = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL);
59 ok(devlist && devlist != INVALID_HANDLE_VALUE, "SetupDiCreateDeviceInfoListExW failed : %p %ld (expected != %p)\n", devlist, error, INVALID_HANDLE_VALUE);
61 /* destroy DeviceInfoList */
62 ret = SetupDiDestroyDeviceInfoList(devlist);
63 ok(ret, "SetupDiDestroyDeviceInfoList failed : %ld", error);
68 test_Device_Info_List();