Commit f0a1c2f7 authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Don't create thunk for CreateThread16 proc, call it directly.

parent f4edf237
......@@ -27,6 +27,7 @@
#include "server.h"
#include "services.h"
#include "stackframe.h"
#include "builtin16.h"
#include "debugtools.h"
#include "queue.h"
#include "hook.h"
......@@ -307,6 +308,30 @@ HANDLE WINAPI CreateThread( SECURITY_ATTRIBUTES *sa, DWORD stack,
return handle;
}
/***********************************************************************
* CreateThread16 (KERNEL.441)
*/
static DWORD CALLBACK THREAD_StartThread16( LPVOID threadArgs )
{
FARPROC16 start = ((FARPROC16 *)threadArgs)[0];
DWORD param = ((DWORD *)threadArgs)[1];
HeapFree( GetProcessHeap(), 0, threadArgs );
((LPDWORD)CURRENT_STACK16)[-1] = param;
return CallTo16Long( start, sizeof(DWORD) );
}
HANDLE WINAPI CreateThread16( SECURITY_ATTRIBUTES *sa, DWORD stack,
FARPROC16 start, SEGPTR param,
DWORD flags, LPDWORD id )
{
DWORD *threadArgs = HeapAlloc( GetProcessHeap(), 0, 2*sizeof(DWORD) );
if (!threadArgs) return INVALID_HANDLE_VALUE;
threadArgs[0] = (DWORD)start;
threadArgs[1] = (DWORD)param;
return CreateThread( sa, stack, THREAD_StartThread16, threadArgs, flags, id );
}
/***********************************************************************
* ExitThread [KERNEL32.215] Ends a thread
......
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