ReactOS 0.4.16-dev-297-gc569aee
main.c File Reference
#include "config.h"
#include "wine/debug.h"
#include "quartz_private.h"
#include "wine/unicode.h"
#include "uuids.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  IClassFactoryImpl
 
struct  object_creation_info
 

Macros

#define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)    { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } , #name },
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (quartz)
 
HRESULT WINAPI QUARTZ_DllGetClassObject (REFCLSID, REFIID, LPVOID *)
 
static HRESULT SeekingPassThru_create (IUnknown *pUnkOuter, LPVOID *ppObj)
 
static IClassFactoryImplimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI DSCF_QueryInterface (IClassFactory *iface, REFIID riid, void **ppobj)
 
static ULONG WINAPI DSCF_AddRef (IClassFactory *iface)
 
static ULONG WINAPI DSCF_Release (IClassFactory *iface)
 
static HRESULT WINAPI DSCF_CreateInstance (IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj)
 
static HRESULT WINAPI DSCF_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT CALLBACK ICaptureGraphBuilder_FindInterface_Proxy (ICaptureGraphBuilder *This, const GUID *pCategory, IBaseFilter *pf, REFIID riid, void **ppint)
 
HRESULT __RPC_STUB ICaptureGraphBuilder_FindInterface_Stub (ICaptureGraphBuilder *This, const GUID *pCategory, IBaseFilter *pf, REFIID riid, IUnknown **ppint)
 
HRESULT CALLBACK ICaptureGraphBuilder2_FindInterface_Proxy (ICaptureGraphBuilder2 *This, const GUID *pCategory, const GUID *pType, IBaseFilter *pf, REFIID riid, void **ppint)
 
HRESULT __RPC_STUB ICaptureGraphBuilder2_FindInterface_Stub (ICaptureGraphBuilder2 *This, const GUID *pCategory, const GUID *pType, IBaseFilter *pf, REFIID riid, IUnknown **ppint)
 
const charqzdebugstr_guid (const GUID *id)
 
LONG WINAPI AmpFactorToDB (LONG ampfactor)
 
LONG WINAPI DBToAmpFactor (LONG db)
 
DWORD WINAPI AMGetErrorTextA (HRESULT hr, LPSTR buffer, DWORD maxlen)
 
DWORD WINAPI AMGetErrorTextW (HRESULT hr, LPWSTR buffer, DWORD maxlen)
 

Variables

static const struct object_creation_info object_creation []
 
static const IClassFactoryVtbl DSCF_Vtbl
 
struct {
   const GUID   riid
 
   const char *   name
 
InterfaceDesc []
 

Macro Definition Documentation

◆ OUR_GUID_ENTRY

#define OUR_GUID_ENTRY (   name,
  l,
  w1,
  w2,
  b1,
  b2,
  b3,
  b4,
  b5,
  b6,
  b7,
  b8 
)     { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } , #name },

Definition at line 219 of file main.c.

Function Documentation

◆ AMGetErrorTextA()

DWORD WINAPI AMGetErrorTextA ( HRESULT  hr,
LPSTR  buffer,
DWORD  maxlen 
)

Definition at line 307 of file main.c.

308{
309 DWORD res;
311
312 TRACE("(%x,%p,%d)\n", hr, buffer, maxlen);
313 if (!buffer)
314 return 0;
315
316 res = AMGetErrorTextW(hr, errorW, sizeof(errorW)/sizeof(*errorW));
317 return WideCharToMultiByte(CP_ACP, 0, errorW, res, buffer, maxlen, 0, 0);
318}
DWORD WINAPI AMGetErrorTextW(HRESULT hr, LPWSTR buffer, DWORD maxlen)
Definition: main.c:323
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define MAX_ERROR_TEXT_LEN
Definition: errors.h:29
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
static const WCHAR errorW[]
Definition: htmlevent.c:61
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ AMGetErrorTextW()

DWORD WINAPI AMGetErrorTextW ( HRESULT  hr,
LPWSTR  buffer,
DWORD  maxlen 
)

Definition at line 323 of file main.c.

