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
645802d7
Commit
645802d7
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 directory buffer.
parent
fd12e340
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
shlexec.c
dlls/shell32/shlexec.c
+26
-6
No files found.
dlls/shell32/shlexec.c
View file @
645802d7
...
...
@@ -1381,10 +1381,11 @@ 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
];
WCHAR
*
wszApplicationName
,
*
wszParameters
,
wszDir
[
MAX_PATH
]
;
WCHAR
parametersBuffer
[
1024
]
,
dirBuffer
[
MAX_PATH
]
;
WCHAR
*
wszApplicationName
,
*
wszParameters
,
*
wszDir
;
DWORD
dwApplicationNameLen
=
MAX_PATH
+
2
;
DWORD
parametersLen
=
sizeof
(
parametersBuffer
)
/
sizeof
(
WCHAR
);
DWORD
dirLen
=
sizeof
(
dirBuffer
)
/
sizeof
(
WCHAR
);
DWORD
len
;
SHELLEXECUTEINFOW
sei_tmp
;
/* modifiable copy of SHELLEXECUTEINFO struct */
WCHAR
wfileName
[
MAX_PATH
];
...
...
@@ -1444,8 +1445,17 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
else
*
wszParameters
=
'\0'
;
wszDir
=
dirBuffer
;
if
(
sei_tmp
.
lpDirectory
)
{
len
=
lstrlenW
(
sei_tmp
.
lpDirectory
)
+
1
;
if
(
len
>
dirLen
)
{
wszDir
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
dirLen
=
len
;
}
strcpyW
(
wszDir
,
sei_tmp
.
lpDirectory
);
}
else
*
wszDir
=
'\0'
;
...
...
@@ -1476,6 +1486,8 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
HeapFree
(
GetProcessHeap
(),
0
,
wszApplicationName
);
if
(
wszParameters
!=
parametersBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszParameters
);
if
(
wszDir
!=
dirBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszDir
);
return
TRUE
;
}
}
...
...
@@ -1491,6 +1503,8 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
HeapFree
(
GetProcessHeap
(),
0
,
wszApplicationName
);
if
(
wszParameters
!=
parametersBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszParameters
);
if
(
wszDir
!=
dirBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszDir
);
return
TRUE
;
}
...
...
@@ -1501,6 +1515,8 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
HeapFree
(
GetProcessHeap
(),
0
,
wszApplicationName
);
if
(
wszParameters
!=
parametersBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszParameters
);
if
(
wszDir
!=
dirBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszDir
);
return
retval
>
32
;
}
...
...
@@ -1555,10 +1571,10 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
len
++
;
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
ExpandEnvironmentStringsW
(
sei_tmp
.
lpDirectory
,
buf
,
len
);
if
(
len
>
1024
)
ERR
(
"Directory exceeds buffer size (%i > 1024)
\n
"
,
len
);
lstrcpynW
(
wszDir
,
buf
,
min
(
1024
,
len
))
;
HeapFree
(
GetProcessHeap
(),
0
,
buf
)
;
if
(
wszDir
!=
dirBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszDir
);
wszDir
=
buf
;
sei_tmp
.
lpDirectory
=
wszDir
;
}
}
...
...
@@ -1640,6 +1656,8 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
HeapFree
(
GetProcessHeap
(),
0
,
wszApplicationName
);
if
(
wszParameters
!=
parametersBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszParameters
);
if
(
wszDir
!=
dirBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszDir
);
return
TRUE
;
}
...
...
@@ -1711,6 +1729,8 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
HeapFree
(
GetProcessHeap
(),
0
,
wszApplicationName
);
if
(
wszParameters
!=
parametersBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszParameters
);
if
(
wszDir
!=
dirBuffer
)
HeapFree
(
GetProcessHeap
(),
0
,
wszDir
);
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