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
b39c3981
Commit
b39c3981
authored
Jun 20, 2005
by
Vitaly Lipatov
Committed by
Alexandre Julliard
Jun 20, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA.
- Fix types and return values. - Add prototype into shellapi.h.
parent
09b7503f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
12 deletions
+41
-12
shellord.c
dlls/shell32/shellord.c
+37
-12
shellapi.h
include/shellapi.h
+4
-0
No files found.
dlls/shell32/shellord.c
View file @
b39c3981
...
...
@@ -1354,32 +1354,57 @@ HRESULT WINAPI SHValidateUNC (DWORD x, DWORD y, DWORD z)
/************************************************************************
* DoEnvironmentSubstA [SHELL32.@]
*
*/
HRESULT
WINAPI
DoEnvironmentSubstA
(
LPSTR
x
,
LPSTR
y
)
{
FIXME
(
"(%s, %s) stub
\n
"
,
debugstr_a
(
x
),
debugstr_a
(
y
));
return
0
;
* 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.
*
* pszString [I] '\0' terminated string with %keyword%.
* [O] '\0' terminated string with %keyword% substituted.
* cchString [I] size of str.
*
* Return
* cchString length in the HIWORD;
* TRUE in LOWORD if subst was successful and FALSE in other case
*/
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
;
if
((
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cchString
*
sizeof
(
CHAR
))))
{
DWORD
num
=
ExpandEnvironmentStringsA
(
pszString
,
dst
,
cchString
);
if
(
num
&&
num
<
cchString
)
/* dest buffer is too small */
{
res
=
TRUE
;
memcpy
(
pszString
,
dst
,
num
);
}
HeapFree
(
GetProcessHeap
(),
0
,
dst
);
}
return
MAKELONG
(
res
,
cchString
);
/* Always cchString? */
}
/************************************************************************
* DoEnvironmentSubstW [SHELL32.@]
*
*/
HRESULT
WINAPI
DoEnvironmentSubstW
(
LPWSTR
x
,
LPWSTR
y
)
DWORD
WINAPI
DoEnvironmentSubstW
(
LPWSTR
pszString
,
UINT
cchString
)
{
FIXME
(
"(%s, %
s): stub
\n
"
,
debugstr_w
(
x
),
debugstr_w
(
y
)
);
return
0
;
FIXME
(
"(%s, %
d): stub
\n
"
,
debugstr_w
(
pszString
),
cchString
);
return
MAKELONG
(
FALSE
,
cchString
)
;
}
/************************************************************************
* DoEnvironmentSubst [SHELL32.53]
*
*/
HRESULT
WINAPI
DoEnvironmentSubstAW
(
LPVOID
x
,
LPVOID
y
)
DWORD
WINAPI
DoEnvironmentSubstAW
(
LPVOID
x
,
UINT
y
)
{
if
(
SHELL_OsIsUnicode
())
return
DoEnvironmentSubstW
(
x
,
y
);
return
DoEnvironmentSubstA
(
x
,
y
);
if
(
SHELL_OsIsUnicode
())
return
DoEnvironmentSubstW
(
x
,
y
);
return
DoEnvironmentSubstA
(
x
,
y
);
}
/*************************************************************************
...
...
include/shellapi.h
View file @
b39c3981
...
...
@@ -442,6 +442,10 @@ BOOL WINAPI ShellAboutW(HWND,LPCWSTR,LPCWSTR,HICON);
int
WINAPIV
ShellMessageBoxA
(
HINSTANCE
,
HWND
,
LPCSTR
,
LPCSTR
,
UINT
,...);
int
WINAPIV
ShellMessageBoxW
(
HINSTANCE
,
HWND
,
LPCWSTR
,
LPCWSTR
,
UINT
,...);
#define ShellMessageBox WINELIB_NAME_AW(ShellMessageBox)
DWORD
WINAPI
DoEnvironmentSubstA
(
LPSTR
,
UINT
);
DWORD
WINAPI
DoEnvironmentSubstW
(
LPWSTR
,
UINT
);
#define DoEnvironmentSubst WINELIB_NAME_AW(DoEnvironmentSubst)
#ifdef __cplusplus
}
/* extern "C" */
...
...
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