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
09c7cc1e
Commit
09c7cc1e
authored
Jul 04, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Use nameless unions/structs.
parent
dd162547
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
28 deletions
+22
-28
istream.c
dlls/shlwapi/istream.c
+0
-2
stopwatch.c
dlls/shlwapi/stopwatch.c
+0
-2
string.c
dlls/shlwapi/string.c
+22
-24
No files found.
dlls/shlwapi/istream.c
View file @
09c7cc1e
...
...
@@ -21,8 +21,6 @@
#include <string.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
...
...
dlls/shlwapi/stopwatch.c
View file @
09c7cc1e
...
...
@@ -27,8 +27,6 @@
#include <string.h>
#include <stdlib.h>
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
...
...
dlls/shlwapi/string.c
View file @
09c7cc1e
...
...
@@ -24,8 +24,6 @@
#include <stdio.h>
#include <string.h>
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#define NO_SHLWAPI_REG
...
...
@@ -220,16 +218,16 @@ HRESULT WINAPI StrRetToBufA (LPSTRRET src, const ITEMIDLIST *pidl, LPSTR dest, U
switch
(
src
->
uType
)
{
case
STRRET_WSTR
:
WideCharToMultiByte
(
CP_ACP
,
0
,
src
->
u
.
pOleStr
,
-
1
,
dest
,
len
,
NULL
,
NULL
);
CoTaskMemFree
(
src
->
u
.
pOleStr
);
WideCharToMultiByte
(
CP_ACP
,
0
,
src
->
pOleStr
,
-
1
,
dest
,
len
,
NULL
,
NULL
);
CoTaskMemFree
(
src
->
pOleStr
);
break
;
case
STRRET_CSTR
:
lstrcpynA
(
dest
,
src
->
u
.
cStr
,
len
);
lstrcpynA
(
dest
,
src
->
cStr
,
len
);
break
;
case
STRRET_OFFSET
:
lstrcpynA
(
dest
,
((
LPCSTR
)
&
pidl
->
mkid
)
+
src
->
u
.
u
Offset
,
len
);
lstrcpynA
(
dest
,
((
LPCSTR
)
&
pidl
->
mkid
)
+
src
->
uOffset
,
len
);
break
;
default:
...
...
@@ -263,12 +261,12 @@ HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest,
switch
(
src
->
uType
)
{
case
STRRET_WSTR
:
{
size_t
dst_len
;
if
(
!
src
->
u
.
pOleStr
)
if
(
!
src
->
pOleStr
)
return
E_FAIL
;
dst_len
=
lstrlenW
(
src
->
u
.
pOleStr
);
memcpy
(
dest
,
src
->
u
.
pOleStr
,
min
(
dst_len
,
len
-
1
)
*
sizeof
(
WCHAR
));
dst_len
=
lstrlenW
(
src
->
pOleStr
);
memcpy
(
dest
,
src
->
pOleStr
,
min
(
dst_len
,
len
-
1
)
*
sizeof
(
WCHAR
));
dest
[
min
(
dst_len
,
len
-
1
)]
=
0
;
CoTaskMemFree
(
src
->
u
.
pOleStr
);
CoTaskMemFree
(
src
->
pOleStr
);
if
(
len
<=
dst_len
)
{
dest
[
0
]
=
0
;
...
...
@@ -278,14 +276,14 @@ HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest,
}
case
STRRET_CSTR
:
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
src
->
u
.
cStr
,
-
1
,
dest
,
len
))
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
src
->
cStr
,
-
1
,
dest
,
len
))
dest
[
len
-
1
]
=
0
;
break
;
case
STRRET_OFFSET
:
if
(
pidl
)
{
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
((
LPCSTR
)
&
pidl
->
mkid
)
+
src
->
u
.
u
Offset
,
-
1
,
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
((
LPCSTR
)
&
pidl
->
mkid
)
+
src
->
uOffset
,
-
1
,
dest
,
len
))
dest
[
len
-
1
]
=
0
;
}
...
...
@@ -320,16 +318,16 @@ HRESULT WINAPI StrRetToStrA(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPSTR *pp
switch
(
lpStrRet
->
uType
)
{
case
STRRET_WSTR
:
hRet
=
_SHStrDupAW
(
lpStrRet
->
u
.
pOleStr
,
ppszName
);
CoTaskMemFree
(
lpStrRet
->
u
.
pOleStr
);
hRet
=
_SHStrDupAW
(
lpStrRet
->
pOleStr
,
ppszName
);
CoTaskMemFree
(
lpStrRet
->
pOleStr
);
break
;
case
STRRET_CSTR
:
hRet
=
_SHStrDupAA
(
lpStrRet
->
u
.
cStr
,
ppszName
);
hRet
=
_SHStrDupAA
(
lpStrRet
->
cStr
,
ppszName
);
break
;
case
STRRET_OFFSET
:
hRet
=
_SHStrDupAA
(((
LPCSTR
)
&
pidl
->
mkid
)
+
lpStrRet
->
u
.
u
Offset
,
ppszName
);
hRet
=
_SHStrDupAA
(((
LPCSTR
)
&
pidl
->
mkid
)
+
lpStrRet
->
uOffset
,
ppszName
);
break
;
default:
...
...
@@ -351,16 +349,16 @@ HRESULT WINAPI StrRetToStrW(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPWSTR *p
switch
(
lpStrRet
->
uType
)
{
case
STRRET_WSTR
:
hRet
=
SHStrDupW
(
lpStrRet
->
u
.
pOleStr
,
ppszName
);
CoTaskMemFree
(
lpStrRet
->
u
.
pOleStr
);
hRet
=
SHStrDupW
(
lpStrRet
->
pOleStr
,
ppszName
);
CoTaskMemFree
(
lpStrRet
->
pOleStr
);
break
;
case
STRRET_CSTR
:
hRet
=
SHStrDupA
(
lpStrRet
->
u
.
cStr
,
ppszName
);
hRet
=
SHStrDupA
(
lpStrRet
->
cStr
,
ppszName
);
break
;
case
STRRET_OFFSET
:
hRet
=
SHStrDupA
(((
LPCSTR
)
&
pidl
->
mkid
)
+
lpStrRet
->
u
.
u
Offset
,
ppszName
);
hRet
=
SHStrDupA
(((
LPCSTR
)
&
pidl
->
mkid
)
+
lpStrRet
->
uOffset
,
ppszName
);
break
;
default:
...
...
@@ -414,18 +412,18 @@ HRESULT WINAPI StrRetToBSTR(STRRET *lpStrRet, LPCITEMIDLIST pidl, BSTR* pBstrOut
switch
(
lpStrRet
->
uType
)
{
case
STRRET_WSTR
:
*
pBstrOut
=
SysAllocString
(
lpStrRet
->
u
.
pOleStr
);
*
pBstrOut
=
SysAllocString
(
lpStrRet
->
pOleStr
);
if
(
*
pBstrOut
)
hRet
=
S_OK
;
CoTaskMemFree
(
lpStrRet
->
u
.
pOleStr
);
CoTaskMemFree
(
lpStrRet
->
pOleStr
);
break
;
case
STRRET_CSTR
:
hRet
=
_SHStrDupAToBSTR
(
lpStrRet
->
u
.
cStr
,
pBstrOut
);
hRet
=
_SHStrDupAToBSTR
(
lpStrRet
->
cStr
,
pBstrOut
);
break
;
case
STRRET_OFFSET
:
hRet
=
_SHStrDupAToBSTR
(((
LPCSTR
)
&
pidl
->
mkid
)
+
lpStrRet
->
u
.
u
Offset
,
pBstrOut
);
hRet
=
_SHStrDupAToBSTR
(((
LPCSTR
)
&
pidl
->
mkid
)
+
lpStrRet
->
uOffset
,
pBstrOut
);
break
;
default:
...
...
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