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
53e5bd50
Commit
53e5bd50
authored
Aug 06, 2002
by
Juergen Schmied
Committed by
Alexandre Julliard
Aug 06, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement StrRetToStr in shlwapi.
parent
afe785c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
119 additions
and
2 deletions
+119
-2
shlwapi.spec
dlls/shlwapi/shlwapi.spec
+2
-2
string.c
dlls/shlwapi/string.c
+117
-0
No files found.
dlls/shlwapi/shlwapi.spec
View file @
53e5bd50
...
...
@@ -686,8 +686,8 @@ init SHLWAPI_LibMain
# exported in later versions
@ stdcall StrRetToBufA (ptr ptr ptr long) StrRetToBufA
@ stdcall StrRetToBufW (ptr ptr ptr long) StrRetToBufW
#
@ stdcall StrRetToStrA (ptr ptr ptr) StrRetToStrA
#
@ stdcall StrRetToStrW (ptr ptr ptr) StrRetToStrW
@ stdcall StrRetToStrA (ptr ptr ptr) StrRetToStrA
@ stdcall StrRetToStrW (ptr ptr ptr) StrRetToStrW
@ stdcall SHRegGetPathA(long str str ptr long)SHRegGetPathA
@ stdcall SHRegGetPathW(long wstr wstr ptr long)SHRegGetPathW
@ stub MLLoadLibraryA
...
...
dlls/shlwapi/string.c
View file @
53e5bd50
...
...
@@ -37,6 +37,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
shell
);
HRESULT
WINAPI
_SHStrDupAA
(
LPCSTR
src
,
LPSTR
*
dest
);
HRESULT
WINAPI
_SHStrDupAW
(
LPCWSTR
src
,
LPSTR
*
dest
);
/*************************************************************************
* ChrCmpIA [SHLWAPI.385]
*
...
...
@@ -559,6 +562,64 @@ HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest,
}
/*************************************************************************
* StrRetToStrA [SHLWAPI.@]
*
* converts a STRRET to a normal string
*/
HRESULT
WINAPI
StrRetToStrA
(
LPSTRRET
pstr
,
const
ITEMIDLIST
*
pidl
,
LPSTR
*
ppszName
)
{
HRESULT
ret
=
E_FAIL
;
switch
(
pstr
->
uType
)
{
case
STRRET_WSTR
:
ret
=
_SHStrDupAW
(
pstr
->
u
.
pOleStr
,
ppszName
);
CoTaskMemFree
(
pstr
->
u
.
pOleStr
);
break
;
case
STRRET_CSTR
:
ret
=
_SHStrDupAA
(
pstr
->
u
.
cStr
,
ppszName
);
break
;
case
STRRET_OFFSET
:
ret
=
_SHStrDupAA
(((
LPCSTR
)
&
pidl
->
mkid
)
+
pstr
->
u
.
uOffset
,
ppszName
);
break
;
default:
*
ppszName
=
NULL
;
}
return
ret
;
}
/*************************************************************************
* StrRetToStrW [SHLWAPI.@]
*
* converts a STRRET to a normal string
*/
HRESULT
WINAPI
StrRetToStrW
(
LPSTRRET
pstr
,
const
ITEMIDLIST
*
pidl
,
LPWSTR
*
ppszName
)
{
HRESULT
ret
=
E_FAIL
;
switch
(
pstr
->
uType
)
{
case
STRRET_WSTR
:
ret
=
SHStrDupW
(
pstr
->
u
.
pOleStr
,
ppszName
);
CoTaskMemFree
(
pstr
->
u
.
pOleStr
);
break
;
case
STRRET_CSTR
:
ret
=
SHStrDupA
(
pstr
->
u
.
cStr
,
ppszName
);
break
;
case
STRRET_OFFSET
:
ret
=
SHStrDupA
(((
LPCSTR
)
&
pidl
->
mkid
)
+
pstr
->
u
.
uOffset
,
ppszName
);
break
;
default:
*
ppszName
=
NULL
;
}
return
ret
;
}
/*************************************************************************
* StrFormatByteSizeA [SHLWAPI.@]
*/
LPSTR
WINAPI
StrFormatByteSizeA
(
DWORD
dw
,
LPSTR
pszBuf
,
UINT
cchBuf
)
...
...
@@ -636,6 +697,34 @@ BOOL WINAPI StrTrimA(LPSTR pszSource, LPCSTR pszTrimChars)
}
/*************************************************************************
* _SHStrDupA [INTERNAL]
*
* Duplicates a ASCII string to ASCII. The destination buffer is allocated.
*/
HRESULT
WINAPI
_SHStrDupAA
(
LPCSTR
src
,
LPSTR
*
dest
)
{
HRESULT
hr
;
int
len
=
0
;
if
(
src
)
{
len
=
lstrlenA
(
src
);
*
dest
=
CoTaskMemAlloc
(
len
);
}
else
{
*
dest
=
NULL
;
}
if
(
*
dest
)
{
lstrcpynA
(
*
dest
,
src
,
len
);
hr
=
S_OK
;
}
else
{
hr
=
E_OUTOFMEMORY
;
}
TRACE
(
"%s->(%p)
\n
"
,
debugstr_a
(
src
),
*
dest
);
return
hr
;
}
/*************************************************************************
* SHStrDupA [SHLWAPI.@]
*
* Duplicates a ASCII string to UNICODE. The destination buffer is allocated.
...
...
@@ -664,6 +753,34 @@ HRESULT WINAPI SHStrDupA(LPCSTR src, LPWSTR * dest)
}
/*************************************************************************
* _SHStrDupAW [INTERNAL]
*
* Duplicates a UNICODE to a ASCII string. The destination buffer is allocated.
*/
HRESULT
WINAPI
_SHStrDupAW
(
LPCWSTR
src
,
LPSTR
*
dest
)
{
HRESULT
hr
;
int
len
=
0
;
if
(
src
)
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
src
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
*
dest
=
CoTaskMemAlloc
(
len
);
}
else
{
*
dest
=
NULL
;
}
if
(
*
dest
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
src
,
-
1
,
*
dest
,
len
,
NULL
,
NULL
);
hr
=
S_OK
;
}
else
{
hr
=
E_OUTOFMEMORY
;
}
TRACE
(
"%s->(%p)
\n
"
,
debugstr_w
(
src
),
*
dest
);
return
hr
;
}
/*************************************************************************
* SHStrDupW [SHLWAPI.@]
*
* Duplicates a UNICODE string. The destination buffer is allocated.
...
...
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