ReactOS  0.4.14-dev-991-g696cdc6
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 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
DMUS_CLOCKINFO8 DMUS_CLOCKINFO
Definition: dmusicc.h:277
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
static void DMUSIC_LockModule(void)
static const IReferenceClockVtbl ReferenceClock_Vtbl
Definition: clock.c:110
#define debugstr_guid
Definition: kernel32.h:35
static HRESULT WINAPI IReferenceClockImpl_QueryInterface(IReferenceClock *iface, REFIID riid, LPVOID *ppobj)
Definition: clock.c:31
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:78
clock_t clock(void)
Definition: clock.c:23
#define IReferenceClock_Release(p)
Definition: dmusicc.h:752
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by midi_port_create(), and synth_port_create().

◆ impl_from_IReferenceClock()

static IReferenceClockImpl* impl_from_IReferenceClock ( IReferenceClock iface)
inlinestatic

Definition at line 25 of file clock.c.

26 {
27  return CONTAINING_RECORD(iface, IReferenceClockImpl, IReferenceClock_iface);
28 }
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

Referenced by IReferenceClockImpl_AddRef(), IReferenceClockImpl_AdvisePeriodic(), IReferenceClockImpl_AdviseTime(), IReferenceClockImpl_GetTime(), IReferenceClockImpl_QueryInterface(), IReferenceClockImpl_Release(), and IReferenceClockImpl_Unadvise().

◆ 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 }
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
static IReferenceClockImpl * impl_from_IReferenceClock(IReferenceClock *iface)
Definition: clock.c:25
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ 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 }
static ULONGLONG startTime
Definition: main.c:113
#define FIXME(fmt,...)
Definition: debug.h:110
static IReferenceClockImpl * impl_from_IReferenceClock(IReferenceClock *iface)
Definition: clock.c:25
#define S_OK
Definition: intsafe.h:59
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41

◆ 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
#define FIXME(fmt,...)
Definition: debug.h:110
static IReferenceClockImpl * impl_from_IReferenceClock(IReferenceClock *iface)
Definition: clock.c:25
#define S_OK
Definition: intsafe.h:59
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41

◆ 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:4840
static IReferenceClockImpl * impl_from_IReferenceClock(IReferenceClock *iface)
Definition: clock.c:25
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ 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 E_NOINTERFACE
Definition: winerror.h:2364
const char * debugstr_dmguid(const GUID *id)
Definition: dmusic_main.c:237
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
static IReferenceClockImpl * impl_from_IReferenceClock(IReferenceClock *iface)
Definition: clock.c:25
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

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 }
Definition: send.c:47
static void DMUSIC_UnlockModule(void)
GLenum GLint ref
Definition: glext.h:6028
static IReferenceClockImpl * impl_from_IReferenceClock(IReferenceClock *iface)
Definition: clock.c:25
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ 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 }
#define FIXME(fmt,...)
Definition: debug.h:110
static IReferenceClockImpl * impl_from_IReferenceClock(IReferenceClock *iface)
Definition: clock.c:25
#define S_OK
Definition: intsafe.h:59

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dmusic  )

Variable Documentation

◆ ReferenceClock_Vtbl

const IReferenceClockVtbl ReferenceClock_Vtbl
static
Initial value:
= {
}
static ULONG WINAPI IReferenceClockImpl_AddRef(IReferenceClock *iface)
Definition: clock.c:46
static HRESULT WINAPI IReferenceClockImpl_AdvisePeriodic(IReferenceClock *iface, REFERENCE_TIME startTime, REFERENCE_TIME periodTime, HANDLE hSemaphore, DWORD *pdwAdviseCookie)
Definition: clock.c:92
static HRESULT WINAPI IReferenceClockImpl_QueryInterface(IReferenceClock *iface, REFIID riid, LPVOID *ppobj)
Definition: clock.c:31
static HRESULT WINAPI IReferenceClockImpl_Unadvise(IReferenceClock *iface, DWORD dwAdviseCookie)
Definition: clock.c:101
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 HRESULT WINAPI IReferenceClockImpl_GetTime(IReferenceClock *iface, REFERENCE_TIME *pTime)
Definition: clock.c:72

Definition at line 110 of file clock.c.

Referenced by DMUSIC_CreateReferenceClockImpl().