Austin English austinenglish@gmail.com wrote:
- SetLastError(0xdeadbeef);
- hFile = CreateFileA("c:\*.*", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- 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());
- if(hFile != INVALID_HANDLE_VALUE)
CloseHandle(hFile);
You need to add an ok() call for hFile right after the CreateFile call. If it's supposed to be INVALID_HANDLE_VALUE then CloseHandle() is redundant.