24#include "wine/unicode.h"
76 if (
NULL == prev_it) {
90#define MAX_REFTIME (REFERENCE_TIME)(0x7FFFFFFFFFFFFFFF)
91#define ADVISE_EXIT (WM_APP + 0)
92#define ADVISE_REMOVE (WM_APP + 2)
93#define ADVISE_ADD_SINGLESHOT (WM_APP + 4)
94#define ADVISE_ADD_PERIODIC (WM_APP + 8)
119 it =
This->pSingleShotAdvise;
133 for (it =
This->pPeriodicAdvise;
NULL != it; it = it->
next) {
143 if (timeOut > tmpTimeOut) timeOut = tmpTimeOut;
155 switch (
msg.message) {
169 ERR(
"Unhandled message %u. Critical Path\n",
msg.message);
218 *ppobj = &
This->IReferenceClock_iface;
236 This->safe.DebugInfo->Spare[0] = 0;
245 DWORD curTimeTickCount;
257 if (
This->lastTimeTickCount == curTimeTickCount)
hr =
S_FALSE;
259 This->lastTimeTickCount = curTimeTickCount;
275 if (0 >= rtBaseTime + rtStreamTime) {
278 if (
NULL == pdwAdviseCookie) {
288 pEntry->rtBaseTime = rtBaseTime + rtStreamTime;
289 pEntry->rtIntervalTime = 0;
311 if (0 >= rtStartTime || 0 >= rtPeriodTime) {
314 if (
NULL == pdwAdviseCookie) {
324 pEntry->rtBaseTime = rtStartTime;
325 pEntry->rtIntervalTime = rtPeriodTime;
342 TRACE(
"(%p, %lu)\n",
This, dwAdviseCookie);
394 obj->safe.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": SystemClockImpl.safe");
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
DWORD WINAPI GetTickCount(VOID)
#define IReferenceClock_GetTime(p, a)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
#define IsEqualIID(riid1, riid2)
REFERENCE_TIME rtBaseTime
REFERENCE_TIME rtIntervalTime
SystemClockAdviseEntry * next
SystemClockAdviseEntry * prev
SystemClockAdviseEntry * pPeriodicAdvise
SystemClockAdviseEntry * pSingleShotAdvise
IReferenceClock IReferenceClock_iface
REFERENCE_TIME lastRefTime
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseSemaphore(IN HANDLE hSemaphore, IN LONG lReleaseCount, IN LPLONG lpPreviousCount)
HRESULT QUARTZ_CreateSystemClock(IUnknown *pUnkOuter, LPVOID *ppv)
static void QUARTZ_InsertAviseEntryFromQueue(SystemClockImpl *This, SystemClockAdviseEntry *pEntry, SystemClockAdviseEntry **pQueue)
static HRESULT WINAPI SystemClockImpl_AdvisePeriodic(IReferenceClock *iface, REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime, HSEMAPHORE hSemaphore, DWORD_PTR *pdwAdviseCookie)
static DWORD WINAPI SystemClockAdviseThread(LPVOID lpParam)
static BOOL SystemClockPostMessageToAdviseThread(SystemClockImpl *This, UINT iMsg)
static HRESULT WINAPI SystemClockImpl_Unadvise(IReferenceClock *iface, DWORD_PTR dwAdviseCookie)
#define ADVISE_ADD_SINGLESHOT
static ULONG WINAPI SystemClockImpl_AddRef(IReferenceClock *iface)
static HRESULT WINAPI SystemClockImpl_AdviseTime(IReferenceClock *iface, REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime, HEVENT hEvent, DWORD_PTR *pdwAdviseCookie)
static SystemClockImpl * impl_from_IReferenceClock(IReferenceClock *iface)
static HRESULT WINAPI SystemClockImpl_GetTime(IReferenceClock *iface, REFERENCE_TIME *pTime)
static const IReferenceClockVtbl SystemClock_Vtbl
static void QUARTZ_RemoveAviseEntryFromQueue(SystemClockImpl *This, SystemClockAdviseEntry *pEntry)
#define ADVISE_ADD_PERIODIC
static ULONG WINAPI SystemClockImpl_Release(IReferenceClock *iface)
static HRESULT WINAPI SystemClockImpl_QueryInterface(IReferenceClock *iface, REFIID riid, void **ppobj)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define CONTAINING_RECORD(address, type, field)
DWORD WINAPI GetLastError(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define THREAD_PRIORITY_TIME_CRITICAL
_In_ PCCERT_CONTEXT _In_opt_ LPFILETIME pTime
#define ERROR_INVALID_THREAD_ID
BOOL WINAPI TranslateMessage(_In_ const MSG *)
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)