Skip to content

Commit b51a6e1

Browse files
committed
Adding CreateRemoteThreadEx definition
1 parent 26b42a0 commit b51a6e1

5 files changed

Lines changed: 25 additions & 6 deletions

File tree

ctypes_generation/definitions/functions/winfunc.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,17 @@ HANDLE WINAPI CreateRemoteThread(
150150
_Out_ LPDWORD lpThreadId
151151
);
152152

153+
HANDLE CreateRemoteThreadEx(
154+
[in] HANDLE hProcess,
155+
[in, optional] LPSECURITY_ATTRIBUTES lpThreadAttributes,
156+
[in] SIZE_T dwStackSize,
157+
[in] LPTHREAD_START_ROUTINE lpStartAddress,
158+
[in, optional] LPVOID lpParameter,
159+
[in] DWORD dwCreationFlags,
160+
[in, optional] LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
161+
[out, optional] LPDWORD lpThreadId
162+
);
163+
153164
BOOL WINAPI CreateProcessA(
154165
__in_opt LPCSTR lpApplicationName,
155166
__inout_opt LPSTR lpCommandLine,

docs/source/winfuncs_generated.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,8 @@ Functions
13901390

13911391
.. function:: CreateRemoteThread(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpThreadId)
13921392

1393+
.. function:: CreateRemoteThreadEx(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpAttributeList, lpThreadId)
1394+
13931395
.. function:: CreateProcessA(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation)
13941396

13951397
.. function:: CreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation)

windows/generated_def/meta.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14680,6 +14680,7 @@
1468014680
'CreateProcessAsUserW',
1468114681
'CreateProcessW',
1468214682
'CreateRemoteThread',
14683+
'CreateRemoteThreadEx',
1468314684
'CreateServiceA',
1468414685
'CreateServiceW',
1468514686
'CreateStreamOnHGlobal',

windows/generated_def/winfuncs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3470,6 +3470,11 @@
34703470
CreateRemoteThreadPrototype = WINFUNCTYPE(HANDLE, HANDLE, LPSECURITY_ATTRIBUTES, SIZE_T, LPTHREAD_START_ROUTINE, LPVOID, DWORD, LPDWORD)
34713471
CreateRemoteThreadParams = ((1, 'hProcess'), (1, 'lpThreadAttributes'), (1, 'dwStackSize'), (1, 'lpStartAddress'), (1, 'lpParameter'), (1, 'dwCreationFlags'), (1, 'lpThreadId'))
34723472

3473+
#def CreateRemoteThreadEx(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpAttributeList, lpThreadId):
3474+
# return CreateRemoteThreadEx.ctypes_function(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpAttributeList, lpThreadId)
3475+
CreateRemoteThreadExPrototype = WINFUNCTYPE(HANDLE, HANDLE, LPSECURITY_ATTRIBUTES, SIZE_T, LPTHREAD_START_ROUTINE, LPVOID, DWORD, LPPROC_THREAD_ATTRIBUTE_LIST, LPDWORD)
3476+
CreateRemoteThreadExParams = ((1, 'hProcess'), (1, 'lpThreadAttributes'), (1, 'dwStackSize'), (1, 'lpStartAddress'), (1, 'lpParameter'), (1, 'dwCreationFlags'), (1, 'lpAttributeList'), (1, 'lpThreadId'))
3477+
34733478
#def CreateProcessA(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation):
34743479
# return CreateProcessA.ctypes_function(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation)
34753480
CreateProcessAPrototype = WINFUNCTYPE(BOOL, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION)

windows/winproxy/apis/kernel32.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ def CreateRemoteThread(hProcess=NeededParameter, lpThreadAttributes=None, dwStac
214214
lpStartAddress=NeededParameter, lpParameter=NeededParameter, dwCreationFlags=0, lpThreadId=None):
215215
return CreateRemoteThread.ctypes_function(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpThreadId)
216216

217+
@Kernel32Proxy()
218+
def CreateRemoteThreadEx(hProcess, lpThreadAttributes=None, dwStackSize=0, lpStartAddress=NeededParameter, lpParameter=NeededParameter, dwCreationFlags=0, lpAttributeList=None, lpThreadId=None):
219+
return CreateRemoteThreadEx.ctypes_function(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpAttributeList, lpThreadId)
220+
221+
217222
@Kernel32Proxy()
218223
def GetThreadContext(hThread, lpContext):
219224
# TODO: RM ME IF TEST PASS
@@ -661,12 +666,7 @@ def FindNextChangeNotification(hChangeHandle):
661666

662667
@Kernel32Proxy()
663668
def FindCloseChangeNotification(hChangeHandle):
664-
return FindCloseChange
665-
Notification.ctypes_function(hChangeHandle)
666-
667-
@Kernel32Proxy()
668-
def FindNextChangeNotification(hChangeHandle):
669-
return FindNextChangeNotification.ctypes_function(hChangeHandle)
669+
return FindCloseChangeNotification.ctypes_function(hChangeHandle)
670670

671671
@Kernel32Proxy()
672672
def ReadDirectoryChangesW(hDirectory, lpBuffer, nBufferLength, bWatchSubtree, dwNotifyFilter, lpBytesReturned, lpOverlapped, lpCompletionRoutine):

0 commit comments

Comments
 (0)