Mark Jansen : kernel32/tests: Close process / thread handles.
Alexandre Julliard
julliard at winehq.org
Fri Feb 23 15:10:23 CST 2018
Module: wine
Branch: master
Commit: 85f515292aa5264e6affde6ba7e05a30f05c6684
URL: https://source.winehq.org/git/wine.git/?a=commit;h=85f515292aa5264e6affde6ba7e05a30f05c6684
Author: Mark Jansen <mark.jansen at reactos.org>
Date: Fri Feb 23 12:16:58 2018 +0100
kernel32/tests: Close process / thread handles.
Signed-off-by: Mark Jansen <mark.jansen at reactos.org>
Signed-off-by: Thomas Faber <thomas.faber at reactos.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/tests/process.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index 59df58a..cbca00e 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -618,6 +618,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);
@@ -656,6 +658,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);
@@ -694,6 +698,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);
@@ -732,6 +738,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);
@@ -770,6 +778,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);
@@ -810,6 +820,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);
@@ -848,6 +860,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);
@@ -888,6 +902,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");
@@ -909,6 +925,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\\");
@@ -930,6 +948,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();
@@ -945,6 +965,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();
@@ -965,6 +987,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);
@@ -988,6 +1012,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);
@@ -1085,6 +1111,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();
@@ -1093,6 +1121,8 @@ static void test_Directory(void)
/* search PATH for the exe if directory is NULL */
ok(CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess\n");
ok(TerminateProcess(info.hProcess, 0), "Child process termination\n");
+ CloseHandle(info.hThread);
+ CloseHandle(info.hProcess);
/* if any directory is provided, don't search PATH, error on bad directory */
SetLastError(0xdeadbeef);
More information about the wine-cvs
mailing list