reactos/modules/rostests/winetests/setupapi/diskspace.c

472 lines
20 KiB
C
Raw Normal View History

/*
* Unit tests for disk space functions
*
* Copyright 2010 Andrew Nguyen
*
* 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 "winnls.h"
#include "winuser.h"
#include "winreg.h"
#include "setupapi.h"
#include "wine/test.h"
static void test_SetupCreateDiskSpaceListA(void)
{
HDSKSPC ret;
ret = SetupCreateDiskSpaceListA(NULL, 0, 0);
ok(ret != NULL,
"Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
ret = SetupCreateDiskSpaceListA(NULL, 0, SPDSL_IGNORE_DISK);
ok(ret != NULL,
"Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
SetLastError(0xdeadbeef);
ret = SetupCreateDiskSpaceListA(NULL, 0, ~0U);
ok(ret == NULL ||
broken(ret != NULL), /* NT4/Win9x/Win2k */
"Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
if (!ret)
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
else
ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
SetLastError(0xdeadbeef);
ret = SetupCreateDiskSpaceListA(NULL, 0xdeadbeef, 0);
ok(ret == NULL,
"Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win9x/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupCreateDiskSpaceListA((void *)0xdeadbeef, 0, 0);
ok(ret == NULL,
"Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win9x/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupCreateDiskSpaceListA((void *)0xdeadbeef, 0xdeadbeef, 0);
ok(ret == NULL,
"Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win9x/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
}
static void test_SetupCreateDiskSpaceListW(void)
{
HDSKSPC ret;
ret = SetupCreateDiskSpaceListW(NULL, 0, 0);
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("SetupCreateDiskSpaceListW is not implemented\n");
return;
}
ok(ret != NULL,
"Expected SetupCreateDiskSpaceListW to return a valid handle, got NULL\n");
ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
ret = SetupCreateDiskSpaceListW(NULL, 0, SPDSL_IGNORE_DISK);
ok(ret != NULL,
"Expected SetupCreateDiskSpaceListW to return a valid handle, got NULL\n");
ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
SetLastError(0xdeadbeef);
ret = SetupCreateDiskSpaceListW(NULL, 0, ~0U);
ok(ret == NULL ||
broken(ret != NULL), /* NT4/Win2k */
"Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
if (!ret)
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
else
ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
SetLastError(0xdeadbeef);
ret = SetupCreateDiskSpaceListW(NULL, 0xdeadbeef, 0);
ok(ret == NULL,
"Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0, 0);
ok(ret == NULL,
"Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0xdeadbeef, 0);
ok(ret == NULL,
"Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
}
static void test_SetupDuplicateDiskSpaceListA(void)
{
HDSKSPC handle, duplicate;
[WINESYNC] setupapi: Support full path enumerator in SetupDiGetClassDevs. Based on a patch by Michael Müller. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345 Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id d5e24897e2cd61a5af71a317c1797757acf1b794 by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: A spelling fix in an ok() message. Signed-off-by: Francois Gouget <fgouget@free.fr> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 21db058d14ac6fb769a42bdeea3dadfa4fd0e8bf by Francois Gouget <fgouget@free.fr> [WINESYNC] setupapi/tests: Fix a crash in the need_media tests. Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 448f4cc9a25c6f994395978df0dfd7c7487b5dbb by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix a path leak (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 5f0d53e20903b009ee47a238a642f2e95f27d712 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix an uninitialized variable warning (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ecbd2dd34b4239318162242caaa197ae4f0911f5 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi/tests: Add some tests for SPFILENOTIFY_STARTCOPY. Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ab3cc3c11a78cbaec7173a4576fda93ecf70ae90 by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi: Fix handling of FILEOP_SKIP from the SPFILENOTIFY_STARTCOPY callback. Fixes a regression introduced by 3e5c9798a80641e0e39e95e4467c60405b22b062. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47436 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id a431b4b54a36b49821cae363d7ea8733eefe62ef by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi/tests: Remove win_9x checks. Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id c59e9d302b79527f4a99be71d1346f56737dc3f3 by Vijay Kiran Kamuju <infyquest@gmail.com> [WINESYNC] setupapi: Define .inf section names for ARM platforms. Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id b2b3975f46c203a129a946128ccd018dd7ed6e46 by Alexandre Julliard <julliard@winehq.org> [WINESYNC] setupapi/tests: Fix timeout on win10 1809+. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 177d6d7f8981b9e036437d78023b76232dcadb3d by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: Add default device registry property tests. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 4fe3d7e220225ddd57ef0acd9142ef8437cdb9ca by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Set device SPDRP_CLASS registry property in create_device(). Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 288a6625ad0177e258a0db1da166d292ff420b1e by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Add SetupGetInfDriverStoreLocationW stub. Signed-off-by: Derek Lesho <dlesho@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id f1b94dc16c35a5c477b6df8aa94c6d3537642c77 by Derek Lesho <dlesho@codeweavers.com>
2023-09-14 18:11:36 +00:00
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(NULL, NULL, 0, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n", GetLastError());
[WINESYNC] setupapi: Support full path enumerator in SetupDiGetClassDevs. Based on a patch by Michael Müller. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345 Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id d5e24897e2cd61a5af71a317c1797757acf1b794 by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: A spelling fix in an ok() message. Signed-off-by: Francois Gouget <fgouget@free.fr> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 21db058d14ac6fb769a42bdeea3dadfa4fd0e8bf by Francois Gouget <fgouget@free.fr> [WINESYNC] setupapi/tests: Fix a crash in the need_media tests. Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 448f4cc9a25c6f994395978df0dfd7c7487b5dbb by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix a path leak (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 5f0d53e20903b009ee47a238a642f2e95f27d712 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix an uninitialized variable warning (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ecbd2dd34b4239318162242caaa197ae4f0911f5 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi/tests: Add some tests for SPFILENOTIFY_STARTCOPY. Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ab3cc3c11a78cbaec7173a4576fda93ecf70ae90 by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi: Fix handling of FILEOP_SKIP from the SPFILENOTIFY_STARTCOPY callback. Fixes a regression introduced by 3e5c9798a80641e0e39e95e4467c60405b22b062. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47436 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id a431b4b54a36b49821cae363d7ea8733eefe62ef by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi/tests: Remove win_9x checks. Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id c59e9d302b79527f4a99be71d1346f56737dc3f3 by Vijay Kiran Kamuju <infyquest@gmail.com> [WINESYNC] setupapi: Define .inf section names for ARM platforms. Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id b2b3975f46c203a129a946128ccd018dd7ed6e46 by Alexandre Julliard <julliard@winehq.org> [WINESYNC] setupapi/tests: Fix timeout on win10 1809+. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 177d6d7f8981b9e036437d78023b76232dcadb3d by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: Add default device registry property tests. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 4fe3d7e220225ddd57ef0acd9142ef8437cdb9ca by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Set device SPDRP_CLASS registry property in create_device(). Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 288a6625ad0177e258a0db1da166d292ff420b1e by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Add SetupGetInfDriverStoreLocationW stub. Signed-off-by: Derek Lesho <dlesho@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id f1b94dc16c35a5c477b6df8aa94c6d3537642c77 by Derek Lesho <dlesho@codeweavers.com>
2023-09-14 18:11:36 +00:00
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(NULL, (void *)0xdeadbeef, 0, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
[WINESYNC] setupapi: Support full path enumerator in SetupDiGetClassDevs. Based on a patch by Michael Müller. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345 Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id d5e24897e2cd61a5af71a317c1797757acf1b794 by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: A spelling fix in an ok() message. Signed-off-by: Francois Gouget <fgouget@free.fr> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 21db058d14ac6fb769a42bdeea3dadfa4fd0e8bf by Francois Gouget <fgouget@free.fr> [WINESYNC] setupapi/tests: Fix a crash in the need_media tests. Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 448f4cc9a25c6f994395978df0dfd7c7487b5dbb by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix a path leak (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 5f0d53e20903b009ee47a238a642f2e95f27d712 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix an uninitialized variable warning (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ecbd2dd34b4239318162242caaa197ae4f0911f5 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi/tests: Add some tests for SPFILENOTIFY_STARTCOPY. Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ab3cc3c11a78cbaec7173a4576fda93ecf70ae90 by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi: Fix handling of FILEOP_SKIP from the SPFILENOTIFY_STARTCOPY callback. Fixes a regression introduced by 3e5c9798a80641e0e39e95e4467c60405b22b062. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47436 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id a431b4b54a36b49821cae363d7ea8733eefe62ef by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi/tests: Remove win_9x checks. Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id c59e9d302b79527f4a99be71d1346f56737dc3f3 by Vijay Kiran Kamuju <infyquest@gmail.com> [WINESYNC] setupapi: Define .inf section names for ARM platforms. Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id b2b3975f46c203a129a946128ccd018dd7ed6e46 by Alexandre Julliard <julliard@winehq.org> [WINESYNC] setupapi/tests: Fix timeout on win10 1809+. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 177d6d7f8981b9e036437d78023b76232dcadb3d by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: Add default device registry property tests. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 4fe3d7e220225ddd57ef0acd9142ef8437cdb9ca by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Set device SPDRP_CLASS registry property in create_device(). Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 288a6625ad0177e258a0db1da166d292ff420b1e by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Add SetupGetInfDriverStoreLocationW stub. Signed-off-by: Derek Lesho <dlesho@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id f1b94dc16c35a5c477b6df8aa94c6d3537642c77 by Derek Lesho <dlesho@codeweavers.com>
2023-09-14 18:11:36 +00:00
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(NULL, NULL, 0xdeadbeef, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(NULL, NULL, 0, ~0U);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
handle = SetupCreateDiskSpaceListA(NULL, 0, 0);
ok(handle != NULL,
"Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
if (!handle)
{
skip("Failed to create a disk space handle\n");
return;
}
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(handle, (void *)0xdeadbeef, 0, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0xdeadbeef, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0, SPDSL_IGNORE_DISK);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0, ~0U);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0, 0);
ok(duplicate != NULL, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(duplicate != handle,
"Expected new handle (%p) to be different from the old handle (%p)\n", duplicate, handle);
ok(SetupDestroyDiskSpaceList(duplicate), "Expected SetupDestroyDiskSpaceList to succeed\n");
ok(SetupDestroyDiskSpaceList(handle), "Expected SetupDestroyDiskSpaceList to succeed\n");
}
static void test_SetupDuplicateDiskSpaceListW(void)
{
HDSKSPC handle, duplicate;
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(NULL, NULL, 0, 0);
if (!duplicate && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("SetupDuplicateDiskSpaceListW is not available\n");
return;
}
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(NULL, (void *)0xdeadbeef, 0, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(NULL, NULL, 0xdeadbeef, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(NULL, NULL, 0, ~0U);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
handle = SetupCreateDiskSpaceListW(NULL, 0, 0);
ok(handle != NULL,
"Expected SetupCreateDiskSpaceListW to return a valid handle, got NULL\n");
if (!handle)
{
skip("Failed to create a disk space handle\n");
return;
}
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(handle, (void *)0xdeadbeef, 0, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0xdeadbeef, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0, SPDSL_IGNORE_DISK);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0, ~0U);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0, 0);
ok(duplicate != NULL, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(duplicate != handle,
"Expected new handle (%p) to be different from the old handle (%p)\n", duplicate, handle);
ok(SetupDestroyDiskSpaceList(duplicate), "Expected SetupDestroyDiskSpaceList to succeed\n");
ok(SetupDestroyDiskSpaceList(handle), "Expected SetupDestroyDiskSpaceList to succeed\n");
}
static void test_SetupQuerySpaceRequiredOnDriveA(void)
{
BOOL ret;
HDSKSPC handle;
LONGLONG space;
[WINESYNC] setupapi: Support full path enumerator in SetupDiGetClassDevs. Based on a patch by Michael Müller. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345 Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id d5e24897e2cd61a5af71a317c1797757acf1b794 by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: A spelling fix in an ok() message. Signed-off-by: Francois Gouget <fgouget@free.fr> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 21db058d14ac6fb769a42bdeea3dadfa4fd0e8bf by Francois Gouget <fgouget@free.fr> [WINESYNC] setupapi/tests: Fix a crash in the need_media tests. Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 448f4cc9a25c6f994395978df0dfd7c7487b5dbb by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix a path leak (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 5f0d53e20903b009ee47a238a642f2e95f27d712 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix an uninitialized variable warning (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ecbd2dd34b4239318162242caaa197ae4f0911f5 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi/tests: Add some tests for SPFILENOTIFY_STARTCOPY. Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ab3cc3c11a78cbaec7173a4576fda93ecf70ae90 by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi: Fix handling of FILEOP_SKIP from the SPFILENOTIFY_STARTCOPY callback. Fixes a regression introduced by 3e5c9798a80641e0e39e95e4467c60405b22b062. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47436 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id a431b4b54a36b49821cae363d7ea8733eefe62ef by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi/tests: Remove win_9x checks. Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id c59e9d302b79527f4a99be71d1346f56737dc3f3 by Vijay Kiran Kamuju <infyquest@gmail.com> [WINESYNC] setupapi: Define .inf section names for ARM platforms. Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id b2b3975f46c203a129a946128ccd018dd7ed6e46 by Alexandre Julliard <julliard@winehq.org> [WINESYNC] setupapi/tests: Fix timeout on win10 1809+. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 177d6d7f8981b9e036437d78023b76232dcadb3d by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: Add default device registry property tests. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 4fe3d7e220225ddd57ef0acd9142ef8437cdb9ca by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Set device SPDRP_CLASS registry property in create_device(). Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 288a6625ad0177e258a0db1da166d292ff420b1e by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Add SetupGetInfDriverStoreLocationW stub. Signed-off-by: Derek Lesho <dlesho@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id f1b94dc16c35a5c477b6df8aa94c6d3537642c77 by Derek Lesho <dlesho@codeweavers.com>
2023-09-14 18:11:36 +00:00
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveA(NULL, NULL, NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
[WINESYNC] setupapi: Support full path enumerator in SetupDiGetClassDevs. Based on a patch by Michael Müller. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345 Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id d5e24897e2cd61a5af71a317c1797757acf1b794 by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: A spelling fix in an ok() message. Signed-off-by: Francois Gouget <fgouget@free.fr> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 21db058d14ac6fb769a42bdeea3dadfa4fd0e8bf by Francois Gouget <fgouget@free.fr> [WINESYNC] setupapi/tests: Fix a crash in the need_media tests. Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 448f4cc9a25c6f994395978df0dfd7c7487b5dbb by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix a path leak (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 5f0d53e20903b009ee47a238a642f2e95f27d712 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix an uninitialized variable warning (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ecbd2dd34b4239318162242caaa197ae4f0911f5 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi/tests: Add some tests for SPFILENOTIFY_STARTCOPY. Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ab3cc3c11a78cbaec7173a4576fda93ecf70ae90 by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi: Fix handling of FILEOP_SKIP from the SPFILENOTIFY_STARTCOPY callback. Fixes a regression introduced by 3e5c9798a80641e0e39e95e4467c60405b22b062. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47436 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id a431b4b54a36b49821cae363d7ea8733eefe62ef by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi/tests: Remove win_9x checks. Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id c59e9d302b79527f4a99be71d1346f56737dc3f3 by Vijay Kiran Kamuju <infyquest@gmail.com> [WINESYNC] setupapi: Define .inf section names for ARM platforms. Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id b2b3975f46c203a129a946128ccd018dd7ed6e46 by Alexandre Julliard <julliard@winehq.org> [WINESYNC] setupapi/tests: Fix timeout on win10 1809+. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 177d6d7f8981b9e036437d78023b76232dcadb3d by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: Add default device registry property tests. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 4fe3d7e220225ddd57ef0acd9142ef8437cdb9ca by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Set device SPDRP_CLASS registry property in create_device(). Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 288a6625ad0177e258a0db1da166d292ff420b1e by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Add SetupGetInfDriverStoreLocationW stub. Signed-off-by: Derek Lesho <dlesho@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id f1b94dc16c35a5c477b6df8aa94c6d3537642c77 by Derek Lesho <dlesho@codeweavers.com>
2023-09-14 18:11:36 +00:00
SetLastError(0xdeadbeef);
space = 0xdeadbeef;
ret = SetupQuerySpaceRequiredOnDriveA(NULL, NULL, &space, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
[WINESYNC] setupapi: Support full path enumerator in SetupDiGetClassDevs. Based on a patch by Michael Müller. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345 Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id d5e24897e2cd61a5af71a317c1797757acf1b794 by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: A spelling fix in an ok() message. Signed-off-by: Francois Gouget <fgouget@free.fr> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 21db058d14ac6fb769a42bdeea3dadfa4fd0e8bf by Francois Gouget <fgouget@free.fr> [WINESYNC] setupapi/tests: Fix a crash in the need_media tests. Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 448f4cc9a25c6f994395978df0dfd7c7487b5dbb by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix a path leak (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 5f0d53e20903b009ee47a238a642f2e95f27d712 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix an uninitialized variable warning (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ecbd2dd34b4239318162242caaa197ae4f0911f5 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi/tests: Add some tests for SPFILENOTIFY_STARTCOPY. Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ab3cc3c11a78cbaec7173a4576fda93ecf70ae90 by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi: Fix handling of FILEOP_SKIP from the SPFILENOTIFY_STARTCOPY callback. Fixes a regression introduced by 3e5c9798a80641e0e39e95e4467c60405b22b062. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47436 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id a431b4b54a36b49821cae363d7ea8733eefe62ef by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi/tests: Remove win_9x checks. Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id c59e9d302b79527f4a99be71d1346f56737dc3f3 by Vijay Kiran Kamuju <infyquest@gmail.com> [WINESYNC] setupapi: Define .inf section names for ARM platforms. Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id b2b3975f46c203a129a946128ccd018dd7ed6e46 by Alexandre Julliard <julliard@winehq.org> [WINESYNC] setupapi/tests: Fix timeout on win10 1809+. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 177d6d7f8981b9e036437d78023b76232dcadb3d by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: Add default device registry property tests. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 4fe3d7e220225ddd57ef0acd9142ef8437cdb9ca by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Set device SPDRP_CLASS registry property in create_device(). Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 288a6625ad0177e258a0db1da166d292ff420b1e by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Add SetupGetInfDriverStoreLocationW stub. Signed-off-by: Derek Lesho <dlesho@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id f1b94dc16c35a5c477b6df8aa94c6d3537642c77 by Derek Lesho <dlesho@codeweavers.com>
2023-09-14 18:11:36 +00:00
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveA(NULL, "", NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
GetLastError());
[WINESYNC] setupapi: Support full path enumerator in SetupDiGetClassDevs. Based on a patch by Michael Müller. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345 Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id d5e24897e2cd61a5af71a317c1797757acf1b794 by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: A spelling fix in an ok() message. Signed-off-by: Francois Gouget <fgouget@free.fr> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 21db058d14ac6fb769a42bdeea3dadfa4fd0e8bf by Francois Gouget <fgouget@free.fr> [WINESYNC] setupapi/tests: Fix a crash in the need_media tests. Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 448f4cc9a25c6f994395978df0dfd7c7487b5dbb by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix a path leak (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 5f0d53e20903b009ee47a238a642f2e95f27d712 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi: Fix an uninitialized variable warning (Valgrind). Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ecbd2dd34b4239318162242caaa197ae4f0911f5 by Sven Baars <sven.wine@gmail.com> [WINESYNC] setupapi/tests: Add some tests for SPFILENOTIFY_STARTCOPY. Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ab3cc3c11a78cbaec7173a4576fda93ecf70ae90 by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi: Fix handling of FILEOP_SKIP from the SPFILENOTIFY_STARTCOPY callback. Fixes a regression introduced by 3e5c9798a80641e0e39e95e4467c60405b22b062. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47436 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id a431b4b54a36b49821cae363d7ea8733eefe62ef by Zebediah Figura <z.figura12@gmail.com> [WINESYNC] setupapi/tests: Remove win_9x checks. Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id c59e9d302b79527f4a99be71d1346f56737dc3f3 by Vijay Kiran Kamuju <infyquest@gmail.com> [WINESYNC] setupapi: Define .inf section names for ARM platforms. Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id b2b3975f46c203a129a946128ccd018dd7ed6e46 by Alexandre Julliard <julliard@winehq.org> [WINESYNC] setupapi/tests: Fix timeout on win10 1809+. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 177d6d7f8981b9e036437d78023b76232dcadb3d by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi/tests: Add default device registry property tests. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 4fe3d7e220225ddd57ef0acd9142ef8437cdb9ca by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Set device SPDRP_CLASS registry property in create_device(). Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 288a6625ad0177e258a0db1da166d292ff420b1e by Zhiyi Zhang <zzhang@codeweavers.com> [WINESYNC] setupapi: Add SetupGetInfDriverStoreLocationW stub. Signed-off-by: Derek Lesho <dlesho@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id f1b94dc16c35a5c477b6df8aa94c6d3537642c77 by Derek Lesho <dlesho@codeweavers.com>
2023-09-14 18:11:36 +00:00
SetLastError(0xdeadbeef);
space = 0xdeadbeef;
ret = SetupQuerySpaceRequiredOnDriveA(NULL, "", &space, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
GetLastError());
handle = SetupCreateDiskSpaceListA(NULL, 0, 0);
ok(handle != NULL,
"Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveA(handle, NULL, NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_DRIVE, /* Win9x */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
space = 0xdeadbeef;
ret = SetupQuerySpaceRequiredOnDriveA(handle, NULL, &space, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_DRIVE, /* Win9x */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveA(handle, "", NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_DRIVE,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
space = 0xdeadbeef;
ret = SetupQuerySpaceRequiredOnDriveA(handle, "", &space, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_DRIVE,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
ok(SetupDestroyDiskSpaceList(handle),
"Expected SetupDestroyDiskSpaceList to succeed\n");
}
static void test_SetupQuerySpaceRequiredOnDriveW(void)
{
static const WCHAR emptyW[] = {0};
BOOL ret;
HDSKSPC handle;
LONGLONG space;
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveW(NULL, NULL, NULL, NULL, 0);
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("SetupQuerySpaceRequiredOnDriveW is not available\n");
return;
}
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
space = 0xdeadbeef;
ret = SetupQuerySpaceRequiredOnDriveW(NULL, NULL, &space, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveW(NULL, emptyW, NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
space = 0xdeadbeef;
ret = SetupQuerySpaceRequiredOnDriveW(NULL, emptyW, &space, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
GetLastError());
handle = SetupCreateDiskSpaceListA(NULL, 0, 0);
ok(handle != NULL,
"Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveW(handle, NULL, NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_DRIVE, /* NT4/Win2k/XP/Win2k3 */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
space = 0xdeadbeef;
ret = SetupQuerySpaceRequiredOnDriveW(handle, NULL, &space, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_DRIVE, /* NT4/Win2k/XP/Win2k3 */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveW(handle, emptyW, NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_DRIVE,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef);
space = 0xdeadbeef;
ret = SetupQuerySpaceRequiredOnDriveW(handle, emptyW, &space, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_DRIVE,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
ok(SetupDestroyDiskSpaceList(handle),
"Expected SetupDestroyDiskSpaceList to succeed\n");
}
START_TEST(diskspace)
{
test_SetupCreateDiskSpaceListA();
test_SetupCreateDiskSpaceListW();
test_SetupDuplicateDiskSpaceListA();
test_SetupDuplicateDiskSpaceListW();
test_SetupQuerySpaceRequiredOnDriveA();
test_SetupQuerySpaceRequiredOnDriveW();
}