Commit f23bf7a4 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi/tests: Return INVALID_FILE_SIZE from get_pf_file_size if the file can't be opened.

So we can distinguish a zero-sized file from a file that doesn't exist.
parent 1ac16331
......@@ -7207,7 +7207,7 @@ static DWORD get_pf_file_size(LPCSTR file)
hfile = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hfile == INVALID_HANDLE_VALUE)
return 0;
return INVALID_FILE_SIZE;
size = GetFileSize(hfile, NULL);
CloseHandle(hfile);
......
......@@ -213,7 +213,7 @@ static DWORD get_pf_file_size( const char *filename )
file = CreateFileA( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL );
if (file == INVALID_HANDLE_VALUE)
return 0;
return INVALID_FILE_SIZE;
size = GetFileSize( file, NULL );
CloseHandle( file );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment