ReactOS 0.4.15-dev-7906-g1b85a5f
wmvcore_main.c
Go to the documentation of this file.
1/*
2 * Copyright 2012 Austin English
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include "wmvcore.h"
20
21#include "initguid.h"
22#include "wmsdk.h"
23#include "wine/debug.h"
24#include "wine/heap.h"
25
27
29{
30 TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
31
32 switch (fdwReason)
33 {
34 case DLL_WINE_PREATTACH:
35 return FALSE; /* prefer native version */
38 break;
39 }
40
41 return TRUE;
42}
43
45{
46 FIXME("(): stub\n");
47
48 return S_OK;
49}
50
52{
53 FIXME("(%s): stub\n", wine_dbgstr_w(url));
54
55 if (!url)
56 return E_INVALIDARG;
57
58 return NS_E_INVALID_NAME;
59}
60
62{
63 FIXME("(%s): stub\n", wine_dbgstr_w(scheme));
64
65 return NS_E_INVALID_NAME;
66}
67
69{
70 FIXME("(%p): stub\n", editor);
71
72 *editor = NULL;
73
74 return E_NOTIMPL;
75}
76
78{
79 FIXME("(%p %p): stub\n", callback, licBackup);
80
81 if (!callback)
82 return E_INVALIDARG;
83
84 *licBackup = NULL;
85
86 return E_NOTIMPL;
87}
88
89typedef struct {
93
95{
96 return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager2_iface);
97}
98
100{
102
104 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
105 *ppv = &This->IWMProfileManager2_iface;
106 }else if(IsEqualGUID(&IID_IWMProfileManager, riid)) {
107 TRACE("(%p)->(IID_IWMProfileManager %p)\n", This, ppv);
108 *ppv = &This->IWMProfileManager2_iface;
109 }else if(IsEqualGUID(&IID_IWMProfileManager2, riid)) {
110 TRACE("(%p)->(IID_IWMProfileManager2 %p)\n", This, ppv);
111 *ppv = &This->IWMProfileManager2_iface;
112 }else {
113 FIXME("Unsupported iface %s\n", debugstr_guid(riid));
114 *ppv = NULL;
115 return E_NOINTERFACE;
116 }
117
118 IUnknown_AddRef((IUnknown*)*ppv);
119 return S_OK;
120}
121
123{
126
127 TRACE("(%p) ref=%d\n", This, ref);
128
129 return ref;
130}
131
133{
136
137 TRACE("(%p) ref=%d\n", This, ref);
138
139 if(!ref)
141
142 return ref;
143}
144
146{
148 FIXME("(%p)->(%x %p)\n", This, version, ret);
149 return E_NOTIMPL;
150}
151
153{
155 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(guid), ret);
156 return E_NOTIMPL;
157}
158
160{
162 FIXME("(%p)->(%s %p)\n", This, debugstr_w(profile), ret);
163 return E_NOTIMPL;
164}
165
167{
169 FIXME("(%p)->(%p %p %p)\n", This, profile, profile_str, len);
170 return E_NOTIMPL;
171}
172
174{
176 FIXME("(%p)->(%p)\n", This, ret);
177 return E_NOTIMPL;
178}
179
181{
183 FIXME("(%p)->(%d %p)\n", This, index, ret);
184 return E_NOTIMPL;
185}
186
188{
190 FIXME("(%p)->(%p)\n", This, version);
191 return E_NOTIMPL;
192}
193
195{
197 FIXME("(%p)->(%x)\n", This, version);
198 return E_NOTIMPL;
199}
200
201static const IWMProfileManager2Vtbl WMProfileManager2Vtbl = {
213};
214
216{
217 WMProfileManager *profile_mgr;
218
219 TRACE("(%p)\n", ret);
220
221 profile_mgr = heap_alloc(sizeof(*profile_mgr));
222 if(!profile_mgr)
223 return E_OUTOFMEMORY;
224
225 profile_mgr->IWMProfileManager2_iface.lpVtbl = &WMProfileManager2Vtbl;
226 profile_mgr->ref = 1;
227
229 return S_OK;
230}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint index
Definition: glext.h:6031
GLenum GLsizei len
Definition: glext.h:6722
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
#define profile
Definition: kernel32.h:12
#define debugstr_w
Definition: kernel32.h:32
#define wine_dbgstr_w
Definition: kernel32.h:34
static IN DWORD IN LPVOID lpvReserved
const GUID * guid
static IPrintDialogCallback callback
Definition: printdlg.c:326
static const WCHAR url[]
Definition: encode.c:1432
#define NS_E_INVALID_NAME
Definition: nserror.h:65
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
DWORD scheme
#define TRACE(s)
Definition: solgame.cpp:4
IWMProfileManager2 IWMProfileManager2_iface
Definition: wmvcore_main.c:90
Definition: scsiwmi.h:51
Definition: send.c:48
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
WMT_VERSION
Definition: wmsdkidl.idl:160
static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager2 *iface, REFIID riid, void **ppv)
Definition: wmvcore_main.c:99
static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager2 *iface, REFGUID guid, IWMProfile **ret)
Definition: wmvcore_main.c:152
HRESULT WINAPI WMCheckURLScheme(const WCHAR *scheme)
Definition: wmvcore_main.c:61
HRESULT WINAPI DllRegisterServer(void)
Definition: wmvcore_main.c:44
HRESULT WINAPI WMCreateBackupRestorer(IUnknown *callback, IWMLicenseBackup **licBackup)
Definition: wmvcore_main.c:77
static WMProfileManager * impl_from_IWMProfileManager2(IWMProfileManager2 *iface)
Definition: wmvcore_main.c:94
HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
Definition: wmvcore_main.c:215
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: wmvcore_main.c:28
static const IWMProfileManager2Vtbl WMProfileManager2Vtbl
Definition: wmvcore_main.c:201
static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager2 *iface, DWORD *ret)
Definition: wmvcore_main.c:173
static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager2 *iface, DWORD index, IWMProfile **ret)
Definition: wmvcore_main.c:180
static HRESULT WINAPI WMProfileManager2_SetSystemProfileVersion(IWMProfileManager2 *iface, WMT_VERSION version)
Definition: wmvcore_main.c:194
HRESULT WINAPI WMCheckURLExtension(const WCHAR *url)
Definition: wmvcore_main.c:51
static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager2 *iface, WMT_VERSION version, IWMProfile **ret)
Definition: wmvcore_main.c:145
static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager2 *iface, const WCHAR *profile, IWMProfile **ret)
Definition: wmvcore_main.c:159
static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager2 *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len)
Definition: wmvcore_main.c:166
static ULONG WINAPI WMProfileManager_Release(IWMProfileManager2 *iface)
Definition: wmvcore_main.c:132
static HRESULT WINAPI WMProfileManager2_GetSystemProfileVersion(IWMProfileManager2 *iface, WMT_VERSION *version)
Definition: wmvcore_main.c:187
static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager2 *iface)
Definition: wmvcore_main.c:122
HRESULT WINAPI WMCreateEditor(IWMMetadataEditor **editor)
Definition: wmvcore_main.c:68
__wchar_t WCHAR
Definition: xmlstorage.h:180