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
fc4813ff
Commit
fc4813ff
authored
Jul 05, 2023
by
Mohamad Al-Jaf
Committed by
Alexandre Julliard
Jul 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.devices.usb/tests: Add IUsbDeviceStatics::GetDeviceSelectorVidPidOnly() tests.
parent
d78579a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
usb.c
dlls/windows.devices.usb/tests/usb.c
+37
-1
No files found.
dlls/windows.devices.usb/tests/usb.c
View file @
fc4813ff
...
@@ -47,11 +47,18 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid )
...
@@ -47,11 +47,18 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid )
static
void
test_UsbDevicesStatics
(
void
)
static
void
test_UsbDevicesStatics
(
void
)
{
{
static
const
WCHAR
*
format
=
L"System.Devices.InterfaceClassGuid:=
\"
{DEE824EF-729B-4A0E-9C14-B7117D33A817}
\"
"
L" AND System.Devices.InterfaceEnabled:=System.StructuredQueryType.Boolean#True"
L" AND System.DeviceInterface.WinUsb.UsbVendorId:=%d"
L" AND System.DeviceInterface.WinUsb.UsbProductId:=%d"
;
static
const
WCHAR
*
usb_device_statics_name
=
L"Windows.Devices.Usb.UsbDevice"
;
static
const
WCHAR
*
usb_device_statics_name
=
L"Windows.Devices.Usb.UsbDevice"
;
IUsbDeviceStatics
*
usb_device_statics
;
IUsbDeviceStatics
*
usb_device_statics
;
IActivationFactory
*
factory
;
IActivationFactory
*
factory
;
HSTRING
str
;
UINT32
vendor
,
product
;
WCHAR
buffer
[
254
+
20
];
HSTRING
str
,
wine_str
;
HRESULT
hr
;
HRESULT
hr
;
INT32
res
;
LONG
ref
;
LONG
ref
;
hr
=
WindowsCreateString
(
usb_device_statics_name
,
wcslen
(
usb_device_statics_name
),
&
str
);
hr
=
WindowsCreateString
(
usb_device_statics_name
,
wcslen
(
usb_device_statics_name
),
&
str
);
...
@@ -73,6 +80,35 @@ static void test_UsbDevicesStatics(void)
...
@@ -73,6 +80,35 @@ static void test_UsbDevicesStatics(void)
hr
=
IActivationFactory_QueryInterface
(
factory
,
&
IID_IUsbDeviceStatics
,
(
void
**
)
&
usb_device_statics
);
hr
=
IActivationFactory_QueryInterface
(
factory
,
&
IID_IUsbDeviceStatics
,
(
void
**
)
&
usb_device_statics
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IUsbDeviceStatics_GetDeviceSelectorVidPidOnly
(
usb_device_statics
,
5
,
10
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got hr %#lx.
\n
"
,
hr
);
vendor
=
20
;
product
=
23
;
hr
=
IUsbDeviceStatics_GetDeviceSelectorVidPidOnly
(
usb_device_statics
,
vendor
,
product
,
&
str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
swprintf
(
buffer
,
ARRAYSIZE
(
buffer
),
format
,
(
INT32
)
vendor
,
(
INT32
)
product
);
hr
=
WindowsCreateString
(
buffer
,
wcslen
(
buffer
),
&
wine_str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
WindowsCompareStringOrdinal
(
str
,
wine_str
,
&
res
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
!
res
,
"got string %s.
\n
"
,
debugstr_hstring
(
str
)
);
WindowsDeleteString
(
str
);
WindowsDeleteString
(
wine_str
);
vendor
=
4294967195
;
/* Vendor = -101 */
product
=
-
1294967195
;
hr
=
IUsbDeviceStatics_GetDeviceSelectorVidPidOnly
(
usb_device_statics
,
vendor
,
product
,
&
str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
swprintf
(
buffer
,
ARRAYSIZE
(
buffer
),
format
,
(
INT32
)
vendor
,
(
INT32
)
product
);
hr
=
WindowsCreateString
(
buffer
,
wcslen
(
buffer
),
&
wine_str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
WindowsCompareStringOrdinal
(
str
,
wine_str
,
&
res
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
!
res
,
"got string %s.
\n
"
,
debugstr_hstring
(
str
)
);
WindowsDeleteString
(
str
);
WindowsDeleteString
(
wine_str
);
ref
=
IUsbDeviceStatics_Release
(
usb_device_statics
);
ref
=
IUsbDeviceStatics_Release
(
usb_device_statics
);
ok
(
ref
==
2
,
"got ref %ld.
\n
"
,
ref
);
ok
(
ref
==
2
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IActivationFactory_Release
(
factory
);
ref
=
IActivationFactory_Release
(
factory
);
...
...
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