324{
325 unsigned int len;
326 static const WCHAR format[] = {'E','r','r','o','r',':',' ','0','x','%','l','x',0};
328
329 FIXME("(%x,%p,%d) stub\n", hr, buffer, maxlen);
330
331 if (!buffer) return 0;
333 if ((len = strlenW(error)) >= maxlen) return 0;
335 return len;
336}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define lstrcpyW
Definition: compat.h:749
GLenum GLsizei len
Definition: glext.h:6722
#define error(str)
Definition: mkdosfs.c:1605
#define strlenW(s)
Definition: unicode.h:34
Definition: format.c:58
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by AMGetErrorTextA().

◆ AmpFactorToDB()

LONG WINAPI AmpFactorToDB ( LONG  ampfactor)

Definition at line 289 of file main.c.

290{
291 FIXME("(%d) Stub!\n", ampfactor);
292 return 0;
293}

◆ DBToAmpFactor()

LONG WINAPI DBToAmpFactor ( LONG  db)

Definition at line 295 of file main.c.

296{
297 FIXME("(%d) Stub!\n", db);
298 /* Avoid divide by zero (probably during range computation) in Windows Media Player 6.4 */
299 if (db < -1000)
300 return 0;
301 return 100;
302}

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 211 of file main.c.

212{
213 if(server_locks == 0 && QUARTZ_DllCanUnloadNow() == S_OK)
214 return S_OK;
215 return S_FALSE;
216}
#define S_OK
Definition: intsafe.h:52
static LONG server_locks
Definition: ole_server.c:61
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 180 of file main.c.

181{
182 unsigned int i;
183
184 TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
185
187 {
188 for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++)
189 {
190 if (IsEqualGUID(object_creation[i].clsid, rclsid))
191 {
193 if (factory == NULL) return E_OUTOFMEMORY;
194
196 factory->ref = 1;
197
198 factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;
199
201 return S_OK;
202 }
203 }
204 }
205 return QUARTZ_DllGetClassObject( rclsid, riid, ppv );
206}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
static const struct object_creation_info object_creation[]
Definition: main.c:74
static const IClassFactoryVtbl DSCF_Vtbl
Definition: main.c:140
HRESULT WINAPI QUARTZ_DllGetClassObject(REFCLSID, REFIID, LPVOID *)
Definition: main.c:28
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
REFCLSID clsid
Definition: msctf.c:82
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
Definition: main.c:439
IClassFactory IClassFactory_iface
Definition: main.c:440

◆ DSCF_AddRef()

static ULONG WINAPI DSCF_AddRef ( IClassFactory iface)
static

Definition at line 104 of file main.c.

105{
107 return InterlockedIncrement(&This->ref);
108}
#define InterlockedIncrement
Definition: armddk.h:53
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:63

◆ DSCF_CreateInstance()

static HRESULT WINAPI DSCF_CreateInstance ( IClassFactory iface,
IUnknown pOuter,
REFIID  riid,
void **  ppobj 
)
static

Definition at line 122 of file main.c.

124{
127 LPUNKNOWN punk;
128
129 TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
130
131 *ppobj = NULL;
132 if(pOuter && !IsEqualGUID(&IID_IUnknown, riid))
133 return E_NOINTERFACE;
134
135 hres = This->pfnCreateInstance(pOuter, (LPVOID *) &punk);
136 if (SUCCEEDED(hres)) {
137 hres = IUnknown_QueryInterface(punk, riid, ppobj);
138 IUnknown_Release(punk);
139 }
140 return hres;
141}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:465
static LPUNKNOWN
Definition: ndr_ole.c:49
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ DSCF_LockServer()

static HRESULT WINAPI DSCF_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 143 of file main.c.

144{
146 FIXME("(%p)->(%d),stub!\n",This,dolock);
147 if(dolock)
149 else
151 return S_OK;
152}
#define InterlockedDecrement
Definition: armddk.h:52

◆ DSCF_QueryInterface()

static HRESULT WINAPI DSCF_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppobj 
)
static

Definition at line 89 of file main.c.

