Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
70d67bec
Commit
70d67bec
authored
Jan 21, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jan 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Free environment strings buffer at the conclusion of the environment tests.
parent
6c8f8a64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
process.c
dlls/kernel32/tests/process.c
+17
-14
No files found.
dlls/kernel32/tests/process.c
View file @
70d67bec
...
...
@@ -1102,10 +1102,11 @@ static void test_Environment(void)
char
buffer
[
MAX_PATH
];
PROCESS_INFORMATION
info
;
STARTUPINFOA
startup
;
char
*
child_env
;
char
*
child_env
;
int
child_env_len
;
char
*
ptr
;
char
*
env
;
char
*
ptr
;
char
*
ptr2
;
char
*
env
;
int
slen
;
memset
(
&
startup
,
0
,
sizeof
(
startup
));
...
...
@@ -1121,8 +1122,9 @@ static void test_Environment(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
);
cmpEnvironment
(
GetEnvironmentStringsA
());
env
=
GetEnvironmentStringsA
();
cmpEnvironment
(
env
);
release_memory
();
assert
(
DeleteFileA
(
resfile
)
!=
0
);
...
...
@@ -1134,9 +1136,9 @@ static void test_Environment(void)
/* the basics */
get_file_name
(
resfile
);
sprintf
(
buffer
,
"
\"
%s
\"
tests/process.c
\"
%s
\"
"
,
selfname
,
resfile
);
child_env_len
=
0
;
ptr
=
GetEnvironmentStringsA
()
;
ptr
=
env
;
while
(
*
ptr
)
{
slen
=
strlen
(
ptr
)
+
1
;
...
...
@@ -1146,7 +1148,7 @@ static void test_Environment(void)
/* Add space for additional environment variables */
child_env_len
+=
256
;
child_env
=
HeapAlloc
(
GetProcessHeap
(),
0
,
child_env_len
);
ptr
=
child_env
;
sprintf
(
ptr
,
"=%c:=%s"
,
'C'
,
"C:
\\
FOO
\\
BAR"
);
ptr
+=
strlen
(
ptr
)
+
1
;
...
...
@@ -1161,13 +1163,13 @@ static void test_Environment(void)
* - PATH (already set above)
* - the directory definitions (=[A-Z]:=)
*/
for
(
env
=
GetEnvironmentStringsA
();
*
env
;
env
+=
strlen
(
env
)
+
1
)
for
(
ptr2
=
env
;
*
ptr2
;
ptr2
+=
strlen
(
ptr2
)
+
1
)
{
if
(
strncmp
(
env
,
"PATH="
,
5
)
!=
0
&&
strncmp
(
env
,
"WINELOADER="
,
11
)
!=
0
&&
!
is_str_env_drive_dir
(
env
))
if
(
strncmp
(
ptr2
,
"PATH="
,
5
)
!=
0
&&
strncmp
(
ptr2
,
"WINELOADER="
,
11
)
!=
0
&&
!
is_str_env_drive_dir
(
ptr2
))
{
strcpy
(
ptr
,
env
);
strcpy
(
ptr
,
ptr2
);
ptr
+=
strlen
(
ptr
)
+
1
;
}
}
...
...
@@ -1177,10 +1179,11 @@ static void test_Environment(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
);
cmpEnvironment
(
child_env
);
HeapFree
(
GetProcessHeap
(),
0
,
child_env
);
FreeEnvironmentStringsA
(
env
);
release_memory
();
assert
(
DeleteFileA
(
resfile
)
!=
0
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment