kernel32/tests: Add a test for CreateFileA.

This commit is contained in:
Austin English 2010-07-27 01:36:39 -05:00 committed by Alexandre Julliard
parent fa7b5b05e2
commit 067168b67b
1 changed files with 7 additions and 0 deletions

View File

@ -874,6 +874,13 @@ static void test_CreateFileA(void)
ret = DeleteFileA(filename);
ok(ret, "DeleteFileA: error %d\n", GetLastError());
SetLastError(0xdeadbeef);
hFile = CreateFileA("c:\\*.*", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
ok(hFile == INVALID_HANDLE_VALUE, "hFile should have been INVALID_HANDLE_VALUE\n");
ok(GetLastError() == ERROR_INVALID_NAME ||
broken(GetLastError() == ERROR_FILE_NOT_FOUND), /* Win98 */
"LastError should have been ERROR_INVALID_NAME or ERROR_FILE_NOT_FOUND but got %u\n", GetLastError());
/* get windows drive letter */
ret = GetWindowsDirectory(windowsdir, sizeof(windowsdir));
ok(ret < sizeof(windowsdir), "windowsdir is abnormally long!\n");