90{
93 {
94 IClassFactory_AddRef(iface);
95 *ppobj = iface;
96 return S_OK;
97 }
98
99 *ppobj = NULL;
100 WARN("(%p)->(%s,%p), not found\n", iface, debugstr_guid(riid), ppobj);
101 return E_NOINTERFACE;
102}
#define WARN(fmt,...)
Definition: precomp.h:61

◆ DSCF_Release()

static ULONG WINAPI DSCF_Release ( IClassFactory iface)
static

Definition at line 110 of file main.c.

111{
114
115 if (ref == 0)
117
118 return ref;
119}
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ ICaptureGraphBuilder2_FindInterface_Proxy()

HRESULT CALLBACK ICaptureGraphBuilder2_FindInterface_Proxy ( ICaptureGraphBuilder2 This,
const GUID pCategory,
const GUID pType,
IBaseFilter pf,
REFIID  riid,
void **  ppint 
)

Definition at line 253 of file main.c.

259{
260 return ICaptureGraphBuilder2_RemoteFindInterface_Proxy( This, pCategory, pType,
261 pf, riid, (IUnknown **)ppint );
262}

◆ ICaptureGraphBuilder2_FindInterface_Stub()

HRESULT __RPC_STUB ICaptureGraphBuilder2_FindInterface_Stub ( ICaptureGraphBuilder2 This,
const GUID pCategory,
const GUID pType,
IBaseFilter pf,
REFIID  riid,
IUnknown **  ppint 
)

Definition at line 264 of file main.c.

270{
271 return ICaptureGraphBuilder2_FindInterface( This, pCategory, pType, pf, riid, (void **)ppint );
272}

◆ ICaptureGraphBuilder_FindInterface_Proxy()

HRESULT CALLBACK ICaptureGraphBuilder_FindInterface_Proxy ( ICaptureGraphBuilder This,
const GUID pCategory,
IBaseFilter pf,
REFIID  riid,
void **  ppint 
)

Definition at line 234 of file main.c.

239{
240 return ICaptureGraphBuilder_RemoteFindInterface_Proxy( This, pCategory, pf,
241 riid, (IUnknown **)ppint );
242}

◆ ICaptureGraphBuilder_FindInterface_Stub()

HRESULT __RPC_STUB ICaptureGraphBuilder_FindInterface_Stub ( ICaptureGraphBuilder This,
const GUID pCategory,
IBaseFilter pf,
REFIID  riid,
IUnknown **  ppint 
)

Definition at line 244 of file main.c.

249{
250 return ICaptureGraphBuilder_FindInterface( This, pCategory, pf, riid, (void **)ppint );
251}

◆ impl_from_IClassFactory()

static IClassFactoryImpl * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 54 of file main.c.

55{
56 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
57}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ QUARTZ_DllGetClassObject()

HRESULT WINAPI QUARTZ_DllGetClassObject ( REFCLSID  ,
REFIID  ,
LPVOID  
)

Definition at line 28 of file main.c.

36{
37 return QUARTZ_DllMain( hInstDLL, fdwReason, lpv );
38}

Referenced by DllGetClassObject().

◆ qzdebugstr_guid()

◆ SeekingPassThru_create()

static HRESULT SeekingPassThru_create ( IUnknown pUnkOuter,
LPVOID ppObj 
)
static

Definition at line 40 of file main.c.

41{
42 return PosPassThru_Construct(pUnkOuter,ppObj); /* from strmbase */
43}
HRESULT WINAPI PosPassThru_Construct(IUnknown *pUnkOuter, LPVOID *ppPassThru)
Definition: pospass.c:249

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( quartz  )

Variable Documentation

◆ DSCF_Vtbl

const IClassFactoryVtbl DSCF_Vtbl
static
Initial value:
=
{
}
static ULONG WINAPI DSCF_AddRef(IClassFactory *iface)
Definition: main.c:81
static ULONG WINAPI DSCF_Release(IClassFactory *iface)
Definition: main.c:87
static HRESULT WINAPI DSCF_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:119
static HRESULT WINAPI DSCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
Definition: main.c:66
static HRESULT WINAPI DSCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj)
Definition: main.c:98

Definition at line 154 of file main.c.

◆ 

