wine-staging/patches/kernel32-Tests/0001-kernel32-tests-Close-process-thread-handles.patch

144 lines
7.2 KiB
Diff
Raw Normal View History

From f1b8afc713f881f8c0ff5328d030dda53ba166ec Mon Sep 17 00:00:00 2001
From: Mark Jansen <mark.jansen@reactos.org>
Date: Fri, 22 Sep 2017 11:20:27 +0200
Subject: kernel32/tests: Close process / thread handles
Signed-off-by: Mark Jansen <mark.jansen@reactos.org>
---
dlls/kernel32/tests/process.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index 0ff1fb165c8..d2afdbdfd71 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -620,6 +620,8 @@ static void test_Startup(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
GetStartupInfoA(&si);
okChildInt("StartupInfoA", "cb", startup.cb);
@@ -658,6 +660,8 @@ static void test_Startup(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
okChildInt("StartupInfoA", "cb", startup.cb);
okChildString("StartupInfoA", "lpDesktop", startup.lpDesktop);
@@ -696,6 +700,8 @@ static void test_Startup(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
okChildInt("StartupInfoA", "cb", startup.cb);
okChildString("StartupInfoA", "lpDesktop", si.lpDesktop);
@@ -734,6 +740,8 @@ static void test_Startup(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
okChildInt("StartupInfoA", "cb", startup.cb);
okChildString("StartupInfoA", "lpDesktop", startup.lpDesktop);
@@ -772,6 +780,8 @@ static void test_Startup(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
okChildInt("StartupInfoA", "cb", startup.cb);
okChildString("StartupInfoA", "lpDesktop", startup.lpDesktop);
@@ -812,6 +822,8 @@ static void test_Startup(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
okChildInt("StartupInfoA", "cb", startup.cb);
okChildString("StartupInfoA", "lpDesktop", startup.lpDesktop);
@@ -850,6 +862,8 @@ static void test_Startup(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
okChildInt("StartupInfoA", "cb", startup.cb);
okChildString("StartupInfoA", "lpDesktop", startup.lpDesktop);
@@ -890,6 +904,8 @@ static void test_CommandLine(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
okChildInt("Arguments", "argcA", 5);
okChildString("Arguments", "argvA4", "C:\\Program Files\\my nice app.exe");
@@ -911,6 +927,8 @@ static void test_CommandLine(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
okChildInt("Arguments", "argcA", 7);
okChildString("Arguments", "argvA4", "a\"b\\");
@@ -932,6 +950,8 @@ static void test_CommandLine(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
sprintf(buffer, "./%s", exename);
okChildString("Arguments", "argvA0", buffer);
release_memory();
@@ -947,6 +967,8 @@ static void test_CommandLine(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
sprintf(buffer, ".\\%s", exename);
okChildString("Arguments", "argvA0", buffer);
release_memory();
@@ -967,6 +989,8 @@ static void test_CommandLine(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
if (p) sprintf(buffer, "..%s/%s", p, exename);
else sprintf(buffer, "./%s", exename);
okChildString("Arguments", "argvA0", buffer);
@@ -990,6 +1014,8 @@ static void test_CommandLine(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
sprintf(buffer, "tests/process.c dump %s", resfile);
okChildString("Arguments", "argvA0", "dummy");
okChildString("Arguments", "CommandLineA", buffer2);
@@ -1087,6 +1113,8 @@ static void test_Directory(void)
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
okChildIString("Misc", "CurrDirA", windir);
release_memory();
--
2.14.1