From 6e45c17182224723f0bafa94623b1e37d81e89c8 Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Sun, 5 Nov 2023 22:02:27 -0700 Subject: [PATCH] ntoskrnl/tests: Put test_input on the stack in the main_test function. --- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 6ca4324f11b..13258b05291 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -44,7 +44,6 @@ #include "ddk/hidsdi.h" #include "ddk/hidpi.h" #include "wine/test.h" -#include "wine/heap.h" #include "wine/mssign.h" #include "driver.h" @@ -397,21 +396,18 @@ static ULONG64 modified_value; static void main_test(void) { - struct main_test_input *test_input; + struct main_test_input test_input; DWORD size; BOOL res; - test_input = heap_alloc( sizeof(*test_input) ); - test_input->process_id = GetCurrentProcessId(); - test_input->teststr_offset = (SIZE_T)((BYTE *)&teststr - (BYTE *)NtCurrentTeb()->Peb->ImageBaseAddress); - test_input->modified_value = &modified_value; + test_input.process_id = GetCurrentProcessId(); + test_input.teststr_offset = (SIZE_T)((BYTE *)&teststr - (BYTE *)NtCurrentTeb()->Peb->ImageBaseAddress); + test_input.modified_value = &modified_value; modified_value = 0; - res = DeviceIoControl(device, IOCTL_WINETEST_MAIN_TEST, test_input, sizeof(*test_input), NULL, 0, &size, NULL); + res = DeviceIoControl(device, IOCTL_WINETEST_MAIN_TEST, &test_input, sizeof(test_input), NULL, 0, &size, NULL); ok(res, "DeviceIoControl failed: %lu\n", GetLastError()); ok(!size, "got size %lu\n", size); - - heap_free(test_input); } static void test_basic_ioctl(void) -- 2.11.4.GIT