wow64: Add thunks for the section object syscalls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b047b66a2b
commit
9dfebb5250
|
@ -37,6 +37,34 @@ typedef struct
|
||||||
UNICODE_STRING32 ObjectTypeName;
|
UNICODE_STRING32 ObjectTypeName;
|
||||||
} DIRECTORY_BASIC_INFORMATION32;
|
} DIRECTORY_BASIC_INFORMATION32;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ULONG BaseAddress;
|
||||||
|
ULONG Attributes;
|
||||||
|
LARGE_INTEGER Size;
|
||||||
|
} SECTION_BASIC_INFORMATION32;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ULONG TransferAddress;
|
||||||
|
ULONG ZeroBits;
|
||||||
|
ULONG MaximumStackSize;
|
||||||
|
ULONG CommittedStackSize;
|
||||||
|
ULONG SubSystemType;
|
||||||
|
USHORT MinorSubsystemVersion;
|
||||||
|
USHORT MajorSubsystemVersion;
|
||||||
|
USHORT MajorOperatingSystemVersion;
|
||||||
|
USHORT MinorOperatingSystemVersion;
|
||||||
|
USHORT ImageCharacteristics;
|
||||||
|
USHORT DllCharacteristics;
|
||||||
|
USHORT Machine;
|
||||||
|
BOOLEAN ImageContainsCode;
|
||||||
|
UCHAR ImageFlags;
|
||||||
|
ULONG LoaderFlags;
|
||||||
|
ULONG ImageFileSize;
|
||||||
|
ULONG CheckSum;
|
||||||
|
} SECTION_IMAGE_INFORMATION32;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
DBG_STATE NewState;
|
DBG_STATE NewState;
|
||||||
|
|
|
@ -32,6 +32,37 @@
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(wow);
|
WINE_DEFAULT_DEBUG_CHANNEL(wow);
|
||||||
|
|
||||||
|
|
||||||
|
void put_section_image_info( SECTION_IMAGE_INFORMATION32 *info32, const SECTION_IMAGE_INFORMATION *info )
|
||||||
|
{
|
||||||
|
if (info->Machine == IMAGE_FILE_MACHINE_AMD64 || info->Machine == IMAGE_FILE_MACHINE_ARM64)
|
||||||
|
{
|
||||||
|
info32->TransferAddress = 0x81231234; /* sic */
|
||||||
|
info32->MaximumStackSize = 0x100000;
|
||||||
|
info32->CommittedStackSize = 0x10000;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
info32->TransferAddress = PtrToUlong( info->TransferAddress );
|
||||||
|
info32->MaximumStackSize = info->MaximumStackSize;
|
||||||
|
info32->CommittedStackSize = info->CommittedStackSize;
|
||||||
|
}
|
||||||
|
info32->ZeroBits = info->ZeroBits;
|
||||||
|
info32->SubSystemType = info->SubSystemType;
|
||||||
|
info32->MinorSubsystemVersion = info->MinorSubsystemVersion;
|
||||||
|
info32->MajorSubsystemVersion = info->MajorSubsystemVersion;
|
||||||
|
info32->MajorOperatingSystemVersion = info->MajorOperatingSystemVersion;
|
||||||
|
info32->MinorOperatingSystemVersion = info->MinorOperatingSystemVersion;
|
||||||
|
info32->ImageCharacteristics = info->ImageCharacteristics;
|
||||||
|
info32->DllCharacteristics = info->DllCharacteristics;
|
||||||
|
info32->Machine = info->Machine;
|
||||||
|
info32->ImageContainsCode = info->ImageContainsCode;
|
||||||
|
info32->ImageFlags = info->ImageFlags;
|
||||||
|
info32->LoaderFlags = info->LoaderFlags;
|
||||||
|
info32->ImageFileSize = info->ImageFileSize;
|
||||||
|
info32->CheckSum = info->CheckSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* wow64_NtCancelTimer
|
* wow64_NtCancelTimer
|
||||||
*/
|
*/
|
||||||
|
@ -201,6 +232,30 @@ NTSTATUS WINAPI wow64_NtCreateMutant( UINT *args )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* wow64_NtCreateSection
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI wow64_NtCreateSection( UINT *args )
|
||||||
|
{
|
||||||
|
ULONG *handle_ptr = get_ptr( &args );
|
||||||
|
ACCESS_MASK access = get_ulong( &args );
|
||||||
|
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
|
||||||
|
const LARGE_INTEGER *size = get_ptr( &args );
|
||||||
|
ULONG protect = get_ulong( &args );
|
||||||
|
ULONG flags = get_ulong( &args );
|
||||||
|
HANDLE file = get_handle( &args );
|
||||||
|
|
||||||
|
struct object_attr64 attr;
|
||||||
|
HANDLE handle = 0;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
*handle_ptr = 0;
|
||||||
|
status = NtCreateSection( &handle, access, objattr_32to64( &attr, attr32 ), size, protect, flags, file );
|
||||||
|
put_handle( handle_ptr, handle );
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* wow64_NtCreateSemaphore
|
* wow64_NtCreateSemaphore
|
||||||
*/
|
*/
|
||||||
|
@ -414,6 +469,26 @@ NTSTATUS WINAPI wow64_NtOpenMutant( UINT *args )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* wow64_NtOpenSection
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI wow64_NtOpenSection( 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 = NtOpenSection( &handle, access, objattr_32to64( &attr, attr32 ));
|
||||||
|
put_handle( handle_ptr, handle );
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* wow64_NtOpenSemaphore
|
* wow64_NtOpenSemaphore
|
||||||
*/
|
*/
|
||||||
|
@ -580,6 +655,59 @@ NTSTATUS WINAPI wow64_NtQueryPerformanceCounter( UINT *args )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* wow64_NtQuerySection
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI wow64_NtQuerySection( UINT *args )
|
||||||
|
{
|
||||||
|
HANDLE handle = get_handle( &args );
|
||||||
|
SECTION_INFORMATION_CLASS class = get_ulong( &args );
|
||||||
|
void *ptr = get_ptr( &args );
|
||||||
|
SIZE_T size = get_ulong( &args );
|
||||||
|
ULONG *ret_ptr = get_ptr( &args );
|
||||||
|
|
||||||
|
NTSTATUS status;
|
||||||
|
SIZE_T ret_size = 0;
|
||||||
|
|
||||||
|
switch (class)
|
||||||
|
{
|
||||||
|
case SectionBasicInformation:
|
||||||
|
{
|
||||||
|
SECTION_BASIC_INFORMATION info;
|
||||||
|
SECTION_BASIC_INFORMATION32 *info32 = ptr;
|
||||||
|
|
||||||
|
if (size < sizeof(*info32)) return STATUS_INFO_LENGTH_MISMATCH;
|
||||||
|
if (!(status = NtQuerySection( handle, class, &info, sizeof(info), &ret_size )))
|
||||||
|
{
|
||||||
|
info32->BaseAddress = PtrToUlong( info.BaseAddress );
|
||||||
|
info32->Attributes = info.Attributes;
|
||||||
|
info32->Size = info.Size;
|
||||||
|
ret_size = sizeof(*info32);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SectionImageInformation:
|
||||||
|
{
|
||||||
|
SECTION_IMAGE_INFORMATION info;
|
||||||
|
SECTION_IMAGE_INFORMATION32 *info32 = ptr;
|
||||||
|
|
||||||
|
if (size < sizeof(*info32)) return STATUS_INFO_LENGTH_MISMATCH;
|
||||||
|
if (!(status = NtQuerySection( handle, class, &info, sizeof(info), &ret_size )))
|
||||||
|
{
|
||||||
|
put_section_image_info( info32, &info );
|
||||||
|
ret_size = sizeof(*info32);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
FIXME( "class %u not implemented\n", class );
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
put_size( ret_ptr, ret_size );
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* wow64_NtQuerySemaphore
|
* wow64_NtQuerySemaphore
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
SYSCALL_ENTRY( NtCreateJobObject ) \
|
SYSCALL_ENTRY( NtCreateJobObject ) \
|
||||||
SYSCALL_ENTRY( NtCreateKeyedEvent ) \
|
SYSCALL_ENTRY( NtCreateKeyedEvent ) \
|
||||||
SYSCALL_ENTRY( NtCreateMutant ) \
|
SYSCALL_ENTRY( NtCreateMutant ) \
|
||||||
|
SYSCALL_ENTRY( NtCreateSection ) \
|
||||||
SYSCALL_ENTRY( NtCreateSemaphore ) \
|
SYSCALL_ENTRY( NtCreateSemaphore ) \
|
||||||
SYSCALL_ENTRY( NtCreateSymbolicLinkObject ) \
|
SYSCALL_ENTRY( NtCreateSymbolicLinkObject ) \
|
||||||
SYSCALL_ENTRY( NtCreateTimer ) \
|
SYSCALL_ENTRY( NtCreateTimer ) \
|
||||||
|
@ -49,6 +50,7 @@
|
||||||
SYSCALL_ENTRY( NtOpenJobObject ) \
|
SYSCALL_ENTRY( NtOpenJobObject ) \
|
||||||
SYSCALL_ENTRY( NtOpenKeyedEvent ) \
|
SYSCALL_ENTRY( NtOpenKeyedEvent ) \
|
||||||
SYSCALL_ENTRY( NtOpenMutant ) \
|
SYSCALL_ENTRY( NtOpenMutant ) \
|
||||||
|
SYSCALL_ENTRY( NtOpenSection ) \
|
||||||
SYSCALL_ENTRY( NtOpenSemaphore ) \
|
SYSCALL_ENTRY( NtOpenSemaphore ) \
|
||||||
SYSCALL_ENTRY( NtOpenSymbolicLinkObject ) \
|
SYSCALL_ENTRY( NtOpenSymbolicLinkObject ) \
|
||||||
SYSCALL_ENTRY( NtOpenTimer ) \
|
SYSCALL_ENTRY( NtOpenTimer ) \
|
||||||
|
@ -62,6 +64,7 @@
|
||||||
SYSCALL_ENTRY( NtQueryIoCompletion ) \
|
SYSCALL_ENTRY( NtQueryIoCompletion ) \
|
||||||
SYSCALL_ENTRY( NtQueryMutant ) \
|
SYSCALL_ENTRY( NtQueryMutant ) \
|
||||||
SYSCALL_ENTRY( NtQueryPerformanceCounter ) \
|
SYSCALL_ENTRY( NtQueryPerformanceCounter ) \
|
||||||
|
SYSCALL_ENTRY( NtQuerySection ) \
|
||||||
SYSCALL_ENTRY( NtQuerySemaphore ) \
|
SYSCALL_ENTRY( NtQuerySemaphore ) \
|
||||||
SYSCALL_ENTRY( NtQuerySymbolicLinkObject ) \
|
SYSCALL_ENTRY( NtQuerySymbolicLinkObject ) \
|
||||||
SYSCALL_ENTRY( NtQueryTimer ) \
|
SYSCALL_ENTRY( NtQueryTimer ) \
|
||||||
|
|
|
@ -137,4 +137,12 @@ static inline void put_handle( ULONG *handle32, HANDLE handle )
|
||||||
*handle32 = HandleToULong( handle );
|
*handle32 = HandleToULong( handle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void put_size( ULONG *size32, SIZE_T size )
|
||||||
|
{
|
||||||
|
if (size32) *size32 = min( size, MAXDWORD );
|
||||||
|
}
|
||||||
|
|
||||||
|
extern void put_section_image_info( SECTION_IMAGE_INFORMATION32 *info32,
|
||||||
|
const SECTION_IMAGE_INFORMATION *info ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
#endif /* __WOW64_PRIVATE_H */
|
#endif /* __WOW64_PRIVATE_H */
|
||||||
|
|
Loading…
Reference in New Issue