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
1708adeb
Commit
1708adeb
authored
Dec 04, 2012
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Dec 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Fix DoEnvironmentSubstA implementation.
parent
ff2f4941
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
shellord.c
dlls/shell32/shellord.c
+14
-20
No files found.
dlls/shell32/shellord.c
View file @
1708adeb
...
...
@@ -1590,39 +1590,33 @@ BOOL WINAPI SHValidateUNC (HWND hwndOwner, PWSTR pszFile, UINT fConnect)
}
/************************************************************************
*
DoEnvironmentSubstA
[SHELL32.@]
*
DoEnvironmentSubstA
[SHELL32.@]
*
* Replace %KEYWORD% in the str with the value of variable KEYWORD
* from environment. If it is not found the %KEYWORD% is left
* intact. If the buffer is too small, str is not modified.
*
* PARAMS
* pszString [I] '\0' terminated string with %keyword%.
* [O] '\0' terminated string with %keyword% substituted.
* cchString [I] size of str.
*
* RETURNS
* cchString length in the HIWORD;
* TRUE in LOWORD if subst was successful and FALSE in other case
* See DoEnvironmentSubstW.
*/
DWORD
WINAPI
DoEnvironmentSubstA
(
LPSTR
pszString
,
UINT
cchString
)
{
LPSTR
dst
;
BOOL
res
=
FALSE
;
FIXME
(
"(%s, %d) stub
\n
"
,
debugstr_a
(
pszString
),
cchString
);
if
(
pszString
==
NULL
)
/* Really return 0? */
return
0
;
DWORD
len
=
cchString
;
TRACE
(
"(%s, %d)
\n
"
,
debugstr_a
(
pszString
),
cchString
);
if
((
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cchString
*
sizeof
(
CHAR
))))
{
DWORD
num
=
ExpandEnvironmentStringsA
(
pszString
,
dst
,
cchString
);
if
(
num
&&
num
<
cchString
)
/* dest buffer is too small */
len
=
ExpandEnvironmentStringsA
(
pszString
,
dst
,
cchString
);
/* len includes the terminating 0 */
if
(
len
&&
len
<
cchString
)
{
res
=
TRUE
;
memcpy
(
pszString
,
dst
,
num
);
memcpy
(
pszString
,
dst
,
len
);
}
else
len
=
cchString
;
HeapFree
(
GetProcessHeap
(),
0
,
dst
);
}
return
MAKELONG
(
res
,
cchString
);
/* Always cchString? */
return
MAKELONG
(
len
,
res
);
}
/************************************************************************
...
...
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