ntoskrnl.exe: Implement IoGetStackLimits.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47017
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-06-24 16:25:00 +02:00 committed by Alexandre Julliard
parent d5249c0f6d
commit 8b787945ef
4 changed files with 25 additions and 1 deletions

View File

@ -1689,6 +1689,18 @@ PCONFIGURATION_INFORMATION WINAPI IoGetConfigurationInformation(void)
return &configuration_information;
}
/***********************************************************************
* IoGetStackLimits (NTOSKRNL.EXE.@)
*/
void WINAPI IoGetStackLimits(ULONG_PTR *low, ULONG_PTR *high)
{
TEB *teb = NtCurrentTeb();
TRACE( "%p %p\n", low, high );
*low = (DWORD_PTR)teb->Tib.StackLimit;
*high = (DWORD_PTR)teb->Tib.StackBase;
}
/***********************************************************************
* IoIsWdmVersionAvailable (NTOSKRNL.EXE.@)

View File

@ -408,7 +408,7 @@
@ stub IoGetRequestorProcess
@ stub IoGetRequestorProcessId
@ stub IoGetRequestorSessionId
@ stub IoGetStackLimits
@ stdcall IoGetStackLimits(ptr ptr)
@ stub IoGetTopLevelIrp
@ stdcall IoInitializeIrp(ptr long long)
@ stdcall IoInitializeRemoveLockEx(ptr long long long long)

View File

@ -1436,6 +1436,16 @@ static void test_lookup_thread(void)
"PsLookupThreadByThreadId returned %#x\n", status);
}
static void test_stack_limits(void)
{
ULONG_PTR low = 0, high = 0;
IoGetStackLimits(&low, &high);
ok(low, "low = 0\n");
ok(low < high, "low >= high\n");
ok(low < (ULONG_PTR)&low && (ULONG_PTR)&low < high, "stack variable is not in stack limits\n");
}
static void test_IoAttachDeviceToDeviceStack(void)
{
DEVICE_OBJECT *dev1, *dev2, *dev3, *ret;
@ -1503,6 +1513,7 @@ static void WINAPI main_test_task(DEVICE_OBJECT *device, void *context)
test_critical_region(FALSE);
test_call_driver(device);
test_cancel_irp(device);
test_stack_limits();
/* print process report */
if (winetest_debug)

View File

@ -1586,6 +1586,7 @@ NTSTATUS WINAPI IoGetDeviceObjectPointer(UNICODE_STRING*,ACCESS_MASK,PFILE_OBJE
NTSTATUS WINAPI IoGetDeviceProperty(PDEVICE_OBJECT,DEVICE_REGISTRY_PROPERTY,ULONG,PVOID,PULONG);
PVOID WINAPI IoGetDriverObjectExtension(PDRIVER_OBJECT,PVOID);
PDEVICE_OBJECT WINAPI IoGetRelatedDeviceObject(PFILE_OBJECT);
void WINAPI IoGetStackLimits(ULONG_PTR*,ULONG_PTR*);
void WINAPI IoInitializeIrp(IRP*,USHORT,CCHAR);
VOID WINAPI IoInitializeRemoveLockEx(PIO_REMOVE_LOCK,ULONG,ULONG,ULONG,ULONG);
void WINAPI IoInvalidateDeviceRelations(PDEVICE_OBJECT,DEVICE_RELATION_TYPE);