const struct { ... } InterfaceDesc[]
Initial value:
=
{
{ { 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0} }, NULL }
}

Referenced by qzdebugstr_guid(), and USBSTOR_FdoHandleStartDevice().

◆ name

Definition at line 224 of file main.c.

◆ object_creation

const struct object_creation_info object_creation[]
static
Initial value:
=
{
{ &CLSID_SeekingPassThru, SeekingPassThru_create },
{ &CLSID_FilterGraph, FilterGraph_create },
{ &CLSID_FilterGraphNoThread, FilterGraphNoThread_create },
{ &CLSID_FilterMapper, FilterMapper_create },
{ &CLSID_FilterMapper2, FilterMapper2_create },
{ &CLSID_AsyncReader, AsyncReader_create },
{ &CLSID_MemoryAllocator, StdMemAllocator_create },
{ &CLSID_AviSplitter, AVISplitter_create },
{ &CLSID_MPEG1Splitter, MPEGSplitter_create },
{ &CLSID_VideoRenderer, VideoRenderer_create },
{ &CLSID_NullRenderer, NullRenderer_create },
{ &CLSID_VideoMixingRenderer, VMR7Impl_create },
{ &CLSID_VideoMixingRenderer9, VMR9Impl_create },
{ &CLSID_VideoRendererDefault, VideoRendererDefault_create },
{ &CLSID_DSoundRender, DSoundRender_create },
{ &CLSID_AudioRender, DSoundRender_create },
{ &CLSID_AVIDec, AVIDec_create },
{ &CLSID_SystemClock, QUARTZ_CreateSystemClock },
{ &CLSID_ACMWrapper, ACMWrapper_create },
{ &CLSID_WAVEParser, WAVEParser_create }
}
HRESULT ACMWrapper_create(IUnknown *pUnkOuter, LPVOID *ppv)
Definition: acmwrapper.c:380
HRESULT AVIDec_create(IUnknown *pUnkOuter, LPVOID *ppv)
Definition: avidec.c:395
HRESULT AVISplitter_create(IUnknown *pUnkOuter, LPVOID *ppv)
Definition: avisplit.c:1430
HRESULT DSoundRender_create(IUnknown *pUnkOuter, LPVOID *ppv)
Definition: dsoundrender.c:618
HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: filtergraph.c:5689
HRESULT FilterGraphNoThread_create(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: filtergraph.c:5766
HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj)
HRESULT FilterMapper_create(IUnknown *pUnkOuter, LPVOID *ppObj)
static HRESULT SeekingPassThru_create(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: main.c:40
HRESULT StdMemAllocator_create(LPUNKNOWN lpUnkOuter, LPVOID *ppv)
Definition: memallocator.c:898
HRESULT MPEGSplitter_create(IUnknown *pUnkOuter, LPVOID *ppv)
Definition: mpegsplit.c:871
HRESULT AsyncReader_create(IUnknown *pUnkOuter, LPVOID *ppv)
Definition: filesource.c:420
HRESULT NullRenderer_create(IUnknown *pUnkOuter, void **ppv)
Definition: nullrenderer.c:225
HRESULT VMR9Impl_create(IUnknown *pUnkOuter, LPVOID *ppv) DECLSPEC_HIDDEN
Definition: vmr9.c:2451
HRESULT WAVEParser_create(IUnknown *pUnkOuter, LPVOID *ppv) DECLSPEC_HIDDEN
Definition: waveparser.c:419
HRESULT VideoRenderer_create(IUnknown *pUnkOuter, LPVOID *ppv) DECLSPEC_HIDDEN
HRESULT QUARTZ_CreateSystemClock(IUnknown *pUnkOuter, LPVOID *ppv) DECLSPEC_HIDDEN
Definition: systemclock.c:377
HRESULT VideoRendererDefault_create(IUnknown *pUnkOuter, LPVOID *ppv) DECLSPEC_HIDDEN
HRESULT VMR7Impl_create(IUnknown *pUnkOuter, LPVOID *ppv) DECLSPEC_HIDDEN
Definition: vmr9.c:2446

Definition at line 65 of file main.c.

◆ riid

Definition at line 223 of file main.c.