Commit cdb9be7b authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

Work with the correct subkey with loading keys. Not a true fix to the

LoadKey/SaveKey situation.
parent 2d106a57
...@@ -1452,6 +1452,7 @@ LONG WINAPI RegLoadKeyW( HKEY hkey, LPCWSTR subkey, LPCWSTR filename ) ...@@ -1452,6 +1452,7 @@ LONG WINAPI RegLoadKeyW( HKEY hkey, LPCWSTR subkey, LPCWSTR filename )
{ {
HANDLE file; HANDLE file;
DWORD ret, len, err = GetLastError(); DWORD ret, len, err = GetLastError();
HKEY shkey;
TRACE( "(%p,%s,%s)\n", hkey, debugstr_w(subkey), debugstr_w(filename) ); TRACE( "(%p,%s,%s)\n", hkey, debugstr_w(subkey), debugstr_w(filename) );
...@@ -1469,15 +1470,18 @@ LONG WINAPI RegLoadKeyW( HKEY hkey, LPCWSTR subkey, LPCWSTR filename ) ...@@ -1469,15 +1470,18 @@ LONG WINAPI RegLoadKeyW( HKEY hkey, LPCWSTR subkey, LPCWSTR filename )
goto done; goto done;
} }
RegCreateKeyW(hkey,subkey,&shkey);
SERVER_START_REQ( load_registry ) SERVER_START_REQ( load_registry )
{ {
req->hkey = hkey; req->hkey = shkey;
req->file = file; req->file = file;
wine_server_add_data( req, subkey, len ); wine_server_add_data( req, subkey, len );
ret = RtlNtStatusToDosError( wine_server_call(req) ); ret = RtlNtStatusToDosError( wine_server_call(req) );
} }
SERVER_END_REQ; SERVER_END_REQ;
CloseHandle( file ); CloseHandle( file );
RegCloseKey(shkey);
done: done:
SetLastError( err ); /* restore the last error code */ SetLastError( err ); /* restore the last error code */
...@@ -1493,6 +1497,7 @@ LONG WINAPI RegLoadKeyA( HKEY hkey, LPCSTR subkey, LPCSTR filename ) ...@@ -1493,6 +1497,7 @@ LONG WINAPI RegLoadKeyA( HKEY hkey, LPCSTR subkey, LPCSTR filename )
WCHAR buffer[MAX_PATH]; WCHAR buffer[MAX_PATH];
HANDLE file; HANDLE file;
DWORD ret, len, err = GetLastError(); DWORD ret, len, err = GetLastError();
HKEY shkey;
TRACE( "(%p,%s,%s)\n", hkey, debugstr_a(subkey), debugstr_a(filename) ); TRACE( "(%p,%s,%s)\n", hkey, debugstr_a(subkey), debugstr_a(filename) );
...@@ -1510,15 +1515,18 @@ LONG WINAPI RegLoadKeyA( HKEY hkey, LPCSTR subkey, LPCSTR filename ) ...@@ -1510,15 +1515,18 @@ LONG WINAPI RegLoadKeyA( HKEY hkey, LPCSTR subkey, LPCSTR filename )
goto done; goto done;
} }
RegCreateKeyA(hkey,subkey,&shkey);
SERVER_START_REQ( load_registry ) SERVER_START_REQ( load_registry )
{ {
req->hkey = hkey; req->hkey = shkey;
req->file = file; req->file = file;
wine_server_add_data( req, buffer, len * sizeof(WCHAR) ); wine_server_add_data( req, buffer, len * sizeof(WCHAR) );
ret = RtlNtStatusToDosError( wine_server_call(req) ); ret = RtlNtStatusToDosError( wine_server_call(req) );
} }
SERVER_END_REQ; SERVER_END_REQ;
CloseHandle( file ); CloseHandle( file );
RegCloseKey(shkey);
done: done:
SetLastError( err ); /* restore the last error code */ SetLastError( err ); /* restore the last error code */
......
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