Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
446ade3b
Commit
446ade3b
authored
Jan 29, 2016
by
Francois Gouget
Committed by
Alexandre Julliard
Jan 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Test environment variable inheritance with ShellExecute().
Signed-off-by:
Francois Gouget
<
fgouget@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bdfaa8c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
shlexec.c
dlls/shell32/tests/shlexec.c
+28
-7
No files found.
dlls/shell32/tests/shlexec.c
View file @
446ade3b
...
...
@@ -209,7 +209,7 @@ static void CALLBACK childTimeout(HWND wnd, UINT msg, UINT_PTR timer, DWORD time
static
void
doChild
(
int
argc
,
char
**
argv
)
{
char
*
filename
,
longpath
[
MAX_PATH
]
=
""
;
char
*
filename
,
buffer
[
MAX_PATH
]
;
HANDLE
hFile
,
map
;
int
i
;
int
rc
;
...
...
@@ -239,8 +239,15 @@ static void doChild(int argc, char** argv)
trace
(
"argvA%d='%s'
\n
"
,
i
,
argv
[
i
]);
childPrintf
(
hFile
,
"argvA%d=%s
\r\n
"
,
i
,
encodeA
(
argv
[
i
]));
}
GetModuleFileNameA
(
GetModuleHandleA
(
NULL
),
longpath
,
MAX_PATH
);
childPrintf
(
hFile
,
"longPath=%s
\r\n
"
,
encodeA
(
longpath
));
GetModuleFileNameA
(
GetModuleHandleA
(
NULL
),
buffer
,
sizeof
(
buffer
));
childPrintf
(
hFile
,
"longPath=%s
\r\n
"
,
encodeA
(
buffer
));
/* Check environment variable inheritance */
*
buffer
=
'\0'
;
SetLastError
(
0
);
GetEnvironmentVariableA
(
"ShlexecVar"
,
buffer
,
sizeof
(
buffer
));
childPrintf
(
hFile
,
"ShlexecVarLE=%d
\r\n
"
,
GetLastError
());
childPrintf
(
hFile
,
"ShlexecVar=%s
\r\n
"
,
encodeA
(
buffer
));
map
=
OpenFileMappingA
(
FILE_MAP_READ
,
FALSE
,
"winetest_shlexec_dde_map"
);
if
(
map
!=
NULL
)
...
...
@@ -314,6 +321,11 @@ static void dump_child_(const char* file, int line)
trace_
(
file
,
line
)(
"%s='%s'
\n
"
,
key
,
str
);
}
c
=
GetPrivateProfileIntA
(
"Child"
,
"ShlexecVarLE"
,
-
1
,
child_file
);
trace_
(
file
,
line
)(
"ShlexecVarLE=%d
\n
"
,
c
);
str
=
getChildString
(
"Child"
,
"ShlexecVar"
);
trace_
(
file
,
line
)(
"ShlexecVar='%s'
\n
"
,
str
);
c
=
GetPrivateProfileIntA
(
"Child"
,
"Failures"
,
-
1
,
child_file
);
trace_
(
file
,
line
)(
"Failures=%d
\n
"
,
c
);
}
...
...
@@ -527,10 +539,13 @@ static INT_PTR shell_execute_(const char* file, int line, LPCSTR verb, LPCSTR fi
WritePrivateProfileStringA
(
NULL
,
NULL
,
NULL
,
child_file
);
if
(
GetFileAttributesA
(
child_file
)
!=
INVALID_FILE_ATTRIBUTES
)
{
int
c
=
GetPrivateProfileIntA
(
"Child"
,
"Failures"
,
-
1
,
child_file
);
int
c
;
dump_child_
(
file
,
line
);
c
=
GetPrivateProfileIntA
(
"Child"
,
"Failures"
,
-
1
,
child_file
);
if
(
c
>
0
)
winetest_add_failures
(
c
);
dump_child_
(
file
,
line
);
okChildInt_
(
file
,
line
,
"ShlexecVarLE"
,
0
);
okChildString_
(
file
,
line
,
"ShlexecVar"
,
"Present"
,
"Present"
);
}
if
(
!
verb
)
...
...
@@ -637,10 +652,13 @@ static INT_PTR shell_execute_ex_(const char* file, int line,
WritePrivateProfileStringA
(
NULL
,
NULL
,
NULL
,
child_file
);
if
(
GetFileAttributesA
(
child_file
)
!=
INVALID_FILE_ATTRIBUTES
)
{
int
c
=
GetPrivateProfileIntA
(
"Child"
,
"Failures"
,
-
1
,
child_file
);
int
c
;
dump_child_
(
file
,
line
);
c
=
GetPrivateProfileIntA
(
"Child"
,
"Failures"
,
-
1
,
child_file
);
if
(
c
>
0
)
winetest_add_failures
(
c
);
dump_child_
(
file
,
line
);
okChildInt_
(
file
,
line
,
"ShlexecVarLE"
,
0
);
okChildString_
(
file
,
line
,
"ShlexecVar"
,
"Present"
,
"Present"
);
}
return
rc
;
...
...
@@ -2736,6 +2754,9 @@ static void init_test(void)
create_test_verb
(
".shlexec"
,
"QuotedLowerL"
,
0
,
"QuotedLowerL
\"
%l
\"
"
);
create_test_verb
(
".shlexec"
,
"UpperL"
,
0
,
"UpperL %L"
);
create_test_verb
(
".shlexec"
,
"QuotedUpperL"
,
0
,
"QuotedUpperL
\"
%L
\"
"
);
/* Set an environment variable to see if it is inherited */
SetEnvironmentVariableA
(
"ShlexecVar"
,
"Present"
);
}
static
void
cleanup_test
(
void
)
...
...
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