ReactOS 0.4.15-dev-7924-g5949c20
clockforward.cpp File Reference
#include "precomp.h"
Include dependency graph for clockforward.cpp:

Go to the source code of this file.

Classes

class  CKsClockForwarder
 

Functions

DWORD WINAPI CKsClockForwarder_ThreadStartup (LPVOID lpParameter)
 
HRESULT WINAPI CKsClockForwarder_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 

Variables

const GUID IID_IKsClockForwarder = {0x877e4352, 0x6fea, 0x11d0, {0xb8, 0x63, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1}}
 

Function Documentation

◆ CKsClockForwarder_Constructor()

HRESULT WINAPI CKsClockForwarder_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv 
)

Definition at line 334 of file clockforward.cpp.

338{
339 HRESULT hr;
341
342#ifdef KSPROXY_TRACE
343 OutputDebugStringW(L"CKsClockForwarder_Constructor\n");
344#endif
345
346 // open default clock
348
349 if (hr != NOERROR)
350 {
351#ifdef KSPROXY_TRACE
352 OutputDebugString("CKsClockForwarder_Constructor failed to open device\n");
353#endif
354 return hr;
355 }
356
358
359 if (!clock)
360 {
361 // free clock handle
363 return E_OUTOFMEMORY;
364 }
365
366 if (FAILED(clock->QueryInterface(riid, ppv)))
367 {
368 /* not supported */
369 delete clock;
370 return E_NOINTERFACE;
371 }
372
373 return NOERROR;
374}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define CloseHandle
Definition: compat.h:739
#define GENERIC_READ
Definition: compat.h:135
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
#define KSCATEGORY_CLOCK
Definition: ks.h:215
KSDDKAPI HRESULT WINAPI KsOpenDefaultDevice(REFGUID Category, ACCESS_MASK Access, PHANDLE DeviceHandle)
Definition: ksproxy.cpp:101
#define GENERIC_WRITE
Definition: nt_native.h:90
#define L(x)
Definition: ntvdm.h:50
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition: clock.c:23
HRESULT hr
Definition: shlfolder.c:183
#define OutputDebugString
Definition: winbase.h:3890
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354

◆ CKsClockForwarder_ThreadStartup()

DWORD WINAPI CKsClockForwarder_ThreadStartup ( LPVOID  lpParameter)

Definition at line 299 of file clockforward.cpp.

300{
303
304 CKsClockForwarder * Fwd = (CKsClockForwarder*)lpParameter;
305
306 Fwd->m_ThreadStarted = TRUE;
307
308 do
309 {
310 if (Fwd->m_PendingStop)
311 break;
312
313 if (Fwd->m_State != KSSTATE_RUN)
315
320
321 Fwd->m_Clock->GetTime(&Time);
322 Time -= Fwd->m_Time;
323
325 }
326 while(TRUE);
327
328 Fwd->m_ThreadStarted = FALSE;
329 return NOERROR;
330}
IReferenceClock * m_Clock
REFERENCE_TIME m_Time
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
#define INFINITE
Definition: serial.h:102
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
HRESULT GetTime([out] REFERENCE_TIME *pTime)
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
@ KSSTATE_RUN
Definition: ks.h:1218
@ KSPROPERTY_CLOCK_TIME
Definition: ks.h:318
#define KSPROPSETID_Clock
Definition: ks.h:315
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
static PLARGE_INTEGER Time
Definition: time.c:105
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
Definition: wdfiotarget.h:1052

Variable Documentation

◆ IID_IKsClockForwarder

const GUID IID_IKsClockForwarder = {0x877e4352, 0x6fea, 0x11d0, {0xb8, 0x63, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1}}

Definition at line 11 of file clockforward.cpp.

Referenced by CKsClockForwarder::QueryInterface().