Wine-Devel
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 4 participants
- 84544 discussions
March 10, 2022
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
programs/dllhost/dllhost.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c
index bfe1d4cbbd6..241b79d13a0 100644
--- a/programs/dllhost/dllhost.c
+++ b/programs/dllhost/dllhost.c
@@ -147,9 +147,11 @@ static ULONG WINAPI marshal_Release(IMarshal *iface)
static HRESULT WINAPI marshal_GetUnmarshalClass(IMarshal *iface, REFIID iid, void *pv,
DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, CLSID *clsid)
{
- FIXME("(%p,%s,%p,%08lx,%p,%08lx,%p): stub\n", iface, wine_dbgstr_guid(iid), pv,
+ TRACE("(%p,%s,%p,%08lx,%p,%08lx,%p)\n", iface, wine_dbgstr_guid(iid), pv,
dwDestContext, pvDestContext, mshlflags, clsid);
- return E_NOTIMPL;
+
+ *clsid = CLSID_StdMarshal;
+ return S_OK;
}
static HRESULT WINAPI marshal_GetMarshalSizeMax(IMarshal *iface, REFIID iid, void *pv,
@@ -163,8 +165,19 @@ static HRESULT WINAPI marshal_GetMarshalSizeMax(IMarshal *iface, REFIID iid, voi
static HRESULT WINAPI marshal_MarshalInterface(IMarshal *iface, IStream *stream, REFIID iid,
void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags)
{
- FIXME("(%p,%s,%p,%08lx,%p,%08lx): stub\n", stream, wine_dbgstr_guid(iid), pv, dwDestContext, pvDestContext, mshlflags);
- return E_NOTIMPL;
+ struct factory *factory = impl_from_IMarshal(iface);
+ IUnknown *object;
+ HRESULT hr;
+
+ TRACE("(%p,%s,%p,%08lx,%p,%08lx)\n", stream, wine_dbgstr_guid(iid), pv, dwDestContext, pvDestContext, mshlflags);
+
+ hr = CoGetClassObject(&factory->clsid, CLSCTX_INPROC_SERVER, NULL, iid, (void **)&object);
+ if (hr == S_OK)
+ {
+ hr = CoMarshalInterface(stream, iid, object, dwDestContext, pvDestContext, mshlflags);
+ IUnknown_Release(object);
+ }
+ return hr;
}
static HRESULT WINAPI marshal_UnmarshalInterface(IMarshal *iface, IStream *stream,
--
2.35.1
2
1
March 10, 2022
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
programs/dllhost/dllhost.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c
index 691f233906a..bfe1d4cbbd6 100644
--- a/programs/dllhost/dllhost.c
+++ b/programs/dllhost/dllhost.c
@@ -204,6 +204,7 @@ struct surrogate
ISurrogate ISurrogate_iface;
IClassFactory *factory;
DWORD cookie;
+ HANDLE event;
LONG ref;
};
@@ -267,15 +268,35 @@ static HRESULT WINAPI surrogate_LoadDllServer(ISurrogate *iface, const CLSID *cl
if (hr != S_OK)
IClassFactory_Release(&factory->IClassFactory_iface);
else
+ {
surrogate->factory = &factory->IClassFactory_iface;
+ surrogate->event = CreateEventW(NULL, FALSE, FALSE, NULL);
+ }
return hr;
}
static HRESULT WINAPI surrogate_FreeSurrogate(ISurrogate *iface)
{
- FIXME("(%p): stub\n", iface);
- return E_NOTIMPL;
+ struct surrogate *surrogate = impl_from_ISurrogate(iface);
+
+ TRACE("(%p)\n", iface);
+
+ if (surrogate->cookie)
+ {
+ CoRevokeClassObject(surrogate->cookie);
+ surrogate->cookie = 0;
+ }
+
+ if (surrogate->factory)
+ {
+ IClassFactory_Release(surrogate->factory);
+ surrogate->factory = NULL;
+ }
+
+ SetEvent(surrogate->event);
+
+ return S_OK;
}
static const ISurrogateVtbl Surrogate_Vtbl =
@@ -301,6 +322,7 @@ int WINAPI wWinMain(HINSTANCE hinst, HINSTANCE previnst, LPWSTR cmdline, int sho
surrogate.ISurrogate_iface.lpVtbl = &Surrogate_Vtbl;
surrogate.factory = NULL;
surrogate.cookie = 0;
+ surrogate.event = NULL;
surrogate.ref = 1;
CoInitializeEx(NULL, COINIT_MULTITHREADED);
@@ -317,8 +339,7 @@ int WINAPI wWinMain(HINSTANCE hinst, HINSTANCE previnst, LPWSTR cmdline, int sho
goto cleanup;
}
- /* FIXME: wait for FreeSurrogate being called */
- Sleep(INFINITE);
+ WaitForSingleObject(surrogate.event, INFINITE);
}
cleanup:
--
2.35.1
2
1
[PATCH v2 1/6] windows.gaming.input: Implement IRawGameControllerStatics_get_RawGameControllers.
by Rémi Bernon March 10, 2022
by Rémi Bernon March 10, 2022
March 10, 2022
It is important to add RawGameController instances to the vector in the
initialization callback, because some games check the vector, as well
as the Gamepad class vector in the OnGameControllerAdded callback.
This also removes the OnGameControllerAdded failure case, to avoid
leaking controllers that were already added to the controller vector,
and instead rely on the OnGameControllerRemoved call to do the cleanup.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
v2: * Initialize controller state in GetReading calls,
* Fix IWineGameControllerProvider query failure support in the class
destruction.
dlls/dinput/tests/joystick8.c | 9 +--
dlls/windows.gaming.input/controller.c | 82 +++++++++++++++++++++-----
dlls/windows.gaming.input/manager.c | 6 +-
3 files changed, 70 insertions(+), 27 deletions(-)
diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c
index 2d801aacda2..e74e76482f9 100644
--- a/dlls/dinput/tests/joystick8.c
+++ b/dlls/dinput/tests/joystick8.c
@@ -3340,17 +3340,10 @@ static void test_windows_gaming_input(void)
ok( hr == S_OK, "get_RawGameControllers returned %#lx\n", hr );
hr = IVectorView_RawGameController_get_Size( controllers_view, &size );
ok( hr == S_OK, "get_Size returned %#lx\n", hr );
- todo_wine
ok( size == 1, "got size %u\n", size );
hr = IVectorView_RawGameController_GetAt( controllers_view, 0, &raw_controller );
- todo_wine
ok( hr == S_OK, "GetAt returned %#lx\n", hr );
IVectorView_RawGameController_Release( controllers_view );
- if (hr != S_OK)
- {
- IRawGameControllerStatics_Release( controller_statics );
- goto done;
- }
/* HID gamepads aren't exposed as WGI gamepads on Windows */
@@ -3372,6 +3365,7 @@ static void test_windows_gaming_input(void)
check_interface( raw_controller, &IID_IInspectable, TRUE );
check_interface( raw_controller, &IID_IAgileObject, TRUE );
check_interface( raw_controller, &IID_IRawGameController, TRUE );
+ todo_wine
check_interface( raw_controller, &IID_IRawGameController2, TRUE );
check_interface( raw_controller, &IID_IGameController, TRUE );
check_interface( raw_controller, &IID_IGamepad, FALSE );
@@ -3384,6 +3378,7 @@ static void test_windows_gaming_input(void)
check_interface( game_controller, &IID_IInspectable, TRUE );
check_interface( game_controller, &IID_IAgileObject, TRUE );
check_interface( game_controller, &IID_IRawGameController, TRUE );
+ todo_wine
check_interface( game_controller, &IID_IRawGameController2, TRUE );
check_interface( game_controller, &IID_IGameController, TRUE );
check_interface( game_controller, &IID_IGamepad, FALSE );
diff --git a/dlls/windows.gaming.input/controller.c b/dlls/windows.gaming.input/controller.c
index 9fb1b1a69a2..51ede5a0e47 100644
--- a/dlls/windows.gaming.input/controller.c
+++ b/dlls/windows.gaming.input/controller.c
@@ -24,6 +24,36 @@
WINE_DEFAULT_DEBUG_CHANNEL(input);
+static CRITICAL_SECTION controller_cs;
+static CRITICAL_SECTION_DEBUG controller_cs_debug =
+{
+ 0, 0, &controller_cs,
+ { &controller_cs_debug.ProcessLocksList, &controller_cs_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": controller_cs") }
+};
+static CRITICAL_SECTION controller_cs = { &controller_cs_debug, -1, 0, 0, 0, 0 };
+
+static IVector_RawGameController *controllers;
+
+static HRESULT init_controllers(void)
+{
+ static const struct vector_iids iids =
+ {
+ .vector = &IID_IVector_RawGameController,
+ .view = &IID_IVectorView_RawGameController,
+ .iterable = &IID_IIterable_RawGameController,
+ .iterator = &IID_IIterator_RawGameController,
+ };
+ HRESULT hr;
+
+ EnterCriticalSection( &controller_cs );
+ if (controllers) hr = S_OK;
+ else hr = vector_create( &iids, (void **)&controllers );
+ LeaveCriticalSection( &controller_cs );
+
+ return hr;
+}
+
struct controller
{
IGameControllerImpl IGameControllerImpl_iface;
@@ -118,13 +148,19 @@ static HRESULT WINAPI controller_Initialize( IGameControllerImpl *iface, IGameCo
IGameControllerProvider *provider )
{
struct controller *impl = impl_from_IGameControllerImpl( iface );
+ HRESULT hr;
TRACE( "iface %p, outer %p, provider %p.\n", iface, outer, provider );
impl->IGameController_outer = outer;
IGameControllerProvider_AddRef( (impl->provider = provider) );
- return S_OK;
+ EnterCriticalSection( &controller_cs );
+ if (SUCCEEDED(hr = init_controllers()))
+ hr = IVector_RawGameController_Append( controllers, &impl->IRawGameController_iface );
+ LeaveCriticalSection( &controller_cs );
+
+ return hr;
}
static const struct IGameControllerImplVtbl controller_vtbl =
@@ -381,23 +417,14 @@ static HRESULT WINAPI statics_remove_RawGameControllerRemoved( IRawGameControlle
static HRESULT WINAPI statics_get_RawGameControllers( IRawGameControllerStatics *iface, IVectorView_RawGameController **value )
{
- static const struct vector_iids iids =
- {
- .vector = &IID_IVector_RawGameController,
- .view = &IID_IVectorView_RawGameController,
- .iterable = &IID_IIterable_RawGameController,
- .iterator = &IID_IIterator_RawGameController,
- };
- IVector_RawGameController *controllers;
HRESULT hr;
TRACE( "iface %p, value %p.\n", iface, value );
- if (SUCCEEDED(hr = vector_create( &iids, (void **)&controllers )))
- {
+ EnterCriticalSection( &controller_cs );
+ if (SUCCEEDED(hr = init_controllers()))
hr = IVector_RawGameController_GetView( controllers, value );
- IVector_RawGameController_Release( controllers );
- }
+ LeaveCriticalSection( &controller_cs );
return hr;
}
@@ -468,8 +495,33 @@ static HRESULT WINAPI controller_factory_OnGameControllerAdded( ICustomGameContr
static HRESULT WINAPI controller_factory_OnGameControllerRemoved( ICustomGameControllerFactory *iface, IGameController *value )
{
- FIXME( "iface %p, value %p stub!\n", iface, value );
- return E_NOTIMPL;
+ IRawGameController *controller;
+ BOOLEAN found;
+ UINT32 index;
+ HRESULT hr;
+
+ TRACE( "iface %p, value %p.\n", iface, value );
+
+ if (FAILED(hr = IGameController_QueryInterface( value, &IID_IRawGameController, (void **)&controller )))
+ return hr;
+
+ EnterCriticalSection( &controller_cs );
+ if (SUCCEEDED(hr = init_controllers()))
+ {
+ if (FAILED(hr = IVector_RawGameController_IndexOf( controllers, controller, &index, &found )) || !found)
+ WARN( "Could not find controller %p, hr %#lx!\n", controller, hr );
+ else
+ hr = IVector_RawGameController_RemoveAt( controllers, index );
+ }
+ LeaveCriticalSection( &controller_cs );
+
+ if (FAILED(hr))
+ WARN( "Failed to remove controller %p, hr %#lx!\n", controller, hr );
+ else if (found)
+ TRACE( "Removed controller %p.\n", controller );
+ IRawGameController_Release( controller );
+
+ return S_OK;
}
static const struct ICustomGameControllerFactoryVtbl controller_factory_vtbl =
diff --git a/dlls/windows.gaming.input/manager.c b/dlls/windows.gaming.input/manager.c
index 489588a68ab..6a8963a1fc4 100644
--- a/dlls/windows.gaming.input/manager.c
+++ b/dlls/windows.gaming.input/manager.c
@@ -502,11 +502,7 @@ void manager_on_provider_created( IGameControllerProvider *provider )
controller = LIST_ENTRY( entry, struct controller, entry );
hr = ICustomGameControllerFactory_OnGameControllerAdded( controller->factory,
&controller->IGameController_iface );
- if (FAILED(hr))
- {
- list_remove( &controller->entry );
- IGameController_Release( &controller->IGameController_iface );
- }
+ if (FAILED(hr)) WARN( "OnGameControllerAdded failed, hr %#lx\n", hr );
if (next == &controller_list) break;
}
--
2.35.1
2
6
March 10, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/wmp/tests/Makefile.in | 1
dlls/wmp/tests/media.c | 168 +++++++++++++++++++++----------------------
dlls/wmp/tests/oleobj.c | 172 ++++++++++++++++++++++----------------------
3 files changed, 170 insertions(+), 171 deletions(-)
diff --git a/dlls/wmp/tests/Makefile.in b/dlls/wmp/tests/Makefile.in
index 4b97242f3aa..089d9e7f3e1 100644
--- a/dlls/wmp/tests/Makefile.in
+++ b/dlls/wmp/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = wmp.dll
IMPORTS = ole32 oleaut32 user32 gdi32
diff --git a/dlls/wmp/tests/media.c b/dlls/wmp/tests/media.c
index fa6cb6490f1..f78e741a189 100644
--- a/dlls/wmp/tests/media.c
+++ b/dlls/wmp/tests/media.c
@@ -36,7 +36,7 @@
#define CHECK_EXPECT(kind, index) \
do { \
- ok(expect_ ##kind & (1 << index), "unexpected event for " #kind ", index:%d\n", index); \
+ ok(expect_ ##kind & (1 << index), "unexpected event for " #kind ", index:%ld\n", index); \
called_ ## kind |= (1 << index); \
}while(0)
@@ -81,7 +81,7 @@ static inline WCHAR *load_resource(const WCHAR *name)
lstrcatW(pathW, name);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
- ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW),
+ ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW),
GetLastError());
res = FindResourceW(NULL, name, (LPCWSTR)RT_RCDATA);
@@ -146,7 +146,7 @@ static HRESULT WINAPI WMPOCXEvents_Invoke(IDispatch *iface, DISPID dispIdMember,
case DISPID_WMPCOREEVENT_OPENSTATECHANGE:
CHECK_EXPECT(OPENSTATE, V_UI4(pDispParams->rgvarg));
if (winetest_debug > 1)
- trace("DISPID_WMPCOREEVENT_OPENSTATECHANGE, %d\n", V_UI4(pDispParams->rgvarg));
+ trace("DISPID_WMPCOREEVENT_OPENSTATECHANGE, %ld\n", V_UI4(pDispParams->rgvarg));
break;
case DISPID_WMPCOREEVENT_PLAYSTATECHANGE:
CHECK_EXPECT(PLAYSTATE, V_UI4(pDispParams->rgvarg));
@@ -156,7 +156,7 @@ static HRESULT WINAPI WMPOCXEvents_Invoke(IDispatch *iface, DISPID dispIdMember,
SetEvent(completed_event);
}
if (winetest_debug > 1)
- trace("DISPID_WMPCOREEVENT_PLAYSTATECHANGE, %d\n", V_UI4(pDispParams->rgvarg));
+ trace("DISPID_WMPCOREEVENT_PLAYSTATECHANGE, %ld\n", V_UI4(pDispParams->rgvarg));
break;
case DISPID_WMPCOREEVENT_MEDIACHANGE:
if (winetest_debug > 1)
@@ -172,7 +172,7 @@ static HRESULT WINAPI WMPOCXEvents_Invoke(IDispatch *iface, DISPID dispIdMember,
break;
default:
if (winetest_debug > 1)
- trace("event: %d\n", dispIdMember);
+ trace("event: %ld\n", dispIdMember);
break;
}
@@ -227,22 +227,22 @@ static void test_completion_event(void)
win_skip("CLSID_WindowsMediaPlayer not registered\n");
return;
}
- ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08x\n", hres);
+ ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IConnectionPointContainer, (void**)&container);
- ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
+ ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08lx\n", hres);
if(FAILED(hres))
return;
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID__WMPOCXEvents, &point);
IConnectionPointContainer_Release(container);
- ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
+ ok(hres == S_OK, "FindConnectionPoint failed: %08lx\n", hres);
hres = IConnectionPoint_Advise(point, (IUnknown*)&WMPOCXEvents, &dw);
- ok(hres == S_OK, "Advise failed: %08x\n", hres);
+ ok(hres == S_OK, "Advise failed: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer4, (void**)&player4);
- ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08lx\n", hres);
filename = SysAllocString(load_resource(mp3file1s));
@@ -260,7 +260,7 @@ static void test_completion_event(void)
SET_EXPECT(OPENSTATE, wmposMediaChanging);
SET_EXPECT(PLAYSTATE, wmppsReady);
hres = IWMPPlayer4_put_URL(player4, filename);
- ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08lx\n", hres);
res = pump_messages(3000, 1, &completed_event);
ok(res == WAIT_OBJECT_0, "Timed out while waiting for media to complete\n");
@@ -281,7 +281,7 @@ static void test_completion_event(void)
CLEAR_CALLED(OPENSTATE, wmposMediaOpening);
hres = IConnectionPoint_Unadvise(point, dw);
- ok(hres == S_OK, "Unadvise failed: %08x\n", hres);
+ ok(hres == S_OK, "Unadvise failed: %08lx\n", hres);
IConnectionPoint_Release(point);
IWMPPlayer4_Release(player4);
@@ -315,47 +315,47 @@ static BOOL test_wmp(void)
win_skip("CLSID_WindowsMediaPlayer not registered\n");
return FALSE;
}
- ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08x\n", hres);
+ ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IConnectionPointContainer, (void**)&container);
- ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
+ ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08lx\n", hres);
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID__WMPOCXEvents, &point);
IConnectionPointContainer_Release(container);
- ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
+ ok(hres == S_OK, "FindConnectionPoint failed: %08lx\n", hres);
hres = IConnectionPoint_Advise(point, (IUnknown*)&WMPOCXEvents, &dw);
- ok(hres == S_OK, "Advise failed: %08x\n", hres);
+ ok(hres == S_OK, "Advise failed: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer4, (void**)&player4);
- ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08lx\n", hres);
settings = NULL;
hres = IWMPPlayer4_get_settings(player4, &settings);
- ok(hres == S_OK, "get_settings failed: %08x\n", hres);
+ ok(hres == S_OK, "get_settings failed: %08lx\n", hres);
ok(settings != NULL, "settings = NULL\n");
hres = IWMPSettings_put_autoStart(settings, VARIANT_FALSE);
- ok(hres == S_OK, "Could not put autoStart in IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not put autoStart in IWMPSettings: %08lx\n", hres);
controls = NULL;
hres = IWMPPlayer4_get_controls(player4, &controls);
- ok(hres == S_OK, "get_controls failed: %08x\n", hres);
+ ok(hres == S_OK, "get_controls failed: %08lx\n", hres);
ok(controls != NULL, "controls = NULL\n");
bstrcurrentPosition = SysAllocString(L"currentPosition");
hres = IWMPControls_get_isAvailable(controls, bstrcurrentPosition, &vbool);
- ok(hres == S_OK, "IWMPControls_get_isAvailable failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_get_isAvailable failed: %08lx\n", hres);
ok(vbool == VARIANT_FALSE, "unexpected value\n");
hres = IWMPControls_play(controls);
- ok(hres == NS_S_WMPCORE_COMMAND_NOT_AVAILABLE, "IWMPControls_play is available: %08x\n", hres);
+ ok(hres == NS_S_WMPCORE_COMMAND_NOT_AVAILABLE, "IWMPControls_play is available: %08lx\n", hres);
hres = IWMPSettings_put_volume(settings, 36);
- ok(hres == S_OK, "IWMPSettings_put_volume failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPSettings_put_volume failed: %08lx\n", hres);
hres = IWMPSettings_get_volume(settings, &progress);
- ok(hres == S_OK, "IWMPSettings_get_volume failed: %08x\n", hres);
- ok(progress == 36, "unexpected value: %d\n", progress);
+ ok(hres == S_OK, "IWMPSettings_get_volume failed: %08lx\n", hres);
+ ok(progress == 36, "unexpected value: %ld\n", progress);
filename = SysAllocString(load_resource(mp3file));
@@ -365,7 +365,7 @@ static BOOL test_wmp(void)
SET_EXPECT(PLAYSTATE, wmppsTransitioning);
SET_EXPECT(PLAYSTATE, wmppsReady);
hres = IWMPPlayer4_put_URL(player4, filename);
- ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08lx\n", hres);
CHECK_CALLED(OPENSTATE, wmposPlaylistChanging);
CHECK_CALLED(OPENSTATE, wmposPlaylistChanged);
CHECK_CALLED(OPENSTATE, wmposPlaylistOpenNoMedia);
@@ -379,7 +379,7 @@ static BOOL test_wmp(void)
/* MediaOpening happens only on xp, 2003 */
SET_EXPECT(OPENSTATE, wmposMediaOpening);
hres = IWMPControls_play(controls);
- ok(hres == S_OK, "IWMPControls_play failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_play failed: %08lx\n", hres);
res = pump_messages(1000, 1, &playing_event);
ok(res == WAIT_OBJECT_0 || broken(res == WAIT_TIMEOUT), "Timed out while waiting for media to become ready\n");
if (res == WAIT_TIMEOUT) {
@@ -397,55 +397,55 @@ static BOOL test_wmp(void)
CLEAR_CALLED(OPENSTATE, wmposMediaOpening);
hres = IWMPControls_get_isAvailable(controls, bstrcurrentPosition, &vbool);
- ok(hres == S_OK, "IWMPControls_get_isAvailable failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_get_isAvailable failed: %08lx\n", hres);
ok(vbool == VARIANT_TRUE, "unexpected value\n");
duration = 0.0;
hres = IWMPControls_get_currentPosition(controls, &duration);
- ok(hres == S_OK, "IWMPControls_get_currentPosition failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_get_currentPosition failed: %08lx\n", hres);
ok((int)duration == 0, "unexpected value %f\n", duration);
duration = 1.1;
hres = IWMPControls_put_currentPosition(controls, duration);
- ok(hres == S_OK, "IWMPControls_put_currentPosition failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_put_currentPosition failed: %08lx\n", hres);
duration = 0.0;
hres = IWMPControls_get_currentPosition(controls, &duration);
- ok(hres == S_OK, "IWMPControls_get_currentPosition failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_get_currentPosition failed: %08lx\n", hres);
ok(duration >= 1.05 /* save some fp errors */, "unexpected value %f\n", duration);
hres = IWMPPlayer4_get_currentMedia(player4, &media);
- ok(hres == S_OK, "IWMPPlayer4_get_currentMedia failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_get_currentMedia failed: %08lx\n", hres);
hres = IWMPMedia_get_duration(media, &duration);
- ok(hres == S_OK, "IWMPMedia_get_duration failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPMedia_get_duration failed: %08lx\n", hres);
ok(floor(duration + 0.5) == 3, "unexpected value: %f\n", duration);
IWMPMedia_Release(media);
network = NULL;
hres = IWMPPlayer4_get_network(player4, &network);
- ok(hres == S_OK, "get_network failed: %08x\n", hres);
+ ok(hres == S_OK, "get_network failed: %08lx\n", hres);
ok(network != NULL, "network = NULL\n");
progress = 0;
hres = IWMPNetwork_get_bufferingProgress(network, &progress);
- ok(hres == S_OK || broken(hres == S_FALSE), "IWMPNetwork_get_bufferingProgress failed: %08x\n", hres);
- ok(progress == 100, "unexpected value: %d\n", progress);
+ ok(hres == S_OK || broken(hres == S_FALSE), "IWMPNetwork_get_bufferingProgress failed: %08lx\n", hres);
+ ok(progress == 100, "unexpected value: %ld\n", progress);
progress = 0;
hres = IWMPNetwork_get_downloadProgress(network, &progress);
- ok(hres == S_OK, "IWMPNetwork_get_downloadProgress failed: %08x\n", hres);
- ok(progress == 100, "unexpected value: %d\n", progress);
+ ok(hres == S_OK, "IWMPNetwork_get_downloadProgress failed: %08lx\n", hres);
+ ok(progress == 100, "unexpected value: %ld\n", progress);
IWMPNetwork_Release(network);
SET_EXPECT(PLAYSTATE, wmppsStopped);
/* The following happens on wine only since we close media on stop */
SET_EXPECT(OPENSTATE, wmposPlaylistOpenNoMedia);
hres = IWMPControls_stop(controls);
- ok(hres == S_OK, "IWMPControls_stop failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_stop failed: %08lx\n", hres);
CHECK_CALLED(PLAYSTATE, wmppsStopped);
todo_wine CHECK_NOT_CALLED(OPENSTATE, wmposPlaylistOpenNoMedia);
/* Already Stopped */
hres = IWMPControls_stop(controls);
- ok(hres == NS_S_WMPCORE_COMMAND_NOT_AVAILABLE, "IWMPControls_stop is available: %08x\n", hres);
+ ok(hres == NS_S_WMPCORE_COMMAND_NOT_AVAILABLE, "IWMPControls_stop is available: %08lx\n", hres);
SET_EXPECT(PLAYSTATE, wmppsPlaying);
/* The following happens on wine only since we close media on stop */
@@ -453,7 +453,7 @@ static BOOL test_wmp(void)
SET_EXPECT(OPENSTATE, wmposMediaOpen);
SET_EXPECT(PLAYSTATE, wmppsTransitioning);
hres = IWMPControls_play(controls);
- ok(hres == S_OK, "IWMPControls_play failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_play failed: %08lx\n", hres);
CHECK_CALLED(PLAYSTATE, wmppsPlaying);
todo_wine CHECK_NOT_CALLED(OPENSTATE, wmposOpeningUnknownURL);
todo_wine CHECK_NOT_CALLED(OPENSTATE, wmposMediaOpen);
@@ -461,16 +461,16 @@ static BOOL test_wmp(void)
playback_skip:
hres = IConnectionPoint_Unadvise(point, dw);
- ok(hres == S_OK, "Unadvise failed: %08x\n", hres);
+ ok(hres == S_OK, "Unadvise failed: %08lx\n", hres);
hres = IWMPSettings_get_volume(settings, &progress);
- ok(hres == S_OK, "IWMPSettings_get_volume failed: %08x\n", hres);
- ok(progress == 36, "unexpected value: %d\n", progress);
+ ok(hres == S_OK, "IWMPSettings_get_volume failed: %08lx\n", hres);
+ ok(progress == 36, "unexpected value: %ld\n", progress);
hres = IWMPSettings_put_volume(settings, 99);
- ok(hres == S_OK, "IWMPSettings_put_volume failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPSettings_put_volume failed: %08lx\n", hres);
hres = IWMPSettings_get_volume(settings, &progress);
- ok(hres == S_OK, "IWMPSettings_get_volume failed: %08x\n", hres);
- ok(progress == 99, "unexpected value: %d\n", progress);
+ ok(hres == S_OK, "IWMPSettings_get_volume failed: %08lx\n", hres);
+ ok(progress == 99, "unexpected value: %ld\n", progress);
IConnectionPoint_Release(point);
IWMPSettings_Release(settings);
@@ -517,27 +517,27 @@ static void test_media_item(void)
win_skip("CLSID_WindowsMediaPlayer is not registered.\n");
return;
}
- ok(hr == S_OK, "Failed to create media player instance, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create media player instance, hr %#lx.\n", hr);
hr = IWMPPlayer4_newMedia(player, NULL, &media);
- ok(hr == S_OK, "Failed to create a media item, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a media item, hr %#lx.\n", hr);
hr = IWMPMedia_get_name(media, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IWMPMedia_get_name(media, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(*str == 0, "Unexpected name %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
media2 = (void *)0xdeadbeef;
hr = IWMPPlayer4_get_currentMedia(player, &media2);
- ok(hr == S_FALSE, "Failed to get current media, hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Failed to get current media, hr %#lx.\n", hr);
ok(media2 == NULL, "Unexpected media instance.\n");
hr = IWMPPlayer4_put_currentMedia(player, media);
- ok(hr == S_OK, "Failed to set current media, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set current media, hr %#lx.\n", hr);
hr = IWMPPlayer4_get_currentMedia(player, &media2);
- ok(hr == S_OK, "Failed to get current media, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get current media, hr %#lx.\n", hr);
ok(media2 != NULL && media != media2, "Unexpected media instance.\n");
IWMPMedia_Release(media2);
@@ -545,38 +545,38 @@ static void test_media_item(void)
str = SysAllocStringLen(NULL, 0);
hr = IWMPPlayer4_newMedia(player, str, &media);
- ok(hr == S_OK, "Failed to create a media item, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a media item, hr %#lx.\n", hr);
SysFreeString(str);
hr = IWMPMedia_get_name(media, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(*str == 0, "Unexpected name %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
IWMPMedia_Release(media);
str = SysAllocString(mp3file);
hr = IWMPPlayer4_newMedia(player, str, &media);
- ok(hr == S_OK, "Failed to create a media item, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a media item, hr %#lx.\n", hr);
SysFreeString(str);
hr = IWMPMedia_get_name(media, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(!lstrcmpW(str, L"test"), "Expected %s, got %s\n", wine_dbgstr_w(L"test"), wine_dbgstr_w(str));
SysFreeString(str);
hr = IWMPMedia_put_name(media, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IWMPMedia_get_name(media, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(!lstrcmpW(str, L"test"), "Expected %s, got %s\n", wine_dbgstr_w(L"test"), wine_dbgstr_w(str));
SysFreeString(str);
hr = IWMPPlayer4_put_currentMedia(player, media);
- ok(hr == S_OK, "Failed to set current media, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set current media, hr %#lx.\n", hr);
IWMPMedia_Release(media);
hr = IWMPPlayer4_get_currentMedia(player, &media2);
- ok(hr == S_OK, "Failed to get current media, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get current media, hr %#lx.\n", hr);
ok(media2 != NULL, "Unexpected media instance.\n");
hr = IWMPMedia_get_name(media2, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(!lstrcmpW(str, L"test"), "Expected %s, got %s\n", wine_dbgstr_w(L"test"), wine_dbgstr_w(str));
SysFreeString(str);
IWMPMedia_Release(media2);
@@ -593,10 +593,10 @@ static void test_media_item(void)
str = SysAllocString(pathW);
hr = IWMPPlayer4_newMedia(player, str, &media);
- ok(hr == S_OK, "Failed to create a media item, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a media item, hr %#lx.\n", hr);
SysFreeString(str);
hr = IWMPMedia_get_name(media, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(!lstrcmpW(str, tests[i].expected), "Expected %s, got %s\n", wine_dbgstr_w(tests[i].expected), wine_dbgstr_w(str));
SysFreeString(str);
IWMPMedia_Release(media);
@@ -617,35 +617,35 @@ static void test_player_url(void)
win_skip("CLSID_WindowsMediaPlayer is not registered.\n");
return;
}
- ok(hr == S_OK, "Failed to create media player instance, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create media player instance, hr %#lx.\n", hr);
hr = IWMPPlayer4_get_URL(player, &str);
- ok(hr == S_OK, "Failed to get url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get url, hr %#lx.\n", hr);
ok(*str == 0, "Unexpected url %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
str2 = SysAllocString(mp3file);
hr = IWMPPlayer4_put_URL(player, str2);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
hr = IWMPPlayer4_put_URL(player, NULL);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
hr = IWMPPlayer4_get_URL(player, &str);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
ok(*str == 0, "Unexpected url, %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
/* Empty url */
hr = IWMPPlayer4_put_URL(player, str2);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
str = SysAllocStringLen(NULL, 0);
hr = IWMPPlayer4_put_URL(player, str);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
SysFreeString(str);
hr = IWMPPlayer4_get_URL(player, &str);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
ok(*str == 0, "Unexpected url, %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
@@ -668,38 +668,38 @@ static void test_playlist(void)
win_skip("CLSID_WindowsMediaPlayer is not registered.\n");
return;
}
- ok(hr == S_OK, "Failed to create media player instance, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create media player instance, hr %#lx.\n", hr);
playlist = NULL;
hr = IWMPPlayer4_get_currentPlaylist(player, &playlist);
- ok(hr == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08x\n", hr);
+ ok(hr == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08lx\n", hr);
ok(playlist != NULL, "playlist == NULL\n");
if (0) /* fails on non-English locales */
{
hr = IWMPPlaylist_get_name(playlist, &str);
- ok(hr == S_OK, "Failed to get playlist name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get playlist name, hr %#lx.\n", hr);
ok(!lstrcmpW(str, nameW), "Expected %s, got %s\n", wine_dbgstr_w(nameW), wine_dbgstr_w(str));
SysFreeString(str);
}
hr = IWMPPlaylist_get_count(playlist, NULL);
- ok(hr == E_POINTER, "Failed to get count, hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Failed to get count, hr %#lx.\n", hr);
count = -1;
hr = IWMPPlaylist_get_count(playlist, &count);
- ok(hr == S_OK, "Failed to get count, hr %#x.\n", hr);
- ok(count == 0, "Expected 0, got %d\n", count);
+ ok(hr == S_OK, "Failed to get count, hr %#lx.\n", hr);
+ ok(count == 0, "Expected 0, got %ld\n", count);
IWMPPlaylist_Release(playlist);
/* newPlaylist doesn't change current playlist */
hr = IWMPPlayer4_newPlaylist(player, NULL, NULL, &playlist);
- ok(hr == S_OK, "Failed to create a playlist, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a playlist, hr %#lx.\n", hr);
playlist2 = NULL;
hr = IWMPPlayer4_get_currentPlaylist(player, &playlist2);
- ok(hr == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08x\n", hr);
+ ok(hr == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08lx\n", hr);
ok(playlist2 != NULL && playlist2 != playlist, "Unexpected playlist instance\n");
IWMPPlaylist_Release(playlist2);
@@ -707,13 +707,13 @@ static void test_playlist(void)
/* different playlists can have the same name */
str = SysAllocString(nameW);
hr = IWMPPlaylist_put_name(playlist, str);
- ok(hr == S_OK, "Failed to get playlist name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get playlist name, hr %#lx.\n", hr);
playlist2 = NULL;
hr = IWMPPlayer4_newPlaylist(player, str, NULL, &playlist2);
- ok(hr == S_OK, "Failed to create a playlist, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a playlist, hr %#lx.\n", hr);
hr = IWMPPlaylist_get_name(playlist2, &str2);
- ok(hr == S_OK, "Failed to get playlist name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get playlist name, hr %#lx.\n", hr);
ok(playlist != playlist2, "Expected playlists to be different");
ok(!lstrcmpW(str, str2), "Expected names to be the same\n");
SysFreeString(str);
diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c
index 80f078e62f5..f36e07dabfc 100644
--- a/dlls/wmp/tests/oleobj.c
+++ b/dlls/wmp/tests/oleobj.c
@@ -83,7 +83,7 @@ static inline WCHAR *load_resource(const WCHAR *name)
lstrcatW(pathW, name);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
- ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW),
+ ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW),
GetLastError());
res = FindResourceW(NULL, name, (LPCWSTR)RT_RCDATA);
@@ -513,7 +513,7 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REF
CHECK_EXPECT(Invoke_USERMODE);
break;
default:
- ok(0, "unexpected call Invoke(%d)\n", dispIdMember);
+ ok(0, "unexpected call Invoke(%ld)\n", dispIdMember);
}
return E_NOTIMPL;
@@ -550,7 +550,7 @@ static HRESULT WINAPI WMPOCXEvents_Invoke(IDispatch *iface, DISPID dispIdMember,
{
switch(dispIdMember) {
default:
- ok(0, "unexpected call Invoke(%d)\n", dispIdMember);
+ ok(0, "unexpected call Invoke(%ld)\n", dispIdMember);
}
return E_NOTIMPL;
@@ -691,7 +691,7 @@ static HRESULT WINAPI InPlaceSiteWindowless_OnInPlaceActivateEx(
IOleInPlaceSiteWindowless *iface, BOOL *pfNoRedraw, DWORD dwFlags)
{
CHECK_EXPECT(OnInPlaceActivateEx);
- ok(!dwFlags, "dwFlags = %x\n", dwFlags);
+ ok(!dwFlags, "dwFlags = %lx\n", dwFlags);
ok(pfNoRedraw != NULL, "pfNoRedraw = NULL\n");
return S_OK;
}
@@ -870,21 +870,21 @@ static void test_ConnectionPoint(IOleObject *unk)
static DWORD dw = 100;
hres = IOleObject_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container);
- ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
+ ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08lx\n", hres);
if(FAILED(hres))
return;
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID__WMPOCXEvents, &point);
IConnectionPointContainer_Release(container);
- ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
+ ok(hres == S_OK, "FindConnectionPoint failed: %08lx\n", hres);
if(FAILED(hres))
return;
hres = IConnectionPoint_Advise(point, (IUnknown*)&WMPOCXEvents, &dw);
- ok(hres == S_OK, "Advise failed: %08x\n", hres);
- ok(dw == 1, "dw=%d, expected 1\n", dw);
+ ok(hres == S_OK, "Advise failed: %08lx\n", hres);
+ ok(dw == 1, "dw=%ld, expected 1\n", dw);
hres = IConnectionPoint_Unadvise(point, dw);
- ok(hres == S_OK, "Unadvise failed: %08x\n", hres);
+ ok(hres == S_OK, "Unadvise failed: %08lx\n", hres);
IConnectionPoint_Release(point);
}
@@ -905,11 +905,11 @@ static void test_wmp_ifaces(IOleObject *oleobj)
BSTR url;
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer4, (void**)&player4);
- ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08lx\n", hres);
controls = NULL;
hres = IWMPPlayer4_get_controls(player4, &controls);
- ok(hres == S_OK, "get_controls failed: %08x\n", hres);
+ ok(hres == S_OK, "get_controls failed: %08lx\n", hres);
ok(controls != NULL, "controls = NULL\n");
player = NULL;
@@ -919,7 +919,7 @@ static void test_wmp_ifaces(IOleObject *oleobj)
unk = NULL;
hres = IWMPControls_QueryInterface(controls, &IID_IUnknown, (void **)&unk);
- ok(hres == S_OK, "Failed to get IUnknown, hr %#x.\n", hres);
+ ok(hres == S_OK, "Failed to get IUnknown, hr %#lx.\n", hres);
ok(unk != NULL, "Unexpected interface pointer.\n");
IUnknown_Release(unk);
@@ -928,7 +928,7 @@ static void test_wmp_ifaces(IOleObject *oleobj)
/* IWPNetwork */
network = NULL;
hres = IWMPPlayer4_get_network(player4, &network);
- ok(hres == S_OK, "get_network failed: %08x\n", hres);
+ ok(hres == S_OK, "get_network failed: %08lx\n", hres);
ok(network != NULL, "network = NULL\n");
player = NULL;
@@ -940,19 +940,19 @@ static void test_wmp_ifaces(IOleObject *oleobj)
playlist = NULL;
hres = IWMPPlayer4_QueryInterface(player4, &IID_IWMPPlaylist, (void**)&playlist);
- ok(hres == E_NOINTERFACE, "Getting IWMPPlaylist from IWMPPlayer4 succeeded: %08x\n", hres);
+ ok(hres == E_NOINTERFACE, "Getting IWMPPlaylist from IWMPPlayer4 succeeded: %08lx\n", hres);
ok(playlist == NULL, "playlist != NULL\n");
playlist = NULL;
hres = IWMPPlayer4_get_currentPlaylist(player4, &playlist);
- ok(hres == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08lx\n", hres);
ok(playlist != NULL, "playlist != NULL\n");
IWMPPlaylist_Release(playlist);
media = NULL;
hres = IWMPPlayer4_QueryInterface(player4, &IID_IWMPMedia, (void**)&media);
- ok(hres == E_NOINTERFACE, "get_currentMedia SUCCEEDED: %08x\n", hres);
+ ok(hres == E_NOINTERFACE, "get_currentMedia SUCCEEDED: %08lx\n", hres);
ok(media == NULL, "media != NULL\n");
/* Test media put/get */
@@ -966,92 +966,92 @@ static void test_wmp_ifaces(IOleObject *oleobj)
SET_EXPECT(GetContainer);
SET_EXPECT(Invoke_USERMODE);
hres = IWMPPlayer4_put_URL(player4, filename);
- ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08lx\n", hres);
todo_wine CHECK_CALLED_OR_BROKEN(GetContainer);
todo_wine CHECK_CALLED(Invoke_USERMODE);
url = NULL;
SET_EXPECT(Invoke_USERMODE);
hres = IWMPPlayer4_get_URL(player4, &url);
- ok(hres == S_OK, "IWMPPlayer4_get_URL failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_get_URL failed: %08lx\n", hres);
ok(0 == lstrcmpW(url, filename), "%s != %s\n", wine_dbgstr_w(url), wine_dbgstr_w(filename));
todo_wine CHECK_CALLED(Invoke_USERMODE);
SysFreeString(url);
hres = IWMPPlayer4_get_currentMedia(player4, &media);
- ok(hres == S_OK, "get_currentMedia failed: %08x\n", hres);
+ ok(hres == S_OK, "get_currentMedia failed: %08lx\n", hres);
ok(media != NULL, "media = (%p)\n", media);
url = NULL;
hres = IWMPMedia_get_sourceURL(media, &url);
- ok(hres == S_OK, "IWMPMedia_get_sourceURL failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPMedia_get_sourceURL failed: %08lx\n", hres);
ok(0 == lstrcmpW(url, filename), "%s != %s\n", wine_dbgstr_w(url), wine_dbgstr_w(filename));
SysFreeString(url);
SET_EXPECT(GetContainer);
hres = IWMPPlayer4_put_currentMedia(player4, media);
- ok(hres == S_OK, "put_currentMedia failed: %08x\n", hres);
+ ok(hres == S_OK, "put_currentMedia failed: %08lx\n", hres);
todo_wine CHECK_CALLED_OR_BROKEN(GetContainer);
IWMPMedia_Release(media);
hres = IWMPPlayer4_get_currentMedia(player4, &media);
- ok(hres == S_OK, "get_currentMedia failed: %08x\n", hres);
+ ok(hres == S_OK, "get_currentMedia failed: %08lx\n", hres);
ok(media != NULL, "media = (%p)\n", media);
IWMPMedia_Release(media);
settings = NULL;
hres = IWMPPlayer4_get_settings(player4, &settings);
- ok(hres == S_OK, "get_settings failed: %08x\n", hres);
+ ok(hres == S_OK, "get_settings failed: %08lx\n", hres);
ok(settings != NULL, "settings = NULL\n");
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPSettings, (void**)&settings_qi);
- ok(hres == S_OK, "Could not get IWMPSettings iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPSettings iface: %08lx\n", hres);
ok(settings == settings_qi, "settings != settings_qi\n");
IWMPSettings_Release(settings_qi);
/* Test few settings put/gets */
hres = IWMPSettings_get_autoStart(settings, &vbool);
- ok(hres == S_OK, "Could not get autoStart from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get autoStart from IWMPSettings: %08lx\n", hres);
ok(vbool == VARIANT_TRUE, "autoStart = %x\n", vbool);
hres = IWMPSettings_put_autoStart(settings, VARIANT_FALSE);
- ok(hres == S_OK, "Could not put autoStart in IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not put autoStart in IWMPSettings: %08lx\n", hres);
hres = IWMPSettings_get_autoStart(settings, &vbool);
- ok(hres == S_OK, "Could not get autoStart from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get autoStart from IWMPSettings: %08lx\n", hres);
ok(!vbool, "autoStart = %x\n", vbool);
hres = IWMPSettings_get_invokeURLs(settings, &vbool);
- ok(hres == S_OK, "Could not get invokeURLs from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get invokeURLs from IWMPSettings: %08lx\n", hres);
ok(vbool == VARIANT_TRUE, "invokeURLs = %x\n", vbool);
hres = IWMPSettings_put_invokeURLs(settings, VARIANT_FALSE);
- ok(hres == S_OK, "Could not put invokeURLs in IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not put invokeURLs in IWMPSettings: %08lx\n", hres);
hres = IWMPSettings_get_invokeURLs(settings, &vbool);
- ok(hres == S_OK, "Could not get invokeURLs from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get invokeURLs from IWMPSettings: %08lx\n", hres);
ok(!vbool, "invokeURLs = %x\n", vbool);
hres = IWMPSettings_get_enableErrorDialogs(settings, &vbool);
- ok(hres == S_OK, "Could not get enableErrorDialogs from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get enableErrorDialogs from IWMPSettings: %08lx\n", hres);
ok(vbool == VARIANT_FALSE, "enableErrorDialogs = %x\n", vbool);
hres = IWMPSettings_put_enableErrorDialogs(settings, VARIANT_TRUE);
- ok(hres == S_OK, "Could not put enableErrorDialogs in IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not put enableErrorDialogs in IWMPSettings: %08lx\n", hres);
hres = IWMPSettings_get_enableErrorDialogs(settings, &vbool);
- ok(hres == S_OK, "Could not get enableErrorDialogs from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get enableErrorDialogs from IWMPSettings: %08lx\n", hres);
ok(vbool == VARIANT_TRUE, "enableErrorDialogs = %x\n", vbool);
IWMPSettings_Release(settings);
IWMPPlayer4_Release(player4);
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer, (void**)&player);
- ok(hres == S_OK, "Could not get IWMPPlayer iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPPlayer iface: %08lx\n", hres);
settings = NULL;
hres = IWMPPlayer_get_settings(player, &settings);
- ok(hres == S_OK, "get_settings failed: %08x\n", hres);
+ ok(hres == S_OK, "get_settings failed: %08lx\n", hres);
ok(settings != NULL, "settings = NULL\n");
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPSettings, (void**)&settings_qi);
- ok(hres == S_OK, "Could not get IWMPSettings iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPSettings iface: %08lx\n", hres);
ok(settings == settings_qi, "settings != settings_qi\n");
IWMPSettings_Release(settings_qi);
@@ -1064,8 +1064,8 @@ static void test_wmp_ifaces(IOleObject *oleobj)
#define test_rect_size(a,b,c) _test_rect_size(__LINE__,a,b,c)
static void _test_rect_size(unsigned line, const RECT *r, int width, int height)
{
- ok_(__FILE__,line)(r->right-r->left == width, "width = %d, expected %d\n", r->right-r->left, width);
- ok_(__FILE__,line)(r->bottom-r->top == height, "height = %d, expected %d\n", r->bottom-r->top, height);
+ ok_(__FILE__,line)(r->right-r->left == width, "width = %ld, expected %d\n", r->right-r->left, width);
+ ok_(__FILE__,line)(r->bottom-r->top == height, "height = %ld, expected %d\n", r->bottom-r->top, height);
}
static void test_window(HWND hwnd)
@@ -1079,13 +1079,13 @@ static void test_window(HWND hwnd)
ok(!strncmp(class_name, "ATL:", 4), "class_name = %s %d\n", class_name, i);
res = GetWindowInfo(hwnd, &wi);
- ok(res, "GetWindowInfo failed: %u\n", GetLastError());
+ ok(res, "GetWindowInfo failed: %lu\n", GetLastError());
test_rect_size(&wi.rcWindow, 400, 410);
test_rect_size(&wi.rcClient, 400, 410);
- ok(wi.dwStyle == (WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_VISIBLE|WS_CHILD), "dwStyle = %x\n", wi.dwStyle);
- ok(!(wi.dwExStyle & ~0x800 /* undocumented, set by some versions */), "dwExStyle = %x\n", wi.dwExStyle);
+ ok(wi.dwStyle == (WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_VISIBLE|WS_CHILD), "dwStyle = %lx\n", wi.dwStyle);
+ ok(!(wi.dwExStyle & ~0x800 /* undocumented, set by some versions */), "dwExStyle = %lx\n", wi.dwExStyle);
ok(IsWindowVisible(hwnd), "Window is not visible\n");
}
@@ -1099,10 +1099,10 @@ static void test_QI(IUnknown *unk)
ok(hres == E_NOINTERFACE, "Got IQuickActivate iface when no expected\n");
hres = IUnknown_QueryInterface(unk, &IID_IMarshal, (void**)&tmp);
- ok(hres == E_NOINTERFACE, "Could not get IMarshal iface: %08x\n", hres);
+ ok(hres == E_NOINTERFACE, "Could not get IMarshal iface: %08lx\n", hres);
hres = IUnknown_QueryInterface(unk, &IID_IOleInPlaceObjectWindowless, (void**)&tmp);
- ok(hres == S_OK, "Could not get IOleInPlaceObjectWindowless iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IOleInPlaceObjectWindowless iface: %08lx\n", hres);
IUnknown_Release(tmp);
}
@@ -1113,20 +1113,20 @@ static void test_IConnectionPointContainer(IOleObject *oleobj)
HRESULT hres;
hres = IOleObject_QueryInterface(oleobj, &IID_IConnectionPointContainer, (void**)&container);
- ok(hres == S_OK, "Could not get IConnectionPointContainer iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IConnectionPointContainer iface: %08lx\n", hres);
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID_IPropertyNotifySink, &point);
- ok(hres == CONNECT_E_NOCONNECTION, "got: %08x\n", hres);
+ ok(hres == CONNECT_E_NOCONNECTION, "got: %08lx\n", hres);
point = NULL;
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID_IWMPEvents, &point);
- todo_wine ok(hres == S_OK, "got: %08x\n", hres);
+ todo_wine ok(hres == S_OK, "got: %08lx\n", hres);
if(point)
IConnectionPoint_Release(point);
point = NULL;
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID_IWMPEvents2, &point);
- todo_wine ok(hres == S_OK, "got: %08x\n", hres);
+ todo_wine ok(hres == S_OK, "got: %08lx\n", hres);
if(point)
IConnectionPoint_Release(point);
@@ -1146,7 +1146,7 @@ static void test_IConnectionPointContainer(IOleObject *oleobj)
point = NULL;
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID__WMPOCXEvents, &point);
- ok(hres == S_OK, "got: %08x\n", hres);
+ ok(hres == S_OK, "got: %08lx\n", hres);
if(point)
IConnectionPoint_Release(point);
@@ -1167,40 +1167,40 @@ static void test_extent(IOleObject *oleobj)
dpi_y = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(0, hdc);
if (dpi_x != 96 || dpi_y != 96)
- trace("dpi: %d / %d\n", dpi_y, dpi_y);
+ trace("dpi: %ld / %ld\n", dpi_y, dpi_y);
extent.cx = extent.cy = 0xdeadbeef;
hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &extent);
- ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
+ ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
expected.cx = MulDiv(192, 2540, dpi_x);
expected.cy = MulDiv(192, 2540, dpi_y);
- ok(extent.cx == expected.cx && extent.cy == expected.cy, "size = {%d %d} (expected %d %d)\n",
+ ok(extent.cx == expected.cx && extent.cy == expected.cy, "size = {%ld %ld} (expected %ld %ld)\n",
extent.cx, extent.cy, expected.cx, expected.cy );
extent.cx = 800;
extent.cy = 700;
hres = IOleObject_SetExtent(oleobj, DVASPECT_CONTENT, &extent);
- ok(hres == S_OK, "SetExtent failed: %08x\n", hres);
+ ok(hres == S_OK, "SetExtent failed: %08lx\n", hres);
extent.cx = extent.cy = 0xdeadbeef;
hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &extent);
- ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
- ok(extent.cx == 800 && extent.cy == 700, "size = {%d %d}\n", extent.cx, extent.cy);
+ ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
+ ok(extent.cx == 800 && extent.cy == 700, "size = {%ld %ld}\n", extent.cx, extent.cy);
hres = IOleObject_GetExtent(oleobj, 0, &extent);
- ok(hres == E_FAIL, "GetExtent failed: %08x\n", hres);
+ ok(hres == E_FAIL, "GetExtent failed: %08lx\n", hres);
hres = IOleObject_GetExtent(oleobj, 7, &extent);
- ok(hres == E_FAIL, "GetExtent failed: %08x\n", hres);
+ ok(hres == E_FAIL, "GetExtent failed: %08lx\n", hres);
extent.cx = 900;
extent.cy = 800;
hres = IOleObject_SetExtent(oleobj, DVASPECT_CONTENT, &expected);
- ok(hres == S_OK, "SetExtent failed: %08x\n", hres);
+ ok(hres == S_OK, "SetExtent failed: %08lx\n", hres);
hres = IOleObject_SetExtent(oleobj, 0, &expected);
- ok(hres == DV_E_DVASPECT, "SetExtent failed: %08x\n", hres);
+ ok(hres == DV_E_DVASPECT, "SetExtent failed: %08lx\n", hres);
hres = IOleObject_SetExtent(oleobj, 7, &expected);
- ok(hres == DV_E_DVASPECT, "SetExtent failed: %08x\n", hres);
+ ok(hres == DV_E_DVASPECT, "SetExtent failed: %08lx\n", hres);
}
static void test_wmp(void)
@@ -1226,31 +1226,31 @@ static void test_wmp(void)
win_skip("CLSID_WindowsMediaPlayer not registered\n");
return;
}
- ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08x\n", hres);
+ ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPCore, (void**)&wmpcore);
- ok(hres == S_OK, "got 0x%08x\n", hres);
+ ok(hres == S_OK, "got 0x%08lx\n", hres);
hres = IWMPCore_get_versionInfo(wmpcore, NULL);
- ok(hres == E_POINTER, "got 0x%08x\n", hres);
+ ok(hres == E_POINTER, "got 0x%08lx\n", hres);
hres = IWMPCore_get_versionInfo(wmpcore, &str);
- ok(hres == S_OK, "got 0x%08x\n", hres);
+ ok(hres == S_OK, "got 0x%08lx\n", hres);
SysFreeString(str);
IWMPCore_Release(wmpcore);
hres = IOleObject_QueryInterface(oleobj, &IID_IProvideClassInfo2, (void**)&class_info);
- ok(hres == S_OK, "Could not get IProvideClassInfo2 iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IProvideClassInfo2 iface: %08lx\n", hres);
hres = IProvideClassInfo2_GetGUID(class_info, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &guid);
- ok(hres == S_OK, "GetGUID failed: %08x\n", hres);
+ ok(hres == S_OK, "GetGUID failed: %08lx\n", hres);
ok(IsEqualGUID(&guid, &IID__WMPOCXEvents), "guid = %s\n", wine_dbgstr_guid(&guid));
hres = IProvideClassInfo2_GetClassInfo(class_info, &ti);
- ok(hres == S_OK, "Failed to get class info, hr %#x.\n", hres);
+ ok(hres == S_OK, "Failed to get class info, hr %#lx.\n", hres);
hres = ITypeInfo_GetTypeAttr(ti, &attr);
- ok(hres == S_OK, "Failed to get type attributes, hr %#x.\n", hres);
+ ok(hres == S_OK, "Failed to get type attributes, hr %#lx.\n", hres);
ok(IsEqualGUID(&CLSID_WindowsMediaPlayer, &attr->guid), "Unexpected typeinfo guid %s\n", wine_dbgstr_guid(&attr->guid));
ITypeInfo_ReleaseTypeAttr(ti, attr);
ITypeInfo_Release(ti);
@@ -1262,25 +1262,25 @@ static void test_wmp(void)
test_extent(oleobj);
hres = IOleObject_GetMiscStatus(oleobj, DVASPECT_CONTENT, &misc_status);
- ok(hres == S_OK, "GetMiscStatus failed: %08x\n", hres);
+ ok(hres == S_OK, "GetMiscStatus failed: %08lx\n", hres);
ok(misc_status == (OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_INSIDEOUT
- |OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE), "misc_status = %x\n", misc_status);
+ |OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE), "misc_status = %lx\n", misc_status);
hres = IOleObject_QueryInterface(oleobj, &IID_IPersistStreamInit, (void**)&psi);
- ok(hres == S_OK, "Could not get IPersistStreamInit iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IPersistStreamInit iface: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IOleInPlaceObject, (void**)&ipobj);
- ok(hres == S_OK, "Could not get IOleInPlaceObject iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IOleInPlaceObject iface: %08lx\n", hres);
hres = IPersistStreamInit_InitNew(psi);
- ok(hres == E_FAIL || broken(hres == S_OK /* Old WMP */), "InitNew failed: %08x\n", hres);
+ ok(hres == E_FAIL || broken(hres == S_OK /* Old WMP */), "InitNew failed: %08lx\n", hres);
SET_EXPECT(GetContainer);
SET_EXPECT(GetExtendedControl);
SET_EXPECT(GetWindow);
SET_EXPECT(Invoke_USERMODE);
hres = IOleObject_SetClientSite(oleobj, &ClientSite);
- ok(hres == S_OK, "SetClientSite failed: %08x\n", hres);
+ ok(hres == S_OK, "SetClientSite failed: %08lx\n", hres);
todo_wine CHECK_CALLED(GetContainer);
CHECK_CALLED(GetExtendedControl);
todo_wine CHECK_CALLED(GetWindow);
@@ -1288,17 +1288,17 @@ static void test_wmp(void)
client_site = NULL;
hres = IOleObject_GetClientSite(oleobj, &client_site);
- ok(hres == S_OK, "GetClientSite failed: %08x\n", hres);
+ ok(hres == S_OK, "GetClientSite failed: %08lx\n", hres);
ok(client_site == &ClientSite, "client_site != ClientSite\n");
SET_EXPECT(GetWindow);
hres = IPersistStreamInit_InitNew(psi);
- ok(hres == S_OK, "InitNew failed: %08x\n", hres);
+ ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
CHECK_CALLED(GetWindow);
hwnd = (HWND)0xdeadbeef;
hres = IOleInPlaceObject_GetWindow(ipobj, &hwnd);
- ok(hres == E_UNEXPECTED, "GetWindow failed: %08x\n", hres);
+ ok(hres == E_UNEXPECTED, "GetWindow failed: %08lx\n", hres);
ok(!hwnd, "hwnd = %p\n", hwnd);
SET_EXPECT(GetWindow);
@@ -1307,7 +1307,7 @@ static void test_wmp(void)
SET_EXPECT(GetWindowContext);
SET_EXPECT(ShowObject);
hres = IOleObject_DoVerb(oleobj, OLEIVERB_INPLACEACTIVATE, NULL, &ClientSite, 0, container_hwnd, &pos);
- ok(hres == S_OK, "DoVerb failed: %08x\n", hres);
+ ok(hres == S_OK, "DoVerb failed: %08lx\n", hres);
CHECK_CALLED(GetWindow);
CHECK_CALLED(CanWindowlessActivate);
CHECK_CALLED(OnInPlaceActivateEx);
@@ -1316,44 +1316,44 @@ static void test_wmp(void)
hwnd = NULL;
hres = IOleInPlaceObject_GetWindow(ipobj, &hwnd);
- ok(hres == S_OK, "GetWindow failed: %08x\n", hres);
+ ok(hres == S_OK, "GetWindow failed: %08lx\n", hres);
ok(hwnd != NULL, "hwnd = NULL\n");
test_window(hwnd);
SetRect(&pos, 1, 2, 301, 312);
hres = IOleInPlaceObject_SetObjectRects(ipobj, &pos, &pos);
- ok(hres == S_OK, "SetObjectRects failed: %08x\n", hres);
+ ok(hres == S_OK, "SetObjectRects failed: %08lx\n", hres);
GetClientRect(hwnd, &pos);
test_rect_size(&pos, 300, 310);
test_wmp_ifaces(oleobj);
hres = IOleObject_DoVerb(oleobj, OLEIVERB_HIDE, NULL, &ClientSite, 0, container_hwnd, &pos);
- ok(hres == S_OK, "DoVerb failed: %08x\n", hres);
+ ok(hres == S_OK, "DoVerb failed: %08lx\n", hres);
ok(!IsWindowVisible(hwnd), "Window is visible\n");
SET_EXPECT(OnShowWindow_FALSE);
SET_EXPECT(OnInPlaceDeactivate);
hres = IOleObject_Close(oleobj, 0);
- ok(hres == S_OK, "Close failed: %08x\n", hres);
+ ok(hres == S_OK, "Close failed: %08lx\n", hres);
todo_wine CHECK_CALLED(OnShowWindow_FALSE);
CHECK_CALLED(OnInPlaceDeactivate);
hwnd = (HWND)0xdeadbeef;
hres = IOleInPlaceObject_GetWindow(ipobj, &hwnd);
- ok(hres == E_UNEXPECTED, "GetWindow failed: %08x\n", hres);
+ ok(hres == E_UNEXPECTED, "GetWindow failed: %08lx\n", hres);
ok(!hwnd, "hwnd = %p\n", hwnd);
hres = IOleObject_Close(oleobj, 0);
- ok(hres == S_OK, "Close failed: %08x\n", hres);
+ ok(hres == S_OK, "Close failed: %08lx\n", hres);
hres = IOleObject_SetClientSite(oleobj, NULL);
- ok(hres == S_OK, "SetClientSite failed: %08x\n", hres);
+ ok(hres == S_OK, "SetClientSite failed: %08lx\n", hres);
client_site = (void*)0xdeadbeef;
hres = IOleObject_GetClientSite(oleobj, &client_site);
- ok(hres == E_FAIL || broken(hres == S_OK), "GetClientSite failed: %08x\n", hres);
+ ok(hres == E_FAIL || broken(hres == S_OK), "GetClientSite failed: %08lx\n", hres);
ok(!client_site, "client_site = %p\n", client_site);
test_ConnectionPoint(oleobj);
@@ -1362,7 +1362,7 @@ static void test_wmp(void)
IOleInPlaceObject_Release(ipobj);
ref = IOleObject_Release(oleobj);
- ok(!ref, "ref = %d\n", ref);
+ ok(!ref, "ref = %ld\n", ref);
}
static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
2
1
March 10, 2022
this lets the compiler do the int => long conversions
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/user32/tests/edit.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c
index 6edec12e03b..777c50be337 100644
--- a/dlls/user32/tests/edit.c
+++ b/dlls/user32/tests/edit.c
@@ -2018,8 +2018,11 @@ static void test_margins_font_change(void)
}
-#define edit_pos_ok(exp, got, txt) \
- ok(exp == got, "wrong " #txt " expected %d got %d\n", exp, got);
+#define edit_pos_ok(exp, got, txt) edit_pos_ok_(__LINE__, exp, got, #txt)
+static inline void edit_pos_ok_(unsigned line, DWORD exp, DWORD got, const char* txt)
+{
+ ok_(__FILE__, line)(exp == got, "wrong %s expected %ld got %ld\n", txt, exp, got);
+}
#define check_pos(hwEdit, set_height, test_top, test_height, test_left) \
do { \
2
2
[tools 1/2] testbot/web: Better initialize and check the Days Stats page parameter.
by Francois Gouget March 10, 2022
by Francois Gouget March 10, 2022
March 10, 2022
Use SetParam() to provide the default value. This allows removing the
Days field and GetDisplayValue() method.
FormPage::Validate() must be called after the property descriptors
have been set otherwise it has no property to check. This removes the
need for redefining Validate().
Treat "00" the same as "0".
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/web/Stats.pl | 31 ++++---------------------------
1 file changed, 4 insertions(+), 27 deletions(-)
diff --git a/testbot/web/Stats.pl b/testbot/web/Stats.pl
index c96e6fdafb..42408a3a81 100644
--- a/testbot/web/Stats.pl
+++ b/testbot/web/Stats.pl
@@ -37,34 +37,18 @@ sub _initialize($$$)
{
my ($self, $Request, $RequiredRole) = @_;
- $self->{Days} = $self->GetParam("Days");
- $self->Validate();
-
$self->{start} = Time();
my @PropertyDescriptors = (
CreateBasicPropertyDescriptor("Days", "Days to analyze", !1, 1, "N", 2),
);
$self->SUPER::_initialize($Request, $RequiredRole, \@PropertyDescriptors);
-}
-
-sub Validate($)
-{
- my ($self) = @_;
- if (!defined $self->{Days})
- {
- $self->{Days} = 7;
- $self->{NoStats} = 1;
- }
- elsif ($self->{Days} !~ /^[0-9]{1,2}$/)
+ if (!$self->GetParam("Days") or !$self->Validate() or
+ !int($self->GetParam("Days"))) # 00 case!
{
- $self->{ErrField} = "Days";
- $self->{ErrMessage} = "The number of days must be between 1 and 99";
+ $self->SetParam("Days", 7) if (!defined $self->{ErrMessage});
$self->{NoStats} = 1;
- $self->{Days} = 7;
- return undef;
}
- return $self->SUPER::Validate();
}
sub GetPageTitle($$)
@@ -211,7 +195,7 @@ sub GenerateBody($)
my $VMs = CreateVMs();
$VMs->FilterEnabledRole();
my @SortedVMs = sort _CompareVMs @{$VMs->GetItems()};
- my $Stats = GetStatistics($VMs, $self->{Days} * 24 * 60 * 60);
+ my $Stats = GetStatistics($VMs, $self->GetParam("Days") * 24 * 60 * 60);
### Show global statistics
@@ -377,13 +361,6 @@ sub GenerateBody($)
print "</tbody></table></div>\n";
}
-sub GetDisplayValue($$)
-{
- my ($self, $PropertyDescriptor) = @_;
-
- return $self->{$PropertyDescriptor->GetName()};
-}
-
sub GetActions($)
{
#my ($self) = @_;
--
2.30.2
1
1
[tools 1/2] testbot/web: Better initialize and check the Hours Log page parameter.
by Francois Gouget March 10, 2022
by Francois Gouget March 10, 2022
March 10, 2022
Call Validate() to make sure the Hours parameter is usable. Note that
due to an implementation detail marking the Hours property as required
is not strictly necessary. But it does reflect that we need a value for
the Download action.
Use SetParam() to provide a default value which removes the need for
redefining GetPropertyValue().
Treat "00" the same as "0".
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/web/admin/Log.pl | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/testbot/web/admin/Log.pl b/testbot/web/admin/Log.pl
index 456e73f55d..f8e4943b3d 100644
--- a/testbot/web/admin/Log.pl
+++ b/testbot/web/admin/Log.pl
@@ -34,9 +34,16 @@ sub _initialize($$$)
my ($self, $Request, $RequiredRole) = @_;
my @PropertyDescriptors = (
- CreateBasicPropertyDescriptor("Hours", "Hours", !1, !1, "N", 2),
+ CreateBasicPropertyDescriptor("Hours", "Hours", !1, 1, "N", 2),
);
$self->SUPER::_initialize($Request, $RequiredRole, \@PropertyDescriptors);
+
+ if (!$self->GetParam("Hours") or !$self->Validate() or
+ !int($self->GetParam("Hours"))) # 00 case!
+ {
+ $self->SetParam("Hours", 1) if (!defined $self->{ErrMessage});
+ $self->SetParam("Action", undef);
+ }
}
sub GetPageTitle($$)
@@ -46,16 +53,6 @@ sub GetPageTitle($$)
return "Engine Log - ${ProjectName} Test Bot";
}
-sub GetPropertyValue($$)
-{
- my ($self, $PropertyDescriptor) = @_;
-
- my $PropertyName = $PropertyDescriptor->GetName();
- return 1 if ($PropertyName eq "Hours"); # Provides a default value
-
- return $self->SUPER::GetPropertyValue($PropertyDescriptor);
-}
-
sub GetHeaderText($)
{
#my ($self) = @_;
--
2.30.2
1
1
March 10, 2022
Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com>
---
dlls/windows.media.speech/tests/Makefile.in | 1 -
dlls/windows.media.speech/tests/speech.c | 92 ++++++++++-----------
2 files changed, 46 insertions(+), 47 deletions(-)
diff --git a/dlls/windows.media.speech/tests/Makefile.in b/dlls/windows.media.speech/tests/Makefile.in
index e1616991573..2ee10d3db21 100644
--- a/dlls/windows.media.speech/tests/Makefile.in
+++ b/dlls/windows.media.speech/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = windows.media.speech.dll
IMPORTS = combase uuid
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c
index 3194a75d6d7..be5499954be 100644
--- a/dlls/windows.media.speech/tests/speech.c
+++ b/dlls/windows.media.speech/tests/speech.c
@@ -48,7 +48,7 @@ static inline LONG get_ref(IUnknown *obj)
static inline void check_refcount_(unsigned int line, void *obj, LONG exp)
{
LONG ref = get_ref(obj);
- ok_(__FILE__, line)(exp == ref, "Unexpected refcount %u, expected %u\n", ref, exp);
+ ok_(__FILE__, line)(exp == ref, "Unexpected refcount %lu, expected %lu\n", ref, exp);
}
#define check_interface(obj, iid, exp) check_interface_(__LINE__, obj, iid, exp)
@@ -61,7 +61,7 @@ static void check_interface_(unsigned int line, void *obj, const IID *iid, BOOL
expected_hr = supported ? S_OK : E_NOINTERFACE;
hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
- ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
if (SUCCEEDED(hr))
IUnknown_Release(unk);
}
@@ -79,19 +79,19 @@ static void test_ActivationFactory(void)
ULONG ref;
hr = RoInitialize(RO_INIT_MULTITHREADED);
- ok(hr == S_OK, "RoInitialize failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "RoInitialize failed, hr %#lx.\n", hr);
hr = WindowsCreateString(synthesizer_name, wcslen(synthesizer_name), &str);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx.\n", hr);
hr = WindowsCreateString(recognizer_name, wcslen(recognizer_name), &str2);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx.\n", hr);
hr = WindowsCreateString(garbage_name, wcslen(garbage_name), &str3);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx.\n", hr);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
- ok(hr == S_OK, "RoGetActivationFactory failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "RoGetActivationFactory failed, hr %#lx.\n", hr);
check_refcount(factory, 2);
@@ -103,12 +103,12 @@ static void test_ActivationFactory(void)
check_interface(factory, &IID_ISpeechRecognizerStatics2, FALSE);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory2);
- ok(hr == S_OK, "RoGetActivationFactory failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "RoGetActivationFactory failed, hr %#lx.\n", hr);
ok(factory == factory2, "Factories pointed at factory %p factory2 %p.\n", factory, factory2);
check_refcount(factory2, 3);
hr = RoGetActivationFactory(str2, &IID_IActivationFactory, (void **)&factory3);
- todo_wine ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "Got unexpected hr %#x.\n", hr);
+ todo_wine ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "Got unexpected hr %#lx.\n", hr);
if (hr == S_OK) /* Win10+ only */
{
@@ -121,18 +121,18 @@ static void test_ActivationFactory(void)
check_interface(factory3, &IID_ISpeechRecognizerStatics, TRUE);
hr = IActivationFactory_QueryInterface(factory3, &IID_ISpeechRecognizerStatics2, (void **)&recognizer_statics2);
- ok(hr == S_OK || broken(hr == E_NOINTERFACE), "IActivationFactory_QueryInterface failed, hr %#x.\n", hr);
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE), "IActivationFactory_QueryInterface failed, hr %#lx.\n", hr);
if (hr == S_OK) /* ISpeechRecognizerStatics2 not available in Win10 1507 */
{
ref = ISpeechRecognizerStatics2_Release(recognizer_statics2);
- ok(ref == 2, "Got unexpected refcount: %u.\n", ref);
+ ok(ref == 2, "Got unexpected refcount: %lu.\n", ref);
}
check_interface(factory3, &IID_IInstalledVoicesStatic, FALSE);
ref = IActivationFactory_Release(factory3);
- ok(ref == 1, "Got unexpected refcount: %u.\n", ref);
+ ok(ref == 1, "Got unexpected refcount: %lu.\n", ref);
}
hdll = LoadLibraryW(L"windows.media.speech.dll");
@@ -143,18 +143,18 @@ static void test_ActivationFactory(void)
ok(!!pDllGetActivationFactory, "DllGetActivationFactory not found.\n");
hr = pDllGetActivationFactory(str3, &factory4);
- ok((hr == CLASS_E_CLASSNOTAVAILABLE), "Got unexpected hr %#x.\n", hr);
+ ok((hr == CLASS_E_CLASSNOTAVAILABLE), "Got unexpected hr %#lx.\n", hr);
FreeLibrary(hdll);
}
hr = RoGetActivationFactory(str3, &IID_IActivationFactory, (void **)&factory4);
- ok((hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#x.\n", hr);
+ ok((hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#lx.\n", hr);
ref = IActivationFactory_Release(factory2);
- ok(ref == 2, "Got unexpected refcount: %u.\n", ref);
+ ok(ref == 2, "Got unexpected refcount: %lu.\n", ref);
ref = IActivationFactory_Release(factory);
- ok(ref == 1, "Got unexpected refcount: %u.\n", ref);
+ ok(ref == 1, "Got unexpected refcount: %lu.\n", ref);
WindowsDeleteString(str);
WindowsDeleteString(str2);
@@ -183,10 +183,10 @@ static void test_SpeechSynthesizer(void)
ULONG ref;
hr = RoInitialize(RO_INIT_MULTITHREADED);
- ok(hr == S_OK, "RoInitialize failed, hr %#x\n", hr);
+ ok(hr == S_OK, "RoInitialize failed, hr %#lx\n", hr);
hr = WindowsCreateString(speech_synthesizer_name, wcslen(speech_synthesizer_name), &str);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hdll = LoadLibraryW(L"windows.media.speech.dll");
if (hdll)
@@ -195,31 +195,31 @@ static void test_SpeechSynthesizer(void)
ok(!!pDllGetActivationFactory, "DllGetActivationFactory not found.\n");
hr = WindowsCreateString(unknown_class_name, wcslen(unknown_class_name), &str2);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = pDllGetActivationFactory(str2, &factory);
- ok(hr == CLASS_E_CLASSNOTAVAILABLE, "Got unexpected hr %#x.\n", hr);
+ ok(hr == CLASS_E_CLASSNOTAVAILABLE, "Got unexpected hr %#lx.\n", hr);
WindowsDeleteString(str2);
hr = WindowsCreateString(speech_synthesizer_name2, wcslen(speech_synthesizer_name2), &str2);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = pDllGetActivationFactory(str2, &factory2);
- ok(hr == CLASS_E_CLASSNOTAVAILABLE, "Got unexpected hr %#x.\n", hr);
+ ok(hr == CLASS_E_CLASSNOTAVAILABLE, "Got unexpected hr %#lx.\n", hr);
WindowsDeleteString(str2);
hr = pDllGetActivationFactory(str, &factory2);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
}
else
{
- win_skip("Failed to load library, err %u.\n", GetLastError());
+ win_skip("Failed to load library, err %lu.\n", GetLastError());
}
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
- ok(hr == S_OK, "RoGetActivationFactory failed, hr %#x\n", hr);
+ ok(hr == S_OK, "RoGetActivationFactory failed, hr %#lx\n", hr);
if (hdll)
{
@@ -229,47 +229,47 @@ static void test_SpeechSynthesizer(void)
}
hr = IActivationFactory_QueryInterface(factory, &IID_IInspectable, (void **)&inspectable);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IAgileObject, (void **)&agile_object);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IInstalledVoicesStatic, (void **)&voices_static);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInstalledVoicesStatic failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInstalledVoicesStatic failed, hr %#lx\n", hr);
hr = IInstalledVoicesStatic_QueryInterface(voices_static, &IID_IInspectable, (void **)&tmp_inspectable);
- ok(hr == S_OK, "IInstalledVoicesStatic_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IInstalledVoicesStatic_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
ok(tmp_inspectable == inspectable, "IInstalledVoicesStatic_QueryInterface IID_IInspectable returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IInstalledVoicesStatic_QueryInterface(voices_static, &IID_IAgileObject, (void **)&tmp_agile_object);
- ok(hr == S_OK, "IInstalledVoicesStatic_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IInstalledVoicesStatic_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
ok(tmp_agile_object == agile_object, "IInstalledVoicesStatic_QueryInterface IID_IAgileObject returned %p, expected %p\n", tmp_agile_object, agile_object);
IAgileObject_Release(tmp_agile_object);
hr = IInstalledVoicesStatic_get_AllVoices(voices_static, &voices);
- ok(hr == S_OK, "IInstalledVoicesStatic_get_AllVoices failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IInstalledVoicesStatic_get_AllVoices failed, hr %#lx\n", hr);
hr = IVectorView_VoiceInformation_QueryInterface(voices, &IID_IInspectable, (void **)&tmp_inspectable);
- ok(hr == S_OK, "IVectorView_VoiceInformation_QueryInterface voices failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_VoiceInformation_QueryInterface voices failed, hr %#lx\n", hr);
ok(tmp_inspectable != inspectable, "IVectorView_VoiceInformation_QueryInterface voices returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IVectorView_VoiceInformation_QueryInterface(voices, &IID_IAgileObject, (void **)&tmp_agile_object);
- ok(hr == E_NOINTERFACE, "IVectorView_VoiceInformation_QueryInterface voices failed, hr %#x\n", hr);
+ ok(hr == E_NOINTERFACE, "IVectorView_VoiceInformation_QueryInterface voices failed, hr %#lx\n", hr);
size = 0xdeadbeef;
hr = IVectorView_VoiceInformation_get_Size(voices, &size);
- ok(hr == S_OK, "IVectorView_VoiceInformation_get_Size voices failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_VoiceInformation_get_Size voices failed, hr %#lx\n", hr);
todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_VoiceInformation_get_Size returned %u\n", size);
voice = (IVoiceInformation *)0xdeadbeef;
hr = IVectorView_VoiceInformation_GetAt(voices, size, &voice);
- ok(hr == E_BOUNDS, "IVectorView_VoiceInformation_GetAt failed, hr %#x\n", hr);
+ ok(hr == E_BOUNDS, "IVectorView_VoiceInformation_GetAt failed, hr %#lx\n", hr);
ok(voice == NULL, "IVectorView_VoiceInformation_GetAt returned %p\n", voice);
hr = IVectorView_VoiceInformation_GetMany(voices, size, 1, &voice, &size);
- ok(hr == S_OK, "IVectorView_VoiceInformation_GetMany failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_VoiceInformation_GetMany failed, hr %#lx\n", hr);
ok(size == 0, "IVectorView_VoiceInformation_GetMany returned count %u\n", size);
IVectorView_VoiceInformation_Release(voices);
@@ -280,25 +280,25 @@ static void test_SpeechSynthesizer(void)
IInspectable_Release(inspectable);
hr = IActivationFactory_QueryInterface(factory, &IID_ISpeechSynthesizer, (void **)&synthesizer);
- ok(hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr);
+ ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
hr = RoActivateInstance(str, &inspectable);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = IInspectable_QueryInterface(inspectable, &IID_ISpeechSynthesizer, (void **)&synthesizer);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = IInspectable_QueryInterface(inspectable, &IID_IClosable, (void **)&closable);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ref = IClosable_Release(closable);
- ok(ref == 2, "Got unexpected ref %u.\n", ref);
+ ok(ref == 2, "Got unexpected ref %lu.\n", ref);
ref = ISpeechSynthesizer_Release(synthesizer);
- ok(ref == 1, "Got unexpected ref %u.\n", ref);
+ ok(ref == 1, "Got unexpected ref %lu.\n", ref);
ref = IInspectable_Release(inspectable);
- ok(!ref, "Got unexpected ref %u.\n", ref);
+ ok(!ref, "Got unexpected ref %lu.\n", ref);
IActivationFactory_Release(factory);
WindowsDeleteString(str);
@@ -315,13 +315,13 @@ static void test_VoiceInformation(void)
HRESULT hr;
hr = RoInitialize(RO_INIT_MULTITHREADED);
- ok(hr == S_OK, "RoInitialize failed, hr %#x\n", hr);
+ ok(hr == S_OK, "RoInitialize failed, hr %#lx\n", hr);
hr = WindowsCreateString(voice_information_name, wcslen(voice_information_name), &str);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
- ok(hr == REGDB_E_CLASSNOTREG, "RoGetActivationFactory returned unexpected hr %#x\n", hr);
+ ok(hr == REGDB_E_CLASSNOTREG, "RoGetActivationFactory returned unexpected hr %#lx\n", hr);
WindowsDeleteString(str);
--
2.35.1
1
0
[tools v2] testbot/web: Explicitly call exit on return from Redirect().
by Francois Gouget March 10, 2022
by Francois Gouget March 10, 2022
March 10, 2022
Having Redirect() call exit() itself is confusing and requires
documenting that it does not return in each call point and/or adding
a defensive exit() call anyway.
Using the exit(Redirect(...)) construct is more explicit, concise and
robust.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
v2: Remove a chunk that was patching a debug web page that's specific to
my test site.
---
testbot/lib/ObjectModel/CGI/CollectionBlock.pm | 18 +++++++-----------
testbot/lib/ObjectModel/CGI/ItemPage.pm | 10 ++++------
testbot/lib/ObjectModel/CGI/Page.pm | 2 +-
testbot/lib/WineTestBot/CGI/PageBase.pm | 6 +++---
testbot/web/JobDetails.pl | 8 +++-----
testbot/web/Login.pl | 3 +--
testbot/web/Submit.pl | 13 +++----------
testbot/web/admin/Log.pl | 4 ++--
testbot/web/admin/SpecialJobs.pl | 3 +--
testbot/web/admin/UserDetails.pl | 9 +++------
10 files changed, 28 insertions(+), 48 deletions(-)
diff --git a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
index a5e8187009..9027b87758 100644
--- a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
+++ b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
@@ -539,20 +539,16 @@ sub OnAction($$)
"=" . uri_escape($MasterColValues->[$ColIndex]);
}
}
- $self->{EnclosingPage}->Redirect($Target);
- return 1;
+ exit($self->{EnclosingPage}->Redirect($Target));
}
- else
+
+ my $Ok = 1;
+ foreach my $Key (@{$self->{Collection}->GetKeys()})
{
- my $Ok = 1;
- foreach my $Key (@{$self->{Collection}->GetKeys()})
+ if (defined $self->{EnclosingPage}->GetParam($self->SelName($Key)) && $Ok)
{
- if (defined($self->{EnclosingPage}->GetParam($self->SelName($Key))) &&
- $Ok)
- {
- my $Item = $self->{Collection}->GetItem($Key);
- $Ok = $self->CallOnItemAction($Item, $Action);
- }
+ my $Item = $self->{Collection}->GetItem($Key);
+ $Ok = $self->CallOnItemAction($Item, $Action);
}
}
}
diff --git a/testbot/lib/ObjectModel/CGI/ItemPage.pm b/testbot/lib/ObjectModel/CGI/ItemPage.pm
index 6d9449173d..940115475f 100644
--- a/testbot/lib/ObjectModel/CGI/ItemPage.pm
+++ b/testbot/lib/ObjectModel/CGI/ItemPage.pm
@@ -151,13 +151,11 @@ sub OnAction($$)
if ($Action eq "OK")
{
return !1 if (!$self->Save());
- $self->RedirectToList();
- exit;
+ exit($self->RedirectToList());
}
- elsif ($Action eq "Cancel")
+ if ($Action eq "Cancel")
{
- $self->RedirectToList();
- exit;
+ exit($self->RedirectToList());
}
return $self->SUPER::OnAction($Action);
@@ -177,7 +175,7 @@ sub RedirectToList($)
"=" . url_escape($MasterColValues->[$ColIndex]);
}
}
- $self->Redirect($Target); # does not return
+ return $self->Redirect($Target);
}
1;
diff --git a/testbot/lib/ObjectModel/CGI/Page.pm b/testbot/lib/ObjectModel/CGI/Page.pm
index 8abaaaa9d2..b0450d0e78 100644
--- a/testbot/lib/ObjectModel/CGI/Page.pm
+++ b/testbot/lib/ObjectModel/CGI/Page.pm
@@ -246,7 +246,7 @@ sub Redirect($$)
{
my ($self, $Location) = @_;
- $self->{PageBase}->Redirect($self, $Location);
+ return $self->{PageBase}->Redirect($self, $Location);
}
sub GetCurrentSession($)
diff --git a/testbot/lib/WineTestBot/CGI/PageBase.pm b/testbot/lib/WineTestBot/CGI/PageBase.pm
index d38e8d96b6..b7edd8fcaa 100644
--- a/testbot/lib/WineTestBot/CGI/PageBase.pm
+++ b/testbot/lib/WineTestBot/CGI/PageBase.pm
@@ -56,7 +56,7 @@ sub new($$$$@)
! $Session->User->HasRole($RequiredRole))
{
my $LoginURL = "/Login.pl?Target=" . uri_escape($ENV{"REQUEST_URI"});
- $self->Redirect($Page, MakeSecureURL($LoginURL));
+ exit($self->Redirect($Page, MakeSecureURL($LoginURL)));
}
}
@@ -75,7 +75,7 @@ sub CheckSecurePage($$)
if ($UseSSL && ! SecureConnection())
{
- $self->Redirect($Page, MakeSecureURL($ENV{"REQUEST_URI"}));
+ exit($self->Redirect($Page, MakeSecureURL($ENV{"REQUEST_URI"})));
}
}
@@ -415,7 +415,7 @@ sub Redirect($$$)
}
$self->{Request}->headers_out->set("Location", $Location);
$self->{Request}->status(Apache2::Const::REDIRECT);
- exit;
+ return 0; # a suitable exit code
}
sub GetCurrentSession($)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 919c7a5e3b..8d93957ce6 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -52,7 +52,7 @@ sub _initialize($$$)
$self->{Job} = CreateJobs()->GetItem($JobId);
if (!defined $self->{Job})
{
- $self->Redirect("/"); # does not return
+ exit($self->Redirect("/"));
}
$self->{JobId} = $JobId;
@@ -193,8 +193,7 @@ sub OnCancel($)
return !1;
}
- $self->Redirect("/JobDetails.pl?Key=" . $self->{JobId}); # does not return
- exit;
+ exit($self->Redirect("/JobDetails.pl?Key=" . $self->{JobId}));
}
sub OnRestart($)
@@ -215,8 +214,7 @@ sub OnRestart($)
return !1;
}
- $self->Redirect("/JobDetails.pl?Key=" . $self->{JobId}); # does not return
- exit;
+ exit($self->Redirect("/JobDetails.pl?Key=" . $self->{JobId}));
}
sub OnAction($$$)
diff --git a/testbot/web/Login.pl b/testbot/web/Login.pl
index d9757edb92..ac64fc28ea 100644
--- a/testbot/web/Login.pl
+++ b/testbot/web/Login.pl
@@ -135,8 +135,7 @@ sub OnLogIn($)
{
$Target = "/";
}
- $self->Redirect(MakeSecureURL($Target)); # does not return
- exit;
+ exit($self->Redirect(MakeSecureURL($Target)));
}
sub OnAction($$)
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 98d13381e0..79d1c8772d 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -1265,8 +1265,7 @@ sub _SubmitJob($$)
return undef;
}
- $self->Redirect("/JobDetails.pl?Key=". $NewJob->GetKey()); # does not return
- exit;
+ exit($self->Redirect("/JobDetails.pl?Key=". $NewJob->GetKey()));
}
sub OnSubmit($)
@@ -1323,14 +1322,8 @@ sub OnOK($)
{
my ($self) = @_;
- if (defined $self->{JobKey})
- {
- $self->Redirect("/JobDetails.pl?Key=$self->{JobKey}"); # does not return
- }
- else
- {
- $self->Redirect("/"); # does not return
- }
+ my $Target = defined $self->{JobKey} ? "/JobDetails.pl?Key=$self->{JobKey}" : "/";
+ exit($self->Redirect($Target));
}
sub OnAction($$)
diff --git a/testbot/web/admin/Log.pl b/testbot/web/admin/Log.pl
index cb253bd03e..456e73f55d 100644
--- a/testbot/web/admin/Log.pl
+++ b/testbot/web/admin/Log.pl
@@ -71,8 +71,8 @@ sub GetActions($)
sub OnDownload($)
{
my ($self) = @_;
- $self->Redirect("/admin/SendLog.pl?Hours=". $self->GetParam("Hours")); # does not return
- exit;
+
+ exit($self->Redirect("/admin/SendLog.pl?Hours=". $self->GetParam("Hours")));
}
sub OnAction($$)
diff --git a/testbot/web/admin/SpecialJobs.pl b/testbot/web/admin/SpecialJobs.pl
index 534336c483..02d9f8ea9d 100644
--- a/testbot/web/admin/SpecialJobs.pl
+++ b/testbot/web/admin/SpecialJobs.pl
@@ -237,8 +237,7 @@ sub OnSubmit($)
return undef;
}
- $self->Redirect("/"); # does not return
- exit;
+ exit($self->Redirect("/"));
}
sub OnAction($$)
diff --git a/testbot/web/admin/UserDetails.pl b/testbot/web/admin/UserDetails.pl
index 2cf0f597fb..8c26930e8e 100644
--- a/testbot/web/admin/UserDetails.pl
+++ b/testbot/web/admin/UserDetails.pl
@@ -74,8 +74,7 @@ sub OnApprove($)
return !1 if (!$self->Save());
$self->{ErrMessage} = $self->{Item}->Approve();
return !1 if (defined $self->{ErrMessage});
- $self->RedirectToList(); # does not return
- exit;
+ exit($self->RedirectToList());
}
sub OnReject($)
@@ -87,8 +86,7 @@ sub OnReject($)
return !1 if (defined $self->{ErrMessage});
# Forcefully log out that user by deleting his web sessions
DeleteSessions($self->{Item});
- $self->RedirectToList(); # does not return
- exit;
+ exit($self->RedirectToList());
}
sub OnOK($)
@@ -101,8 +99,7 @@ sub OnOK($)
# Forcefully log out that user by deleting his web sessions
DeleteSessions($self->{Item});
}
- $self->RedirectToList(); # does not return
- exit;
+ exit($self->RedirectToList());
}
sub OnAction($$)
--
2.30.2
1
0
The migration to long type (after the serie of this morning) is coming
to an end
What remains to be done:
- migration of dlls/oleaut32/tests, dlls/ntdll/tests, dlls/user32/tests
- all the D3D related modules (Henri's working on it) [1]
- media speech (Berhnard's working on it)
At the begining there were 745 modules to be migrated. Current
situation: 78 modules yet to be migrated (D3D accounts for 53 of those)
What's on hold
- all the modules with a Unixlib, and the modules not yet migrated to
cross compilation (and tools/winedump) [2]: strategy of migration to
long type for ELF compilation (A) still be decided
- dlls/user32: pending on (A) & interferes with win32u migration
- dlls/nsi/tests: impacted by migration of dlls/nsiproxy.sys (in fact
include/wine/nsi.h) and/or (A)
For the remaining work: trying to limit the load on Marvin
- for the (ntdll|user32)/tests modules: using a sub-module granularity
and no serie of patches
- that will allow to limit to number of changes per day
- for (ntdll|user32)/tests (and the cleanup of kernel32/tests): trying
to bypass Marvin for the patch which moves control of long type from
module's Makefile to individual .c files
cheers
[1] dlls/d3d* dlls/d3d*/tests dlls/ddraw* dlls/ddraw*/tests dlls/dxgi*
dlls/dxgi*/tests dlls/wined3d
[2] Not yet migrated modules to long types
| Module                         | Family | Why_Not_Migrated |
| ------Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â | ------ | ---------------- |
| dlls/capi2032                  |       | Unixlib         |
| dlls/nsiproxy.sys              | nsi   | Unixlib         |
| dlls/ntdll                     |       | Unixlib         |
| dlls/openal32                  |       | no-cross        |
| dlls/opengl32                  |       | no-cross        |
| dlls/user32Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â | win32u |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |
| dlls/win32u                    | win32u | Unixlib         |
| dlls/winealsa.drv              |       | no-cross,Unixlib |
| dlls/wineandroid.drv           |       | no-cross        |
| dlls/winecoreaudio.drv         |       | Unixlib         |
| dlls/winecrt0Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |Â Â Â Â Â Â Â | (A) Â Â Â Â Â Â Â Â Â Â |
| dlls/winemac.drv               |       | no-cross        |
| dlls/wineoss.drv               |       | no-cross        |
| dlls/winepulse.drv             |       | Unixlib         |
| dlls/wineusb.sys               |       | no-cross        |
| dlls/winevulkan                |       | Unixlib         |
| dlls/winex11.drv               |       | no-cross        |
| dlls/winspool.drv              |       | Unixlib         |
| dlls/nsi/tests                 | nsi   |                 |
| dlls/ntdll/tests               |       |                 |
| dlls/oleaut32/tests            |       |                 |
| dlls/user32/tests              |       |                 |
| dlls/windows.media.speech/tests |Â Â Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |
| dlls/winmm/tests               |       | under review   |
| tools/winedump                 |       | (A)             |
Unixlib: module with a Unixlib part
no-cross: module not yet cross-compiled / linked with msvcrt/ucrtbase
1
0