[PATCH v6 0/1] MR3096: ntdll: Add NtGetNextProcess stub.
The stub is enough for TokenViewer.exe to start up and display its user interface. Based on a patch by Nikolay Sivov. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45119 -- v6: ntdll: Add NtGetNextProcess stub. https://gitlab.winehq.org/wine/wine/-/merge_requests/3096
From: Alex Henrie <alexhenrie24(a)gmail.com> The stub is enough for TokenViewer.exe to start up and display its user interface. Based on a patch by Nikolay Sivov. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45119 --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/unix/process.c | 12 ++++++++++++ dlls/wow64/process.c | 21 +++++++++++++++++++++ include/winternl.h | 1 + 4 files changed, 35 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 66995346e57..c0ccf92b7e6 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -231,6 +231,7 @@ @ stdcall -norelay -syscall NtGetContextThread(long ptr) @ stdcall -syscall NtGetCurrentProcessorNumber() # @ stub NtGetDevicePowerState +@ stdcall -syscall NtGetNextProcess(ptr long long long ptr) @ stdcall -syscall NtGetNextThread(ptr ptr long long long ptr) @ stdcall -syscall NtGetNlsSectionPtr(long long long ptr ptr) # @ stub NtGetPlugPlayEvent diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index bf24161fedb..758ce820b4c 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -1774,6 +1774,18 @@ NTSTATUS WINAPI NtResumeProcess( HANDLE handle ) } +/********************************************************************** + * NtGetNextProcess (NTDLL.@) + */ +NTSTATUS WINAPI NtGetNextProcess( HANDLE process, ACCESS_MASK access, ULONG attributes, + ULONG flags, HANDLE *handle ) +{ + FIXME( "process %p, access %#x, attributes %#x, flags %#x, handle %p. stub!\n", + process, (int)access, (int)attributes, (int)flags, handle ); + return STATUS_NOT_IMPLEMENTED; +} + + /********************************************************************** * NtDebugActiveProcess (NTDLL.@) */ diff --git a/dlls/wow64/process.c b/dlls/wow64/process.c index 817926d0f13..6fe997bb0b4 100644 --- a/dlls/wow64/process.c +++ b/dlls/wow64/process.c @@ -435,6 +435,27 @@ NTSTATUS WINAPI wow64_NtFlushProcessWriteBuffers( UINT *args ) } +/********************************************************************** + * wow64_NtGetNextProcess + */ +NTSTATUS WINAPI wow64_NtGetNextProcess( UINT *args ) +{ + HANDLE process = get_handle( &args ); + ACCESS_MASK access = get_ulong( &args ); + ULONG attributes = get_ulong( &args ); + ULONG flags = get_ulong( &args ); + ULONG *handle_ptr = get_ptr( &args ); + + HANDLE handle = 0; + NTSTATUS status; + + *handle_ptr = 0; + status = NtGetNextProcess( process, access, attributes, flags, &handle ); + put_handle( handle_ptr, handle ); + return status; +} + + /********************************************************************** * wow64_NtGetNextThread */ diff --git a/include/winternl.h b/include/winternl.h index 52af87320a5..eb5e6888b78 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4446,6 +4446,7 @@ NTSYSAPI NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG); NTSYSAPI NTSTATUS WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*); NTSYSAPI ULONG WINAPI NtGetCurrentProcessorNumber(void); +NTSYSAPI NTSTATUS WINAPI NtGetNextProcess(HANDLE,ACCESS_MASK,ULONG,ULONG,HANDLE*); NTSYSAPI NTSTATUS WINAPI NtGetNextThread(HANDLE,HANDLE,ACCESS_MASK,ULONG,ULONG,HANDLE*); NTSYSAPI NTSTATUS WINAPI NtGetNlsSectionPtr(ULONG,ULONG,void*,void**,SIZE_T*); NTSYSAPI NTSTATUS WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3096
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=143198 Your paranoid android. === debian11 (build log) === /usr/bin/i686-w64-mingw32-ld: tmp6604bc70/ntdll-00000000.spec.o:fake:(.edata+0x30c): undefined reference to `NtGetNextProcess(a)20' collect2: error: ld returned 1 exit status Task: The win32 Wine build failed === debian11b (build log) === /usr/bin/x86_64-w64-mingw32-ld: tmp6601a192/ntdll-00000000.spec.o:fake:(.edata+0x308): undefined reference to `NtGetNextProcess' collect2: error: ld returned 1 exit status Task: The wow64 Wine build failed
participants (3)
-
Alex Henrie -
Alex Henrie (@alexhenrie) -
Marvin