Lines 1186-1192
Link Here
|
1186 |
static void test_FindFirstFileA(void) |
1186 |
static void test_FindFirstFileA(void) |
1187 |
{ |
1187 |
{ |
1188 |
HANDLE handle; |
1188 |
HANDLE handle; |
1189 |
WIN32_FIND_DATAA search_results; |
1189 |
WIN32_FIND_DATAA data; |
1190 |
int err; |
1190 |
int err; |
1191 |
char buffer[5] = "C:\\"; |
1191 |
char buffer[5] = "C:\\"; |
1192 |
char buffer2[100]; |
1192 |
char buffer2[100]; |
Lines 1195-1201
Link Here
|
1195 |
buffer[0] = get_windows_drive(); |
1195 |
buffer[0] = get_windows_drive(); |
1196 |
|
1196 |
|
1197 |
SetLastError( 0xdeadbeaf ); |
1197 |
SetLastError( 0xdeadbeaf ); |
1198 |
handle = FindFirstFileA(buffer, &search_results); |
1198 |
handle = FindFirstFileA(buffer, &data); |
1199 |
err = GetLastError(); |
1199 |
err = GetLastError(); |
1200 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on root directory should fail\n" ); |
1200 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on root directory should fail\n" ); |
1201 |
ok ( err == ERROR_FILE_NOT_FOUND, "Bad Error number %d\n", err ); |
1201 |
ok ( err == ERROR_FILE_NOT_FOUND, "Bad Error number %d\n", err ); |
Lines 1203-1209
Link Here
|
1203 |
/* try FindFirstFileA on "C:\*" */ |
1203 |
/* try FindFirstFileA on "C:\*" */ |
1204 |
strcpy(buffer2, buffer); |
1204 |
strcpy(buffer2, buffer); |
1205 |
strcat(buffer2, "*"); |
1205 |
strcat(buffer2, "*"); |
1206 |
handle = FindFirstFileA(buffer2, &search_results); |
1206 |
handle = FindFirstFileA(buffer2, &data); |
1207 |
ok ( handle != INVALID_HANDLE_VALUE, "FindFirstFile on %s should succeed\n", buffer2 ); |
1207 |
ok ( handle != INVALID_HANDLE_VALUE, "FindFirstFile on %s should succeed\n", buffer2 ); |
1208 |
ok ( FindClose(handle) == TRUE, "Failed to close handle %s\n", buffer2 ); |
1208 |
ok ( FindClose(handle) == TRUE, "Failed to close handle %s\n", buffer2 ); |
1209 |
|
1209 |
|
Lines 1211-1217
Link Here
|
1211 |
SetLastError( 0xdeadbeaf ); |
1211 |
SetLastError( 0xdeadbeaf ); |
1212 |
strcpy(buffer2, buffer); |
1212 |
strcpy(buffer2, buffer); |
1213 |
strcat(buffer2, "foo\\"); |
1213 |
strcat(buffer2, "foo\\"); |
1214 |
handle = FindFirstFileA(buffer2, &search_results); |
1214 |
handle = FindFirstFileA(buffer2, &data); |
1215 |
err = GetLastError(); |
1215 |
err = GetLastError(); |
1216 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1216 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1217 |
todo_wine { |
1217 |
todo_wine { |
Lines 1222-1254
Link Here
|
1222 |
SetLastError( 0xdeadbeaf ); |
1222 |
SetLastError( 0xdeadbeaf ); |
1223 |
strcpy(buffer2, buffer); |
1223 |
strcpy(buffer2, buffer); |
1224 |
strcat(buffer2, "foo\\bar.txt"); |
1224 |
strcat(buffer2, "foo\\bar.txt"); |
1225 |
handle = FindFirstFileA(buffer2, &search_results); |
1225 |
handle = FindFirstFileA(buffer2, &data); |
1226 |
err = GetLastError(); |
1226 |
err = GetLastError(); |
1227 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1227 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1228 |
todo_wine { |
1228 |
ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); |
1229 |
ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); |
|
|
1230 |
} |
1231 |
|
1229 |
|
1232 |
/* try FindFirstFileA on "C:\foo\*.*" */ |
1230 |
/* try FindFirstFileA on "C:\foo\*.*" */ |
1233 |
SetLastError( 0xdeadbeaf ); |
1231 |
SetLastError( 0xdeadbeaf ); |
1234 |
strcpy(buffer2, buffer); |
1232 |
strcpy(buffer2, buffer); |
1235 |
strcat(buffer2, "foo\\*.*"); |
1233 |
strcat(buffer2, "foo\\*.*"); |
1236 |
handle = FindFirstFileA(buffer2, &search_results); |
1234 |
handle = FindFirstFileA(buffer2, &data); |
1237 |
err = GetLastError(); |
1235 |
err = GetLastError(); |
1238 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1236 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1239 |
todo_wine { |
1237 |
ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); |
1240 |
ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); |
|
|
1241 |
} |
1242 |
|
1238 |
|
1243 |
/* try FindFirstFileA on "foo\bar.txt" */ |
1239 |
/* try FindFirstFileA on "foo\bar.txt" */ |
1244 |
SetLastError( 0xdeadbeaf ); |
1240 |
SetLastError( 0xdeadbeaf ); |
1245 |
strcpy(buffer2, "foo\\bar.txt"); |
1241 |
strcpy(buffer2, "foo\\bar.txt"); |
1246 |
handle = FindFirstFileA(buffer2, &search_results); |
1242 |
handle = FindFirstFileA(buffer2, &data); |
1247 |
err = GetLastError(); |
1243 |
err = GetLastError(); |
1248 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1244 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1249 |
todo_wine { |
1245 |
ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); |
1250 |
ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); |
1246 |
|
1251 |
} |
1247 |
/* try FindFirstFileA on "c:\nul" */ |
|
|
1248 |
SetLastError( 0xdeadbeaf ); |
1249 |
strcpy(buffer2, buffer); |
1250 |
strcat(buffer2, "nul"); |
1251 |
handle = FindFirstFileA(buffer2, &data); |
1252 |
err = GetLastError(); |
1253 |
ok( handle != INVALID_HANDLE_VALUE, "FindFirstFile on %s failed\n", buffer2 ); |
1254 |
ok( 0 == lstrcmpiA(data.cFileName, "nul"), "wrong name %s\n", data.cFileName ); |
1255 |
ok( 0 == data.nFileSizeHigh, "wrong size %d\n", data.nFileSizeHigh ); |
1256 |
ok( 0 == data.nFileSizeLow, "wrong size %d\n", data.nFileSizeLow ); |
1257 |
ok( FILE_ATTRIBUTE_ARCHIVE == data.dwFileAttributes, "wrong attributes %x\n", data.dwFileAttributes ); |
1258 |
SetLastError( 0xdeadbeaf ); |
1259 |
ok( !FindNextFileA( handle, &data ), "FindNextFileA succeeded\n" ); |
1260 |
ok( GetLastError() == ERROR_NO_MORE_FILES, "bad error %d\n", GetLastError() ); |
1261 |
ok( FindClose( handle ), "failed to close handle\n" ); |
1262 |
|
1263 |
/* try FindFirstFileA on "lpt1" */ |
1264 |
SetLastError( 0xdeadbeaf ); |
1265 |
strcpy(buffer2, "lpt1"); |
1266 |
handle = FindFirstFileA(buffer2, &data); |
1267 |
err = GetLastError(); |
1268 |
ok( handle != INVALID_HANDLE_VALUE, "FindFirstFile on %s failed\n", buffer2 ); |
1269 |
ok( 0 == lstrcmpiA(data.cFileName, "lpt1"), "wrong name %s\n", data.cFileName ); |
1270 |
ok( 0 == data.nFileSizeHigh, "wrong size %d\n", data.nFileSizeHigh ); |
1271 |
ok( 0 == data.nFileSizeLow, "wrong size %d\n", data.nFileSizeLow ); |
1272 |
ok( FILE_ATTRIBUTE_ARCHIVE == data.dwFileAttributes, "wrong attributes %x\n", data.dwFileAttributes ); |
1273 |
SetLastError( 0xdeadbeaf ); |
1274 |
ok( !FindNextFileA( handle, &data ), "FindNextFileA succeeded\n" ); |
1275 |
ok( GetLastError() == ERROR_NO_MORE_FILES, "bad error %d\n", GetLastError() ); |
1276 |
ok( FindClose( handle ), "failed to close handle\n" ); |
1277 |
|
1278 |
/* try FindFirstFileA on "c:\nul\*" */ |
1279 |
SetLastError( 0xdeadbeaf ); |
1280 |
strcpy(buffer2, buffer); |
1281 |
strcat(buffer2, "nul\\*"); |
1282 |
handle = FindFirstFileA(buffer2, &data); |
1283 |
err = GetLastError(); |
1284 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1285 |
ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); |
1286 |
|
1287 |
/* try FindFirstFileA on "c:\nul*" */ |
1288 |
SetLastError( 0xdeadbeaf ); |
1289 |
strcpy(buffer2, buffer); |
1290 |
strcat(buffer2, "nul*"); |
1291 |
handle = FindFirstFileA(buffer2, &data); |
1292 |
err = GetLastError(); |
1293 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1294 |
ok ( err == ERROR_FILE_NOT_FOUND, "Bad Error number %d\n", err ); |
1295 |
|
1296 |
/* try FindFirstFileA on "c:\foo\bar\nul" */ |
1297 |
SetLastError( 0xdeadbeaf ); |
1298 |
strcpy(buffer2, buffer); |
1299 |
strcat(buffer2, "foo\\bar\\nul"); |
1300 |
handle = FindFirstFileA(buffer2, &data); |
1301 |
err = GetLastError(); |
1302 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1303 |
ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); |
1304 |
|
1305 |
/* try FindFirstFileA on "c:\foo\nul\bar" */ |
1306 |
SetLastError( 0xdeadbeaf ); |
1307 |
strcpy(buffer2, buffer); |
1308 |
strcat(buffer2, "foo\\nul\\bar"); |
1309 |
handle = FindFirstFileA(buffer2, &data); |
1310 |
err = GetLastError(); |
1311 |
ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); |
1312 |
ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); |
1252 |
} |
1313 |
} |
1253 |
|
1314 |
|
1254 |
static void test_FindNextFileA(void) |
1315 |
static void test_FindNextFileA(void) |