10#define COM_NO_WINDOWS_H
21#define test_S_OK(hres, message) ok((hres) == S_OK, "%s (0x%lx instead of S_OK)\n", (message), (hres))
22#define test_HRES(hres, hresExpected, message) ok((hres) == (hresExpected), "%s (0x%lx instead of 0x%lx)\n", (message), (hres), (hresExpected))
23#define test_ref(spy, expectedRef) ok((spy)->GetRef() == (expectedRef), "unexpected refcount, %ld instead of %d\n", (spy)->GetRef(), (expectedRef))
78 ok(
GetRef() == 0,
"Expected m_lRef to be 0, was: %ld\n",
GetRef());
102 ok(expectApt == dwCurThreadAptRefs,
"Unexpected dwCurThreadAptRefs: got %lx, expected %lx\n", dwCurThreadAptRefs, expectApt);
112 ok(
m_CurAptRefs == dwNewThreadAptRefs,
"Unexpected dwNewThreadAptRefs: got %lx, expected %lx\n", dwNewThreadAptRefs,
m_CurAptRefs);
121 ok(
m_CurAptRefs == dwCurThreadAptRefs,
"Unexpected dwCurThreadAptRefs: got %lx, expected %lx\n", dwCurThreadAptRefs,
m_CurAptRefs);
130 ok(apt == dwNewThreadAptRefs,
"Unexpected dwNewThreadAptRefs: got %lx, expected %lx\n", dwNewThreadAptRefs, apt);
179 spy.
Check(1, 1, 0, 0);
180 spy2.
Check(1, 1, 0, 0);
188 spy.
Check(2, 2, 0, 0);
189 spy2.
Check(2, 2, 0, 0);
201 spy.
Check(3, 3, 0, 0);
202 spy2.
Check(3, 3, 0, 0);
205 spy.
Check(3, 3, 1, 1);
206 spy2.
Check(3, 3, 1, 1);
211 spy.
Check(3, 3, 2, 2);
212 spy2.
Check(3, 3, 2, 2);
217 spy.
Check(3, 3, 3, 3);
218 spy2.
Check(3, 3, 3, 3);
223 spy.
Check(3, 3, 4, 4);
224 spy2.
Check(3, 3, 4, 4);
239 spy.
Check(1, 1, 0, 0);
245 spy.
Check(2, 2, 0, 0);
249 spy.
Check(2, 2, 1, 1);
254 spy.
Check(2, 2, 2, 2);
257 spy.
Check(2, 2, 3, 3);
#define InterlockedIncrement
#define STDMETHODCALLTYPE
void Check(LONG PreInit, LONG PostInit, LONG PreUninit, LONG PostUninit)
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv)
HRESULT STDMETHODCALLTYPE PostUninitialize(DWORD dwNewThreadAptRefs)
HRESULT STDMETHODCALLTYPE PreInitialize(DWORD dwCoInit, DWORD dwCurThreadAptRefs)
bool m_FailQueryInterface
HRESULT STDMETHODCALLTYPE PreUninitialize(DWORD dwCurThreadAptRefs)
HRESULT STDMETHODCALLTYPE PostInitialize(HRESULT hrCoInit, DWORD dwCoInit, DWORD dwNewThreadAptRefs)
void Expect(HRESULT hrCoInit, DWORD CoInit, DWORD CurAptRefs)
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv)
#define GetProcAddress(x, y)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT(WINAPI * pCoRevokeInitializeSpy_t)(_In_ ULARGE_INTEGER uliCookie)
pCoRegisterInitializeSpy_t pCoRegisterInitializeSpy
void test_IInitializeSpy_fail()
#define test_HRES(hres, hresExpected, message)
pCoRevokeInitializeSpy_t pCoRevokeInitializeSpy
const DWORD INVALID_VALUE
void test_IInitializeSpy_twice()
#define test_ref(spy, expectedRef)
#define test_S_OK(hres, message)
void test_IInitializeSpy_switch_apt()
void test_IInitializeSpy_register2()
HRESULT(WINAPI * pCoRegisterInitializeSpy_t)(_In_ LPINITIALIZESPY pSpy, _Out_ ULARGE_INTEGER *puliCookie)
static void PreInit(void)
static void PostInit(void)
@ COINIT_APARTMENTTHREADED
#define OFFSETOFCLASS(base, derived)
#define RPC_E_CHANGED_MODE
_In_opt_ PVOID _Out_ PLARGE_INTEGER Cookie