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
d177709b
Commit
d177709b
authored
Oct 08, 2023
by
Fabian Maurer
Committed by
Alexandre Julliard
Oct 12, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propsys: Implement PropVariantToUInt32WithDefault.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55713
parent
9e767992
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
1 deletion
+25
-1
propsys.spec
dlls/propsys/propsys.spec
+1
-1
propvar.c
dlls/propsys/propvar.c
+14
-0
propsys.c
dlls/propsys/tests/propsys.c
+9
-0
propvarutil.h
include/propvarutil.h
+1
-0
No files found.
dlls/propsys/propsys.spec
View file @
d177709b
...
@@ -145,7 +145,7 @@
...
@@ -145,7 +145,7 @@
@ stdcall PropVariantToUInt32(ptr ptr)
@ stdcall PropVariantToUInt32(ptr ptr)
@ stub PropVariantToUInt32Vector
@ stub PropVariantToUInt32Vector
@ stub PropVariantToUInt32VectorAlloc
@ stub PropVariantToUInt32VectorAlloc
@ st
ub PropVariantToUInt32WithDefault
@ st
dcall PropVariantToUInt32WithDefault(ptr long)
@ stdcall PropVariantToUInt64(ptr ptr)
@ stdcall PropVariantToUInt64(ptr ptr)
@ stub PropVariantToUInt64Vector
@ stub PropVariantToUInt64Vector
@ stub PropVariantToUInt64VectorAlloc
@ stub PropVariantToUInt64VectorAlloc
...
...
dlls/propsys/propvar.c
View file @
d177709b
...
@@ -229,6 +229,20 @@ HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret)
...
@@ -229,6 +229,20 @@ HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret)
return
hr
;
return
hr
;
}
}
ULONG
WINAPI
PropVariantToUInt32WithDefault
(
REFPROPVARIANT
propvarIn
,
ULONG
ulDefault
)
{
LONGLONG
res
;
HRESULT
hr
;
TRACE
(
"%p,%lu
\n
"
,
propvarIn
,
ulDefault
);
hr
=
PROPVAR_ConvertNumber
(
propvarIn
,
32
,
FALSE
,
&
res
);
if
(
SUCCEEDED
(
hr
))
return
(
ULONG
)
res
;
return
ulDefault
;
}
HRESULT
WINAPI
PropVariantToUInt64
(
REFPROPVARIANT
propvarIn
,
ULONGLONG
*
ret
)
HRESULT
WINAPI
PropVariantToUInt64
(
REFPROPVARIANT
propvarIn
,
ULONGLONG
*
ret
)
{
{
LONGLONG
res
;
LONGLONG
res
;
...
...
dlls/propsys/tests/propsys.c
View file @
d177709b
...
@@ -966,6 +966,9 @@ static void test_intconversions(void)
...
@@ -966,6 +966,9 @@ static void test_intconversions(void)
hr
=
PropVariantToUInt32
(
&
propvar
,
&
ulval
);
hr
=
PropVariantToUInt32
(
&
propvar
,
&
ulval
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_ARITHMETIC_OVERFLOW
),
"hr=%lx
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_ARITHMETIC_OVERFLOW
),
"hr=%lx
\n
"
,
hr
);
ulval
=
PropVariantToUInt32WithDefault
(
&
propvar
,
77
);
ok
(
ulval
==
77
,
"ulval=%lu
\n
"
,
ulval
);
hr
=
PropVariantToInt16
(
&
propvar
,
&
sval
);
hr
=
PropVariantToInt16
(
&
propvar
,
&
sval
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_ARITHMETIC_OVERFLOW
),
"hr=%lx
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_ARITHMETIC_OVERFLOW
),
"hr=%lx
\n
"
,
hr
);
...
@@ -991,6 +994,9 @@ static void test_intconversions(void)
...
@@ -991,6 +994,9 @@ static void test_intconversions(void)
ok
(
hr
==
S_OK
,
"hr=%lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"hr=%lx
\n
"
,
hr
);
ok
(
ulval
==
5
,
"got wrong value %ld
\n
"
,
ulval
);
ok
(
ulval
==
5
,
"got wrong value %ld
\n
"
,
ulval
);
ulval
=
PropVariantToUInt32WithDefault
(
&
propvar
,
77
);
ok
(
ulval
==
5
,
"got wrong value %lu
\n
"
,
ulval
);
hr
=
PropVariantToInt16
(
&
propvar
,
&
sval
);
hr
=
PropVariantToInt16
(
&
propvar
,
&
sval
);
ok
(
hr
==
S_OK
,
"hr=%lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"hr=%lx
\n
"
,
hr
);
ok
(
sval
==
5
,
"got wrong value %d
\n
"
,
sval
);
ok
(
sval
==
5
,
"got wrong value %d
\n
"
,
sval
);
...
@@ -1016,6 +1022,9 @@ static void test_intconversions(void)
...
@@ -1016,6 +1022,9 @@ static void test_intconversions(void)
hr
=
PropVariantToUInt32
(
&
propvar
,
&
ulval
);
hr
=
PropVariantToUInt32
(
&
propvar
,
&
ulval
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_ARITHMETIC_OVERFLOW
),
"hr=%lx
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_ARITHMETIC_OVERFLOW
),
"hr=%lx
\n
"
,
hr
);
ulval
=
PropVariantToUInt32WithDefault
(
&
propvar
,
77
);
ok
(
ulval
==
77
,
"ulval=%lu
\n
"
,
ulval
);
hr
=
PropVariantToInt16
(
&
propvar
,
&
sval
);
hr
=
PropVariantToInt16
(
&
propvar
,
&
sval
);
ok
(
hr
==
S_OK
,
"hr=%lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"hr=%lx
\n
"
,
hr
);
ok
(
sval
==
-
5
,
"got wrong value %d
\n
"
,
sval
);
ok
(
sval
==
-
5
,
"got wrong value %d
\n
"
,
sval
);
...
...
include/propvarutil.h
View file @
d177709b
...
@@ -89,6 +89,7 @@ HRESULT WINAPI PropVariantToInt32(REFPROPVARIANT propvarIn, LONG *ret);
...
@@ -89,6 +89,7 @@ HRESULT WINAPI PropVariantToInt32(REFPROPVARIANT propvarIn, LONG *ret);
HRESULT
WINAPI
PropVariantToInt64
(
REFPROPVARIANT
propvarIn
,
LONGLONG
*
ret
);
HRESULT
WINAPI
PropVariantToInt64
(
REFPROPVARIANT
propvarIn
,
LONGLONG
*
ret
);
HRESULT
WINAPI
PropVariantToUInt16
(
REFPROPVARIANT
propvarIn
,
USHORT
*
ret
);
HRESULT
WINAPI
PropVariantToUInt16
(
REFPROPVARIANT
propvarIn
,
USHORT
*
ret
);
HRESULT
WINAPI
PropVariantToUInt32
(
REFPROPVARIANT
propvarIn
,
ULONG
*
ret
);
HRESULT
WINAPI
PropVariantToUInt32
(
REFPROPVARIANT
propvarIn
,
ULONG
*
ret
);
ULONG
WINAPI
PropVariantToUInt32WithDefault
(
REFPROPVARIANT
propvarIn
,
ULONG
uLDefault
);
HRESULT
WINAPI
PropVariantToUInt64
(
REFPROPVARIANT
propvarIn
,
ULONGLONG
*
ret
);
HRESULT
WINAPI
PropVariantToUInt64
(
REFPROPVARIANT
propvarIn
,
ULONGLONG
*
ret
);
HRESULT
WINAPI
PropVariantToBoolean
(
REFPROPVARIANT
propvarIn
,
BOOL
*
ret
);
HRESULT
WINAPI
PropVariantToBoolean
(
REFPROPVARIANT
propvarIn
,
BOOL
*
ret
);
HRESULT
WINAPI
PropVariantToBuffer
(
REFPROPVARIANT
propvarIn
,
void
*
ret
,
UINT
cb
);
HRESULT
WINAPI
PropVariantToBuffer
(
REFPROPVARIANT
propvarIn
,
void
*
ret
,
UINT
cb
);
...
...
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