Andrew Wesie : ntdll: Implement NtCreateThreadEx.

Alexandre Julliard julliard at winehq.org
Mon May 14 06:54:25 CDT 2018


Module: wine
Branch: stable
Commit: 11dbee29209da0c1bedf6cac9a57c278bbbc6042
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=11dbee29209da0c1bedf6cac9a57c278bbbc6042

Author: Andrew Wesie <awesie at gmail.com>
Date:   Tue Mar  6 03:10:30 2018 +0000

ntdll: Implement NtCreateThreadEx.

Signed-off-by: Andrew Wesie <awesie at gmail.com>
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 4fda0463237d395fbee5d955e72a7c13ed125416)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/ntdll/ntdll.spec |  1 +
 dlls/ntdll/thread.c   | 17 +++++++++++++++++
 include/winternl.h    |  7 +++++++
 3 files changed, 25 insertions(+)

diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 27c10e1..584b5a4 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -152,6 +152,7 @@
 @ stdcall NtCreateSemaphore(ptr long ptr long long)
 @ stdcall NtCreateSymbolicLinkObject(ptr long ptr ptr)
 @ stub NtCreateThread
+@ stdcall NtCreateThreadEx(ptr long ptr long ptr ptr long long long long ptr)
 @ stdcall NtCreateTimer(ptr long ptr long)
 @ stub NtCreateToken
 # @ stub NtCreateWaitablePort
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 66beeb0..88008ad 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -522,6 +522,23 @@ static void start_thread( struct startup_info *info )
 
 
 /***********************************************************************
+ *              NtCreateThreadEx   (NTDLL.@)
+ */
+NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle_ptr, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr,
+                                  HANDLE process, LPTHREAD_START_ROUTINE start, void *param,
+                                  ULONG flags, ULONG zero_bits, ULONG stack_commit,
+                                  ULONG stack_reserve, void *attribute_list )
+{
+    FIXME( "%p, %x, %p, %p, %p, %p, %x, %x, %x, %x, %p semi-stub!\n", handle_ptr, access, attr,
+           process, start, param, flags, zero_bits, stack_commit, stack_reserve, attribute_list );
+
+    return RtlCreateUserThread( process, NULL, flags & THREAD_CREATE_FLAGS_CREATE_SUSPENDED,
+                                NULL, stack_reserve, stack_commit, (PRTL_THREAD_START_ROUTINE)start,
+                                param, handle_ptr, NULL );
+}
+
+
+/***********************************************************************
  *              RtlCreateUserThread   (NTDLL.@)
  */
 NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *descr,
diff --git a/include/winternl.h b/include/winternl.h
index 21353d8..24cf15c 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2149,6 +2149,13 @@ typedef struct _SYSTEM_MODULE_INFORMATION
     SYSTEM_MODULE       Modules[1]; /* FIXME: should be Modules[0] */
 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
 
+#define THREAD_CREATE_FLAGS_CREATE_SUSPENDED        0x00000001
+#define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH      0x00000002
+#define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER      0x00000004
+#define THREAD_CREATE_FLAGS_HAS_SECURITY_DESCRIPTOR 0x00000010
+#define THREAD_CREATE_FLAGS_ACCESS_CHECK_IN_TARGET  0x00000020
+#define THREAD_CREATE_FLAGS_INITIAL_THREAD          0x00000080
+
 /***********************************************************************
  * Function declarations
  */




More information about the wine-cvs mailing list