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
ff2f4941
Commit
ff2f4941
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: Implement DoEnvironmentSubstW.
parent
1cf2c9c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
4 deletions
+37
-4
shellord.c
dlls/shell32/shellord.c
+37
-4
No files found.
dlls/shell32/shellord.c
View file @
ff2f4941
...
...
@@ -1626,14 +1626,47 @@ DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
}
/************************************************************************
*
DoEnvironmentSubstW
[SHELL32.@]
*
DoEnvironmentSubstW
[SHELL32.@]
*
* See DoEnvironmentSubstA.
* Replace all %KEYWORD% in the string with the value of the named
* environment variable. If the buffer is too small, the string is not modified.
*
* PARAMS
* pszString [I] '\0' terminated string with %keyword%.
* [O] '\0' terminated string with %keyword% substituted.
* cchString [I] size of str.
*
* RETURNS
* Success: The string in the buffer is updated
* HIWORD: TRUE
* LOWORD: characters used in the buffer, including space for the terminating 0
* Failure: buffer too small. The string is not modified.
* HIWORD: FALSE
* LOWORD: provided size of the buffer in characters
*/
DWORD
WINAPI
DoEnvironmentSubstW
(
LPWSTR
pszString
,
UINT
cchString
)
{
FIXME
(
"(%s, %d): stub
\n
"
,
debugstr_w
(
pszString
),
cchString
);
return
MAKELONG
(
FALSE
,
cchString
);
LPWSTR
dst
;
BOOL
res
=
FALSE
;
DWORD
len
=
cchString
;
TRACE
(
"(%s, %d)
\n
"
,
debugstr_w
(
pszString
),
cchString
);
if
((
cchString
<
MAXLONG
)
&&
(
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cchString
*
sizeof
(
WCHAR
))))
{
len
=
ExpandEnvironmentStringsW
(
pszString
,
dst
,
cchString
);
/* len includes the terminating 0 */
if
(
len
&&
len
<=
cchString
)
{
res
=
TRUE
;
memcpy
(
pszString
,
dst
,
len
*
sizeof
(
WCHAR
));
}
else
len
=
cchString
;
HeapFree
(
GetProcessHeap
(),
0
,
dst
);
}
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