ReactOS  0.4.14-dev-614-gbfd8a84
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;
340  HANDLE handle;
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 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define CloseHandle
Definition: compat.h:406
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define OutputDebugString
Definition: winbase.h:3724
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GENERIC_WRITE
Definition: nt_native.h:90
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:124
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition: clock.c:23
#define KSCATEGORY_CLOCK
Definition: ks.h:215
KSDDKAPI HRESULT WINAPI KsOpenDefaultDevice(REFGUID Category, ACCESS_MASK Access, PHANDLE DeviceHandle)
Definition: ksproxy.cpp:101

◆ CKsClockForwarder_ThreadStartup()

DWORD WINAPI CKsClockForwarder_ThreadStartup ( LPVOID  lpParameter)

Definition at line 299 of file clockforward.cpp.

300 {
303 
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 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define TRUE
Definition: types.h:120
#define NOERROR
Definition: winerror.h:2354
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
REFERENCE_TIME m_Time
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
const GUID KSPROPSETID_Clock
Definition: pin.c:115
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
LPVOID lpParameter
Definition: kernel32.h:241
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1
#define INFINITE
Definition: serial.h:102
IReferenceClock * m_Clock
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
HRESULT GetTime([out] REFERENCE_TIME *pTime)
static PLARGE_INTEGER Time
Definition: time.c:105

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().