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
ea602b2a
Commit
ea602b2a
authored
Aug 26, 2022
by
Julian Klemann
Committed by
Alexandre Julliard
Sep 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.devices.enumeration: Add DeviceWatcher stub.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53328
parent
606cb45e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
188 additions
and
4 deletions
+188
-4
main.c
dlls/windows.devices.enumeration/main.c
+188
-2
private.h
dlls/windows.devices.enumeration/private.h
+0
-2
No files found.
dlls/windows.devices.enumeration/main.c
View file @
ea602b2a
...
...
@@ -34,6 +34,182 @@ static const char *debugstr_hstring( HSTRING hstr )
return
wine_dbgstr_wn
(
str
,
len
);
}
struct
device_watcher
{
IDeviceWatcher
IDeviceWatcher_iface
;
LONG
ref
;
};
static
inline
struct
device_watcher
*
impl_from_IDeviceWatcher
(
IDeviceWatcher
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
device_watcher
,
IDeviceWatcher_iface
);
}
static
HRESULT
WINAPI
device_watcher_QueryInterface
(
IDeviceWatcher
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
device_watcher
*
impl
=
impl_from_IDeviceWatcher
(
iface
);
TRACE
(
"iface %p, iid %s, out %p stub!
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IInspectable
)
||
IsEqualGUID
(
iid
,
&
IID_IAgileObject
)
||
IsEqualGUID
(
iid
,
&
IID_IDeviceWatcher
))
{
IInspectable_AddRef
(
(
*
out
=
&
impl
->
IDeviceWatcher_iface
)
);
return
S_OK
;
}
FIXME
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
iid
)
);
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
device_watcher_AddRef
(
IDeviceWatcher
*
iface
)
{
struct
device_watcher
*
impl
=
impl_from_IDeviceWatcher
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
impl
->
ref
);
TRACE
(
"iface %p, ref %lu.
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
device_watcher_Release
(
IDeviceWatcher
*
iface
)
{
struct
device_watcher
*
impl
=
impl_from_IDeviceWatcher
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
impl
->
ref
);
TRACE
(
"iface %p, ref %lu.
\n
"
,
iface
,
ref
);
if
(
!
ref
)
free
(
impl
);
return
ref
;
}
static
HRESULT
WINAPI
device_watcher_GetIids
(
IDeviceWatcher
*
iface
,
ULONG
*
iid_count
,
IID
**
iids
)
{
FIXME
(
"iface %p, iid_count %p, iids %p stub!
\n
"
,
iface
,
iid_count
,
iids
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_GetRuntimeClassName
(
IDeviceWatcher
*
iface
,
HSTRING
*
class_name
)
{
FIXME
(
"iface %p, class_name %p stub!
\n
"
,
iface
,
class_name
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_GetTrustLevel
(
IDeviceWatcher
*
iface
,
TrustLevel
*
trust_level
)
{
FIXME
(
"iface %p, trust_level %p stub!
\n
"
,
iface
,
trust_level
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_add_Added
(
IDeviceWatcher
*
iface
,
ITypedEventHandler_DeviceWatcher_DeviceInformation
*
handler
,
EventRegistrationToken
*
token
)
{
FIXME
(
"iface %p, handler %p, token %p stub!
\n
"
,
iface
,
handler
,
token
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_remove_Added
(
IDeviceWatcher
*
iface
,
EventRegistrationToken
token
)
{
FIXME
(
"iface %p, token %#I64x stub!
\n
"
,
iface
,
token
.
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_add_Updated
(
IDeviceWatcher
*
iface
,
ITypedEventHandler_DeviceWatcher_DeviceInformationUpdate
*
handler
,
EventRegistrationToken
*
token
)
{
FIXME
(
"iface %p, handler %p, token %p stub!
\n
"
,
iface
,
handler
,
token
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_remove_Updated
(
IDeviceWatcher
*
iface
,
EventRegistrationToken
token
)
{
FIXME
(
"iface %p, token %#I64x stub!
\n
"
,
iface
,
token
.
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_add_Removed
(
IDeviceWatcher
*
iface
,
ITypedEventHandler_DeviceWatcher_DeviceInformationUpdate
*
handler
,
EventRegistrationToken
*
token
)
{
FIXME
(
"iface %p, handler %p, token %p stub!
\n
"
,
iface
,
handler
,
token
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_remove_Removed
(
IDeviceWatcher
*
iface
,
EventRegistrationToken
token
)
{
FIXME
(
"iface %p, token %#I64x stub!
\n
"
,
iface
,
token
.
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_add_EnumerationCompleted
(
IDeviceWatcher
*
iface
,
ITypedEventHandler_DeviceWatcher_IInspectable
*
handler
,
EventRegistrationToken
*
token
)
{
FIXME
(
"iface %p, handler %p, token %p stub!
\n
"
,
iface
,
handler
,
token
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_remove_EnumerationCompleted
(
IDeviceWatcher
*
iface
,
EventRegistrationToken
token
)
{
FIXME
(
"iface %p, token %#I64x stub!
\n
"
,
iface
,
token
.
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_add_Stopped
(
IDeviceWatcher
*
iface
,
ITypedEventHandler_DeviceWatcher_IInspectable
*
handler
,
EventRegistrationToken
*
token
)
{
FIXME
(
"iface %p, handler %p, token %p stub!
\n
"
,
iface
,
handler
,
token
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_remove_Stopped
(
IDeviceWatcher
*
iface
,
EventRegistrationToken
token
)
{
FIXME
(
"iface %p, token %#I64x stub!
\n
"
,
iface
,
token
.
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_Status
(
IDeviceWatcher
*
iface
,
DeviceWatcherStatus
*
status
)
{
FIXME
(
"iface %p, status %p stub!
\n
"
,
iface
,
status
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_Start
(
IDeviceWatcher
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
device_watcher_Stop
(
IDeviceWatcher
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
E_NOTIMPL
;
}
static
const
struct
IDeviceWatcherVtbl
device_watcher_vtbl
=
{
device_watcher_QueryInterface
,
device_watcher_AddRef
,
device_watcher_Release
,
/* IInspectable methods */
device_watcher_GetIids
,
device_watcher_GetRuntimeClassName
,
device_watcher_GetTrustLevel
,
/* IDeviceWatcher methods */
device_watcher_add_Added
,
device_watcher_remove_Added
,
device_watcher_add_Updated
,
device_watcher_remove_Updated
,
device_watcher_add_Removed
,
device_watcher_remove_Removed
,
device_watcher_add_EnumerationCompleted
,
device_watcher_remove_EnumerationCompleted
,
device_watcher_add_Stopped
,
device_watcher_remove_Stopped
,
device_watcher_Status
,
device_watcher_Start
,
device_watcher_Stop
,
};
struct
device_information_statics
{
IActivationFactory
IActivationFactory_iface
;
...
...
@@ -155,9 +331,19 @@ static HRESULT WINAPI device_statics2_CreateWatcher( IDeviceInformationStatics2
IIterable_HSTRING
*
additional_properties
,
DeviceInformationKind
kind
,
IDeviceWatcher
**
watcher
)
{
FIXME
(
"iface %p, filter %s, additional_properties %p, kind %u, watcher %p stub!
\n
"
,
struct
device_watcher
*
this
;
FIXME
(
"iface %p, filter %s, additional_properties %p, kind %u, watcher %p semi-stub!
\n
"
,
iface
,
debugstr_hstring
(
filter
),
additional_properties
,
kind
,
watcher
);
return
E_NOTIMPL
;
if
(
!
(
this
=
calloc
(
1
,
sizeof
(
*
this
)
)))
return
E_OUTOFMEMORY
;
this
->
IDeviceWatcher_iface
.
lpVtbl
=
&
device_watcher_vtbl
;
this
->
ref
=
1
;
*
watcher
=
&
this
->
IDeviceWatcher_iface
;
return
S_OK
;
}
static
const
struct
IDeviceInformationStatics2Vtbl
device_statics2_vtbl
=
...
...
dlls/windows.devices.enumeration/private.h
View file @
ea602b2a
...
...
@@ -37,8 +37,6 @@
#define WIDL_using_Windows_Devices_Enumeration
#include "windows.devices.enumeration.h"
#include "wine/list.h"
#define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \
static inline impl_type *impl_from( iface_type *iface ) \
{ \
...
...
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