Commit 668b1829 authored by Alexandre Julliard's avatar Alexandre Julliard

wow64: Add thunks for the file I/O syscalls.

parent 01ad0993
......@@ -75,6 +75,49 @@ NTSTATUS WINAPI wow64_NtDeleteFile( UINT *args )
/**********************************************************************
* wow64_NtFlushBuffersFile
*/
NTSTATUS WINAPI wow64_NtFlushBuffersFile( UINT *args )
{
HANDLE handle = get_handle( &args );
IO_STATUS_BLOCK32 *io32 = get_ptr( &args );
IO_STATUS_BLOCK io;
NTSTATUS status;
status = NtFlushBuffersFile( handle, iosb_32to64( &io, io32 ));
put_iosb( io32, &io );
return status;
}
/**********************************************************************
* wow64_NtLockFile
*/
NTSTATUS WINAPI wow64_NtLockFile( UINT *args )
{
HANDLE handle = get_handle( &args );
HANDLE event = get_handle( &args );
ULONG apc = get_ulong( &args );
ULONG apc_param = get_ulong( &args );
IO_STATUS_BLOCK32 *io32 = get_ptr( &args );
LARGE_INTEGER *offset = get_ptr( &args );
LARGE_INTEGER *count = get_ptr( &args );
ULONG *key = get_ptr( &args );
BOOLEAN dont_wait = get_ulong( &args );
BOOLEAN exclusive = get_ulong( &args );
IO_STATUS_BLOCK io;
NTSTATUS status;
status = NtLockFile( handle, event, apc_32to64( apc ), apc_param_32to64( apc, apc_param ),
iosb_32to64( &io, io32 ), offset, count, key, dont_wait, exclusive );
put_iosb( io32, &io );
return status;
}
/**********************************************************************
* wow64_NtOpenFile
*/
NTSTATUS WINAPI wow64_NtOpenFile( UINT *args )
......@@ -98,3 +141,123 @@ NTSTATUS WINAPI wow64_NtOpenFile( UINT *args )
put_iosb( io32, &io );
return status;
}
/**********************************************************************
* wow64_NtReadFile
*/
NTSTATUS WINAPI wow64_NtReadFile( UINT *args )
{
HANDLE handle = get_handle( &args );
HANDLE event = get_handle( &args );
ULONG apc = get_ulong( &args );
ULONG apc_param = get_ulong( &args );
IO_STATUS_BLOCK32 *io32 = get_ptr( &args );
void *buffer = get_ptr( &args );
ULONG len = get_ulong( &args );
LARGE_INTEGER *offset = get_ptr( &args );
ULONG *key = get_ptr( &args );
IO_STATUS_BLOCK io;
NTSTATUS status;
status = NtReadFile( handle, event, apc_32to64( apc ), apc_param_32to64( apc, apc_param ),
iosb_32to64( &io, io32 ), buffer, len, offset, key );
put_iosb( io32, &io );
return status;
}
/**********************************************************************
* wow64_NtReadFileScatter
*/
NTSTATUS WINAPI wow64_NtReadFileScatter( UINT *args )
{
HANDLE handle = get_handle( &args );
HANDLE event = get_handle( &args );
ULONG apc = get_ulong( &args );
ULONG apc_param = get_ulong( &args );
IO_STATUS_BLOCK32 *io32 = get_ptr( &args );
FILE_SEGMENT_ELEMENT *segments = get_ptr( &args );
ULONG len = get_ulong( &args );
LARGE_INTEGER *offset = get_ptr( &args );
ULONG *key = get_ptr( &args );
IO_STATUS_BLOCK io;
NTSTATUS status;
status = NtReadFileScatter( handle, event, apc_32to64( apc ), apc_param_32to64( apc, apc_param ),
iosb_32to64( &io, io32 ), segments, len, offset, key );
put_iosb( io32, &io );
return status;
}
/**********************************************************************
* wow64_NtUnlockFile
*/
NTSTATUS WINAPI wow64_NtUnlockFile( UINT *args )
{
HANDLE handle = get_handle( &args );
IO_STATUS_BLOCK32 *io32 = get_ptr( &args );
LARGE_INTEGER *offset = get_ptr( &args );
LARGE_INTEGER *count = get_ptr( &args );
ULONG *key = get_ptr( &args );
IO_STATUS_BLOCK io;
NTSTATUS status;
status = NtUnlockFile( handle, iosb_32to64( &io, io32 ), offset, count, key );
put_iosb( io32, &io );
return status;
}
/**********************************************************************
* wow64_NtWriteFile
*/
NTSTATUS WINAPI wow64_NtWriteFile( UINT *args )
{
HANDLE handle = get_handle( &args );
HANDLE event = get_handle( &args );
ULONG apc = get_ulong( &args );
ULONG apc_param = get_ulong( &args );
IO_STATUS_BLOCK32 *io32 = get_ptr( &args );
void *buffer = get_ptr( &args );
ULONG len = get_ulong( &args );
LARGE_INTEGER *offset = get_ptr( &args );
ULONG *key = get_ptr( &args );
IO_STATUS_BLOCK io;
NTSTATUS status;
status = NtWriteFile( handle, event, apc_32to64( apc ), apc_param_32to64( apc, apc_param ),
iosb_32to64( &io, io32 ), buffer, len, offset, key );
put_iosb( io32, &io );
return status;
}
/**********************************************************************
* wow64_NtWriteFileGather
*/
NTSTATUS WINAPI wow64_NtWriteFileGather( UINT *args )
{
HANDLE handle = get_handle( &args );
HANDLE event = get_handle( &args );
ULONG apc = get_ulong( &args );
ULONG apc_param = get_ulong( &args );
IO_STATUS_BLOCK32 *io32 = get_ptr( &args );
FILE_SEGMENT_ELEMENT *segments = get_ptr( &args );
ULONG len = get_ulong( &args );
LARGE_INTEGER *offset = get_ptr( &args );
ULONG *key = get_ptr( &args );
IO_STATUS_BLOCK io;
NTSTATUS status;
status = NtWriteFileGather( handle, event, apc_32to64( apc ), apc_param_32to64( apc, apc_param ),
iosb_32to64( &io, io32 ), segments, len, offset, key );
put_iosb( io32, &io );
return status;
}
......@@ -61,6 +61,7 @@
SYSCALL_ENTRY( NtEnumerateKey ) \
SYSCALL_ENTRY( NtEnumerateValueKey ) \
SYSCALL_ENTRY( NtFindAtom ) \
SYSCALL_ENTRY( NtFlushBuffersFile ) \
SYSCALL_ENTRY( NtFlushKey ) \
SYSCALL_ENTRY( NtFlushVirtualMemory ) \
SYSCALL_ENTRY( NtFreeVirtualMemory ) \
......@@ -70,6 +71,7 @@
SYSCALL_ENTRY( NtListenPort ) \
SYSCALL_ENTRY( NtLoadKey ) \
SYSCALL_ENTRY( NtLoadKey2 ) \
SYSCALL_ENTRY( NtLockFile ) \
SYSCALL_ENTRY( NtLockVirtualMemory ) \
SYSCALL_ENTRY( NtMakeTemporaryObject ) \
SYSCALL_ENTRY( NtMapViewOfSection ) \
......@@ -109,6 +111,8 @@
SYSCALL_ENTRY( NtQueryTimerResolution ) \
SYSCALL_ENTRY( NtQueryValueKey ) \
SYSCALL_ENTRY( NtQueryVirtualMemory ) \
SYSCALL_ENTRY( NtReadFile ) \
SYSCALL_ENTRY( NtReadFileScatter ) \
SYSCALL_ENTRY( NtReadVirtualMemory ) \
SYSCALL_ENTRY( NtReleaseKeyedEvent ) \
SYSCALL_ENTRY( NtReleaseMutant ) \
......@@ -136,6 +140,7 @@
SYSCALL_ENTRY( NtSignalAndWaitForSingleObject ) \
SYSCALL_ENTRY( NtTerminateJobObject ) \
SYSCALL_ENTRY( NtUnloadKey ) \
SYSCALL_ENTRY( NtUnlockFile ) \
SYSCALL_ENTRY( NtUnlockVirtualMemory ) \
SYSCALL_ENTRY( NtUnmapViewOfSection ) \
SYSCALL_ENTRY( NtWaitForDebugEvent ) \
......@@ -145,6 +150,8 @@
SYSCALL_ENTRY( NtWow64AllocateVirtualMemory64 ) \
SYSCALL_ENTRY( NtWow64ReadVirtualMemory64 ) \
SYSCALL_ENTRY( NtWow64WriteVirtualMemory64 ) \
SYSCALL_ENTRY( NtWriteFile ) \
SYSCALL_ENTRY( NtWriteFileGather ) \
SYSCALL_ENTRY( NtWriteVirtualMemory ) \
SYSCALL_ENTRY( NtYieldExecution )
......
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