winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
728 discussions
Start a n
N
ew thread
Paul Gofman : ntdll: Decrement IO pending count in ioqueue_thread_proc().
by Alexandre Julliard
28 Jul '21
28 Jul '21
Module: wine Branch: master Commit: 217ae19d03f67836cfc0add2f9aeeeaeb34cdb77 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=217ae19d03f67836cfc0add2…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Jul 28 01:06:59 2021 +0300 ntdll: Decrement IO pending count in ioqueue_thread_proc(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/threadpool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index 9e99398bdee..b82d06e5e42 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -1536,6 +1536,8 @@ static void CALLBACK ioqueue_thread_proc( void *param ) { RtlEnterCriticalSection( &io->pool->cs ); + --io->u.io.pending_count; + if (!array_reserve((void **)&io->u.io.completions, &io->u.io.completion_max, io->u.io.completion_count + 1, sizeof(*io->u.io.completions))) { @@ -2138,7 +2140,6 @@ static void tp_object_execute( struct threadpool_object *object, BOOL wait_threa { assert( object->u.io.completion_count ); completion = object->u.io.completions[--object->u.io.completion_count]; - object->u.io.pending_count--; } /* Leave critical section and do the actual callback. */
1
0
0
0
Alexandre Julliard : wow64: Add support for file system redirection.
by Alexandre Julliard
28 Jul '21
28 Jul '21
Module: wine Branch: master Commit: 90e1907ded822bbb4a1ad39b3e7dd62e66492118 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=90e1907ded822bbb4a1ad39b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 28 18:28:16 2021 +0200 wow64: Add support for file system redirection. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/file.c | 184 ++++++++++++++++++++++++++++++++++++++++++--- dlls/wow64/syscall.c | 2 + dlls/wow64/wow64_private.h | 12 +++ 3 files changed, 189 insertions(+), 9 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=90e1907ded822bbb4a1a…
1
0
0
0
Alexandre Julliard : wow64: Add thunks for some misc file creation syscalls.
by Alexandre Julliard
28 Jul '21
28 Jul '21
Module: wine Branch: master Commit: fdd459455475c0cada9ebe90e944f6e953937653 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fdd459455475c0cada9ebe90…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 28 18:14:35 2021 +0200 wow64: Add thunks for some misc file creation syscalls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/file.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/syscall.h | 3 ++ 2 files changed, 83 insertions(+) diff --git a/dlls/wow64/file.c b/dlls/wow64/file.c index 5fb0fe97699..ca87fabe868 100644 --- a/dlls/wow64/file.c +++ b/dlls/wow64/file.c @@ -99,6 +99,86 @@ NTSTATUS WINAPI wow64_NtCreateFile( UINT *args ) } +/********************************************************************** + * wow64_NtCreateMailslotFile + */ +NTSTATUS WINAPI wow64_NtCreateMailslotFile( UINT *args ) +{ + ULONG *handle_ptr = get_ptr( &args ); + ACCESS_MASK access = get_ulong( &args ); + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + ULONG options = get_ulong( &args ); + ULONG quota = get_ulong( &args ); + ULONG msg_size = get_ulong( &args ); + LARGE_INTEGER *timeout = get_ptr( &args ); + + struct object_attr64 attr; + IO_STATUS_BLOCK io; + HANDLE handle = 0; + NTSTATUS status; + + *handle_ptr = 0; + status = NtCreateMailslotFile( &handle, access, objattr_32to64( &attr, attr32 ), + iosb_32to64( &io, io32 ), options, quota, msg_size, timeout ); + put_handle( handle_ptr, handle ); + put_iosb( io32, &io ); + return status; +} + + +/********************************************************************** + * wow64_NtCreateNamedPipeFile + */ +NTSTATUS WINAPI wow64_NtCreateNamedPipeFile( UINT *args ) +{ + ULONG *handle_ptr = get_ptr( &args ); + ACCESS_MASK access = get_ulong( &args ); + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + ULONG sharing = get_ulong( &args ); + ULONG dispo = get_ulong( &args ); + ULONG options = get_ulong( &args ); + ULONG pipe_type = get_ulong( &args ); + ULONG read_mode = get_ulong( &args ); + ULONG completion_mode = get_ulong( &args ); + ULONG max_inst = get_ulong( &args ); + ULONG inbound_quota = get_ulong( &args ); + ULONG outbound_quota = get_ulong( &args ); + LARGE_INTEGER *timeout = get_ptr( &args ); + + struct object_attr64 attr; + IO_STATUS_BLOCK io; + HANDLE handle = 0; + NTSTATUS status; + + *handle_ptr = 0; + status = NtCreateNamedPipeFile( &handle, access, objattr_32to64( &attr, attr32 ), + iosb_32to64( &io, io32 ), sharing, dispo, options, + pipe_type, read_mode, completion_mode, max_inst, + inbound_quota, outbound_quota, timeout ); + put_handle( handle_ptr, handle ); + put_iosb( io32, &io ); + return status; +} + + +/********************************************************************** + * wow64_NtCreatePagingFile + */ +NTSTATUS WINAPI wow64_NtCreatePagingFile( UINT *args ) +{ + UNICODE_STRING32 *str32 = get_ptr( &args ); + LARGE_INTEGER *min_size = get_ptr( &args ); + LARGE_INTEGER *max_size = get_ptr( &args ); + LARGE_INTEGER *actual_size = get_ptr( &args ); + + UNICODE_STRING str; + + return NtCreatePagingFile( unicode_str_32to64( &str, str32 ), min_size, max_size, actual_size ); +} + + /********************************************************************** * wow64_NtDeleteFile */ diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index 1990dc335f3..93896ae4ca3 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -46,7 +46,10 @@ SYSCALL_ENTRY( NtCreateKey ) \ SYSCALL_ENTRY( NtCreateKeyTransacted ) \ SYSCALL_ENTRY( NtCreateKeyedEvent ) \ + SYSCALL_ENTRY( NtCreateMailslotFile ) \ SYSCALL_ENTRY( NtCreateMutant ) \ + SYSCALL_ENTRY( NtCreateNamedPipeFile ) \ + SYSCALL_ENTRY( NtCreatePagingFile ) \ SYSCALL_ENTRY( NtCreatePort ) \ SYSCALL_ENTRY( NtCreatePowerRequest ) \ SYSCALL_ENTRY( NtCreateSection ) \
1
0
0
0
Alexandre Julliard : wow64: Add thunks for the file async I/O syscalls.
by Alexandre Julliard
28 Jul '21
28 Jul '21
Module: wine Branch: master Commit: 011ce0b2ada2cededa1cab410347836ae3b7cab3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=011ce0b2ada2cededa1cab41…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 28 18:09:20 2021 +0200 wow64: Add thunks for the file async I/O syscalls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/file.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/struct32.h | 7 +++ dlls/wow64/syscall.h | 5 +++ 3 files changed, 127 insertions(+) diff --git a/dlls/wow64/file.c b/dlls/wow64/file.c index bf11ee4b2e2..5fb0fe97699 100644 --- a/dlls/wow64/file.c +++ b/dlls/wow64/file.c @@ -32,6 +32,41 @@ WINE_DEFAULT_DEBUG_CHANNEL(wow); +/********************************************************************** + * wow64_NtCancelIoFile + */ +NTSTATUS WINAPI wow64_NtCancelIoFile( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + + IO_STATUS_BLOCK io; + NTSTATUS status; + + status = NtCancelIoFile( handle, iosb_32to64( &io, io32 )); + put_iosb( io32, &io ); + return status; +} + + +/********************************************************************** + * wow64_NtCancelIoFileEx + */ +NTSTATUS WINAPI wow64_NtCancelIoFileEx( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + IO_STATUS_BLOCK32 *io_ptr = get_ptr( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + + IO_STATUS_BLOCK io; + NTSTATUS status; + + status = NtCancelIoFileEx( handle, (IO_STATUS_BLOCK *)io_ptr, iosb_32to64( &io, io32 )); + put_iosb( io32, &io ); + return status; +} + + /********************************************************************** * wow64_NtCreateFile */ @@ -120,6 +155,32 @@ NTSTATUS WINAPI wow64_NtLockFile( UINT *args ) } +/********************************************************************** + * wow64_NtNotifyChangeDirectoryFile + */ +NTSTATUS WINAPI wow64_NtNotifyChangeDirectoryFile( 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 ); + ULONG filter = get_ulong( &args ); + BOOLEAN subtree = get_ulong( &args ); + + IO_STATUS_BLOCK io; + NTSTATUS status; + + status = NtNotifyChangeDirectoryFile( handle, event, apc_32to64( apc ), + apc_param_32to64( apc, apc_param ), iosb_32to64( &io, io32 ), + buffer, len, filter, subtree ); + put_iosb( io32, &io ); + return status; +} + + /********************************************************************** * wow64_NtOpenFile */ @@ -318,6 +379,60 @@ NTSTATUS WINAPI wow64_NtReadFileScatter( UINT *args ) } +/********************************************************************** + * wow64_NtRemoveIoCompletion + */ +NTSTATUS WINAPI wow64_NtRemoveIoCompletion( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + ULONG *key_ptr = get_ptr( &args ); + ULONG *value_ptr = get_ptr( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + LARGE_INTEGER *timeout = get_ptr( &args ); + + IO_STATUS_BLOCK io; + ULONG_PTR key, value; + NTSTATUS status; + + status = NtRemoveIoCompletion( handle, &key, &value, iosb_32to64( &io, io32 ), timeout ); + if (!status) + { + *key_ptr = key; + *value_ptr = value; + } + put_iosb( io32, &io ); + return status; +} + + +/********************************************************************** + * wow64_NtRemoveIoCompletionEx + */ +NTSTATUS WINAPI wow64_NtRemoveIoCompletionEx( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + FILE_IO_COMPLETION_INFORMATION32 *info32 = get_ptr( &args ); + ULONG count = get_ulong( &args ); + ULONG *written = get_ptr( &args ); + LARGE_INTEGER *timeout = get_ptr( &args ); + BOOLEAN alertable = get_ulong( &args ); + + NTSTATUS status; + ULONG i; + FILE_IO_COMPLETION_INFORMATION *info = Wow64AllocateTemp( count * sizeof(*info) ); + + status = NtRemoveIoCompletionEx( handle, info, count, written, timeout, alertable ); + for (i = 0; i < *written; i++) + { + info32[i].CompletionKey = info[i].CompletionKey; + info32[i].CompletionValue = info[i].CompletionValue; + info32[i].IoStatusBlock.Status = info[i].IoStatusBlock.Status; + info32[i].IoStatusBlock.Information = info[i].IoStatusBlock.Information; + } + return status; +} + + /********************************************************************** * wow64_NtSetEaFile */ diff --git a/dlls/wow64/struct32.h b/dlls/wow64/struct32.h index 168519b18da..258fa9f74c1 100644 --- a/dlls/wow64/struct32.h +++ b/dlls/wow64/struct32.h @@ -85,6 +85,13 @@ typedef struct ULONG CompletionKey; } FILE_COMPLETION_INFORMATION32; +typedef struct +{ + ULONG CompletionKey; + ULONG CompletionValue; + IO_STATUS_BLOCK32 IoStatusBlock; +} FILE_IO_COMPLETION_INFORMATION32; + typedef struct { BOOLEAN ReplaceIfExists; diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index 38eca6b744e..1990dc335f3 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -29,6 +29,8 @@ SYSCALL_ENTRY( NtAllocateVirtualMemory ) \ SYSCALL_ENTRY( NtAllocateVirtualMemoryEx ) \ SYSCALL_ENTRY( NtAreMappedFilesTheSame ) \ + SYSCALL_ENTRY( NtCancelIoFile ) \ + SYSCALL_ENTRY( NtCancelIoFileEx ) \ SYSCALL_ENTRY( NtCancelTimer ) \ SYSCALL_ENTRY( NtClearEvent ) \ SYSCALL_ENTRY( NtClearPowerRequest ) \ @@ -75,6 +77,7 @@ SYSCALL_ENTRY( NtLockVirtualMemory ) \ SYSCALL_ENTRY( NtMakeTemporaryObject ) \ SYSCALL_ENTRY( NtMapViewOfSection ) \ + SYSCALL_ENTRY( NtNotifyChangeDirectoryFile ) \ SYSCALL_ENTRY( NtOpenDirectoryObject ) \ SYSCALL_ENTRY( NtOpenEvent ) \ SYSCALL_ENTRY( NtOpenFile ) \ @@ -123,6 +126,8 @@ SYSCALL_ENTRY( NtReleaseKeyedEvent ) \ SYSCALL_ENTRY( NtReleaseMutant ) \ SYSCALL_ENTRY( NtReleaseSemaphore ) \ + SYSCALL_ENTRY( NtRemoveIoCompletion ) \ + SYSCALL_ENTRY( NtRemoveIoCompletionEx ) \ SYSCALL_ENTRY( NtRenameKey ) \ SYSCALL_ENTRY( NtReplaceKey ) \ SYSCALL_ENTRY( NtReplyWaitReceivePort ) \
1
0
0
0
Alexandre Julliard : wow64: Add thunks for the file set information syscalls.
by Alexandre Julliard
28 Jul '21
28 Jul '21
Module: wine Branch: master Commit: c12abcc2d82538eeec66617c3986672f9a61db63 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c12abcc2d82538eeec66617c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 28 17:25:59 2021 +0200 wow64: Add thunks for the file set information syscalls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/file.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/struct32.h | 14 +++++++ dlls/wow64/syscall.h | 3 ++ 3 files changed, 129 insertions(+) diff --git a/dlls/wow64/file.c b/dlls/wow64/file.c index 18c65de05d0..bf11ee4b2e2 100644 --- a/dlls/wow64/file.c +++ b/dlls/wow64/file.c @@ -27,6 +27,9 @@ #include "winnt.h" #include "winternl.h" #include "wow64_private.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wow); /********************************************************************** @@ -315,6 +318,115 @@ NTSTATUS WINAPI wow64_NtReadFileScatter( UINT *args ) } +/********************************************************************** + * wow64_NtSetEaFile + */ +NTSTATUS WINAPI wow64_NtSetEaFile( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + void *ptr = get_ptr( &args ); + ULONG len = get_ulong( &args ); + + IO_STATUS_BLOCK io; + NTSTATUS status; + + status = NtSetEaFile( handle, iosb_32to64( &io, io32 ), ptr, len ); + put_iosb( io32, &io ); + return status; +} + + +/********************************************************************** + * wow64_NtSetInformationFile + */ +NTSTATUS WINAPI wow64_NtSetInformationFile( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + void *ptr = get_ptr( &args ); + ULONG len = get_ulong( &args ); + FILE_INFORMATION_CLASS class = get_ulong( &args ); + + IO_STATUS_BLOCK io; + NTSTATUS status; + + switch (class) + { + case FileBasicInformation: /* FILE_BASIC_INFORMATION */ + case FilePositionInformation: /* FILE_POSITION_INFORMATION */ + case FileEndOfFileInformation: /* FILE_END_OF_FILE_INFORMATION */ + case FilePipeInformation: /* FILE_PIPE_INFORMATION */ + case FileMailslotSetInformation: /* FILE_MAILSLOT_SET_INFORMATION */ + case FileIoCompletionNotificationInformation: /* FILE_IO_COMPLETION_NOTIFICATION_INFORMATION */ + case FileIoPriorityHintInformation: /* FILE_IO_PRIORITY_HINT_INFO */ + case FileValidDataLengthInformation: /* FILE_VALID_DATA_LENGTH_INFORMATION */ + case FileDispositionInformation: /* FILE_DISPOSITION_INFORMATION */ + status = NtSetInformationFile( handle, iosb_32to64( &io, io32 ), ptr, len, class ); + break; + + case FileRenameInformation: /* FILE_RENAME_INFORMATION */ + case FileLinkInformation: /* FILE_LINK_INFORMATION */ + if (len >= sizeof(FILE_RENAME_INFORMATION32)) + { + FILE_RENAME_INFORMATION32 *info32 = ptr; + FILE_RENAME_INFORMATION *info; + ULONG size; + + size = offsetof( FILE_RENAME_INFORMATION, FileName[info32->FileNameLength/sizeof(WCHAR)] ); + info = Wow64AllocateTemp( size ); + info->ReplaceIfExists = info32->ReplaceIfExists; + info->RootDirectory = LongToHandle( info32->RootDirectory ); + info->FileNameLength = info32->FileNameLength; + memcpy( info->FileName, info32->FileName, info->FileNameLength ); + status = NtSetInformationFile( handle, iosb_32to64( &io, io32 ), info, size, class ); + } + else status = io.Status = STATUS_INVALID_PARAMETER_3; + break; + + case FileCompletionInformation: /* FILE_COMPLETION_INFORMATION */ + if (len >= sizeof(FILE_COMPLETION_INFORMATION32)) + { + FILE_COMPLETION_INFORMATION32 *info32 = ptr; + FILE_COMPLETION_INFORMATION info; + + info.CompletionPort = LongToHandle( info32->CompletionPort ); + info.CompletionKey = info32->CompletionKey; + status = NtSetInformationFile( handle, iosb_32to64( &io, io32 ), &info, sizeof(info), class ); + } + else status = io.Status = STATUS_INVALID_PARAMETER_3; + break; + + default: + FIXME( "unsupported class %u\n", class ); + status = io.Status = STATUS_INVALID_INFO_CLASS; + break; + } + put_iosb( io32, &io ); + return status; +} + + +/********************************************************************** + * wow64_NtSetVolumeInformationFile + */ +NTSTATUS WINAPI wow64_NtSetVolumeInformationFile( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + void *ptr = get_ptr( &args ); + ULONG len = get_ulong( &args ); + FS_INFORMATION_CLASS class = get_ulong( &args ); + + IO_STATUS_BLOCK io; + NTSTATUS status; + + status = NtSetVolumeInformationFile( handle, iosb_32to64( &io, io32 ), ptr, len, class ); + put_iosb( io32, &io ); + return status; +} + + /********************************************************************** * wow64_NtUnlockFile */ diff --git a/dlls/wow64/struct32.h b/dlls/wow64/struct32.h index 76055115b08..168519b18da 100644 --- a/dlls/wow64/struct32.h +++ b/dlls/wow64/struct32.h @@ -79,6 +79,20 @@ typedef struct UNICODE_STRING32 ObjectTypeName; } DIRECTORY_BASIC_INFORMATION32; +typedef struct +{ + ULONG CompletionPort; + ULONG CompletionKey; +} FILE_COMPLETION_INFORMATION32; + +typedef struct +{ + BOOLEAN ReplaceIfExists; + ULONG RootDirectory; + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_RENAME_INFORMATION32; + typedef struct { ULONG BaseAddress; diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index d147014c3be..38eca6b744e 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -134,8 +134,10 @@ SYSCALL_ENTRY( NtSecureConnectPort ) \ SYSCALL_ENTRY( NtSetDefaultLocale ) \ SYSCALL_ENTRY( NtSetDefaultUILanguage ) \ + SYSCALL_ENTRY( NtSetEaFile ) \ SYSCALL_ENTRY( NtSetEvent ) \ SYSCALL_ENTRY( NtSetInformationDebugObject ) \ + SYSCALL_ENTRY( NtSetInformationFile ) \ SYSCALL_ENTRY( NtSetInformationKey ) \ SYSCALL_ENTRY( NtSetInformationObject ) \ SYSCALL_ENTRY( NtSetIoCompletion ) \ @@ -143,6 +145,7 @@ SYSCALL_ENTRY( NtSetTimer ) \ SYSCALL_ENTRY( NtSetTimerResolution ) \ SYSCALL_ENTRY( NtSetValueKey ) \ + SYSCALL_ENTRY( NtSetVolumeInformationFile ) \ SYSCALL_ENTRY( NtSignalAndWaitForSingleObject ) \ SYSCALL_ENTRY( NtTerminateJobObject ) \ SYSCALL_ENTRY( NtUnloadKey ) \
1
0
0
0
Alexandre Julliard : wow64: Add thunks for the file query information syscalls.
by Alexandre Julliard
28 Jul '21
28 Jul '21
Module: wine Branch: master Commit: f1d888413fb8bb71253f4a5cf72bf88edc01d47d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f1d888413fb8bb71253f4a5c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 28 16:27:10 2021 +0200 wow64: Add thunks for the file query information syscalls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/file.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/syscall.h | 6 +++ 2 files changed, 128 insertions(+) diff --git a/dlls/wow64/file.c b/dlls/wow64/file.c index b1081735ea5..18c65de05d0 100644 --- a/dlls/wow64/file.c +++ b/dlls/wow64/file.c @@ -143,6 +143,128 @@ NTSTATUS WINAPI wow64_NtOpenFile( UINT *args ) } +/********************************************************************** + * wow64_NtQueryAttributesFile + */ +NTSTATUS WINAPI wow64_NtQueryAttributesFile( UINT *args ) +{ + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + FILE_BASIC_INFORMATION *info = get_ptr( &args ); + + struct object_attr64 attr; + + return NtQueryAttributesFile( objattr_32to64( &attr, attr32 ), info ); +} + + +/********************************************************************** + * wow64_NtQueryDirectoryFile + */ +NTSTATUS WINAPI wow64_NtQueryDirectoryFile( 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 ); + FILE_INFORMATION_CLASS class = get_ulong( &args ); + BOOLEAN single_entry = get_ulong( &args ); + UNICODE_STRING32 *mask32 = get_ptr( &args ); + BOOLEAN restart_scan = get_ulong( &args ); + + UNICODE_STRING mask; + IO_STATUS_BLOCK io; + NTSTATUS status; + + status = NtQueryDirectoryFile( handle, event, apc_32to64( apc ), apc_param_32to64( apc, apc_param ), + iosb_32to64( &io, io32 ), buffer, len, class, single_entry, + unicode_str_32to64( &mask, mask32 ), restart_scan ); + put_iosb( io32, &io ); + return status; +} + + +/********************************************************************** + * wow64_NtQueryEaFile + */ +NTSTATUS WINAPI wow64_NtQueryEaFile( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + void *buffer = get_ptr( &args ); + ULONG len = get_ulong( &args ); + BOOLEAN single_entry = get_ulong( &args ); + void *list = get_ptr( &args ); + ULONG list_len = get_ulong( &args ); + ULONG *index = get_ptr( &args ); + BOOLEAN restart = get_ulong( &args ); + + IO_STATUS_BLOCK io; + NTSTATUS status; + + status = NtQueryEaFile( handle, iosb_32to64( &io, io32 ), buffer, len, + single_entry, list, list_len, index, restart ); + put_iosb( io32, &io ); + return status; +} + + +/********************************************************************** + * wow64_NtQueryFullAttributesFile + */ +NTSTATUS WINAPI wow64_NtQueryFullAttributesFile( UINT *args ) +{ + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + FILE_NETWORK_OPEN_INFORMATION *info = get_ptr( &args ); + + struct object_attr64 attr; + + return NtQueryFullAttributesFile( objattr_32to64( &attr, attr32 ), info ); +} + + +/********************************************************************** + * wow64_NtQueryInformationFile + */ +NTSTATUS WINAPI wow64_NtQueryInformationFile( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + void *info = get_ptr( &args ); + ULONG len = get_ulong( &args ); + FILE_INFORMATION_CLASS class = get_ulong( &args ); + + IO_STATUS_BLOCK io; + NTSTATUS status; + + status = NtQueryInformationFile( handle, iosb_32to64( &io, io32 ), info, len, class ); + put_iosb( io32, &io ); + return status; +} + + +/********************************************************************** + * wow64_NtQueryVolumeInformationFile + */ +NTSTATUS WINAPI wow64_NtQueryVolumeInformationFile( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + void *buffer = get_ptr( &args ); + ULONG len = get_ulong( &args ); + FS_INFORMATION_CLASS class = get_ulong( &args ); + + IO_STATUS_BLOCK io; + NTSTATUS status; + + status = NtQueryVolumeInformationFile( handle, iosb_32to64( &io, io32 ), buffer, len, class ); + put_iosb( io32, &io ); + return status; +} + + /********************************************************************** * wow64_NtReadFile */ diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index 870cb3b77b8..d147014c3be 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -92,11 +92,16 @@ SYSCALL_ENTRY( NtOpenTimer ) \ SYSCALL_ENTRY( NtProtectVirtualMemory ) \ SYSCALL_ENTRY( NtPulseEvent ) \ + SYSCALL_ENTRY( NtQueryAttributesFile ) \ SYSCALL_ENTRY( NtQueryDefaultLocale ) \ SYSCALL_ENTRY( NtQueryDefaultUILanguage ) \ + SYSCALL_ENTRY( NtQueryDirectoryFile ) \ SYSCALL_ENTRY( NtQueryDirectoryObject ) \ + SYSCALL_ENTRY( NtQueryEaFile ) \ SYSCALL_ENTRY( NtQueryEvent ) \ + SYSCALL_ENTRY( NtQueryFullAttributesFile ) \ SYSCALL_ENTRY( NtQueryInformationAtom ) \ + SYSCALL_ENTRY( NtQueryInformationFile ) \ SYSCALL_ENTRY( NtQueryInstallUILanguage ) \ SYSCALL_ENTRY( NtQueryIoCompletion ) \ SYSCALL_ENTRY( NtQueryKey ) \ @@ -111,6 +116,7 @@ SYSCALL_ENTRY( NtQueryTimerResolution ) \ SYSCALL_ENTRY( NtQueryValueKey ) \ SYSCALL_ENTRY( NtQueryVirtualMemory ) \ + SYSCALL_ENTRY( NtQueryVolumeInformationFile ) \ SYSCALL_ENTRY( NtReadFile ) \ SYSCALL_ENTRY( NtReadFileScatter ) \ SYSCALL_ENTRY( NtReadVirtualMemory ) \
1
0
0
0
Alexandre Julliard : wow64: Add thunks for the file I/O syscalls.
by Alexandre Julliard
28 Jul '21
28 Jul '21
Module: wine Branch: master Commit: 668b1829200fdbfa91845d089cc37683476e4aa9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=668b1829200fdbfa91845d08…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 28 16:20:48 2021 +0200 wow64: Add thunks for the file I/O syscalls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/file.c | 163 +++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/syscall.h | 7 +++ 2 files changed, 170 insertions(+) diff --git a/dlls/wow64/file.c b/dlls/wow64/file.c index 361aa1905ee..b1081735ea5 100644 --- a/dlls/wow64/file.c +++ b/dlls/wow64/file.c @@ -74,6 +74,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 */ @@ -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; +} diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index 2b542658f9e..870cb3b77b8 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -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 )
1
0
0
0
Alexandre Julliard : wow64: Add thunks for the file creation syscalls.
by Alexandre Julliard
28 Jul '21
28 Jul '21
Module: wine Branch: master Commit: 01ad0993cb6c74fd0efd960ecad9d1af54375a90 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=01ad0993cb6c74fd0efd960e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 28 16:15:56 2021 +0200 wow64: Add thunks for the file creation syscalls. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/Makefile.in | 1 + dlls/wow64/file.c | 100 +++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/struct32.h | 10 +++++ dlls/wow64/syscall.h | 3 ++ dlls/wow64/wow64_private.h | 18 ++++++++ 5 files changed, 132 insertions(+) diff --git a/dlls/wow64/Makefile.in b/dlls/wow64/Makefile.in index 693fdefaae4..f56d1f0aad9 100644 --- a/dlls/wow64/Makefile.in +++ b/dlls/wow64/Makefile.in @@ -5,6 +5,7 @@ IMPORTS = ntdll winecrt0 EXTRADLLFLAGS = -nodefaultlibs -mno-cygwin -Wl,--image-base,0x6f000000 C_SRCS = \ + file.c \ registry.c \ sync.c \ syscall.c \ diff --git a/dlls/wow64/file.c b/dlls/wow64/file.c new file mode 100644 index 00000000000..361aa1905ee --- /dev/null +++ b/dlls/wow64/file.c @@ -0,0 +1,100 @@ +/* + * WoW64 file 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_NtCreateFile + */ +NTSTATUS WINAPI wow64_NtCreateFile( UINT *args ) +{ + ULONG *handle_ptr = get_ptr( &args ); + ACCESS_MASK access = get_ulong( &args ); + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + LARGE_INTEGER *alloc_size = get_ptr( &args ); + ULONG attributes = get_ulong( &args ); + ULONG sharing = get_ulong( &args ); + ULONG disposition = get_ulong( &args ); + ULONG options = get_ulong( &args ); + void *ea_buffer = get_ptr( &args ); + ULONG ea_length = get_ulong( &args ); + + struct object_attr64 attr; + IO_STATUS_BLOCK io; + HANDLE handle = 0; + NTSTATUS status; + + *handle_ptr = 0; + status = NtCreateFile( &handle, access, objattr_32to64( &attr, attr32 ), + iosb_32to64( &io, io32 ), alloc_size, attributes, + sharing, disposition, options, ea_buffer, ea_length ); + put_handle( handle_ptr, handle ); + put_iosb( io32, &io ); + return status; +} + + +/********************************************************************** + * wow64_NtDeleteFile + */ +NTSTATUS WINAPI wow64_NtDeleteFile( UINT *args ) +{ + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + + struct object_attr64 attr; + + return NtDeleteFile( objattr_32to64( &attr, attr32 )); +} + + +/********************************************************************** + * wow64_NtOpenFile + */ +NTSTATUS WINAPI wow64_NtOpenFile( UINT *args ) +{ + ULONG *handle_ptr = get_ptr( &args ); + ACCESS_MASK access = get_ulong( &args ); + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + IO_STATUS_BLOCK32 *io32 = get_ptr( &args ); + ULONG sharing = get_ulong( &args ); + ULONG options = get_ulong( &args ); + + struct object_attr64 attr; + IO_STATUS_BLOCK io; + HANDLE handle = 0; + NTSTATUS status; + + *handle_ptr = 0; + status = NtOpenFile( &handle, access, objattr_32to64( &attr, attr32 ), + iosb_32to64( &io, io32 ), sharing, options ); + put_handle( handle_ptr, handle ); + put_iosb( io32, &io ); + return status; +} diff --git a/dlls/wow64/struct32.h b/dlls/wow64/struct32.h index 069564948d0..76055115b08 100644 --- a/dlls/wow64/struct32.h +++ b/dlls/wow64/struct32.h @@ -31,6 +31,16 @@ typedef struct ULONG SecurityQualityOfService; } OBJECT_ATTRIBUTES32; +typedef struct +{ + union + { + NTSTATUS Status; + ULONG Pointer; + }; + ULONG Information; +} IO_STATUS_BLOCK32; + typedef struct { UNICODE_STRING32 Name; diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index ab25bcb501d..2b542658f9e 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -38,6 +38,7 @@ SYSCALL_ENTRY( NtCreateDebugObject ) \ SYSCALL_ENTRY( NtCreateDirectoryObject ) \ SYSCALL_ENTRY( NtCreateEvent ) \ + SYSCALL_ENTRY( NtCreateFile ) \ SYSCALL_ENTRY( NtCreateIoCompletion ) \ SYSCALL_ENTRY( NtCreateJobObject ) \ SYSCALL_ENTRY( NtCreateKey ) \ @@ -53,6 +54,7 @@ SYSCALL_ENTRY( NtDebugContinue ) \ SYSCALL_ENTRY( NtDelayExecution ) \ SYSCALL_ENTRY( NtDeleteAtom ) \ + SYSCALL_ENTRY( NtDeleteFile ) \ SYSCALL_ENTRY( NtDeleteKey ) \ SYSCALL_ENTRY( NtDeleteValueKey ) \ SYSCALL_ENTRY( NtDuplicateObject ) \ @@ -73,6 +75,7 @@ SYSCALL_ENTRY( NtMapViewOfSection ) \ SYSCALL_ENTRY( NtOpenDirectoryObject ) \ SYSCALL_ENTRY( NtOpenEvent ) \ + SYSCALL_ENTRY( NtOpenFile ) \ SYSCALL_ENTRY( NtOpenIoCompletion ) \ SYSCALL_ENTRY( NtOpenJobObject ) \ SYSCALL_ENTRY( NtOpenKey ) \ diff --git a/dlls/wow64/wow64_private.h b/dlls/wow64/wow64_private.h index e9935303cbb..303914c540e 100644 --- a/dlls/wow64/wow64_private.h +++ b/dlls/wow64/wow64_private.h @@ -105,6 +105,13 @@ static inline void *apc_param_32to64( ULONG func, ULONG context ) return (void *)(ULONG_PTR)(((ULONG64)func << 32) | context); } +static inline IO_STATUS_BLOCK *iosb_32to64( IO_STATUS_BLOCK *io, IO_STATUS_BLOCK32 *io32 ) +{ + if (!io32) return NULL; + io->Pointer = io32; + return io; +} + static inline UNICODE_STRING *unicode_str_32to64( UNICODE_STRING *str, const UNICODE_STRING32 *str32 ) { if (!str32) return NULL; @@ -178,6 +185,17 @@ static inline void put_size( ULONG *size32, SIZE_T size ) if (size32) *size32 = min( size, MAXDWORD ); } +static inline void put_iosb( IO_STATUS_BLOCK32 *io32, const IO_STATUS_BLOCK *io ) +{ + /* sync I/O modifies the 64-bit iosb right away, so in that case we update the 32-bit one */ + /* async I/O leaves the 64-bit one untouched and updates the 32-bit one directly later on */ + if (io32 && io->Pointer != io32) + { + io32->Status = io->Status; + io32->Information = io->Information; + } +} + extern void put_section_image_info( SECTION_IMAGE_INFORMATION32 *info32, const SECTION_IMAGE_INFORMATION *info ) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : wow64: Implement Wow64AllocateTemp().
by Alexandre Julliard
28 Jul '21
28 Jul '21
Module: wine Branch: master Commit: 65caa0f2efc810993d76dcee7d7c94319905349f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=65caa0f2efc810993d76dcee…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 28 15:59:06 2021 +0200 wow64: Implement Wow64AllocateTemp(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wow64/sync.c | 9 +++------ dlls/wow64/syscall.c | 42 ++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/virtual.c | 7 +++---- dlls/wow64/wow64.spec | 2 +- dlls/wow64/wow64_private.h | 3 ++- include/winternl.h | 1 + 6 files changed, 52 insertions(+), 12 deletions(-) diff --git a/dlls/wow64/sync.c b/dlls/wow64/sync.c index ef7176bd199..afea4a5c531 100644 --- a/dlls/wow64/sync.c +++ b/dlls/wow64/sync.c @@ -757,7 +757,7 @@ NTSTATUS WINAPI wow64_NtQueryDirectoryObject( UINT *args ) ULONG size = size32 + sizeof(*info) - sizeof(*info32); if (!single_entry) FIXME( "not implemented\n" ); - info = RtlAllocateHeap( GetProcessHeap(), 0, size ); + info = Wow64AllocateTemp( size ); status = NtQueryDirectoryObject( handle, info, size, single_entry, restart, context, NULL ); if (!status) { @@ -771,7 +771,6 @@ NTSTATUS WINAPI wow64_NtQueryDirectoryObject( UINT *args ) memcpy( info32 + 1, info + 1, size ); if (retlen) *retlen = sizeof(*info32) + size; } - RtlFreeHeap( GetProcessHeap(), 0, info ); return status; } @@ -845,7 +844,7 @@ NTSTATUS WINAPI wow64_NtQueryObject( UINT *args ) { ULONG size = len + sizeof(OBJECT_NAME_INFORMATION) - sizeof(OBJECT_NAME_INFORMATION32); OBJECT_NAME_INFORMATION32 *info32 = ptr; - OBJECT_NAME_INFORMATION *info = RtlAllocateHeap( GetProcessHeap(), 0, size ); + OBJECT_NAME_INFORMATION *info = Wow64AllocateTemp( size ); if (!(status = NtQueryObject( handle, class, info, size, &ret_size ))) { @@ -867,7 +866,6 @@ NTSTATUS WINAPI wow64_NtQueryObject( UINT *args ) { if (retlen) *retlen = ret_size - sizeof(*info) + sizeof(*info32); } - RtlFreeHeap( GetProcessHeap(), 0, info ); return status; } @@ -894,7 +892,7 @@ NTSTATUS WINAPI wow64_NtQueryObject( UINT *args ) /* assume at most 32 types, with an average 16-char name */ ULONG ret_size, size = 32 * (sizeof(OBJECT_TYPE_INFORMATION) + 16 * sizeof(WCHAR)); - info = RtlAllocateHeap( GetProcessHeap(), 0, size ); + info = Wow64AllocateTemp( size ); if (!(status = NtQueryObject( handle, class, info, size, &ret_size ))) { OBJECT_TYPE_INFORMATION *type; @@ -915,7 +913,6 @@ NTSTATUS WINAPI wow64_NtQueryObject( UINT *args ) if (pos32 > len) status = STATUS_INFO_LENGTH_MISMATCH; if (retlen) *retlen = pos32; } - RtlFreeHeap( GetProcessHeap(), 0, info ); return status; } diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index 2f165879195..0000db54c29 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -54,6 +54,14 @@ static const char *syscall_names[] = static unsigned short syscall_map[1024]; +/* header for Wow64AllocTemp blocks; probably not the right layout */ +struct mem_header +{ + struct mem_header *next; + void *__pad; + BYTE data[1]; +}; + static SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock; void *dummy = RtlUnwind; @@ -375,6 +383,22 @@ static void process_init(void) } +/********************************************************************** + * free_temp_data + */ +static void free_temp_data(void) +{ + struct mem_header *next, *mem; + + for (mem = NtCurrentTeb()->TlsSlots[WOW64_TLS_TEMPLIST]; mem; mem = next) + { + next = mem->next; + RtlFreeHeap( GetProcessHeap(), 0, mem ); + } + NtCurrentTeb()->TlsSlots[WOW64_TLS_TEMPLIST] = NULL; +} + + /********************************************************************** * Wow64SystemServiceEx (NTDLL.@) */ @@ -397,10 +421,28 @@ NTSTATUS WINAPI Wow64SystemServiceEx( UINT num, UINT *args ) status = GetExceptionCode(); } __ENDTRY; + free_temp_data(); return status; } +/********************************************************************** + * Wow64AllocateTemp + * + * FIXME: probably not 100% compatible. + */ +void * WINAPI Wow64AllocateTemp( SIZE_T size ) +{ + struct mem_header *mem; + + if (!(mem = RtlAllocateHeap( GetProcessHeap(), 0, offsetof( struct mem_header, data[size] )))) + return NULL; + mem->next = NtCurrentTeb()->TlsSlots[WOW64_TLS_TEMPLIST]; + NtCurrentTeb()->TlsSlots[WOW64_TLS_TEMPLIST] = mem; + return mem->data; +} + + /********************************************************************** * Wow64ApcRoutine (NTDLL.@) */ diff --git a/dlls/wow64/virtual.c b/dlls/wow64/virtual.c index 36bd91d9f8c..3cf2b934c93 100644 --- a/dlls/wow64/virtual.c +++ b/dlls/wow64/virtual.c @@ -198,13 +198,12 @@ NTSTATUS WINAPI wow64_NtGetWriteWatch( UINT *args ) if (flags & ~WRITE_WATCH_FLAG_RESET) return STATUS_INVALID_PARAMETER; if (!addr_ptr) return STATUS_ACCESS_VIOLATION; - addresses = RtlAllocateHeap( GetProcessHeap(), 0, count * sizeof(*addresses) ); + addresses = Wow64AllocateTemp( count * sizeof(*addresses) ); if (!(status = NtGetWriteWatch( handle, flags, base, size, addresses, &count, granularity ))) { for (i = 0; i < count; i++) addr_ptr[i] = PtrToUlong( addresses[i] ); *count_ptr = count; } - RtlFreeHeap( GetProcessHeap(), 0, addresses ); return status; } @@ -335,7 +334,7 @@ NTSTATUS WINAPI wow64_NtQueryVirtualMemory( UINT *args ) MEMORY_SECTION_NAME32 *info32 = ptr; SIZE_T size = len + sizeof(*info) - sizeof(*info32); - info = RtlAllocateHeap( GetProcessHeap(), 0, size ); + info = Wow64AllocateTemp( size ); if (!(status = NtQueryVirtualMemory( handle, addr, class, info, size, &res_len ))) { info32->SectionFileName.Length = info->SectionFileName.Length; @@ -353,7 +352,7 @@ NTSTATUS WINAPI wow64_NtQueryVirtualMemory( UINT *args ) MEMORY_WORKING_SET_EX_INFORMATION *info; ULONG i, count = len / sizeof(*info32); - info = RtlAllocateHeap( GetProcessHeap(), 0, count * sizeof(*info) ); + info = Wow64AllocateTemp( count * sizeof(*info) ); for (i = 0; i < count; i++) info[i].VirtualAddress = ULongToPtr( info32[i].VirtualAddress ); if (!(status = NtQueryVirtualMemory( handle, addr, class, info, count * sizeof(*info), &res_len ))) { diff --git a/dlls/wow64/wow64.spec b/dlls/wow64/wow64.spec index 8f188043556..4ed20af0f29 100644 --- a/dlls/wow64/wow64.spec +++ b/dlls/wow64/wow64.spec @@ -1,6 +1,6 @@ @ stub Wow64AllocThreadHeap @ stub Wow64AllocateHeap -@ stub Wow64AllocateTemp +@ stdcall Wow64AllocateTemp(long) @ stdcall Wow64ApcRoutine(long long long ptr) @ stub Wow64CheckIfNXEnabled @ stub Wow64EmulateAtlThunk diff --git a/dlls/wow64/wow64_private.h b/dlls/wow64/wow64_private.h index 6ba77720263..e9935303cbb 100644 --- a/dlls/wow64/wow64_private.h +++ b/dlls/wow64/wow64_private.h @@ -28,7 +28,8 @@ ALL_SYSCALLS #undef SYSCALL_ENTRY -void WINAPI Wow64ApcRoutine( ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3, CONTEXT *context ) DECLSPEC_HIDDEN; +void * WINAPI Wow64AllocateTemp( SIZE_T size ) DECLSPEC_HIDDEN; +void WINAPI Wow64ApcRoutine( ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3, CONTEXT *context ) DECLSPEC_HIDDEN; extern USHORT native_machine DECLSPEC_HIDDEN; extern USHORT current_machine DECLSPEC_HIDDEN; diff --git a/include/winternl.h b/include/winternl.h index 7d732d895d9..10d6de1f9ed 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -1081,6 +1081,7 @@ typedef struct _TEB64 /* reserved TEB64 TLS slots for Wow64 */ #define WOW64_TLS_CPURESERVED 1 +#define WOW64_TLS_TEMPLIST 3 #define WOW64_TLS_FILESYSREDIR 8
1
0
0
0
Chip Davis : vkd3d: Pass vkd3d_pipeline_bind_point values to invalidate_root_parameters() calls.
by Alexandre Julliard
28 Jul '21
28 Jul '21
Module: vkd3d Branch: master Commit: 5812aa17c6274c851fcf7bec910dd4d86cb9af80 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=5812aa17c6274c851fcf7be…
Author: Chip Davis <cdavis(a)codeweavers.com> Date: Tue Jul 27 22:45:59 2021 -0500 vkd3d: Pass vkd3d_pipeline_bind_point values to invalidate_root_parameters() calls. Signed-off-by: Chip Davis <cdavis(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 33239b8..7150c59 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -4909,7 +4909,7 @@ static void d3d12_command_list_clear_uav(struct d3d12_command_list *list, d3d12_command_list_invalidate_current_pipeline(list); d3d12_command_list_invalidate_bindings(list, list->state); - d3d12_command_list_invalidate_root_parameters(list, VK_PIPELINE_BIND_POINT_COMPUTE); + d3d12_command_list_invalidate_root_parameters(list, VKD3D_PIPELINE_BIND_POINT_COMPUTE); if (!d3d12_command_allocator_add_view(list->allocator, view)) WARN("Failed to add view.\n");
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
73
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Results per page:
10
25
50
100
200