ReactOS 0.4.15-dev-7934-g1dc8d80
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 IReferenceClockImplimpl_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 baseTime, REFERENCE_TIME streamTime, HANDLE hEvent, DWORD *pdwAdviseCookie)
 
static HRESULT WINAPI IReferenceClockImpl_AdvisePeriodic (IReferenceClock *iface, REFERENCE_TIME startTime, REFERENCE_TIME periodTime, HANDLE hSemaphore, DWORD *pdwAdviseCookie)
 
static HRESULT WINAPI IReferenceClockImpl_Unadvise (IReferenceClock *iface, DWORD dwAdviseCookie)
 
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 121 of file clock.c.

122{
124 HRESULT hr;
125
126 TRACE("(%s, %p, %p)\n", debugstr_guid(riid), ret_iface, unkouter);
127
129 if (!clock) {
130 *ret_iface = NULL;
131 return E_OUTOFMEMORY;
132 }
133
134 clock->IReferenceClock_iface.lpVtbl = &ReferenceClock_Vtbl;
135 clock->ref = 1;
136 clock->rtTime = 0;
137 clock->pClockInfo.dwSize = sizeof (DMUS_CLOCKINFO);
138
140 hr = IReferenceClockImpl_QueryInterface(&clock->IReferenceClock_iface, riid, ret_iface);
141 IReferenceClock_Release(&clock->IReferenceClock_iface);
142
143 return hr;
144}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#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:110
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static void DMUSIC_LockModule(void)
DMUS_CLOCKINFO8 DMUS_CLOCKINFO
Definition: dmusicc.h:277
#define IReferenceClock_Release(p)
Definition: dmusicc.h:752
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition: clock.c:23
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by midi_port_create(), and synth_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 = %u\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  startTime,
REFERENCE_TIME  periodTime,
HANDLE  hSemaphore,
DWORD pdwAdviseCookie 
)
static

Definition at line 92 of file clock.c.

93{
95
96 FIXME("(%p)->(0x%s, 0x%s, %p, %p): stub\n", This, wine_dbgstr_longlong(startTime), wine_dbgstr_longlong(periodTime), hSemaphore, pdwAdviseCookie);
97
98 return S_OK;
99}
#define FIXME(fmt,...)
Definition: debug.h:111
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
static ULONGLONG startTime
Definition: main.c:113
#define S_OK
Definition: intsafe.h:52

◆ IReferenceClockImpl_AdviseTime()

static HRESULT WINAPI IReferenceClockImpl_AdviseTime ( IReferenceClock iface,
REFERENCE_TIME  baseTime,
REFERENCE_TIME  streamTime,
HANDLE  hEvent,
DWORD pdwAdviseCookie 
)
static

Definition at line 83 of file clock.c.

84{
86
87 FIXME("(%p)->(0x%s, 0x%s, %p, %p): stub\n", This, wine_dbgstr_longlong(baseTime), wine_dbgstr_longlong(streamTime), hEvent, pdwAdviseCookie);
88
89 return S_OK;
90}
static HANDLE hEvent
Definition: comm.c:54

◆ IReferenceClockImpl_GetTime()

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

Definition at line 72 of file clock.c.

73{
75
76 TRACE("(%p)->(%p)\n", This, pTime);
77
78 *pTime = This->rtTime;
79
80 return S_OK;
81}
_In_ PCCERT_CONTEXT _In_opt_ LPFILETIME pTime
Definition: wincrypt.h:4837

◆ 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}
const GUID IID_IUnknown
#define WARN(fmt,...)
Definition: debug.h:112
const char * debugstr_dmguid(const GUID *id)
Definition: dmusic_main.c:237
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

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 = %u\n", This, ref);
62
63 if (!ref) {
66 }
67
68 return ref;
69}
#define InterlockedDecrement
Definition: armddk.h:52
#define HeapFree(x, y, z)
Definition: compat.h:735
static void DMUSIC_UnlockModule(void)

◆ IReferenceClockImpl_Unadvise()

static HRESULT WINAPI IReferenceClockImpl_Unadvise ( IReferenceClock iface,
DWORD  dwAdviseCookie 
)
static

Definition at line 101 of file clock.c.

102{
104
105 FIXME("(%p)->(%d): stub\n", This, dwAdviseCookie);
106
107 return S_OK;
108}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dmusic  )

Variable Documentation

◆ ReferenceClock_Vtbl

const IReferenceClockVtbl ReferenceClock_Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI IReferenceClockImpl_AdvisePeriodic(IReferenceClock *iface, REFERENCE_TIME startTime, REFERENCE_TIME periodTime, HANDLE hSemaphore, DWORD *pdwAdviseCookie)
Definition: clock.c:92
static ULONG WINAPI IReferenceClockImpl_Release(IReferenceClock *iface)
Definition: clock.c:56
static HRESULT WINAPI IReferenceClockImpl_AdviseTime(IReferenceClock *iface, REFERENCE_TIME baseTime, REFERENCE_TIME streamTime, HANDLE hEvent, DWORD *pdwAdviseCookie)
Definition: clock.c:83
static ULONG WINAPI IReferenceClockImpl_AddRef(IReferenceClock *iface)
Definition: clock.c:46
static HRESULT WINAPI IReferenceClockImpl_GetTime(IReferenceClock *iface, REFERENCE_TIME *pTime)
Definition: clock.c:72
static HRESULT WINAPI IReferenceClockImpl_Unadvise(IReferenceClock *iface, DWORD dwAdviseCookie)
Definition: clock.c:101

Definition at line 110 of file clock.c.

Referenced by DMUSIC_CreateReferenceClockImpl().