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
b72440fa
Commit
b72440fa
authored
Oct 03, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propsys: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bbb00dce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
24 deletions
+9
-24
propsys_main.c
dlls/propsys/propsys_main.c
+3
-9
propvar.c
dlls/propsys/propvar.c
+6
-15
No files found.
dlls/propsys/propsys_main.c
View file @
b72440fa
...
...
@@ -280,12 +280,6 @@ HRESULT WINAPI PSRefreshPropertySchema(void)
HRESULT
WINAPI
PSStringFromPropertyKey
(
REFPROPERTYKEY
pkey
,
LPWSTR
psz
,
UINT
cch
)
{
static
const
WCHAR
guid_fmtW
[]
=
{
'{'
,
'%'
,
'0'
,
'8'
,
'X'
,
'-'
,
'%'
,
'0'
,
'4'
,
'X'
,
'-'
,
'%'
,
'0'
,
'4'
,
'X'
,
'-'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'-'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'}'
,
0
};
static
const
WCHAR
pid_fmtW
[]
=
{
'%'
,
'u'
,
0
};
WCHAR
pidW
[
PKEY_PIDSTR_MAX
+
1
];
LPWSTR
p
=
psz
;
int
len
;
...
...
@@ -305,8 +299,8 @@ HRESULT WINAPI PSStringFromPropertyKey(REFPROPERTYKEY pkey, LPWSTR psz, UINT cch
return
E_NOT_SUFFICIENT_BUFFER
;
}
swprintf
(
psz
,
cch
,
guid_fmtW
,
pkey
->
fmtid
.
Data1
,
pkey
->
fmtid
.
Data2
,
pkey
->
fmtid
.
Data3
,
pkey
->
fmtid
.
Data4
[
0
],
pkey
->
fmtid
.
Data4
[
1
],
swprintf
(
psz
,
cch
,
L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"
,
pkey
->
fmtid
.
Data1
,
pkey
->
fmtid
.
Data
2
,
pkey
->
fmtid
.
Data
3
,
pkey
->
fmtid
.
Data4
[
0
],
pkey
->
fmtid
.
Data4
[
1
],
pkey
->
fmtid
.
Data4
[
2
],
pkey
->
fmtid
.
Data4
[
3
],
pkey
->
fmtid
.
Data4
[
4
],
pkey
->
fmtid
.
Data4
[
5
],
pkey
->
fmtid
.
Data4
[
6
],
pkey
->
fmtid
.
Data4
[
7
]);
...
...
@@ -315,7 +309,7 @@ HRESULT WINAPI PSStringFromPropertyKey(REFPROPERTYKEY pkey, LPWSTR psz, UINT cch
*
p
++
=
' '
;
cch
-=
GUIDSTRING_MAX
-
1
+
1
;
len
=
swprintf
(
pidW
,
ARRAY_SIZE
(
pidW
),
pid_fmtW
,
pkey
->
pid
);
len
=
swprintf
(
pidW
,
ARRAY_SIZE
(
pidW
),
L"%u"
,
pkey
->
pid
);
if
(
cch
>=
len
+
1
)
{
...
...
dlls/propsys/propvar.c
View file @
b72440fa
...
...
@@ -245,10 +245,6 @@ HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret)
HRESULT
WINAPI
PropVariantToBoolean
(
REFPROPVARIANT
propvarIn
,
BOOL
*
ret
)
{
static
const
WCHAR
trueW
[]
=
{
't'
,
'r'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
falseW
[]
=
{
'f'
,
'a'
,
'l'
,
's'
,
'e'
,
0
};
static
const
WCHAR
true2W
[]
=
{
'#'
,
'T'
,
'R'
,
'U'
,
'E'
,
'#'
,
0
};
static
const
WCHAR
false2W
[]
=
{
'#'
,
'F'
,
'A'
,
'L'
,
'S'
,
'E'
,
'#'
,
0
};
LONGLONG
res
;
HRESULT
hr
;
...
...
@@ -267,13 +263,13 @@ HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret)
if
(
!
propvarIn
->
u
.
pwszVal
)
return
DISP_E_TYPEMISMATCH
;
if
(
!
lstrcmpiW
(
propvarIn
->
u
.
pwszVal
,
trueW
)
||
!
lstrcmpW
(
propvarIn
->
u
.
pwszVal
,
true2W
))
if
(
!
lstrcmpiW
(
propvarIn
->
u
.
pwszVal
,
L"true"
)
||
!
lstrcmpW
(
propvarIn
->
u
.
pwszVal
,
L"#TRUE#"
))
{
*
ret
=
TRUE
;
return
S_OK
;
}
if
(
!
lstrcmpiW
(
propvarIn
->
u
.
pwszVal
,
falseW
)
||
!
lstrcmpW
(
propvarIn
->
u
.
pwszVal
,
false2W
))
if
(
!
lstrcmpiW
(
propvarIn
->
u
.
pwszVal
,
L"false"
)
||
!
lstrcmpW
(
propvarIn
->
u
.
pwszVal
,
L"#FALSE#"
))
{
*
ret
=
FALSE
;
return
S_OK
;
...
...
@@ -406,11 +402,10 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret)
PCWSTR
WINAPI
PropVariantToStringWithDefault
(
REFPROPVARIANT
propvarIn
,
LPCWSTR
pszDefault
)
{
static
const
WCHAR
str_empty
[]
=
{
0
};
if
(
propvarIn
->
vt
==
VT_BSTR
)
{
if
(
propvarIn
->
u
.
bstrVal
==
NULL
)
return
str_empty
;
return
L""
;
return
propvarIn
->
u
.
bstrVal
;
}
...
...
@@ -580,13 +575,9 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p
static
void
PROPVAR_GUIDToWSTR
(
REFGUID
guid
,
WCHAR
*
str
)
{
static
const
WCHAR
format
[]
=
{
'{'
,
'%'
,
'0'
,
'8'
,
'X'
,
'-'
,
'%'
,
'0'
,
'4'
,
'X'
,
'-'
,
'%'
,
'0'
,
'4'
,
'X'
,
'-'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'-'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'}'
,
0
};
swprintf
(
str
,
39
,
format
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]);
swprintf
(
str
,
39
,
L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]);
}
HRESULT
WINAPI
InitPropVariantFromGUIDAsString
(
REFGUID
guid
,
PROPVARIANT
*
ppropvar
)
...
...
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