kernel32: Implement GetCurrentThreadStackLimits.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46179 Signed-off-by: André Hentschel <nerv@dawncrow.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7a3f08c7a3
commit
ee9f2c62d5
|
@ -15,7 +15,7 @@
|
||||||
@ stdcall GetCurrentProcessorNumberEx(ptr) kernel32.GetCurrentProcessorNumberEx
|
@ stdcall GetCurrentProcessorNumberEx(ptr) kernel32.GetCurrentProcessorNumberEx
|
||||||
@ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread
|
@ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread
|
||||||
@ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId
|
@ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId
|
||||||
@ stub GetCurrentThreadStackLimits
|
@ stdcall GetCurrentThreadStackLimits(ptr ptr) kernel32.GetCurrentThreadStackLimits
|
||||||
@ stdcall GetExitCodeProcess(long ptr) kernel32.GetExitCodeProcess
|
@ stdcall GetExitCodeProcess(long ptr) kernel32.GetExitCodeProcess
|
||||||
@ stdcall GetExitCodeThread(long ptr) kernel32.GetExitCodeThread
|
@ stdcall GetExitCodeThread(long ptr) kernel32.GetExitCodeThread
|
||||||
@ stdcall GetPriorityClass(long) kernel32.GetPriorityClass
|
@ stdcall GetPriorityClass(long) kernel32.GetPriorityClass
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
@ stdcall GetCurrentProcessorNumberEx(ptr) kernel32.GetCurrentProcessorNumberEx
|
@ stdcall GetCurrentProcessorNumberEx(ptr) kernel32.GetCurrentProcessorNumberEx
|
||||||
@ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread
|
@ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread
|
||||||
@ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId
|
@ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId
|
||||||
@ stub GetCurrentThreadStackLimits
|
@ stdcall GetCurrentThreadStackLimits(ptr ptr) kernel32.GetCurrentThreadStackLimits
|
||||||
@ stdcall GetExitCodeProcess(long ptr) kernel32.GetExitCodeProcess
|
@ stdcall GetExitCodeProcess(long ptr) kernel32.GetExitCodeProcess
|
||||||
@ stdcall GetExitCodeThread(long ptr) kernel32.GetExitCodeThread
|
@ stdcall GetExitCodeThread(long ptr) kernel32.GetExitCodeThread
|
||||||
@ stdcall GetPriorityClass(long) kernel32.GetPriorityClass
|
@ stdcall GetPriorityClass(long) kernel32.GetPriorityClass
|
||||||
|
|
|
@ -635,6 +635,7 @@
|
||||||
@ stdcall GetCurrentProcessorNumberEx(ptr) ntdll.RtlGetCurrentProcessorNumberEx
|
@ stdcall GetCurrentProcessorNumberEx(ptr) ntdll.RtlGetCurrentProcessorNumberEx
|
||||||
@ stdcall -norelay GetCurrentThread()
|
@ stdcall -norelay GetCurrentThread()
|
||||||
@ stdcall -norelay GetCurrentThreadId()
|
@ stdcall -norelay GetCurrentThreadId()
|
||||||
|
@ stdcall GetCurrentThreadStackLimits(ptr ptr)
|
||||||
@ stdcall -arch=x86_64 GetCurrentUmsThread()
|
@ stdcall -arch=x86_64 GetCurrentUmsThread()
|
||||||
@ stdcall GetDateFormatA(long long ptr str ptr long)
|
@ stdcall GetDateFormatA(long long ptr str ptr long)
|
||||||
@ stdcall GetDateFormatEx(wstr long ptr wstr ptr long wstr)
|
@ stdcall GetDateFormatEx(wstr long ptr wstr ptr long wstr)
|
||||||
|
|
|
@ -76,6 +76,7 @@
|
||||||
#define ARCH "none"
|
#define ARCH "none"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void (WINAPI *pGetCurrentThreadStackLimits)(PULONG_PTR,PULONG_PTR);
|
||||||
static BOOL (WINAPI *pGetThreadPriorityBoost)(HANDLE,PBOOL);
|
static BOOL (WINAPI *pGetThreadPriorityBoost)(HANDLE,PBOOL);
|
||||||
static HANDLE (WINAPI *pOpenThread)(DWORD,BOOL,DWORD);
|
static HANDLE (WINAPI *pOpenThread)(DWORD,BOOL,DWORD);
|
||||||
static BOOL (WINAPI *pQueueUserWorkItem)(LPTHREAD_START_ROUTINE,PVOID,ULONG);
|
static BOOL (WINAPI *pQueueUserWorkItem)(LPTHREAD_START_ROUTINE,PVOID,ULONG);
|
||||||
|
@ -992,6 +993,29 @@ static VOID test_thread_processor(void)
|
||||||
win_skip("Get/SetThreadGroupAffinity not available\n");
|
win_skip("Get/SetThreadGroupAffinity not available\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VOID test_GetCurrentThreadStackLimits(void)
|
||||||
|
{
|
||||||
|
ULONG_PTR low = 0, high = 0;
|
||||||
|
|
||||||
|
if (!pGetCurrentThreadStackLimits)
|
||||||
|
{
|
||||||
|
win_skip("GetCurrentThreadStackLimits not available.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
/* crashes on native */
|
||||||
|
pGetCurrentThreadStackLimits(NULL, NULL);
|
||||||
|
pGetCurrentThreadStackLimits(NULL, &high);
|
||||||
|
pGetCurrentThreadStackLimits(&low, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
pGetCurrentThreadStackLimits(&low, &high);
|
||||||
|
ok(low == (ULONG_PTR)NtCurrentTeb()->DeallocationStack, "exptected %p, got %lx\n", NtCurrentTeb()->DeallocationStack, low);
|
||||||
|
ok(high == (ULONG_PTR)NtCurrentTeb()->Tib.StackBase, "exptected %p, got %lx\n", NtCurrentTeb()->Tib.StackBase, high);
|
||||||
|
}
|
||||||
|
|
||||||
static VOID test_GetThreadExitCode(void)
|
static VOID test_GetThreadExitCode(void)
|
||||||
{
|
{
|
||||||
DWORD exitCode, threadid;
|
DWORD exitCode, threadid;
|
||||||
|
@ -1999,6 +2023,7 @@ static void init_funcs(void)
|
||||||
so that the compile passes */
|
so that the compile passes */
|
||||||
|
|
||||||
#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f)
|
#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f)
|
||||||
|
X(GetCurrentThreadStackLimits);
|
||||||
X(GetThreadPriorityBoost);
|
X(GetThreadPriorityBoost);
|
||||||
X(OpenThread);
|
X(OpenThread);
|
||||||
X(QueueUserWorkItem);
|
X(QueueUserWorkItem);
|
||||||
|
@ -2084,6 +2109,7 @@ START_TEST(thread)
|
||||||
test_TerminateThread();
|
test_TerminateThread();
|
||||||
test_CreateThread_stack();
|
test_CreateThread_stack();
|
||||||
test_thread_priority();
|
test_thread_priority();
|
||||||
|
test_GetCurrentThreadStackLimits();
|
||||||
test_GetThreadTimes();
|
test_GetThreadTimes();
|
||||||
test_thread_processor();
|
test_thread_processor();
|
||||||
test_GetThreadExitCode();
|
test_GetThreadExitCode();
|
||||||
|
|
|
@ -701,6 +701,15 @@ HANDLE WINAPI GetCurrentThread(void)
|
||||||
return (HANDLE)~(ULONG_PTR)1;
|
return (HANDLE)~(ULONG_PTR)1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* GetCurrentThreadStackLimits (KERNEL32.@)
|
||||||
|
*/
|
||||||
|
void WINAPI GetCurrentThreadStackLimits(ULONG_PTR *low, ULONG_PTR *high)
|
||||||
|
{
|
||||||
|
*low = (ULONG_PTR)NtCurrentTeb()->DeallocationStack;
|
||||||
|
*high = (ULONG_PTR)NtCurrentTeb()->Tib.StackBase;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
|
|
||||||
|
|
|
@ -471,7 +471,7 @@
|
||||||
# @ stub GetCurrentTargetPlatformContext
|
# @ stub GetCurrentTargetPlatformContext
|
||||||
@ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread
|
@ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread
|
||||||
@ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId
|
@ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId
|
||||||
# @ stub GetCurrentThreadStackLimits
|
@ stdcall GetCurrentThreadStackLimits(ptr ptr) kernel32.GetCurrentThreadStackLimits
|
||||||
@ stdcall GetDateFormatA(long long ptr str ptr long) kernel32.GetDateFormatA
|
@ stdcall GetDateFormatA(long long ptr str ptr long) kernel32.GetDateFormatA
|
||||||
@ stdcall GetDateFormatEx(wstr long ptr wstr ptr long wstr) kernel32.GetDateFormatEx
|
@ stdcall GetDateFormatEx(wstr long ptr wstr ptr long wstr) kernel32.GetDateFormatEx
|
||||||
@ stdcall GetDateFormatW(long long ptr wstr ptr long) kernel32.GetDateFormatW
|
@ stdcall GetDateFormatW(long long ptr wstr ptr long) kernel32.GetDateFormatW
|
||||||
|
|
Loading…
Reference in New Issue