1c2c66affSColin Finck /*
2c2c66affSColin Finck * Copyright (C) 2002 Aric Stewart for CodeWeavers
3c2c66affSColin Finck * Copyright (C) 2009 Damjan Jovanovic
4c2c66affSColin Finck *
5c2c66affSColin Finck * This library is free software; you can redistribute it and/or
6c2c66affSColin Finck * modify it under the terms of the GNU Lesser General Public
7c2c66affSColin Finck * License as published by the Free Software Foundation; either
8c2c66affSColin Finck * version 2.1 of the License, or (at your option) any later version.
9c2c66affSColin Finck *
10c2c66affSColin Finck * This library is distributed in the hope that it will be useful,
11c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of
12c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13c2c66affSColin Finck * Lesser General Public License for more details.
14c2c66affSColin Finck *
15c2c66affSColin Finck * You should have received a copy of the GNU Lesser General Public
16c2c66affSColin Finck * License along with this library; if not, write to the Free Software
17c2c66affSColin Finck * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18c2c66affSColin Finck */
19c2c66affSColin Finck
20cd3274d6SAmine Khaldi #include <stdarg.h>
21*66b46b04SAmine Khaldi #ifdef __REACTOS__
22*66b46b04SAmine Khaldi #include <wchar.h>
23*66b46b04SAmine Khaldi #endif
24c2c66affSColin Finck
25cd3274d6SAmine Khaldi #define COBJMACROS
26c2c66affSColin Finck
27cd3274d6SAmine Khaldi #include "windef.h"
28cd3274d6SAmine Khaldi #include "winbase.h"
29cd3274d6SAmine Khaldi #include "winreg.h"
30cd3274d6SAmine Khaldi #include "winerror.h"
31cd3274d6SAmine Khaldi #include "objbase.h"
32cd3274d6SAmine Khaldi #include "sti.h"
33cd3274d6SAmine Khaldi
34cd3274d6SAmine Khaldi #include "wine/debug.h"
35cd3274d6SAmine Khaldi
36cd3274d6SAmine Khaldi WINE_DEFAULT_DEBUG_CHANNEL(sti);
37c2c66affSColin Finck
38c2c66affSColin Finck static const WCHAR registeredAppsLaunchPath[] = {
39c2c66affSColin Finck 'S','O','F','T','W','A','R','E','\\',
40c2c66affSColin Finck 'M','i','c','r','o','s','o','f','t','\\',
41c2c66affSColin Finck 'W','i','n','d','o','w','s','\\',
42c2c66affSColin Finck 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
43c2c66affSColin Finck 'S','t','i','l','l','I','m','a','g','e','\\',
44c2c66affSColin Finck 'R','e','g','i','s','t','e','r','e','d',' ','A','p','p','l','i','c','a','t','i','o','n','s',0
45c2c66affSColin Finck };
46c2c66affSColin Finck
47c2c66affSColin Finck typedef struct _stillimage
48c2c66affSColin Finck {
49c2c66affSColin Finck IUnknown IUnknown_inner;
50c2c66affSColin Finck IStillImageW IStillImageW_iface;
51c2c66affSColin Finck IUnknown *outer_unk;
52c2c66affSColin Finck LONG ref;
53c2c66affSColin Finck } stillimage;
54c2c66affSColin Finck
impl_from_IStillImageW(IStillImageW * iface)55c2c66affSColin Finck static inline stillimage *impl_from_IStillImageW(IStillImageW *iface)
56c2c66affSColin Finck {
57c2c66affSColin Finck return CONTAINING_RECORD(iface, stillimage, IStillImageW_iface);
58c2c66affSColin Finck }
59c2c66affSColin Finck
stillimagew_QueryInterface(IStillImageW * iface,REFIID riid,void ** ppvObject)60c2c66affSColin Finck static HRESULT WINAPI stillimagew_QueryInterface(IStillImageW *iface, REFIID riid, void **ppvObject)
61c2c66affSColin Finck {
62c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
63c2c66affSColin Finck TRACE("(%p %s %p)\n", This, debugstr_guid(riid), ppvObject);
64c2c66affSColin Finck return IUnknown_QueryInterface(This->outer_unk, riid, ppvObject);
65c2c66affSColin Finck }
66c2c66affSColin Finck
stillimagew_AddRef(IStillImageW * iface)67c2c66affSColin Finck static ULONG WINAPI stillimagew_AddRef(IStillImageW *iface)
68c2c66affSColin Finck {
69c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
70c2c66affSColin Finck return IUnknown_AddRef(This->outer_unk);
71c2c66affSColin Finck }
72c2c66affSColin Finck
stillimagew_Release(IStillImageW * iface)73c2c66affSColin Finck static ULONG WINAPI stillimagew_Release(IStillImageW *iface)
74c2c66affSColin Finck {
75c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
76c2c66affSColin Finck return IUnknown_Release(This->outer_unk);
77c2c66affSColin Finck }
78c2c66affSColin Finck
stillimagew_Initialize(IStillImageW * iface,HINSTANCE hinst,DWORD dwVersion)79c2c66affSColin Finck static HRESULT WINAPI stillimagew_Initialize(IStillImageW *iface, HINSTANCE hinst, DWORD dwVersion)
80c2c66affSColin Finck {
81c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
82c2c66affSColin Finck TRACE("(%p, %p, 0x%X)\n", This, hinst, dwVersion);
83c2c66affSColin Finck return S_OK;
84c2c66affSColin Finck }
85c2c66affSColin Finck
stillimagew_GetDeviceList(IStillImageW * iface,DWORD dwType,DWORD dwFlags,DWORD * pdwItemsReturned,LPVOID * ppBuffer)86c2c66affSColin Finck static HRESULT WINAPI stillimagew_GetDeviceList(IStillImageW *iface, DWORD dwType, DWORD dwFlags,
87c2c66affSColin Finck DWORD *pdwItemsReturned, LPVOID *ppBuffer)
88c2c66affSColin Finck {
89c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
90c2c66affSColin Finck FIXME("(%p, %u, 0x%X, %p, %p): stub\n", This, dwType, dwFlags, pdwItemsReturned, ppBuffer);
91c2c66affSColin Finck return E_NOTIMPL;
92c2c66affSColin Finck }
93c2c66affSColin Finck
stillimagew_GetDeviceInfo(IStillImageW * iface,LPWSTR pwszDeviceName,LPVOID * ppBuffer)94c2c66affSColin Finck static HRESULT WINAPI stillimagew_GetDeviceInfo(IStillImageW *iface, LPWSTR pwszDeviceName,
95c2c66affSColin Finck LPVOID *ppBuffer)
96c2c66affSColin Finck {
97c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
98c2c66affSColin Finck FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszDeviceName), ppBuffer);
99c2c66affSColin Finck return E_NOTIMPL;
100c2c66affSColin Finck }
101c2c66affSColin Finck
stillimagew_CreateDevice(IStillImageW * iface,LPWSTR pwszDeviceName,DWORD dwMode,PSTIDEVICEW * pDevice,LPUNKNOWN pUnkOuter)102c2c66affSColin Finck static HRESULT WINAPI stillimagew_CreateDevice(IStillImageW *iface, LPWSTR pwszDeviceName, DWORD dwMode,
103c2c66affSColin Finck PSTIDEVICEW *pDevice, LPUNKNOWN pUnkOuter)
104c2c66affSColin Finck {
105c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
106c2c66affSColin Finck FIXME("(%p, %s, %u, %p, %p): stub\n", This, debugstr_w(pwszDeviceName), dwMode, pDevice, pUnkOuter);
107c2c66affSColin Finck return E_NOTIMPL;
108c2c66affSColin Finck }
109c2c66affSColin Finck
stillimagew_GetDeviceValue(IStillImageW * iface,LPWSTR pwszDeviceName,LPWSTR pValueName,LPDWORD pType,LPBYTE pData,LPDWORD cbData)110c2c66affSColin Finck static HRESULT WINAPI stillimagew_GetDeviceValue(IStillImageW *iface, LPWSTR pwszDeviceName, LPWSTR pValueName,
111c2c66affSColin Finck LPDWORD pType, LPBYTE pData, LPDWORD cbData)
112c2c66affSColin Finck {
113c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
114c2c66affSColin Finck FIXME("(%p, %s, %s, %p, %p, %p): stub\n", This, debugstr_w(pwszDeviceName), debugstr_w(pValueName),
115c2c66affSColin Finck pType, pData, cbData);
116c2c66affSColin Finck return E_NOTIMPL;
117c2c66affSColin Finck }
118c2c66affSColin Finck
stillimagew_SetDeviceValue(IStillImageW * iface,LPWSTR pwszDeviceName,LPWSTR pValueName,DWORD type,LPBYTE pData,DWORD cbData)119c2c66affSColin Finck static HRESULT WINAPI stillimagew_SetDeviceValue(IStillImageW *iface, LPWSTR pwszDeviceName, LPWSTR pValueName,
120c2c66affSColin Finck DWORD type, LPBYTE pData, DWORD cbData)
121c2c66affSColin Finck {
122c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
123c2c66affSColin Finck FIXME("(%p, %s, %s, %u, %p, %u): stub\n", This, debugstr_w(pwszDeviceName), debugstr_w(pValueName),
124c2c66affSColin Finck type, pData, cbData);
125c2c66affSColin Finck return E_NOTIMPL;
126c2c66affSColin Finck }
127c2c66affSColin Finck
stillimagew_GetSTILaunchInformation(IStillImageW * iface,LPWSTR pwszDeviceName,DWORD * pdwEventCode,LPWSTR pwszEventName)128c2c66affSColin Finck static HRESULT WINAPI stillimagew_GetSTILaunchInformation(IStillImageW *iface, LPWSTR pwszDeviceName,
129c2c66affSColin Finck DWORD *pdwEventCode, LPWSTR pwszEventName)
130c2c66affSColin Finck {
131c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
132c2c66affSColin Finck FIXME("(%p, %p, %p, %p): stub\n", This, pwszDeviceName,
133c2c66affSColin Finck pdwEventCode, pwszEventName);
134c2c66affSColin Finck return E_NOTIMPL;
135c2c66affSColin Finck }
136c2c66affSColin Finck
stillimagew_RegisterLaunchApplication(IStillImageW * iface,LPWSTR pwszAppName,LPWSTR pwszCommandLine)137c2c66affSColin Finck static HRESULT WINAPI stillimagew_RegisterLaunchApplication(IStillImageW *iface, LPWSTR pwszAppName,
138c2c66affSColin Finck LPWSTR pwszCommandLine)
139c2c66affSColin Finck {
140c2c66affSColin Finck static const WCHAR format[] = {'%','s',' ','%','s',0};
141c2c66affSColin Finck static const WCHAR commandLineSuffix[] = {
142c2c66affSColin Finck '/','S','t','i','D','e','v','i','c','e',':','%','1',' ',
143c2c66affSColin Finck '/','S','t','i','E','v','e','n','t',':','%','2',0};
144c2c66affSColin Finck HKEY registeredAppsKey = NULL;
145c2c66affSColin Finck DWORD ret;
146c2c66affSColin Finck HRESULT hr = S_OK;
147c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
148c2c66affSColin Finck
149c2c66affSColin Finck TRACE("(%p, %s, %s)\n", This, debugstr_w(pwszAppName), debugstr_w(pwszCommandLine));
150c2c66affSColin Finck
151c2c66affSColin Finck ret = RegCreateKeyW(HKEY_LOCAL_MACHINE, registeredAppsLaunchPath, ®isteredAppsKey);
152c2c66affSColin Finck if (ret == ERROR_SUCCESS)
153c2c66affSColin Finck {
154*66b46b04SAmine Khaldi size_t len = lstrlenW(pwszCommandLine) + 1 + lstrlenW(commandLineSuffix) + 1;
155*66b46b04SAmine Khaldi WCHAR *value = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
156c2c66affSColin Finck if (value)
157c2c66affSColin Finck {
158*66b46b04SAmine Khaldi swprintf(value, format, pwszCommandLine, commandLineSuffix);
159c2c66affSColin Finck ret = RegSetValueExW(registeredAppsKey, pwszAppName, 0,
160c2c66affSColin Finck REG_SZ, (BYTE*)value, (lstrlenW(value)+1)*sizeof(WCHAR));
161c2c66affSColin Finck if (ret != ERROR_SUCCESS)
162c2c66affSColin Finck hr = HRESULT_FROM_WIN32(ret);
163c2c66affSColin Finck HeapFree(GetProcessHeap(), 0, value);
164c2c66affSColin Finck }
165c2c66affSColin Finck else
166c2c66affSColin Finck hr = E_OUTOFMEMORY;
167c2c66affSColin Finck RegCloseKey(registeredAppsKey);
168c2c66affSColin Finck }
169c2c66affSColin Finck else
170c2c66affSColin Finck hr = HRESULT_FROM_WIN32(ret);
171c2c66affSColin Finck return hr;
172c2c66affSColin Finck }
173c2c66affSColin Finck
stillimagew_UnregisterLaunchApplication(IStillImageW * iface,LPWSTR pwszAppName)174c2c66affSColin Finck static HRESULT WINAPI stillimagew_UnregisterLaunchApplication(IStillImageW *iface, LPWSTR pwszAppName)
175c2c66affSColin Finck {
176c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
177c2c66affSColin Finck HKEY registeredAppsKey = NULL;
178c2c66affSColin Finck DWORD ret;
179c2c66affSColin Finck HRESULT hr = S_OK;
180c2c66affSColin Finck
181c2c66affSColin Finck TRACE("(%p, %s)\n", This, debugstr_w(pwszAppName));
182c2c66affSColin Finck
183c2c66affSColin Finck ret = RegCreateKeyW(HKEY_LOCAL_MACHINE, registeredAppsLaunchPath, ®isteredAppsKey);
184c2c66affSColin Finck if (ret == ERROR_SUCCESS)
185c2c66affSColin Finck {
186c2c66affSColin Finck ret = RegDeleteValueW(registeredAppsKey, pwszAppName);
187c2c66affSColin Finck if (ret != ERROR_SUCCESS)
188c2c66affSColin Finck hr = HRESULT_FROM_WIN32(ret);
189c2c66affSColin Finck RegCloseKey(registeredAppsKey);
190c2c66affSColin Finck }
191c2c66affSColin Finck else
192c2c66affSColin Finck hr = HRESULT_FROM_WIN32(ret);
193c2c66affSColin Finck return hr;
194c2c66affSColin Finck }
195c2c66affSColin Finck
stillimagew_EnableHwNotifications(IStillImageW * iface,LPCWSTR pwszDeviceName,BOOL bNewState)196c2c66affSColin Finck static HRESULT WINAPI stillimagew_EnableHwNotifications(IStillImageW *iface, LPCWSTR pwszDeviceName,
197c2c66affSColin Finck BOOL bNewState)
198c2c66affSColin Finck {
199c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
200c2c66affSColin Finck FIXME("(%p, %s, %u): stub\n", This, debugstr_w(pwszDeviceName), bNewState);
201c2c66affSColin Finck return E_NOTIMPL;
202c2c66affSColin Finck }
203c2c66affSColin Finck
stillimagew_GetHwNotificationState(IStillImageW * iface,LPCWSTR pwszDeviceName,BOOL * pbCurrentState)204c2c66affSColin Finck static HRESULT WINAPI stillimagew_GetHwNotificationState(IStillImageW *iface, LPCWSTR pwszDeviceName,
205c2c66affSColin Finck BOOL *pbCurrentState)
206c2c66affSColin Finck {
207c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
208c2c66affSColin Finck FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszDeviceName), pbCurrentState);
209c2c66affSColin Finck return E_NOTIMPL;
210c2c66affSColin Finck }
211c2c66affSColin Finck
stillimagew_RefreshDeviceBus(IStillImageW * iface,LPCWSTR pwszDeviceName)212c2c66affSColin Finck static HRESULT WINAPI stillimagew_RefreshDeviceBus(IStillImageW *iface, LPCWSTR pwszDeviceName)
213c2c66affSColin Finck {
214c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
215c2c66affSColin Finck FIXME("(%p, %s): stub\n", This, debugstr_w(pwszDeviceName));
216c2c66affSColin Finck return E_NOTIMPL;
217c2c66affSColin Finck }
218c2c66affSColin Finck
stillimagew_LaunchApplicationForDevice(IStillImageW * iface,LPWSTR pwszDeviceName,LPWSTR pwszAppName,LPSTINOTIFY pStiNotify)219c2c66affSColin Finck static HRESULT WINAPI stillimagew_LaunchApplicationForDevice(IStillImageW *iface, LPWSTR pwszDeviceName,
220c2c66affSColin Finck LPWSTR pwszAppName, LPSTINOTIFY pStiNotify)
221c2c66affSColin Finck {
222c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
223c2c66affSColin Finck FIXME("(%p, %s, %s, %p): stub\n", This, debugstr_w(pwszDeviceName), debugstr_w(pwszAppName),
224c2c66affSColin Finck pStiNotify);
225c2c66affSColin Finck return E_NOTIMPL;
226c2c66affSColin Finck }
227c2c66affSColin Finck
stillimagew_SetupDeviceParameters(IStillImageW * iface,PSTI_DEVICE_INFORMATIONW pDevInfo)228c2c66affSColin Finck static HRESULT WINAPI stillimagew_SetupDeviceParameters(IStillImageW *iface, PSTI_DEVICE_INFORMATIONW pDevInfo)
229c2c66affSColin Finck {
230c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
231c2c66affSColin Finck FIXME("(%p, %p): stub\n", This, pDevInfo);
232c2c66affSColin Finck return E_NOTIMPL;
233c2c66affSColin Finck }
234c2c66affSColin Finck
stillimagew_WriteToErrorLog(IStillImageW * iface,DWORD dwMessageType,LPCWSTR pszMessage)235c2c66affSColin Finck static HRESULT WINAPI stillimagew_WriteToErrorLog(IStillImageW *iface, DWORD dwMessageType, LPCWSTR pszMessage)
236c2c66affSColin Finck {
237c2c66affSColin Finck stillimage *This = impl_from_IStillImageW(iface);
238c2c66affSColin Finck FIXME("(%p, %u, %s): stub\n", This, dwMessageType, debugstr_w(pszMessage));
239c2c66affSColin Finck return E_NOTIMPL;
240c2c66affSColin Finck }
241c2c66affSColin Finck
242c2c66affSColin Finck static const struct IStillImageWVtbl stillimagew_vtbl =
243c2c66affSColin Finck {
244c2c66affSColin Finck stillimagew_QueryInterface,
245c2c66affSColin Finck stillimagew_AddRef,
246c2c66affSColin Finck stillimagew_Release,
247c2c66affSColin Finck stillimagew_Initialize,
248c2c66affSColin Finck stillimagew_GetDeviceList,
249c2c66affSColin Finck stillimagew_GetDeviceInfo,
250c2c66affSColin Finck stillimagew_CreateDevice,
251c2c66affSColin Finck stillimagew_GetDeviceValue,
252c2c66affSColin Finck stillimagew_SetDeviceValue,
253c2c66affSColin Finck stillimagew_GetSTILaunchInformation,
254c2c66affSColin Finck stillimagew_RegisterLaunchApplication,
255c2c66affSColin Finck stillimagew_UnregisterLaunchApplication,
256c2c66affSColin Finck stillimagew_EnableHwNotifications,
257c2c66affSColin Finck stillimagew_GetHwNotificationState,
258c2c66affSColin Finck stillimagew_RefreshDeviceBus,
259c2c66affSColin Finck stillimagew_LaunchApplicationForDevice,
260c2c66affSColin Finck stillimagew_SetupDeviceParameters,
261c2c66affSColin Finck stillimagew_WriteToErrorLog
262c2c66affSColin Finck };
263c2c66affSColin Finck
impl_from_IUnknown(IUnknown * iface)264c2c66affSColin Finck static inline stillimage *impl_from_IUnknown(IUnknown *iface)
265c2c66affSColin Finck {
266c2c66affSColin Finck return CONTAINING_RECORD(iface, stillimage, IUnknown_inner);
267c2c66affSColin Finck }
268c2c66affSColin Finck
Internal_QueryInterface(IUnknown * iface,REFIID riid,void ** ppvObject)269c2c66affSColin Finck static HRESULT WINAPI Internal_QueryInterface(IUnknown *iface, REFIID riid, void **ppvObject)
270c2c66affSColin Finck {
271c2c66affSColin Finck stillimage *This = impl_from_IUnknown(iface);
272c2c66affSColin Finck
273c2c66affSColin Finck TRACE("(%p %s %p)\n", This, debugstr_guid(riid), ppvObject);
274c2c66affSColin Finck
275c2c66affSColin Finck if (IsEqualGUID(riid, &IID_IUnknown))
276c2c66affSColin Finck *ppvObject = iface;
277c2c66affSColin Finck else if (IsEqualGUID(riid, &IID_IStillImageW))
278c2c66affSColin Finck *ppvObject = &This->IStillImageW_iface;
279c2c66affSColin Finck else
280c2c66affSColin Finck {
281c2c66affSColin Finck if (IsEqualGUID(riid, &IID_IStillImageA))
282c2c66affSColin Finck FIXME("interface IStillImageA is unsupported on Windows Vista too, please report if it's needed\n");
283c2c66affSColin Finck else
284c2c66affSColin Finck FIXME("interface %s not implemented\n", debugstr_guid(riid));
285c2c66affSColin Finck *ppvObject = NULL;
286c2c66affSColin Finck return E_NOINTERFACE;
287c2c66affSColin Finck }
288c2c66affSColin Finck
289c2c66affSColin Finck IUnknown_AddRef((IUnknown*) *ppvObject);
290c2c66affSColin Finck return S_OK;
291c2c66affSColin Finck }
292c2c66affSColin Finck
Internal_AddRef(IUnknown * iface)293c2c66affSColin Finck static ULONG WINAPI Internal_AddRef(IUnknown *iface)
294c2c66affSColin Finck {
295c2c66affSColin Finck stillimage *This = impl_from_IUnknown(iface);
296c2c66affSColin Finck return InterlockedIncrement(&This->ref);
297c2c66affSColin Finck }
298c2c66affSColin Finck
Internal_Release(IUnknown * iface)299c2c66affSColin Finck static ULONG WINAPI Internal_Release(IUnknown *iface)
300c2c66affSColin Finck {
301c2c66affSColin Finck ULONG ref;
302c2c66affSColin Finck stillimage *This = impl_from_IUnknown(iface);
303c2c66affSColin Finck
304c2c66affSColin Finck ref = InterlockedDecrement(&This->ref);
305c2c66affSColin Finck if (ref == 0)
306c2c66affSColin Finck HeapFree(GetProcessHeap(), 0, This);
307c2c66affSColin Finck return ref;
308c2c66affSColin Finck }
309c2c66affSColin Finck
310c2c66affSColin Finck static const struct IUnknownVtbl internal_unk_vtbl =
311c2c66affSColin Finck {
312c2c66affSColin Finck Internal_QueryInterface,
313c2c66affSColin Finck Internal_AddRef,
314c2c66affSColin Finck Internal_Release
315c2c66affSColin Finck };
316c2c66affSColin Finck
317c2c66affSColin Finck /******************************************************************************
318c2c66affSColin Finck * StiCreateInstanceA (STI.@)
319c2c66affSColin Finck */
StiCreateInstanceA(HINSTANCE hinst,DWORD dwVer,PSTIA * ppSti,LPUNKNOWN pUnkOuter)320c2c66affSColin Finck HRESULT WINAPI StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, PSTIA *ppSti, LPUNKNOWN pUnkOuter)
321c2c66affSColin Finck {
322c2c66affSColin Finck FIXME("(%p, %u, %p, %p): stub, unimplemented on Windows Vista too, please report if it's needed\n", hinst, dwVer, ppSti, pUnkOuter);
323c2c66affSColin Finck return STG_E_UNIMPLEMENTEDFUNCTION;
324c2c66affSColin Finck }
325c2c66affSColin Finck
326c2c66affSColin Finck /******************************************************************************
327c2c66affSColin Finck * StiCreateInstanceW (STI.@)
328c2c66affSColin Finck */
StiCreateInstanceW(HINSTANCE hinst,DWORD dwVer,PSTIW * ppSti,LPUNKNOWN pUnkOuter)329c2c66affSColin Finck HRESULT WINAPI StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, PSTIW *ppSti, LPUNKNOWN pUnkOuter)
330c2c66affSColin Finck {
331c2c66affSColin Finck stillimage *This;
332c2c66affSColin Finck HRESULT hr;
333c2c66affSColin Finck
334c2c66affSColin Finck TRACE("(%p, %u, %p, %p)\n", hinst, dwVer, ppSti, pUnkOuter);
335c2c66affSColin Finck
336c2c66affSColin Finck This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(stillimage));
337c2c66affSColin Finck if (This)
338c2c66affSColin Finck {
339c2c66affSColin Finck This->IStillImageW_iface.lpVtbl = &stillimagew_vtbl;
340c2c66affSColin Finck This->IUnknown_inner.lpVtbl = &internal_unk_vtbl;
341c2c66affSColin Finck if (pUnkOuter)
342c2c66affSColin Finck This->outer_unk = pUnkOuter;
343c2c66affSColin Finck else
344c2c66affSColin Finck This->outer_unk = &This->IUnknown_inner;
345c2c66affSColin Finck This->ref = 1;
346c2c66affSColin Finck
347c2c66affSColin Finck hr = IStillImage_Initialize(&This->IStillImageW_iface, hinst, dwVer);
348c2c66affSColin Finck if (SUCCEEDED(hr))
349c2c66affSColin Finck {
350c2c66affSColin Finck if (pUnkOuter)
351c2c66affSColin Finck *ppSti = (IStillImageW*) &This->IUnknown_inner;
352c2c66affSColin Finck else
353c2c66affSColin Finck *ppSti = &This->IStillImageW_iface;
354c2c66affSColin Finck }
355c2c66affSColin Finck }
356c2c66affSColin Finck else
357c2c66affSColin Finck hr = E_OUTOFMEMORY;
358c2c66affSColin Finck
359c2c66affSColin Finck return hr;
360c2c66affSColin Finck }
361