ReactOS 0.4.15-dev-8413-gc1c91f2
main.c File Reference
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winerror.h"
#include "ole2.h"
#include "rpcproxy.h"
#include "amstream_private.h"
#include "wine/debug.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  IClassFactoryImpl
 
struct  object_creation_info
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (amstream)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 
static IClassFactoryImplimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI AMCF_QueryInterface (IClassFactory *iface, REFIID riid, void **ppobj)
 
static ULONG WINAPI AMCF_AddRef (IClassFactory *iface)
 
static ULONG WINAPI AMCF_Release (IClassFactory *iface)
 
static HRESULT WINAPI AMCF_CreateInstance (IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj)
 
static HRESULT WINAPI AMCF_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

static HINSTANCE instance
 
static const struct object_creation_info object_creation []
 
static const IClassFactoryVtbl DSCF_Vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file main.c.

Function Documentation

◆ AMCF_AddRef()

static ULONG WINAPI AMCF_AddRef ( IClassFactory iface)
static

Definition at line 97 of file main.c.

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

◆ AMCF_CreateInstance()

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

Definition at line 115 of file main.c.

117{
120 IUnknown *punk;
121
122 TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
123
124 *ppobj = NULL;
125 hres = This->pfnCreateInstance(pOuter, (LPVOID *) &punk);
126 if (SUCCEEDED(hres)) {
127 hres = IUnknown_QueryInterface(punk, riid, ppobj);
128 IUnknown_Release(punk);
129 }
130 return hres;
131}
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_guid
Definition: kernel32.h:35
HRESULT hres
Definition: protocol.c:465
#define TRACE(s)
Definition: solgame.cpp:4

◆ AMCF_LockServer()

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

Definition at line 133 of file main.c.

134{
136 FIXME("(%p)->(%d),stub!\n",This,dolock);
137 return S_OK;
138}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define S_OK
Definition: intsafe.h:52

◆ AMCF_QueryInterface()

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

Definition at line 82 of file main.c.

83{
86 {
87 IClassFactory_AddRef(iface);
88 *ppobj = iface;
89 return S_OK;
90 }
91
92 *ppobj = NULL;
93 WARN("(%p)->(%s,%p), not found\n", iface, debugstr_guid(riid), ppobj);
94 return E_NOINTERFACE;
95}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ AMCF_Release()

static ULONG WINAPI AMCF_Release ( IClassFactory iface)
static

Definition at line 103 of file main.c.

104{
107
108 if (ref == 0)
110
111 return ref;
112}
#define InterlockedDecrement
Definition: armddk.h:52
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 204 of file main.c.

205{
206 return S_FALSE;
207}
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 166 of file main.c.

167{
168 unsigned int i;
170
171 TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
172
174 && ! IsEqualGUID( &IID_IUnknown, riid) )
175 return E_NOINTERFACE;
176
177 for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++)
178 {
179 if (IsEqualGUID(object_creation[i].clsid, rclsid))
180 break;
181 }
182
183 if (i == sizeof(object_creation)/sizeof(object_creation[0]))
184 {
185 FIXME("%s: no class found.\n", debugstr_guid(rclsid));
187 }
188
189 factory = HeapAlloc(GetProcessHeap(), 0, sizeof(*factory));
190 if (factory == NULL) return E_OUTOFMEMORY;
191
193 factory->ref = 1;
194
195 factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;
196
198 return S_OK;
199}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const struct object_creation_info object_creation[]
Definition: main.c:74
static const IClassFactoryVtbl DSCF_Vtbl
Definition: main.c:140
#define HeapAlloc
Definition: compat.h:733
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
REFIID LPVOID * ppv
Definition: atlbase.h:39
REFCLSID clsid
Definition: msctf.c:82
Definition: main.c:439
IClassFactory IClassFactory_iface
Definition: main.c:440
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  lpv 
)

Definition at line 43 of file main.c.

