ReactOS  0.4.14-dev-1338-g0d187f7
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 */
36  case DLL_PROCESS_ATTACH:
37  DisableThreadLibraryCalls(hinstDLL);
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 
89 typedef struct {
93 
95 {
96  return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager2_iface);
97 }
98 
100 {
102 
103  if(IsEqualGUID(&IID_IUnknown, riid)) {
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)
140  heap_free(This);
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 
201 static 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 
228  *ret = (IWMProfileManager *)&profile_mgr->IWMProfileManager2_iface;
229  return S_OK;
230 }
static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager2 *iface, REFIID riid, void **ppv)
Definition: wmvcore_main.c:99
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
#define E_NOINTERFACE
Definition: winerror.h:2364
static HRESULT WINAPI WMProfileManager2_GetSystemProfileVersion(IWMProfileManager2 *iface, WMT_VERSION *version)
Definition: wmvcore_main.c:187
HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
Definition: wmvcore_main.c:215
Definition: scsiwmi.h:51
static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager2 *iface, DWORD *ret)
Definition: wmvcore_main.c:173
REFIID riid
Definition: precomp.h:44
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
HRESULT WINAPI DllRegisterServer(void)
Definition: wmvcore_main.c:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
WMT_VERSION
Definition: wmsdkidl.idl:159
DWORD scheme
HRESULT WINAPI WMCheckURLScheme(const WCHAR *scheme)
Definition: wmvcore_main.c:61
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager2 *iface, REFGUID guid, IWMProfile **ret)
Definition: wmvcore_main.c:152
static ULONG WINAPI WMProfileManager_Release(IWMProfileManager2 *iface)
Definition: wmvcore_main.c:132
static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager2 *iface)
Definition: wmvcore_main.c:122
HRESULT WINAPI WMCheckURLExtension(const WCHAR *url)
Definition: wmvcore_main.c:51
#define NS_E_INVALID_NAME
Definition: nserror.h:65
Definition: send.c:47
static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager2 *iface, const WCHAR *profile, IWMProfile **ret)
Definition: wmvcore_main.c:159
static IN DWORD IN LPVOID lpvReserved
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static WMProfileManager * impl_from_IWMProfileManager2(IWMProfileManager2 *iface)
Definition: wmvcore_main.c:94
const GUID * guid
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: wmvcore_main.c:28
GLuint index
Definition: glext.h:6031
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
static const WCHAR url[]
Definition: encode.c:1432
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager2 *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len)
Definition: wmvcore_main.c:166
int ret
#define InterlockedDecrement
Definition: armddk.h:52
IWMProfileManager2 IWMProfileManager2_iface
Definition: wmvcore_main.c:90
GLenum GLsizei len
Definition: glext.h:6722
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore)
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
HRESULT WINAPI WMCreateEditor(IWMMetadataEditor **editor)
Definition: wmvcore_main.c:68
static HRESULT WINAPI WMProfileManager2_SetSystemProfileVersion(IWMProfileManager2 *iface, WMT_VERSION version)
Definition: wmvcore_main.c:194
static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager2 *iface, WMT_VERSION version, IWMProfile **ret)
Definition: wmvcore_main.c:145
static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager2 *iface, DWORD index, IWMProfile **ret)
Definition: wmvcore_main.c:180
unsigned int ULONG
Definition: retypes.h:1
static const IWMProfileManager2Vtbl WMProfileManager2Vtbl
Definition: wmvcore_main.c:201
#define profile
Definition: kernel32.h:12
HRESULT WINAPI WMCreateBackupRestorer(IUnknown *callback, IWMLicenseBackup **licBackup)
Definition: wmvcore_main.c:77
static BOOL heap_free(void *mem)
Definition: appwiz.h:75