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
f2748c7a
Commit
f2748c7a
authored
Nov 16, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Nov 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Dynamically allocate buffer for command.
parent
75ba7119
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
shlexec.c
dlls/shell32/shlexec.c
+17
-4
No files found.
dlls/shell32/shlexec.c
View file @
f2748c7a
...
...
@@ -1417,11 +1417,12 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
SEE_MASK_CONNECTNETDRV
|
SEE_MASK_FLAG_DDEWAIT
|
SEE_MASK_FLAG_NO_UI
|
SEE_MASK_UNICODE
|
SEE_MASK_ASYNCOK
|
SEE_MASK_HMONITOR
;
WCHAR
parametersBuffer
[
1024
],
dirBuffer
[
MAX_PATH
];
WCHAR
*
wszApplicationName
,
*
wszParameters
,
*
wszDir
;
WCHAR
parametersBuffer
[
1024
],
dirBuffer
[
MAX_PATH
]
,
wcmdBuffer
[
1024
]
;
WCHAR
*
wszApplicationName
,
*
wszParameters
,
*
wszDir
,
*
wcmd
;
DWORD
dwApplicationNameLen
=
MAX_PATH
+
2
;
DWORD
parametersLen
=
sizeof
(
parametersBuffer
)
/
sizeof
(
WCHAR
);
DWORD
dirLen
=
sizeof
(
dirBuffer
)
/
sizeof
(
WCHAR
);
DWORD
wcmdLen
=
sizeof
(
wcmdBuffer
)
/
sizeof
(
WCHAR
);
DWORD
len
;
SHELLEXECUTEINFOW
sei_tmp
;
/* modifiable copy of SHELLEXECUTEINFO struct */
WCHAR
wfileName
[
MAX_PATH
];
...
...
@@ -1429,7 +1430,6 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
WCHAR
lpstrProtocol
[
256
];
LPCWSTR
lpFile
;
UINT_PTR
retval
=
SE_ERR_NOASSOC
;
WCHAR
wcmd
[
1024
];
BOOL
appKnownSingular
=
FALSE
;
/* make a local copy of the LPSHELLEXECUTEINFO structure and work with this from now on */
...
...
@@ -1681,6 +1681,15 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
lpFile
=
wfileName
;
wcmd
=
wcmdBuffer
;
len
=
lstrlenW
(
wszApplicationName
)
+
1
;
if
(
sei_tmp
.
lpParameters
[
0
])
len
+=
1
+
lstrlenW
(
wszParameters
);
if
(
len
>
wcmdLen
)
{
wcmd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
wcmdLen
=
len
;
}
strcpyW
(
wcmd
,
wszApplicationName
);
if
(
sei_tmp
.
lpParameters
[
0
])
{
strcatW
(
wcmd
,
wSpace
);
...
...
@@ -1694,12 +1703,14 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
HeapFree
(
GetProcessHeap
(),
0
,
wszParameters
);
if
(
wszDir
!=
dirBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszDir
);
if
(
wcmd
!=
wcmdBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wcmd
);
return
TRUE
;
}
/* Else, try to find the executable */
wcmd
[
0
]
=
'\0'
;
retval
=
SHELL_FindExecutable
(
sei_tmp
.
lpDirectory
,
lpFile
,
sei_tmp
.
lpVerb
,
wcmd
,
1024
,
lpstrProtocol
,
&
env
,
sei_tmp
.
lpIDList
,
sei_tmp
.
lpParameters
);
retval
=
SHELL_FindExecutable
(
sei_tmp
.
lpDirectory
,
lpFile
,
sei_tmp
.
lpVerb
,
wcmd
,
wcmdLen
,
lpstrProtocol
,
&
env
,
sei_tmp
.
lpIDList
,
sei_tmp
.
lpParameters
);
if
(
retval
>
32
)
/* Found */
{
retval
=
SHELL_quote_and_execute
(
wcmd
,
wszParameters
,
lpstrProtocol
,
...
...
@@ -1754,6 +1765,8 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
HeapFree
(
GetProcessHeap
(),
0
,
wszParameters
);
if
(
wszDir
!=
dirBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszDir
);
if
(
wcmd
!=
wcmdBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wcmd
);
sei
->
hInstApp
=
(
HINSTANCE
)(
retval
>
32
?
33
:
retval
);
return
retval
>
32
;
...
...
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