Commit f53aba8a authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed error checking in registry saving.

parent 4ff3b205
...@@ -195,7 +195,7 @@ static void save_key( HKEY hkey, const char *filename ) ...@@ -195,7 +195,7 @@ static void save_key( HKEY hkey, const char *filename )
handle = FILE_CreateFile( name, GENERIC_WRITE, 0, NULL, handle = FILE_CreateFile( name, GENERIC_WRITE, 0, NULL,
CREATE_NEW, FILE_ATTRIBUTE_NORMAL, -1 ); CREATE_NEW, FILE_ATTRIBUTE_NORMAL, -1 );
if (handle != INVALID_HANDLE_VALUE) break; if (handle != INVALID_HANDLE_VALUE) break;
if ((ret = GetLastError()) != ERROR_FILE_EXISTS) break; if ((ret = GetLastError()) != ERROR_ALREADY_EXISTS) break;
} }
if (handle != INVALID_HANDLE_VALUE) if (handle != INVALID_HANDLE_VALUE)
...@@ -212,6 +212,8 @@ static void save_key( HKEY hkey, const char *filename ) ...@@ -212,6 +212,8 @@ static void save_key( HKEY hkey, const char *filename )
unlink( name ); unlink( name );
} }
} }
else ERR( "Failed to save registry to %s, err %ld\n", name, GetLastError() );
HeapFree( GetProcessHeap(), 0, name ); HeapFree( GetProcessHeap(), 0, name );
} }
......
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