Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fotios Valasiadis
wine
Commits
1450dd79
Commit
1450dd79
authored
1 year ago
by
Mohamad Al-Jaf
Committed by
Alexandre Julliard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
windows.devices.usb: Add IUsbDeviceStatics stub interface.
parent
701a0506
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/windows.devices.usb/private.h
+38
-0
38 additions, 0 deletions
dlls/windows.devices.usb/private.h
dlls/windows.devices.usb/tests/usb.c
+6
-0
6 additions, 0 deletions
dlls/windows.devices.usb/tests/usb.c
dlls/windows.devices.usb/usbdevice.c
+60
-0
60 additions, 0 deletions
dlls/windows.devices.usb/usbdevice.c
with
104 additions
and
0 deletions
dlls/windows.devices.usb/private.h
+
38
−
0
View file @
1450dd79
...
...
@@ -37,4 +37,42 @@
extern
IActivationFactory
*
usb_device_factory
;
#define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \
static inline impl_type *impl_from( iface_type *iface ) \
{ \
return CONTAINING_RECORD( iface, impl_type, iface_mem ); \
} \
static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_QueryInterface( (IInspectable *)(expr), iid, out ); \
} \
static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_AddRef( (IInspectable *)(expr) ); \
} \
static ULONG WINAPI pfx##_Release( iface_type *iface ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_Release( (IInspectable *)(expr) ); \
} \
static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_GetIids( (IInspectable *)(expr), iid_count, iids ); \
} \
static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_GetRuntimeClassName( (IInspectable *)(expr), class_name ); \
} \
static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_GetTrustLevel( (IInspectable *)(expr), trust_level ); \
}
#define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \
DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface )
#endif
This diff is collapsed.
Click to expand it.
dlls/windows.devices.usb/tests/usb.c
+
6
−
0
View file @
1450dd79
...
...
@@ -48,6 +48,7 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid )
static
void
test_UsbDevicesStatics
(
void
)
{
static
const
WCHAR
*
usb_device_statics_name
=
L"Windows.Devices.Usb.UsbDevice"
;
IUsbDeviceStatics
*
usb_device_statics
;
IActivationFactory
*
factory
;
HSTRING
str
;
HRESULT
hr
;
...
...
@@ -69,6 +70,11 @@ static void test_UsbDevicesStatics(void)
check_interface
(
factory
,
&
IID_IInspectable
);
check_interface
(
factory
,
&
IID_IAgileObject
);
hr
=
IActivationFactory_QueryInterface
(
factory
,
&
IID_IUsbDeviceStatics
,
(
void
**
)
&
usb_device_statics
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ref
=
IUsbDeviceStatics_Release
(
usb_device_statics
);
ok
(
ref
==
2
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IActivationFactory_Release
(
factory
);
ok
(
ref
==
1
,
"got ref %ld.
\n
"
,
ref
);
}
...
...
This diff is collapsed.
Click to expand it.
dlls/windows.devices.usb/usbdevice.c
+
60
−
0
View file @
1450dd79
...
...
@@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(usb);
struct
usb_device_statics
{
IActivationFactory
IActivationFactory_iface
;
IUsbDeviceStatics
IUsbDeviceStatics_iface
;
LONG
ref
;
};
...
...
@@ -49,6 +50,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID
return
S_OK
;
}
if
(
IsEqualGUID
(
iid
,
&
IID_IUsbDeviceStatics
))
{
*
out
=
&
impl
->
IUsbDeviceStatics_iface
;
IInspectable_AddRef
(
*
out
);
return
S_OK
;
}
FIXME
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
iid
)
);
*
out
=
NULL
;
return
E_NOINTERFACE
;
...
...
@@ -107,9 +115,61 @@ static const struct IActivationFactoryVtbl factory_vtbl =
factory_ActivateInstance
,
};
DEFINE_IINSPECTABLE
(
usb_device_statics
,
IUsbDeviceStatics
,
struct
usb_device_statics
,
IActivationFactory_iface
)
static
HRESULT
WINAPI
usb_device_statics_GetDeviceSelector
(
IUsbDeviceStatics
*
iface
,
UINT32
vendor
,
UINT32
product
,
GUID
class
,
HSTRING
*
value
)
{
FIXME
(
"iface %p, vendor %d, product %d, class %s, value %p stub!
\n
"
,
iface
,
vendor
,
product
,
debugstr_guid
(
&
class
),
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
usb_device_statics_GetDeviceSelectorGuidOnly
(
IUsbDeviceStatics
*
iface
,
GUID
class
,
HSTRING
*
value
)
{
FIXME
(
"iface %p, class %s, value %p stub!
\n
"
,
iface
,
debugstr_guid
(
&
class
),
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
usb_device_statics_GetDeviceSelectorVidPidOnly
(
IUsbDeviceStatics
*
iface
,
UINT32
vendor
,
UINT32
product
,
HSTRING
*
value
)
{
FIXME
(
"iface %p, vendor %d, product %d, value %p stub!
\n
"
,
iface
,
vendor
,
product
,
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
usb_device_statics_GetDeviceClassSelector
(
IUsbDeviceStatics
*
iface
,
IUsbDeviceClass
*
class
,
HSTRING
*
value
)
{
FIXME
(
"iface %p, class %p, value %p stub!
\n
"
,
iface
,
class
,
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
usb_device_statics_FromIdAsync
(
IUsbDeviceStatics
*
iface
,
HSTRING
id
,
IAsyncOperation_UsbDevice
**
operation
)
{
FIXME
(
"iface %p, id %s, operation %p stub!
\n
"
,
iface
,
debugstr_hstring
(
id
),
operation
);
return
E_NOTIMPL
;
}
static
const
struct
IUsbDeviceStaticsVtbl
usb_device_statics_vtbl
=
{
usb_device_statics_QueryInterface
,
usb_device_statics_AddRef
,
usb_device_statics_Release
,
/* IInspectable methods */
usb_device_statics_GetIids
,
usb_device_statics_GetRuntimeClassName
,
usb_device_statics_GetTrustLevel
,
/* IUsbDeviceStatics methods */
usb_device_statics_GetDeviceSelector
,
usb_device_statics_GetDeviceSelectorGuidOnly
,
usb_device_statics_GetDeviceSelectorVidPidOnly
,
usb_device_statics_GetDeviceClassSelector
,
usb_device_statics_FromIdAsync
,
};
static
struct
usb_device_statics
usb_device_statics
=
{
{
&
factory_vtbl
},
{
&
usb_device_statics_vtbl
},
1
,
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment