wow64: Add thunks for the registry key syscalls.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-07-26 13:37:53 +02:00
parent 7d418c170a
commit 4307429b4a
3 changed files with 264 additions and 0 deletions

View File

@ -5,5 +5,6 @@ IMPORTS = ntdll winecrt0
EXTRADLLFLAGS = -nodefaultlibs -mno-cygwin -Wl,--image-base,0x6f000000 EXTRADLLFLAGS = -nodefaultlibs -mno-cygwin -Wl,--image-base,0x6f000000
C_SRCS = \ C_SRCS = \
registry.c \
sync.c \ sync.c \
syscall.c syscall.c

251
dlls/wow64/registry.c Normal file
View File

@ -0,0 +1,251 @@
/*
* WoW64 registry functions
*
* Copyright 2021 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "winternl.h"
#include "wow64_private.h"
/**********************************************************************
* wow64_NtCreateKey
*/
NTSTATUS WINAPI wow64_NtCreateKey( UINT *args )
{
ULONG *handle_ptr = get_ptr( &args );
ACCESS_MASK access = get_ulong( &args );
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
ULONG index = get_ulong( &args );
UNICODE_STRING32 *class32 = get_ptr( &args );
ULONG options = get_ulong( &args );
ULONG *dispos = get_ptr( &args );
struct object_attr64 attr;
UNICODE_STRING class;
HANDLE handle = 0;
NTSTATUS status;
*handle_ptr = 0;
status = NtCreateKey( &handle, access, objattr_32to64( &attr, attr32 ), index,
unicode_str_32to64( &class, class32 ), options, dispos );
put_handle( handle_ptr, handle );
return status;
}
/**********************************************************************
* wow64_NtCreateKeyTransacted
*/
NTSTATUS WINAPI wow64_NtCreateKeyTransacted( UINT *args )
{
ULONG *handle_ptr = get_ptr( &args );
ACCESS_MASK access = get_ulong( &args );
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
ULONG index = get_ulong( &args );
UNICODE_STRING32 *class32 = get_ptr( &args );
ULONG options = get_ulong( &args );
HANDLE transacted = get_handle( &args );
ULONG *dispos = get_ptr( &args );
struct object_attr64 attr;
UNICODE_STRING class;
HANDLE handle = 0;
NTSTATUS status;
*handle_ptr = 0;
status = NtCreateKeyTransacted( &handle, access, objattr_32to64( &attr, attr32 ), index,
unicode_str_32to64( &class, class32 ), options, transacted, dispos );
put_handle( handle_ptr, handle );
return status;
}
/**********************************************************************
* wow64_NtDeleteKey
*/
NTSTATUS WINAPI wow64_NtDeleteKey( UINT *args )
{
HANDLE handle = get_handle( &args );
return NtDeleteKey( handle );
}
/**********************************************************************
* wow64_NtEnumerateKey
*/
NTSTATUS WINAPI wow64_NtEnumerateKey( UINT *args )
{
HANDLE handle = get_handle( &args );
ULONG index = get_ulong( &args );
KEY_INFORMATION_CLASS class = get_ulong( &args );
void *ptr = get_ptr( &args );
ULONG len = get_ulong( &args );
ULONG *retlen = get_ptr( &args );
return NtEnumerateKey( handle, index, class, ptr, len, retlen );
}
/**********************************************************************
* wow64_NtOpenKey
*/
NTSTATUS WINAPI wow64_NtOpenKey( UINT *args )
{
ULONG *handle_ptr = get_ptr( &args );
ACCESS_MASK access = get_ulong( &args );
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
struct object_attr64 attr;
HANDLE handle = 0;
NTSTATUS status;
*handle_ptr = 0;
status = NtOpenKey( &handle, access, objattr_32to64( &attr, attr32 ));
put_handle( handle_ptr, handle );
return status;
}
/**********************************************************************
* wow64_NtOpenKeyEx
*/
NTSTATUS WINAPI wow64_NtOpenKeyEx( UINT *args )
{
ULONG *handle_ptr = get_ptr( &args );
ACCESS_MASK access = get_ulong( &args );
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
ULONG options = get_ulong( &args );
struct object_attr64 attr;
HANDLE handle = 0;
NTSTATUS status;
*handle_ptr = 0;
status = NtOpenKeyEx( &handle, access, objattr_32to64( &attr, attr32 ), options );
put_handle( handle_ptr, handle );
return status;
}
/**********************************************************************
* wow64_NtOpenKeyTransacted
*/
NTSTATUS WINAPI wow64_NtOpenKeyTransacted( UINT *args )
{
ULONG *handle_ptr = get_ptr( &args );
ACCESS_MASK access = get_ulong( &args );
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
HANDLE transaction = get_handle( &args );
struct object_attr64 attr;
HANDLE handle = 0;
NTSTATUS status;
*handle_ptr = 0;
status = NtOpenKeyTransacted( &handle, access, objattr_32to64( &attr, attr32 ), transaction );
put_handle( handle_ptr, handle );
return status;
}
/**********************************************************************
* wow64_NtOpenKeyTransactedEx
*/
NTSTATUS WINAPI wow64_NtOpenKeyTransactedEx( UINT *args )
{
ULONG *handle_ptr = get_ptr( &args );
ACCESS_MASK access = get_ulong( &args );
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
ULONG options = get_ulong( &args );
HANDLE transaction = get_handle( &args );
struct object_attr64 attr;
HANDLE handle = 0;
NTSTATUS status;
*handle_ptr = 0;
status = NtOpenKeyTransactedEx( &handle, access, objattr_32to64( &attr, attr32 ), options, transaction );
put_handle( handle_ptr, handle );
return status;
}
/**********************************************************************
* wow64_NtQueryKey
*/
NTSTATUS WINAPI wow64_NtQueryKey( UINT *args )
{
HANDLE handle = get_handle( &args );
KEY_INFORMATION_CLASS class = get_ulong( &args );
void *info = get_ptr( &args );
ULONG len = get_ulong( &args );
ULONG *retlen = get_ptr( &args );
return NtQueryKey( handle, class, info, len, retlen );
}
/**********************************************************************
* wow64_NtRenameKey
*/
NTSTATUS WINAPI wow64_NtRenameKey( UINT *args )
{
HANDLE handle = get_handle( &args );
UNICODE_STRING32 *str32 = get_ptr( &args );
UNICODE_STRING str;
return NtRenameKey( handle, unicode_str_32to64( &str, str32 ));
}
/**********************************************************************
* wow64_NtReplaceKey
*/
NTSTATUS WINAPI wow64_NtReplaceKey( UINT *args )
{
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
HANDLE handle = get_handle( &args );
OBJECT_ATTRIBUTES32 *replace32 = get_ptr( &args );
struct object_attr64 attr, replace;
return NtReplaceKey( objattr_32to64( &attr, attr32 ), handle, objattr_32to64( &replace, replace32 ));
}
/**********************************************************************
* wow64_NtSetInformationKey
*/
NTSTATUS WINAPI wow64_NtSetInformationKey( UINT *args )
{
HANDLE handle = get_handle( &args );
int class = get_ulong( &args );
void *info = get_ptr( &args );
ULONG len = get_ulong( &args );
return NtSetInformationKey( handle, class, info, len );
}

