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
30 #include "wine/test.h"
34 static void test_SetupCreateDiskSpaceListA(void)
38 ret
= SetupCreateDiskSpaceListA(NULL
, 0, 0);
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
);
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);
53 broken(ret
!= NULL
), /* NT4/Win9x/Win2k */
54 "Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret
);
56 ok(GetLastError() == ERROR_INVALID_PARAMETER
,
57 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
60 ok(SetupDestroyDiskSpaceList(ret
), "Expected SetupDestroyDiskSpaceList to succeed\n");
62 SetLastError(0xdeadbeef);
63 ret
= SetupCreateDiskSpaceListA(NULL
, 0xdeadbeef, 0);
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",
71 SetLastError(0xdeadbeef);
72 ret
= SetupCreateDiskSpaceListA((void *)0xdeadbeef, 0, 0);
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",
80 SetLastError(0xdeadbeef);
81 ret
= SetupCreateDiskSpaceListA((void *)0xdeadbeef, 0xdeadbeef, 0);
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",
90 static void test_SetupCreateDiskSpaceListW(void)
94 ret
= SetupCreateDiskSpaceListW(NULL
, 0, 0);
95 if (!ret
&& GetLastError() == ERROR_CALL_NOT_IMPLEMENTED
)
97 win_skip("SetupCreateDiskSpaceListW is not implemented\n");
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
);
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);
114 broken(ret
!= NULL
), /* NT4/Win2k */
115 "Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret
);
117 ok(GetLastError() == ERROR_INVALID_PARAMETER
,
118 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
121 ok(SetupDestroyDiskSpaceList(ret
), "Expected SetupDestroyDiskSpaceList to succeed\n");
123 SetLastError(0xdeadbeef);
124 ret
= SetupCreateDiskSpaceListW(NULL
, 0xdeadbeef, 0);
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",
132 SetLastError(0xdeadbeef);
133 ret
= SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0, 0);
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",
141 SetLastError(0xdeadbeef);
142 ret
= SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0xdeadbeef, 0);
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",
151 static void test_SetupDuplicateDiskSpaceListA(void)
153 HDSKSPC handle
, duplicate
;
156 win_skip("SetupDuplicateDiskSpaceListA crashes with NULL disk space handle on Win9x\n");
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);
186 "Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL\n");
190 skip("Failed to create a disk space handle\n");
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");
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);
262 "Expected SetupCreateDiskSpaceListW to return a valid handle, got NULL\n");
266 skip("Failed to create a disk space handle\n");
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)
310 win_skip("SetupQuerySpaceRequiredOnDriveA crashes with NULL disk space handle on Win9x\n");
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",
320 SetLastError(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",
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",
336 SetLastError(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",
346 handle
= SetupCreateDiskSpaceListA(NULL
, 0, 0);
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",
358 SetLastError(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",
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",
375 SetLastError(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",
384 ok(SetupDestroyDiskSpaceList(handle
),
385 "Expected SetupDestroyDiskSpaceList to succeed\n");
388 static void test_SetupQuerySpaceRequiredOnDriveW(void)
390 static const WCHAR emptyW
[] = {0};
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");
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",
408 SetLastError(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",
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",
424 SetLastError(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",
433 handle
= SetupCreateDiskSpaceListA(NULL
, 0, 0);
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",
445 SetLastError(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",
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",
462 SetLastError(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",
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();