ReactOS 0.4.17-dev-966-gf06eace
clock.c File Reference
#include "dmusic_private.h"
Include dependency graph for clock.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dmusic)
 
static IReferenceClockImpl * impl_from_IReferenceClock (IReferenceClock *iface)
 
static HRESULT WINAPI IReferenceClockImpl_QueryInterface (IReferenceClock *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI IReferenceClockImpl_AddRef (IReferenceClock *iface)
 
static ULONG WINAPI IReferenceClockImpl_Release (IReferenceClock *iface)
 
static HRESULT WINAPI IReferenceClockImpl_GetTime (IReferenceClock *iface, REFERENCE_TIME *pTime)
 
static HRESULT WINAPI IReferenceClockImpl_AdviseTime (IReferenceClock *iface, REFERENCE_TIME base, REFERENCE_TIME offset, HEVENT event, DWORD_PTR *cookie)
 
static HRESULT WINAPI IReferenceClockImpl_AdvisePeriodic (IReferenceClock *iface, REFERENCE_TIME start, REFERENCE_TIME period, HSEMAPHORE semaphore, DWORD_PTR *cookie)
 
static HRESULT WINAPI IReferenceClockImpl_Unadvise (IReferenceClock *iface, DWORD_PTR cookie)
 
HRESULT DMUSIC_CreateReferenceClockImpl (LPCGUID riid, LPVOID *ret_iface, LPUNKNOWN unkouter)
 

Variables

static const IReferenceClockVtbl ReferenceClock_Vtbl
 

Function Documentation

◆ DMUSIC_CreateReferenceClockImpl()

HRESULT DMUSIC_CreateReferenceClockImpl ( LPCGUID  riid,
LPVOID *  ret_iface,
LPUNKNOWN  unkouter 
)

Definition at line 116 of file clock.c.

117{
119 HRESULT hr;
120
121 TRACE("(%s, %p, %p)\n", debugstr_guid(riid), ret_iface, unkouter);
122
123 clock = calloc(1, sizeof(IReferenceClockImpl));
124 if (!clock) {
125 *ret_iface = NULL;
126 return E_OUTOFMEMORY;
127 }
128
129 clock->IReferenceClock_iface.lpVtbl = &ReferenceClock_Vtbl;
130 clock->ref = 1;
131 clock->rtTime = 0;
132 clock->pClockInfo.dwSize = sizeof (DMUS_CLOCKINFO);
133
134 hr = IReferenceClockImpl_QueryInterface(&clock->IReferenceClock_iface, riid, ret_iface);
135 IReferenceClock_Release(&clock->IReferenceClock_iface);
136
137 return hr;
138}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
static HRESULT WINAPI IReferenceClockImpl_QueryInterface(IReferenceClock *iface, REFIID riid, LPVOID *ppobj)
Definition: clock.c:31
static const IReferenceClockVtbl ReferenceClock_Vtbl
Definition: clock.c:105
_ACRTIMP clock_t __cdecl clock(void)
Definition: time.c:698
DMUS_CLOCKINFO8 DMUS_CLOCKINFO
Definition: dmusicc.h:278
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define calloc
Definition: rosglue.h:14
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by midi_port_create().

◆ impl_from_IReferenceClock()

static IReferenceClockImpl * impl_from_IReferenceClock ( IReferenceClock *  iface)
inlinestatic

◆ IReferenceClockImpl_AddRef()

static ULONG WINAPI IReferenceClockImpl_AddRef ( IReferenceClock *  iface)
static

Definition at line 46 of file clock.c.

47{
50
51 TRACE("(%p): new ref = %lu\n", This, ref);
52
53 return ref;
54}
#define InterlockedIncrement
Definition: armddk.h:53
static IReferenceClockImpl * impl_from_IReferenceClock(IReferenceClock *iface)
Definition: clock.c:25
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ IReferenceClockImpl_AdvisePeriodic()

static HRESULT WINAPI IReferenceClockImpl_AdvisePeriodic ( IReferenceClock *  iface,
REFERENCE_TIME  start,
REFERENCE_TIME  period,
HSEMAPHORE  semaphore,
DWORD_PTR *  cookie 
)
static

Definition at line 90 of file clock.c.

92{
94 FIXME("(%p)->(%I64d, %I64d, %#Ix, %p): stub\n", This, start, period, semaphore, cookie);
95 return S_OK;
96}
#define FIXME(fmt,...)
Definition: precomp.h:53
GLuint start
Definition: gl.h:1545
#define S_OK
Definition: intsafe.h:52
static HANDLE semaphore
Definition: loader.c:2947
Definition: cookie.c:34

◆ IReferenceClockImpl_AdviseTime()

static HRESULT WINAPI IReferenceClockImpl_AdviseTime ( IReferenceClock *  iface,
REFERENCE_TIME  base,
REFERENCE_TIME  offset,
HEVENT  event,
DWORD_PTR *  cookie 
)
static

Definition at line 82 of file clock.c.

84{
86 FIXME("(%p)->(%I64d, %I64d, %#Ix, %p): stub\n", This, base, offset, event, cookie);
87 return S_OK;
88}
GLintptr offset
Definition: glext.h:5920
Definition: filter.c:185

◆ IReferenceClockImpl_GetTime()

static HRESULT WINAPI IReferenceClockImpl_GetTime ( IReferenceClock *  iface,
REFERENCE_TIME *  pTime 
)
static

Definition at line 71 of file clock.c.

72{
74
75 TRACE("(%p)->(%p)\n", This, pTime);
76
77 *pTime = This->rtTime;
78
79 return S_OK;
80}

◆ IReferenceClockImpl_QueryInterface()

static HRESULT WINAPI IReferenceClockImpl_QueryInterface ( IReferenceClock *  iface,
REFIID  riid,
LPVOID *  ppobj 
)
static

Definition at line 31 of file clock.c.

32{
34 TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
35
36 if (IsEqualIID (riid, &IID_IUnknown) ||
37 IsEqualIID (riid, &IID_IReferenceClock)) {
38 IUnknown_AddRef(iface);
39 *ppobj = This;
40 return S_OK;
41 }
42 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
43 return E_NOINTERFACE;
44}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
const char * debugstr_dmguid(const GUID *id)
Definition: dmobject.c:36
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:3479

Referenced by DMUSIC_CreateReferenceClockImpl().

◆ IReferenceClockImpl_Release()

static ULONG WINAPI IReferenceClockImpl_Release ( IReferenceClock *  iface)
static

Definition at line 56 of file clock.c.

57{
60
61 TRACE("(%p): new ref = %lu\n", This, ref);
62
63 if (!ref) {
64 free(This);
65 }
66
67 return ref;
68}
#define InterlockedDecrement
Definition: armddk.h:52
#define free
Definition: debug_ros.c:5

◆ IReferenceClockImpl_Unadvise()

static HRESULT WINAPI IReferenceClockImpl_Unadvise ( IReferenceClock *  iface,
DWORD_PTR  cookie 
)
static

Definition at line 98 of file clock.c.

99{
101 FIXME("(%p, %#Ix): stub\n", This, cookie);
102 return S_OK;
103}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dmusic  )

Variable Documentation

◆ ReferenceClock_Vtbl

const IReferenceClockVtbl ReferenceClock_Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI IReferenceClockImpl_Unadvise(IReferenceClock *iface, DWORD_PTR cookie)
Definition: clock.c:98
static ULONG WINAPI IReferenceClockImpl_Release(IReferenceClock *iface)
Definition: clock.c:56
static HRESULT WINAPI IReferenceClockImpl_AdvisePeriodic(IReferenceClock *iface, REFERENCE_TIME start, REFERENCE_TIME period, HSEMAPHORE semaphore, DWORD_PTR *cookie)
Definition: clock.c:90
static ULONG WINAPI IReferenceClockImpl_AddRef(IReferenceClock *iface)
Definition: clock.c:46
static HRESULT WINAPI IReferenceClockImpl_AdviseTime(IReferenceClock *iface, REFERENCE_TIME base, REFERENCE_TIME offset, HEVENT event, DWORD_PTR *cookie)
Definition: clock.c:82
static HRESULT WINAPI IReferenceClockImpl_GetTime(IReferenceClock *iface, REFERENCE_TIME *pTime)
Definition: clock.c:71

Definition at line 105 of file clock.c.

Referenced by DMUSIC_CreateReferenceClockImpl().