906{
910 int itemCount_justFiles;
911 int itemCount_justDrives;
912 int itemCount_allFiles;
913 int itemCount_allDirs;
917 char driveletter;
918 const char *wildcard = "*";
921
923
926 ok(
ret,
"Failed to set current directory.\n");
927
929 ok(
ret,
"Failed to create test directory.\n");
930
934
935
936
937
938
939
943
944
945
946
951 {
952 wildcard = "*.*";
955 }
957
958
960 ok (itemCount > 0,
"SendMessage(LB_DIR) did NOT fill the listbox!\n");
961 itemCount_allFiles = itemCount;
962 ok(
res + 1 == itemCount,
963 "SendMessage(LB_DIR, 0, *) returned incorrect index (expected %d got %d)!\n",
965
966
971
972
974 ok (itemCount == 0,
"SendMessage(LB_DIR) DID fill the listbox!\n");
975
976
977
978
979
984
985
987 "expected no change to pathBuffer, got %s\n",
pathBuffer);
988
989
991 ok (itemCount > 0,
"SendMessage(LB_DIR) did NOT fill the listbox!\n");
992 itemCount_justFiles = itemCount;
993 ok(
res + 1 == itemCount,
994 "SendMessage(LB_DIR, 0, w*.c) returned incorrect index (expected %d got %d)!\n",
996
997
998 for (
i = 0;
i < itemCount;
i++) {
1003 (*(
p-1) ==
'c' || *(
p-1) ==
'C') &&
1004 (*(
p-2) ==
'.')),
"Element %d (%s) does not fit requested w*.c\n",
i,
pathBuffer);
1005 }
1006
1007
1011 ok (
res > 0,
"SendMessage(LB_DIR, DDL_DIRECTORY, *) failed - 0x%08x\n",
GetLastError());
1012
1013
1014
1015
1017 itemCount_allDirs = itemCount - itemCount_allFiles;
1018 ok (itemCount > itemCount_allFiles,
1019 "SendMessage(LB_DIR, DDL_DIRECTORY, *) filled with %d entries, expected > %d\n",
1020 itemCount, itemCount_allFiles);
1021 ok(
res + 1 == itemCount,
1022 "SendMessage(LB_DIR, DDL_DIRECTORY, *) returned incorrect index (expected %d got %d)!\n",
1023 itemCount - 1,
res);
1024
1025
1029 ok (
res == -1,
"SendMessage(LB_DIR, DDL_DIRECTORY, %s) returned %d, expected -1\n",
BAD_EXTENSION,
res);
1030
1031
1033 ok (itemCount == 0,
"SendMessage(LB_DIR) DID fill the listbox!\n");
1034
1035
1036
1040 ok (
res >= 0,
"SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) failed - 0x%08x\n",
GetLastError());
1041
1042
1043
1044
1046 ok (itemCount == itemCount_justFiles,
1047 "SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) filled with %d entries, expected %d\n",
1048 itemCount, itemCount_justFiles);
1049 ok(
res + 1 == itemCount,
1050 "SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) returned incorrect index (expected %d got %d)!\n",
1051 itemCount - 1,
res);
1052
1053
1054 for (
i = 0;
i < itemCount;
i++) {
1060 (*(
p-1) ==
'c' || *(
p-1) ==
'C') &&
1061 (*(
p-2) ==
'.')),
"Element %d (%s) does not fit requested w*.c\n",
i,
pathBuffer);
1062 }
1063
1064
1065
1069 ok (
res >= 0,
"SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) failed - 0x%08x\n",
GetLastError());
1070
1071
1072
1073
1074
1075
1078 "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) filled with %d entries, expected at least %d\n",
1079 itemCount, 1);
1080 itemCount_justDrives = itemCount;
1081 ok(
res + 1 == itemCount,
"SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) returned incorrect index!\n");
1082
1083
1084 for (
i = 0;
i < itemCount;
i++) {
1086 driveletter = '\0';
1090 ok( driveletter >=
'a' && driveletter <=
'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
1091 if (!(driveletter >= 'a' && driveletter <= 'z')) {
1092
1094 itemCount_justDrives--;
1095 }
1096 }
1097
1098
1102 ok (
res == itemCount_justDrives -1,
"SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, %s) returned %d, expected %d\n",
1104
1106 ok (itemCount == itemCount_justDrives,
"SendMessage(LB_DIR) returned %d expected %d\n",
1107 itemCount, itemCount_justDrives);
1108
1109 trace(
"Files with w*.c: %d Mapped drives: %d Directories: 1\n",
1110 itemCount_justFiles, itemCount_justDrives);
1111
1112
1116 ok (
res > 0,
"SendMessage(LB_DIR, DDL_DRIVES, *) failed - 0x%08x\n",
GetLastError());
1117
1118
1119
1120
1121
1122
1124 ok (itemCount == itemCount_justDrives + itemCount_allFiles,
1125 "SendMessage(LB_DIR, DDL_DRIVES, *) filled with %d entries, expected %d\n",
1126 itemCount, itemCount_justDrives + itemCount_allFiles);
1127 ok(
res + 1 == itemCount,
"SendMessage(LB_DIR, DDL_DRIVES, *) returned incorrect index!\n");
1128
1129
1133 ok (
res == itemCount_justDrives -1,
"SendMessage(LB_DIR, DDL_DRIVES, %s) returned %d, expected %d\n",
1135
1137 ok (itemCount ==
res + 1,
"SendMessage(LB_DIR) returned %d expected %d\n", itemCount,
res + 1);
1138
1139
1140
1144 ok (
res > 0,
"SendMessage(LB_DIR, DDL_DRIVES, w*.c) failed - 0x%08x\n",
GetLastError());
1145
1146
1147
1148
1149
1150
1152 ok (itemCount == itemCount_justDrives + itemCount_justFiles,
1153 "SendMessage(LB_DIR, DDL_DRIVES, w*.c) filled with %d entries, expected %d\n",
1154 itemCount, itemCount_justDrives + itemCount_justFiles);
1155 ok(
res + 1 == itemCount,
"SendMessage(LB_DIR, DDL_DRIVES, w*.c) returned incorrect index!\n");
1156
1157
1158 for (
i = 0;
i < itemCount;
i++) {
1160 driveletter = '\0';
1165 ok( driveletter >=
'a' && driveletter <=
'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
1166 } else {
1169 (*(
p-1) ==
'c' || *(
p-1) ==
'C') &&
1170 (*(
p-2) ==
'.')),
"Element %d (%s) does not fit requested w*.c\n",
i,
pathBuffer);
1171 }
1172 }
1173
1174
1175
1179 ok (
res > 0,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, *) failed - 0x%08x\n",
GetLastError());
1180
1181
1182
1183
1185 ok (itemCount == itemCount_allFiles + itemCount_justDrives + itemCount_allDirs,
1186 "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES) filled with %d entries, expected %d\n",
1187 itemCount, itemCount_allFiles + itemCount_justDrives + itemCount_allDirs);
1188 ok(
res + 1 == itemCount,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) returned incorrect index!\n");
1189
1190
1191
1192
1193
1194 for (
i = 0;
i < itemCount;
i++) {
1196 driveletter = '\0';
1199 ok( driveletter >=
'a' && driveletter <=
'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
1200 }
1201 }
1202
1203
1207 ok (
res == itemCount_justDrives -1,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, %s) returned %d, expected %d\n",
1209
1211 ok (itemCount ==
res + 1,
"SendMessage(LB_DIR) returned %d expected %d\n", itemCount,
res + 1);
1212
1213
1214
1215
1219 ok (
res > 0,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) failed - 0x%08x\n",
GetLastError());
1220
1221
1222
1223
1225 ok (itemCount == itemCount_justFiles + itemCount_justDrives,
1226 "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES) filled with %d entries, expected %d\n",
1227 itemCount, itemCount_justFiles + itemCount_justDrives);
1228 ok(
res + 1 == itemCount,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) returned incorrect index!\n");
1229
1230
1231
1232
1233
1234 for (
i = 0;
i < itemCount;
i++) {
1236 driveletter = '\0';
1240 ok( driveletter >=
'a' && driveletter <=
'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
1241 } else {
1244 (*(
p-1) ==
'c' || *(
p-1) ==
'C') &&
1245 (*(
p-2) ==
'.')),
"Element %d (%s) does not fit requested w*.c\n",
i,
pathBuffer);
1246 }
1247 }
1248
1249
1253 ok (
res != -1,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err %u\n",
GetLastError());
1254
1256 ok (itemCount == itemCount_allDirs,
1257 "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected %d\n",
1258 itemCount, itemCount_allDirs);
1259 ok(
res + 1 == itemCount,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) returned incorrect index!\n");
1260
1261 if (itemCount)
1262 {
1266 }
1267
1268
1272 ok (
res == -1,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, %s) returned %d, expected %d\n",
1274
1276 ok (itemCount ==
res + 1,
"SendMessage(LB_DIR) returned %d expected %d\n", itemCount,
res + 1);
1277
1278
1279
1283 ok (
res ==
LB_ERR,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, w*.c) returned %d expected %d\n",
res,
LB_ERR);
1284
1285
1288 "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected %d\n",
1289 itemCount, 0);
1290
1291
1295 ok (
res > 0,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08x\n",
GetLastError());
1296
1297
1299 ok (itemCount == itemCount_justDrives + itemCount_allDirs,
1300 "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) filled with %d entries, expected %d\n",
1301 itemCount, itemCount_justDrives + itemCount_allDirs);
1302 ok(
res + 1 == itemCount,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c) returned incorrect index!\n");
1303
1304 for (
i = 0;
i < itemCount;
i++) {
1306 driveletter = '\0';
1309 ok( driveletter >=
'a' && driveletter <=
'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
1310 } else {
1312 "Element %d (%s) does not fit expected [...]\n",
i,
pathBuffer);
1313 }
1314 }
1315
1316
1320 ok (
res == itemCount_justDrives -1,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, %s) returned %d, expected %d\n",
1322
1324 ok (itemCount ==
res + 1,
"SendMessage(LB_DIR) returned %d expected %d\n", itemCount,
res + 1);
1325
1326
1330 ok (
res >= 0,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08x\n",
GetLastError());
1331
1332
1334 ok (itemCount == itemCount_justDrives,
1335 "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) filled with %d entries, expected %d\n",
1336 itemCount, itemCount_justDrives);
1337 ok(
res + 1 == itemCount,
"SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c) returned incorrect index!\n");
1338
1339 for (
i = 0;
i < itemCount;
i++) {
1341 driveletter = '\0';
1344 ok( driveletter >=
'a' && driveletter <=
'z',
"Drive letter not in range a..z, got ascii %d\n", driveletter);
1345 }
1347
1350
1352}
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)