4 * Copyright 2006 Stefan Leichter
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 "wine/test.h"
25 #define FLOPPY "FLOPPY"
26 #define HARDISK "HARDDISK"
27 #define LANMAN "LANMANREDIRECTOR"
28 #define RAMDISK "RAMDISK"
30 static void test_query_dos_deviceA(void)
32 char drivestr[] = "a:";
33 char *p, buffer[2000];
35 for (;drivestr[0] <= 'z'; drivestr[0]++) {
36 ret = QueryDosDeviceA( drivestr, buffer, sizeof(buffer));
38 for (p = buffer; *p; p++) *p = toupper(*p);
40 ok( strstr( buffer, CDROM) || strstr( buffer, FLOPPY) ||
41 strstr( buffer, HARDISK) || strstr( buffer, LANMAN) ||
42 strstr( buffer, RAMDISK), "expect the string %s contains %s,%s,%s,%s or %s\n",
43 buffer, CDROM, FLOPPY, HARDISK, LANMAN, RAMDISK);
48 static void test_GetVolumeNameForVolumeMountPointA(void)
51 char volume[MAX_PATH], path[] = "c:\\";
52 DWORD len = sizeof(volume);
54 ret = GetVolumeNameForVolumeMountPointA(path, volume, 0);
55 ok(ret == FALSE, "GetVolumeNameForVolumeMountPointA succeeded\n");
57 if (0) { /* these crash on XP */
58 ret = GetVolumeNameForVolumeMountPointA(path, NULL, len);
59 ok(ret == FALSE, "GetVolumeNameForVolumeMountPointA succeeded\n");
61 ret = GetVolumeNameForVolumeMountPointA(NULL, volume, len);
62 ok(ret == FALSE, "GetVolumeNameForVolumeMountPointA succeeded\n");
65 ret = GetVolumeNameForVolumeMountPointA(path, volume, len);
66 ok(ret == TRUE, "GetVolumeNameForVolumeMountPointA failed\n");
69 static void test_GetVolumeNameForVolumeMountPointW(void)
72 WCHAR volume[MAX_PATH], path[] = {'c',':','\\',0};
73 DWORD len = sizeof(volume) / sizeof(WCHAR);
75 ret = GetVolumeNameForVolumeMountPointW(path, volume, 0);
76 ok(ret == FALSE, "GetVolumeNameForVolumeMountPointA succeeded\n");
78 if (0) { /* these crash on XP */
79 ret = GetVolumeNameForVolumeMountPointW(path, NULL, len);
80 ok(ret == FALSE, "GetVolumeNameForVolumeMountPointW succeeded\n");
82 ret = GetVolumeNameForVolumeMountPointW(NULL, volume, len);
83 ok(ret == FALSE, "GetVolumeNameForVolumeMountPointW succeeded\n");
86 ret = GetVolumeNameForVolumeMountPointW(path, volume, len);
87 ok(ret == TRUE, "GetVolumeNameForVolumeMountPointW failed\n");
92 test_query_dos_deviceA();
93 test_GetVolumeNameForVolumeMountPointA();
94 test_GetVolumeNameForVolumeMountPointW();