44{
45 switch(fdwReason) {
47 instance = hInstDLL;
49 break;
50 }
51 return TRUE;
52}
#define TRUE
Definition: types.h:120
static HINSTANCE instance
Definition: main.c:40
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 212 of file main.c.

213{
215}
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 220 of file main.c.

221{
223}
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ impl_from_IClassFactory()

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( amstream  )

Variable Documentation

◆ DSCF_Vtbl

const IClassFactoryVtbl DSCF_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI AMCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj)
Definition: main.c:115
static HRESULT WINAPI AMCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
Definition: main.c:82
static HRESULT WINAPI AMCF_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:133
static ULONG WINAPI AMCF_Release(IClassFactory *iface)
Definition: main.c:103
static ULONG WINAPI AMCF_AddRef(IClassFactory *iface)
Definition: main.c:97

Definition at line 140 of file main.c.

Referenced by DllGetClassObject().

◆ instance

HINSTANCE instance
static

Definition at line 40 of file main.c.

Referenced by _dump_EnumObjects_flags(), connection_collector(), dde_execute(), dde_request(), disassociate2_cb(), disassociate3_cb(), disassociate_cb(), DllMain(), DllRegisterServer(), DllUnregisterServer(), dummy_callback(), enum_devices_callback(), fake_dll_main(), get_dom_element(), getItemAndInstanceFromTable(), getItemAndIntegerInstanceFromOid(), ICONTITLE_Create(), IDirectPlay2AImpl_EnumGroupPlayers(), IDirectPlay2AImpl_EnumGroups(), IDirectPlay2AImpl_EnumPlayers(), IDirectPlay2Impl_EnumGroupPlayers(), IDirectPlay2Impl_EnumGroups(), IDirectPlay2Impl_EnumPlayers(), IDirectPlay3AImpl_EnumGroupPlayers(), IDirectPlay3AImpl_EnumGroups(), IDirectPlay3AImpl_EnumGroupsInGroup(), IDirectPlay3AImpl_EnumPlayers(), IDirectPlay3Impl_EnumGroupPlayers(), IDirectPlay3Impl_EnumGroups(), IDirectPlay3Impl_EnumGroupsInGroup(), IDirectPlay3Impl_EnumPlayers(), IDirectPlay4AImpl_EnumGroupPlayers(), IDirectPlay4AImpl_EnumGroups(), IDirectPlay4AImpl_EnumGroupsInGroup(), IDirectPlay4AImpl_EnumPlayers(), IDirectPlay4Impl_EnumGroupPlayers(), IDirectPlay4Impl_EnumGroups(), IDirectPlay4Impl_EnumGroupsInGroup(), IDirectPlay4Impl_EnumPlayers(), instance_semaphore_completion_cb(), ldap_cleanup(), ldap_startup(), load_string(), LoadStringA(), LoadStringW(), map_A_to_W(), map_W_to_A(), NPP_Destroy(), NPP_New(), NPP_SetWindow(), PdhMakeCounterPathW(), setOidWithItemAndInteger(), simple_group_cancel_cb(), SortTest::sort4(), START_TEST(), test_build_action_map(), test_desktop_winproc(), test_parser(), test_progman_dde(), test_progman_dde2(), test_request_groups(), time_stamp_callback(), and VSSAPI_CVssWriter_Initialize().

◆ object_creation

const struct object_creation_info object_creation[]
static
Initial value:
=
{
{ &CLSID_AMMultiMediaStream, AM_create },
{ &CLSID_AMDirectDrawStream, AM_create },
{ &CLSID_AMAudioData, AMAudioData_create },
{ &CLSID_MediaStreamFilter, MediaStreamFilter_create }
}
HRESULT MediaStreamFilter_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN
HRESULT AMAudioData_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN
Definition: audiodata.c:222
HRESULT AM_create(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: amstream.c:54

Definition at line 74 of file main.c.

Referenced by DllGetClassObject().