2182{
2194
2197 {
2198 skip(
"User SID not available -> skipping MsiSourceListEnumMediaDisksA tests\n");
2199 return;
2200 }
2201
2204
2205
2206
2207
2208 labelsz =
sizeof(
label);
2209 promptsz = sizeof(prompt);
2213
2214
2215 labelsz =
sizeof(
label);
2216 promptsz = sizeof(prompt);
2220
2221
2222 labelsz =
sizeof(
label);
2223 promptsz = sizeof(prompt);
2227
2228
2229 labelsz =
sizeof(
label);
2230 promptsz = sizeof(prompt);
2235
2236
2237 labelsz =
sizeof(
label);
2238 promptsz = sizeof(prompt);
2243
2244
2245 labelsz =
sizeof(
label);
2246 promptsz = sizeof(prompt);
2249 0, &
id,
label, &labelsz, prompt, &promptsz);
2251
2252
2253 labelsz =
sizeof(
label);
2254 promptsz = sizeof(prompt);
2257 0, &
id,
label, &labelsz, prompt, &promptsz);
2259
2260
2261 labelsz =
sizeof(
label);
2262 promptsz = sizeof(prompt);
2266
2267
2268
2269 lstrcpyA(keypath,
"Software\\Microsoft\\Installer\\Products\\");
2271
2274
2275
2276 labelsz =
sizeof(
label);
2277 promptsz = sizeof(prompt);
2281
2284
2285
2286 id = 0xbeef;
2288 labelsz = 0xdeadbeef;
2290 promptsz = 0xdeadbeef;
2294 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2296 ok(labelsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", labelsz);
2297 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2298 ok(promptsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", promptsz);
2299
2302
2303
2304 id = 0xbeef;
2306 labelsz = 0xdeadbeef;
2308 promptsz = 0xdeadbeef;
2312 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2314 ok(labelsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", labelsz);
2315 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2316 ok(promptsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", promptsz);
2317
2320
2321
2322 id = 0;
2330 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2332 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2333 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2334 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2335
2338
2339
2340 id = 0;
2346 "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n",
r);
2348 {
2349 ok(
id == 2,
"Expected 2, got %lu\n",
id);
2350 ok(labelsz == 3,
"Expected 3, got %lu\n", labelsz);
2351 ok(promptsz == 3,
"Expected 3, got %lu\n", promptsz);
2352 }
2353
2354
2355 id = 0xbeef;
2363 "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n",
r);
2365 {
2366 ok(
id == 2,
"Expected 2, got %lu\n",
id);
2368 ok(labelsz == 3,
"Expected 3, got %lu\n", labelsz);
2369 ok(!
lstrcmpA(prompt,
"two"),
"Expected \"two\", got \"%s\"\n", prompt);
2370 ok(promptsz == 3,
"Expected 3, got %lu\n", promptsz);
2371 }
2373 {
2374 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2376 ok(labelsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", labelsz);
2377 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2378 ok(promptsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", promptsz);
2379 }
2380
2383
2384
2385 id = 0;
2393 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2395 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2396 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2397 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2398
2399
2400 id = 0;
2408 ok(
id == 2,
"Expected 2, got %lu\n",
id);
2410 ok(labelsz == 3,
"Expected 3, got %lu\n", labelsz);
2411 ok(!
lstrcmpA(prompt,
"two"),
"Expected \"two\", got \"%s\"\n", prompt);
2412 ok(promptsz == 3,
"Expected 3, got %lu\n", promptsz);
2413
2414
2415 id = 0;
2423 ok(
id == 4,
"Expected 4, got %lu\n",
id);
2425 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2426 ok(!
lstrcmpA(prompt,
"four"),
"Expected \"four\", got \"%s\"\n", prompt);
2427 ok(promptsz == 4,
"Expected 4, got %lu\n", promptsz);
2428
2429
2430 id = 0xbeef;
2438 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2440 ok(labelsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", labelsz);
2441 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2442 ok(promptsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", promptsz);
2443
2444
2445 id = 0;
2453 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2455 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2456 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2457 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2458
2459
2460 id = 0;
2468 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2470 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2471 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2472 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2473
2474
2475 id = 0xbeef;
2483 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2485 ok(labelsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", labelsz);
2486 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2487 ok(promptsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", promptsz);
2488
2489
2490 id = 0xbeef;
2498 ok(
id == 2,
"Expected 2, got %lu\n",
id);
2500 ok(labelsz == 3,
"Expected 3, got %lu\n", labelsz);
2501 ok(!
lstrcmpA(prompt,
"two"),
"Expected \"two\", got \"%s\"\n", prompt);
2502 ok(promptsz == 3,
"Expected 3, got %lu\n", promptsz);
2503
2504
2505 id = 0xbeef;
2513 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2515 ok(labelsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", labelsz);
2516 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2517 ok(promptsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", promptsz);
2518
2519
2528 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2529 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2530 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2531
2532
2533 id = 0;
2540 "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n",
r);
2542 {
2543 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2544 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2545 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2546 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2547 }
2548
2549
2550 id = 0;
2556 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2557 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2558 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2559
2560
2561 id = 0xbeef;
2568 "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n",
r);
2570 {
2571 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2573 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2574 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2575 }
2576
2577
2578 id = 0;
2586 {
2587 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2589 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2590 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2591 }
2592
2593
2594 id = 0;
2600 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2602 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2603
2604
2605 id = 0xbeef;
2612 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2614 ok(labelsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", labelsz);
2615 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2616
2617
2618 id = 0;
2624 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2625
2626
2627 id = 0;
2631 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2632
2633
2635 labelsz = 5;
2642 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2643 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2644 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2645
2646
2650 promptsz = 6;
2655 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2656 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2657 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2658
2661
2662
2663 id = 0;
2671 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2673 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2674 ok(!
lstrcmpA(prompt,
"label"),
"Expected \"label\", got \"%s\"\n", prompt);
2675 ok(promptsz == 5,
"Expected 5, got %lu\n", promptsz);
2676
2679
2680
2681 id = 0;
2689 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2691 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2692 ok(!
lstrcmpA(prompt,
""),
"Expected \"\", got \"%s\"\n", prompt);
2693 ok(promptsz == 0,
"Expected 0, got %lu\n", promptsz);
2694
2697
2698
2699 id = 0;
2707 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2709 ok(labelsz == 0,
"Expected 0, got %lu\n", labelsz);
2710 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2711 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2712
2715
2716
2717 id = 0;
2725 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2727 ok(labelsz == 0,
"Expected 0, got %lu\n", labelsz);
2728 ok(!
lstrcmpA(prompt,
""),
"Expected \"\", got \"%s\"\n", prompt);
2729 ok(promptsz == 0,
"Expected 0, got %lu\n", promptsz);
2730
2734
2735
2736 id = 0;
2744 ok(
id == 1,
"Expected 1, got %lu\n",
id);
2746 ok(labelsz == 3,
"Expected 3, got %lu\n", labelsz);
2747 ok(!
lstrcmpA(prompt,
"#42"),
"Expected \"#42\", got \"%s\"\n", prompt);
2748 ok(promptsz == 3,
"Expected 3, got %lu\n", promptsz);
2749
2759
2760
2761
2762 lstrcpyA(keypath,
"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed\\");
2764 lstrcatA(keypath,
"\\Installer\\Products\\");
2766
2769 {
2770 skip(
"Product key creation failed with error code %ld\n",
res);
2771 goto machine_tests;
2772 }
2773
2774
2778
2781
2782
2783 id = 0xbeef;
2785 labelsz = 0xdeadbeef;
2787 promptsz = 0xdeadbeef;
2791 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2793 ok(labelsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", labelsz);
2794 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2795 ok(promptsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", promptsz);
2796
2799
2800
2801 id = 0xbeef;
2803 labelsz = 0xdeadbeef;
2805 promptsz = 0xdeadbeef;
2809 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2811 ok(labelsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", labelsz);
2812 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2813 ok(promptsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", promptsz);
2814
2817
2818
2819 id = 0;
2827 ok(
id == 2,
"Expected 2, got %lu\n",
id);
2829 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2830 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2831 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2832
2840
2841
2842
2843machine_tests:
2844 lstrcpyA(keypath,
"Software\\Classes\\Installer\\Products\\");
2846
2849 {
2850 skip(
"Product key creation failed with error code %ld\n",
res);
2852 return;
2853 }
2854
2855
2859
2862
2863
2864 id = 0xbeef;
2866 labelsz = 0xdeadbeef;
2868 promptsz = 0xdeadbeef;
2872 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2874 ok(labelsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", labelsz);
2875 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2876 ok(promptsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", promptsz);
2877
2880
2881
2882 id = 0xbeef;
2884 labelsz = 0xdeadbeef;
2886 promptsz = 0xdeadbeef;
2890 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2892 ok(labelsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", labelsz);
2893 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2894 ok(promptsz == 0xdeadbeef,
"Expected 0xdeadbeef, got %lu\n", promptsz);
2895
2898
2899
2900 id = 0;
2908 ok(
id == 2,
"Expected 2, got %lu\n",
id);
2910 ok(labelsz == 5,
"Expected 5, got %lu\n", labelsz);
2911 ok(!
lstrcmpA(prompt,
"prompt"),
"Expected \"prompt\", got \"%s\"\n", prompt);
2912 ok(promptsz == 6,
"Expected 6, got %lu\n", promptsz);
2913
2914
2915 id = 0xbeef;
2923 ok(
id == 0xbeef,
"Expected 0xbeef, got %lu\n",
id);
2925 ok(labelsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", labelsz);
2926 ok(!
lstrcmpA(prompt,
"bbb"),
"Expected \"bbb\", got \"%s\"\n", prompt);
2927 ok(promptsz ==
MAX_PATH,
"Expected MAX_PATH, got %lu\n", promptsz);
2928
2937}
#define ERROR_NO_MORE_ITEMS
UINT WINAPI MsiSourceListEnumMediaDisksA(const char *szProductCodeOrPatchCode, const char *szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwIndex, DWORD *pdwDiskId, char *szVolumeLabel, DWORD *pcchVolumeLabel, char *szDiskPrompt, DWORD *pcchDiskPrompt)
static const WCHAR label[]