4 * Copyright 2009 Damjan Jovanovic
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include "wiaservc_private.h"
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(wia
);
32 static inline wiadevmgr
*impl_from_IWiaDevMgr(IWiaDevMgr
*iface
)
34 return CONTAINING_RECORD(iface
, wiadevmgr
, IWiaDevMgr_iface
);
37 static HRESULT WINAPI
wiadevmgr_QueryInterface(IWiaDevMgr
*iface
, REFIID riid
, void **ppvObject
)
39 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
41 TRACE("(%p, %s, %p)\n", This
, debugstr_guid(riid
), ppvObject
);
43 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IWiaDevMgr
))
47 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
51 IUnknown_AddRef((IUnknown
*) *ppvObject
);
55 static ULONG WINAPI
wiadevmgr_AddRef(IWiaDevMgr
*iface
)
57 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
58 return InterlockedIncrement(&This
->ref
);
61 static ULONG WINAPI
wiadevmgr_Release(IWiaDevMgr
*iface
)
64 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
66 ref
= InterlockedDecrement(&This
->ref
);
68 HeapFree(GetProcessHeap(), 0, This
);
72 static HRESULT WINAPI
wiadevmgr_EnumDeviceInfo(IWiaDevMgr
*iface
, LONG lFlag
, IEnumWIA_DEV_INFO
**ppIEnum
)
74 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
75 FIXME("(%p, %d, %p): stub\n", This
, lFlag
, ppIEnum
);
79 static HRESULT WINAPI
wiadevmgr_CreateDevice(IWiaDevMgr
*iface
, BSTR bstrDeviceID
, IWiaItem
**ppWiaItemRoot
)
81 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
82 FIXME("(%p, %s, %p): stub\n", This
, debugstr_w(bstrDeviceID
), ppWiaItemRoot
);
86 static HRESULT WINAPI
wiadevmgr_SelectDeviceDlg(IWiaDevMgr
*iface
, HWND hwndParent
, LONG lDeviceType
,
87 LONG lFlags
, BSTR
*pbstrDeviceID
, IWiaItem
**ppItemRoot
)
89 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
90 FIXME("(%p, %p, %d, 0x%x, %p, %p): stub\n", This
, hwndParent
, lDeviceType
, lFlags
, pbstrDeviceID
, ppItemRoot
);
94 static HRESULT WINAPI
wiadevmgr_SelectDeviceDlgID(IWiaDevMgr
*iface
, HWND hwndParent
, LONG lDeviceType
,
95 LONG lFlags
, BSTR
*pbstrDeviceID
)
97 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
98 FIXME("(%p, %p, %d, 0x%x, %p): stub\n", This
, hwndParent
, lDeviceType
, lFlags
, pbstrDeviceID
);
102 static HRESULT WINAPI
wiadevmgr_GetImageDlg(IWiaDevMgr
*iface
, HWND hwndParent
, LONG lDeviceType
,
103 LONG lFlags
, LONG lIntent
, IWiaItem
*pItemRoot
,
104 BSTR bstrFilename
, GUID
*pguidFormat
)
106 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
107 FIXME("(%p, %p, %d, 0x%x, %d, %p, %s, %s): stub\n", This
, hwndParent
, lDeviceType
, lFlags
,
108 lIntent
, pItemRoot
, debugstr_w(bstrFilename
), debugstr_guid(pguidFormat
));
112 static HRESULT WINAPI
wiadevmgr_RegisterEventCallbackProgram(IWiaDevMgr
*iface
, LONG lFlags
, BSTR bstrDeviceID
,
113 const GUID
*pEventGUID
, BSTR bstrCommandline
,
114 BSTR bstrName
, BSTR bstrDescription
, BSTR bstrIcon
)
116 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
117 FIXME("(%p, 0x%x, %s, %s, %s, %s, %s, %s): stub\n", This
, lFlags
, debugstr_w(bstrDeviceID
),
118 debugstr_guid(pEventGUID
), debugstr_w(bstrCommandline
), debugstr_w(bstrName
),
119 debugstr_w(bstrDescription
), debugstr_w(bstrIcon
));
123 static HRESULT WINAPI
wiadevmgr_RegisterEventCallbackInterface(IWiaDevMgr
*iface
, LONG lFlags
, BSTR bstrDeviceID
,
124 const GUID
*pEventGUID
, IWiaEventCallback
*pIWiaEventCallback
,
125 IUnknown
**pEventObject
)
127 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
128 FIXME("(%p, 0x%x, %s, %s, %p, %p): stub\n", This
, lFlags
, debugstr_w(bstrDeviceID
),
129 debugstr_guid(pEventGUID
), pIWiaEventCallback
, pEventObject
);
133 static HRESULT WINAPI
wiadevmgr_RegisterEventCallbackCLSID(IWiaDevMgr
*iface
, LONG lFlags
, BSTR bstrDeviceID
,
134 const GUID
*pEventGUID
, const GUID
*pClsID
, BSTR bstrName
,
135 BSTR bstrDescription
, BSTR bstrIcon
)
137 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
138 FIXME("(%p, 0x%x, %s, %s, %s, %s, %s, %s): stub\n", This
, lFlags
, debugstr_w(bstrDeviceID
),
139 debugstr_guid(pEventGUID
), debugstr_guid(pClsID
), debugstr_w(bstrName
),
140 debugstr_w(bstrDescription
), debugstr_w(bstrIcon
));
144 static HRESULT WINAPI
wiadevmgr_AddDeviceDlg(IWiaDevMgr
*iface
, HWND hwndParent
, LONG lFlags
)
146 wiadevmgr
*This
= impl_from_IWiaDevMgr(iface
);
147 FIXME("(%p, %p, 0x%x): stub\n", This
, hwndParent
, lFlags
);
151 static const IWiaDevMgrVtbl WIASERVC_IWiaDevMgr_Vtbl
=
153 wiadevmgr_QueryInterface
,
156 wiadevmgr_EnumDeviceInfo
,
157 wiadevmgr_CreateDevice
,
158 wiadevmgr_SelectDeviceDlg
,
159 wiadevmgr_SelectDeviceDlgID
,
160 wiadevmgr_GetImageDlg
,
161 wiadevmgr_RegisterEventCallbackProgram
,
162 wiadevmgr_RegisterEventCallbackInterface
,
163 wiadevmgr_RegisterEventCallbackCLSID
,
164 wiadevmgr_AddDeviceDlg
167 HRESULT
wiadevmgr_Constructor(IWiaDevMgr
**ppObj
)
170 TRACE("(%p)\n", ppObj
);
171 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(wiadevmgr
));
174 This
->IWiaDevMgr_iface
.lpVtbl
= &WIASERVC_IWiaDevMgr_Vtbl
;
176 *ppObj
= &This
->IWiaDevMgr_iface
;
180 return E_OUTOFMEMORY
;