29 &IID_IReferenceClock, (
void **)&
clock);
38 return IUnknown_Release(
unknown);
41#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
50 hr = IUnknown_QueryInterface(iface, iid, (
void **)&unk);
53 IUnknown_Release(unk);
66 ref = IReferenceClock_Release(
clock);
67 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
114 &IID_IReferenceClock, (
void **)&
clock);
122 ok(unk != &
test_outer,
"Returned IUnknown should not be outer IUnknown.\n");
124 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
126 ref = IUnknown_AddRef(unk);
127 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
130 ref = IUnknown_Release(unk);
131 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
136 ok(unk2 == unk,
"Got unexpected IUnknown %p.\n", unk2);
137 IUnknown_Release(unk2);
139 hr = IUnknown_QueryInterface(unk, &IID_IReferenceClock, (
void **)&
clock);
144 ok(unk2 == (
IUnknown *)0xdeadbeef,
"Got unexpected IUnknown %p.\n", unk2);
146 hr = IReferenceClock_QueryInterface(
clock, &IID_IReferenceClock, (
void **)&clock2);
148 ok(clock2 == (
IReferenceClock *)0xdeadbeef,
"Got unexpected IReferenceClock %p.\n", clock2);
150 hr = IUnknown_QueryInterface(unk, &
test_iid, (
void **)&unk2);
152 ok(!unk2,
"Got unexpected IUnknown %p.\n", unk2);
156 ok(unk2 == (
IUnknown *)0xdeadbeef,
"Got unexpected IUnknown %p.\n", unk2);
158 IReferenceClock_Release(
clock);
159 ref = IUnknown_Release(unk);
160 ok(!
ref,
"Got unexpected refcount %ld.\n",
ref);
174 hr = IReferenceClock_GetTime(
clock, &time1);
176 ok(time1 % 10000 == 0,
"Expected no less than 1ms coarseness, but got time %s.\n",
181 hr = IReferenceClock_GetTime(
clock, &time2);
183 ok(time2 % 10000 == 0,
"Expected no less than 1ms coarseness, but got time %s.\n",
186 ok(time2 >= ticks && ticks >= time1,
"Got timestamps %I64d, %I64d, %I64d.\n", time1, ticks, time2);
189 hr = IReferenceClock_GetTime(
clock, &time2);
191 ok(time2 - time1 > 80 * 10000,
"Expected about %s, but got %s.\n",
194 ref = IReferenceClock_Release(
clock);
195 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
263 for (
i = 0;
i < 5; ++
i)
276 ref = IReferenceClock_Release(
clock);
277 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
#define InterlockedIncrement
#define InterlockedDecrement
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
_ACRTIMP clock_t __cdecl clock(void)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
DWORD WINAPI timeGetTime(void)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
struct task_struct * current
static const IUnknownVtbl outer_vtbl
static void test_aggregation(void)
static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported)
static ULONG WINAPI outer_AddRef(IUnknown *iface)
static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out)
static ULONG get_refcount(void *iface)
static IUnknown test_outer
static void test_interfaces(void)
static IReferenceClock * create_system_clock(void)
static void test_get_time(void)
#define check_interface(a, b, c)
static void test_advise(void)
static const GUID test_iid
static ULONG WINAPI outer_Release(IUnknown *iface)
#define IsEqualGUID(rguid1, rguid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreA(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, IN LPCSTR lpName OPTIONAL)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out