View File

@ -37,6 +37,8 @@
SYSCALL_ENTRY( NtCreateEvent ) \ SYSCALL_ENTRY( NtCreateEvent ) \
SYSCALL_ENTRY( NtCreateIoCompletion ) \ SYSCALL_ENTRY( NtCreateIoCompletion ) \
SYSCALL_ENTRY( NtCreateJobObject ) \ SYSCALL_ENTRY( NtCreateJobObject ) \
SYSCALL_ENTRY( NtCreateKey ) \
SYSCALL_ENTRY( NtCreateKeyTransacted ) \
SYSCALL_ENTRY( NtCreateKeyedEvent ) \ SYSCALL_ENTRY( NtCreateKeyedEvent ) \
SYSCALL_ENTRY( NtCreateMutant ) \ SYSCALL_ENTRY( NtCreateMutant ) \
SYSCALL_ENTRY( NtCreatePort ) \ SYSCALL_ENTRY( NtCreatePort ) \
@ -48,7 +50,9 @@
SYSCALL_ENTRY( NtDebugContinue ) \ SYSCALL_ENTRY( NtDebugContinue ) \
SYSCALL_ENTRY( NtDelayExecution ) \ SYSCALL_ENTRY( NtDelayExecution ) \
SYSCALL_ENTRY( NtDeleteAtom ) \ SYSCALL_ENTRY( NtDeleteAtom ) \
SYSCALL_ENTRY( NtDeleteKey ) \
SYSCALL_ENTRY( NtDuplicateObject ) \ SYSCALL_ENTRY( NtDuplicateObject ) \
SYSCALL_ENTRY( NtEnumerateKey ) \
SYSCALL_ENTRY( NtFindAtom ) \ SYSCALL_ENTRY( NtFindAtom ) \
SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \ SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \
SYSCALL_ENTRY( NtListenPort ) \ SYSCALL_ENTRY( NtListenPort ) \
@ -57,6 +61,10 @@
SYSCALL_ENTRY( NtOpenEvent ) \ SYSCALL_ENTRY( NtOpenEvent ) \
SYSCALL_ENTRY( NtOpenIoCompletion ) \ SYSCALL_ENTRY( NtOpenIoCompletion ) \
SYSCALL_ENTRY( NtOpenJobObject ) \ SYSCALL_ENTRY( NtOpenJobObject ) \
SYSCALL_ENTRY( NtOpenKey ) \
SYSCALL_ENTRY( NtOpenKeyEx ) \
SYSCALL_ENTRY( NtOpenKeyTransacted ) \
SYSCALL_ENTRY( NtOpenKeyTransactedEx ) \
SYSCALL_ENTRY( NtOpenKeyedEvent ) \ SYSCALL_ENTRY( NtOpenKeyedEvent ) \
SYSCALL_ENTRY( NtOpenMutant ) \ SYSCALL_ENTRY( NtOpenMutant ) \
SYSCALL_ENTRY( NtOpenSection ) \ SYSCALL_ENTRY( NtOpenSection ) \
@ -71,6 +79,7 @@
SYSCALL_ENTRY( NtQueryInformationAtom ) \ SYSCALL_ENTRY( NtQueryInformationAtom ) \
SYSCALL_ENTRY( NtQueryInstallUILanguage ) \ SYSCALL_ENTRY( NtQueryInstallUILanguage ) \
SYSCALL_ENTRY( NtQueryIoCompletion ) \ SYSCALL_ENTRY( NtQueryIoCompletion ) \
SYSCALL_ENTRY( NtQueryKey ) \
SYSCALL_ENTRY( NtQueryMutant ) \ SYSCALL_ENTRY( NtQueryMutant ) \
SYSCALL_ENTRY( NtQueryObject ) \ SYSCALL_ENTRY( NtQueryObject ) \
SYSCALL_ENTRY( NtQueryPerformanceCounter ) \ SYSCALL_ENTRY( NtQueryPerformanceCounter ) \
@ -82,6 +91,8 @@
SYSCALL_ENTRY( NtReleaseKeyedEvent ) \ SYSCALL_ENTRY( NtReleaseKeyedEvent ) \
SYSCALL_ENTRY( NtReleaseMutant ) \ SYSCALL_ENTRY( NtReleaseMutant ) \
SYSCALL_ENTRY( NtReleaseSemaphore ) \ SYSCALL_ENTRY( NtReleaseSemaphore ) \
SYSCALL_ENTRY( NtRenameKey ) \
SYSCALL_ENTRY( NtReplaceKey ) \
SYSCALL_ENTRY( NtReplyWaitReceivePort ) \ SYSCALL_ENTRY( NtReplyWaitReceivePort ) \
SYSCALL_ENTRY( NtRequestWaitReplyPort ) \ SYSCALL_ENTRY( NtRequestWaitReplyPort ) \
SYSCALL_ENTRY( NtResetEvent ) \ SYSCALL_ENTRY( NtResetEvent ) \
@ -90,6 +101,7 @@
SYSCALL_ENTRY( NtSetDefaultUILanguage ) \ SYSCALL_ENTRY( NtSetDefaultUILanguage ) \
SYSCALL_ENTRY( NtSetEvent ) \ SYSCALL_ENTRY( NtSetEvent ) \
SYSCALL_ENTRY( NtSetInformationDebugObject ) \ SYSCALL_ENTRY( NtSetInformationDebugObject ) \
SYSCALL_ENTRY( NtSetInformationKey ) \
SYSCALL_ENTRY( NtSetInformationObject ) \ SYSCALL_ENTRY( NtSetInformationObject ) \
SYSCALL_ENTRY( NtSetIoCompletion ) \ SYSCALL_ENTRY( NtSetIoCompletion ) \
SYSCALL_ENTRY( NtSetPowerRequest ) \ SYSCALL_ENTRY( NtSetPowerRequest ) \