tools: Add support for generating cursor files from SVG.
[wine.git] / dlls / setupapi / tests / diskspace.c
blob4e87ea905e0742b67dc877017ddaeece56f27913
1 /*
2 * Unit tests for disk space functions
4 * Copyright 2010 Andrew Nguyen
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
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winnls.h"
26 #include "winuser.h"
27 #include "winreg.h"
28 #include "setupapi.h"
30 #include "wine/test.h"
32 static BOOL is_win9x;
34 static void test_SetupCreateDiskSpaceListA(void)
36 HDSKSPC ret;
38 ret = SetupCreateDiskSpaceListA(NULL, 0, 0);
39 ok(ret != NULL,
40 "Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
42 ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
44 ret = SetupCreateDiskSpaceListA(NULL, 0, SPDSL_IGNORE_DISK);
45 ok(ret != NULL,
46 "Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
48 ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
50 SetLastError(0xdeadbeef);
51 ret = SetupCreateDiskSpaceListA(NULL, 0, ~0U);
52 ok(ret == NULL ||
53 broken(ret != NULL), /* NT4/Win9x/Win2k */
54 "Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
55 if (!ret)
56 ok(GetLastError() == ERROR_INVALID_PARAMETER,
57 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
58 GetLastError());
59 else
60 ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
62 SetLastError(0xdeadbeef);
63 ret = SetupCreateDiskSpaceListA(NULL, 0xdeadbeef, 0);
64 ok(ret == NULL,
65 "Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
66 ok(GetLastError() == ERROR_INVALID_PARAMETER ||
67 broken(GetLastError() == 0xdeadbeef), /* NT4/Win9x/Win2k */
68 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
69 GetLastError());
71 SetLastError(0xdeadbeef);
72 ret = SetupCreateDiskSpaceListA((void *)0xdeadbeef, 0, 0);
73 ok(ret == NULL,
74 "Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
75 ok(GetLastError() == ERROR_INVALID_PARAMETER ||
76 broken(GetLastError() == 0xdeadbeef), /* NT4/Win9x/Win2k */
77 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
78 GetLastError());
80 SetLastError(0xdeadbeef);
81 ret = SetupCreateDiskSpaceListA((void *)0xdeadbeef, 0xdeadbeef, 0);
82 ok(ret == NULL,
83 "Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
84 ok(GetLastError() == ERROR_INVALID_PARAMETER ||
85 broken(GetLastError() == 0xdeadbeef), /* NT4/Win9x/Win2k */
86 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
87 GetLastError());
90 static void test_SetupCreateDiskSpaceListW(void)
92 HDSKSPC ret;
94 ret = SetupCreateDiskSpaceListW(NULL, 0, 0);
95 if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
97 win_skip("SetupCreateDiskSpaceListW is not implemented\n");
98 return;
100 ok(ret != NULL,
101 "Expected SetupCreateDiskSpaceListW to return a valid handle, got NULL\n");
103 ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
105 ret = SetupCreateDiskSpaceListW(NULL, 0, SPDSL_IGNORE_DISK);
106 ok(ret != NULL,
107 "Expected SetupCreateDiskSpaceListW to return a valid handle, got NULL\n");
109 ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
111 SetLastError(0xdeadbeef);
112 ret = SetupCreateDiskSpaceListW(NULL, 0, ~0U);
113 ok(ret == NULL ||
114 broken(ret != NULL), /* NT4/Win2k */
115 "Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
116 if (!ret)
117 ok(GetLastError() == ERROR_INVALID_PARAMETER,
118 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
119 GetLastError());
120 else
121 ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
123 SetLastError(0xdeadbeef);
124 ret = SetupCreateDiskSpaceListW(NULL, 0xdeadbeef, 0);
125 ok(ret == NULL,
126 "Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
127 ok(GetLastError() == ERROR_INVALID_PARAMETER ||
128 broken(GetLastError() == 0xdeadbeef), /* NT4/Win2k */
129 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
130 GetLastError());
132 SetLastError(0xdeadbeef);
133 ret = SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0, 0);
134 ok(ret == NULL,
135 "Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
136 ok(GetLastError() == ERROR_INVALID_PARAMETER ||
137 broken(GetLastError() == 0xdeadbeef), /* NT4/Win2k */
138 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
139 GetLastError());
141 SetLastError(0xdeadbeef);
142 ret = SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0xdeadbeef, 0);
143 ok(ret == NULL,
144 "Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
145 ok(GetLastError() == ERROR_INVALID_PARAMETER ||
146 broken(GetLastError() == 0xdeadbeef), /* NT4/Win2k */
147 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
148 GetLastError());
151 static void test_SetupDuplicateDiskSpaceListA(void)
153 HDSKSPC handle, duplicate;
155 if (is_win9x)
156 win_skip("SetupDuplicateDiskSpaceListA crashes with NULL disk space handle on Win9x\n");
157 else
159 SetLastError(0xdeadbeef);
160 duplicate = SetupDuplicateDiskSpaceListA(NULL, NULL, 0, 0);
161 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
162 ok(GetLastError() == ERROR_INVALID_HANDLE,
163 "Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n", GetLastError());
165 SetLastError(0xdeadbeef);
166 duplicate = SetupDuplicateDiskSpaceListA(NULL, (void *)0xdeadbeef, 0, 0);
167 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
168 ok(GetLastError() == ERROR_INVALID_PARAMETER,
169 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
171 SetLastError(0xdeadbeef);
172 duplicate = SetupDuplicateDiskSpaceListA(NULL, NULL, 0xdeadbeef, 0);
173 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
174 ok(GetLastError() == ERROR_INVALID_PARAMETER,
175 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
177 SetLastError(0xdeadbeef);
178 duplicate = SetupDuplicateDiskSpaceListA(NULL, NULL, 0, ~0U);
179 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
180 ok(GetLastError() == ERROR_INVALID_PARAMETER,
181 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
184 handle = SetupCreateDiskSpaceListA(NULL, 0, 0);
185 ok(handle != NULL,
186 "Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
188 if (!handle)
190 skip("Failed to create a disk space handle\n");
191 return;
194 SetLastError(0xdeadbeef);
195 duplicate = SetupDuplicateDiskSpaceListA(handle, (void *)0xdeadbeef, 0, 0);
196 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
197 ok(GetLastError() == ERROR_INVALID_PARAMETER,
198 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
200 SetLastError(0xdeadbeef);
201 duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0xdeadbeef, 0);
202 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
203 ok(GetLastError() == ERROR_INVALID_PARAMETER,
204 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
206 SetLastError(0xdeadbeef);
207 duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0, SPDSL_IGNORE_DISK);
208 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
209 ok(GetLastError() == ERROR_INVALID_PARAMETER,
210 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
212 SetLastError(0xdeadbeef);
213 duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0, ~0U);
214 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
215 ok(GetLastError() == ERROR_INVALID_PARAMETER,
216 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
218 duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0, 0);
219 ok(duplicate != NULL, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
220 ok(duplicate != handle,
221 "Expected new handle (%p) to be different from the old handle (%p)\n", duplicate, handle);
223 ok(SetupDestroyDiskSpaceList(duplicate), "Expected SetupDestroyDiskSpaceList to succeed\n");
224 ok(SetupDestroyDiskSpaceList(handle), "Expected SetupDestroyDiskSpaceList to succeed\n");
227 static void test_SetupDuplicateDiskSpaceListW(void)
229 HDSKSPC handle, duplicate;
231 SetLastError(0xdeadbeef);
232 duplicate = SetupDuplicateDiskSpaceListW(NULL, NULL, 0, 0);
233 if (!duplicate && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
235 win_skip("SetupDuplicateDiskSpaceListW is not available\n");
236 return;
238 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
239 ok(GetLastError() == ERROR_INVALID_HANDLE,
240 "Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n", GetLastError());
242 SetLastError(0xdeadbeef);
243 duplicate = SetupDuplicateDiskSpaceListW(NULL, (void *)0xdeadbeef, 0, 0);
244 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
245 ok(GetLastError() == ERROR_INVALID_PARAMETER,
246 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
248 SetLastError(0xdeadbeef);
249 duplicate = SetupDuplicateDiskSpaceListW(NULL, NULL, 0xdeadbeef, 0);
250 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
251 ok(GetLastError() == ERROR_INVALID_PARAMETER,
252 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
254 SetLastError(0xdeadbeef);
255 duplicate = SetupDuplicateDiskSpaceListW(NULL, NULL, 0, ~0U);
256 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
257 ok(GetLastError() == ERROR_INVALID_PARAMETER,
258 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
260 handle = SetupCreateDiskSpaceListW(NULL, 0, 0);
261 ok(handle != NULL,
262 "Expected SetupCreateDiskSpaceListW to return a valid handle, got NULL\n");
264 if (!handle)
266 skip("Failed to create a disk space handle\n");
267 return;
270 SetLastError(0xdeadbeef);
271 duplicate = SetupDuplicateDiskSpaceListW(handle, (void *)0xdeadbeef, 0, 0);
272 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
273 ok(GetLastError() == ERROR_INVALID_PARAMETER,
274 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
276 SetLastError(0xdeadbeef);
277 duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0xdeadbeef, 0);
278 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
279 ok(GetLastError() == ERROR_INVALID_PARAMETER,
280 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
282 SetLastError(0xdeadbeef);
283 duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0, SPDSL_IGNORE_DISK);
284 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
285 ok(GetLastError() == ERROR_INVALID_PARAMETER,
286 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
288 SetLastError(0xdeadbeef);
289 duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0, ~0U);
290 ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
291 ok(GetLastError() == ERROR_INVALID_PARAMETER,
292 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
294 duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0, 0);
295 ok(duplicate != NULL, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
296 ok(duplicate != handle,
297 "Expected new handle (%p) to be different from the old handle (%p)\n", duplicate, handle);
299 ok(SetupDestroyDiskSpaceList(duplicate), "Expected SetupDestroyDiskSpaceList to succeed\n");
300 ok(SetupDestroyDiskSpaceList(handle), "Expected SetupDestroyDiskSpaceList to succeed\n");
303 static void test_SetupQuerySpaceRequiredOnDriveA(void)
305 BOOL ret;
306 HDSKSPC handle;
307 LONGLONG space;
309 if (is_win9x)
310 win_skip("SetupQuerySpaceRequiredOnDriveA crashes with NULL disk space handle on Win9x\n");
311 else
313 SetLastError(0xdeadbeef);
314 ret = SetupQuerySpaceRequiredOnDriveA(NULL, NULL, NULL, NULL, 0);
315 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
316 ok(GetLastError() == ERROR_INVALID_PARAMETER,
317 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
318 GetLastError());
320 SetLastError(0xdeadbeef);
321 space = 0xdeadbeef;
322 ret = SetupQuerySpaceRequiredOnDriveA(NULL, NULL, &space, NULL, 0);
323 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
324 ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
325 ok(GetLastError() == ERROR_INVALID_PARAMETER,
326 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
327 GetLastError());
329 SetLastError(0xdeadbeef);
330 ret = SetupQuerySpaceRequiredOnDriveA(NULL, "", NULL, NULL, 0);
331 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
332 ok(GetLastError() == ERROR_INVALID_HANDLE,
333 "Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
334 GetLastError());
336 SetLastError(0xdeadbeef);
337 space = 0xdeadbeef;
338 ret = SetupQuerySpaceRequiredOnDriveA(NULL, "", &space, NULL, 0);
339 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
340 ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
341 ok(GetLastError() == ERROR_INVALID_HANDLE,
342 "Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
343 GetLastError());
346 handle = SetupCreateDiskSpaceListA(NULL, 0, 0);
347 ok(handle != NULL,
348 "Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
350 SetLastError(0xdeadbeef);
351 ret = SetupQuerySpaceRequiredOnDriveA(handle, NULL, NULL, NULL, 0);
352 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
353 ok(GetLastError() == ERROR_INVALID_PARAMETER ||
354 GetLastError() == ERROR_INVALID_DRIVE, /* Win9x */
355 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
356 GetLastError());
358 SetLastError(0xdeadbeef);
359 space = 0xdeadbeef;
360 ret = SetupQuerySpaceRequiredOnDriveA(handle, NULL, &space, NULL, 0);
361 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
362 ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
363 ok(GetLastError() == ERROR_INVALID_PARAMETER ||
364 GetLastError() == ERROR_INVALID_DRIVE, /* Win9x */
365 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
366 GetLastError());
368 SetLastError(0xdeadbeef);
369 ret = SetupQuerySpaceRequiredOnDriveA(handle, "", NULL, NULL, 0);
370 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
371 ok(GetLastError() == ERROR_INVALID_DRIVE,
372 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
373 GetLastError());
375 SetLastError(0xdeadbeef);
376 space = 0xdeadbeef;
377 ret = SetupQuerySpaceRequiredOnDriveA(handle, "", &space, NULL, 0);
378 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
379 ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
380 ok(GetLastError() == ERROR_INVALID_DRIVE,
381 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
382 GetLastError());
384 ok(SetupDestroyDiskSpaceList(handle),
385 "Expected SetupDestroyDiskSpaceList to succeed\n");
388 static void test_SetupQuerySpaceRequiredOnDriveW(void)
390 static const WCHAR emptyW[] = {0};
392 BOOL ret;
393 HDSKSPC handle;
394 LONGLONG space;
396 SetLastError(0xdeadbeef);
397 ret = SetupQuerySpaceRequiredOnDriveW(NULL, NULL, NULL, NULL, 0);
398 if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
400 win_skip("SetupQuerySpaceRequiredOnDriveW is not available\n");
401 return;
403 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
404 ok(GetLastError() == ERROR_INVALID_HANDLE,
405 "Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
406 GetLastError());
408 SetLastError(0xdeadbeef);
409 space = 0xdeadbeef;
410 ret = SetupQuerySpaceRequiredOnDriveW(NULL, NULL, &space, NULL, 0);
411 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
412 ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
413 ok(GetLastError() == ERROR_INVALID_HANDLE,
414 "Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
415 GetLastError());
417 SetLastError(0xdeadbeef);
418 ret = SetupQuerySpaceRequiredOnDriveW(NULL, emptyW, NULL, NULL, 0);
419 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
420 ok(GetLastError() == ERROR_INVALID_HANDLE,
421 "Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
422 GetLastError());
424 SetLastError(0xdeadbeef);
425 space = 0xdeadbeef;
426 ret = SetupQuerySpaceRequiredOnDriveW(NULL, emptyW, &space, NULL, 0);
427 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
428 ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
429 ok(GetLastError() == ERROR_INVALID_HANDLE,
430 "Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
431 GetLastError());
433 handle = SetupCreateDiskSpaceListA(NULL, 0, 0);
434 ok(handle != NULL,
435 "Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
437 SetLastError(0xdeadbeef);
438 ret = SetupQuerySpaceRequiredOnDriveW(handle, NULL, NULL, NULL, 0);
439 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
440 ok(GetLastError() == ERROR_INVALID_PARAMETER ||
441 GetLastError() == ERROR_INVALID_DRIVE, /* NT4/Win2k/XP/Win2k3 */
442 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
443 GetLastError());
445 SetLastError(0xdeadbeef);
446 space = 0xdeadbeef;
447 ret = SetupQuerySpaceRequiredOnDriveW(handle, NULL, &space, NULL, 0);
448 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
449 ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
450 ok(GetLastError() == ERROR_INVALID_PARAMETER ||
451 GetLastError() == ERROR_INVALID_DRIVE, /* NT4/Win2k/XP/Win2k3 */
452 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
453 GetLastError());
455 SetLastError(0xdeadbeef);
456 ret = SetupQuerySpaceRequiredOnDriveW(handle, emptyW, NULL, NULL, 0);
457 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
458 ok(GetLastError() == ERROR_INVALID_DRIVE,
459 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
460 GetLastError());
462 SetLastError(0xdeadbeef);
463 space = 0xdeadbeef;
464 ret = SetupQuerySpaceRequiredOnDriveW(handle, emptyW, &space, NULL, 0);
465 ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
466 ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
467 ok(GetLastError() == ERROR_INVALID_DRIVE,
468 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
469 GetLastError());
471 ok(SetupDestroyDiskSpaceList(handle),
472 "Expected SetupDestroyDiskSpaceList to succeed\n");
475 START_TEST(diskspace)
477 is_win9x = !SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0xdeadbeef, 0) &&
478 GetLastError() == ERROR_CALL_NOT_IMPLEMENTED;
479 test_SetupCreateDiskSpaceListA();
480 test_SetupCreateDiskSpaceListW();
481 test_SetupDuplicateDiskSpaceListA();
482 test_SetupDuplicateDiskSpaceListW();
483 test_SetupQuerySpaceRequiredOnDriveA();
484 test_SetupQuerySpaceRequiredOnDriveW();