Wine-Devel
Threads by month
- ----- 2026 -----
- 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
- 84515 discussions
April 13, 2022
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/wineoss.drv/mmdevdrv.c | 13 +++++--------
dlls/wineoss.drv/oss.c | 13 +++++++++++++
dlls/wineoss.drv/unixlib.h | 8 ++++++++
3 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index 8a2329d1f04..fb71aa7562a 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -827,7 +827,7 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient3 *iface,
UINT32 *numpad)
{
ACImpl *This = impl_from_IAudioClient3(iface);
- struct oss_stream *stream = This->stream;
+ struct get_current_padding_params params;
TRACE("(%p)->(%p)\n", This, numpad);
@@ -837,15 +837,12 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient3 *iface,
if(!This->stream)
return AUDCLNT_E_NOT_INITIALIZED;
- oss_lock(stream);
-
- *numpad = stream->held_frames;
-
+ params.stream = This->stream;
+ params.padding = numpad;
+ OSS_CALL(get_current_padding, ¶ms);
TRACE("padding: %u\n", *numpad);
- oss_unlock(stream);
-
- return S_OK;
+ return params.result;
}
static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient3 *iface,
diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c
index a80557b2c15..7e716ef4704 100644
--- a/dlls/wineoss.drv/oss.c
+++ b/dlls/wineoss.drv/oss.c
@@ -776,6 +776,18 @@ static NTSTATUS get_latency(void *args)
return oss_unlock_result(stream, ¶ms->result, S_OK);
}
+static NTSTATUS get_current_padding(void *args)
+{
+ struct get_current_padding_params *params = args;
+ struct oss_stream *stream = params->stream;
+
+ oss_lock(stream);
+
+ *params->padding = stream->held_frames;
+
+ return oss_unlock_result(stream, ¶ms->result, S_OK);
+}
+
unixlib_entry_t __wine_unix_call_funcs[] =
{
test_connect,
@@ -786,4 +798,5 @@ unixlib_entry_t __wine_unix_call_funcs[] =
get_mix_format,
get_buffer_size,
get_latency,
+ get_current_padding,
};
diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h
index 9f4c736fe4e..bc88be80db2 100644
--- a/dlls/wineoss.drv/unixlib.h
+++ b/dlls/wineoss.drv/unixlib.h
@@ -120,6 +120,13 @@ struct get_latency_params
REFERENCE_TIME *latency;
};
+struct get_current_padding_params
+{
+ struct oss_stream *stream;
+ HRESULT result;
+ UINT32 *padding;
+};
+
enum oss_funcs
{
oss_test_connect,
@@ -130,6 +137,7 @@ enum oss_funcs
oss_get_mix_format,
oss_get_buffer_size,
oss_get_latency,
+ oss_get_current_padding,
};
extern unixlib_handle_t oss_handle;
--
2.25.1
2
1
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/wineoss.drv/mmdevdrv.c | 14 +++++---------
dlls/wineoss.drv/oss.c | 15 +++++++++++++++
dlls/wineoss.drv/unixlib.h | 8 ++++++++
3 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index a2f75d7a479..8a2329d1f04 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -806,7 +806,7 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient3 *iface,
REFERENCE_TIME *latency)
{
ACImpl *This = impl_from_IAudioClient3(iface);
- struct oss_stream *stream = This->stream;
+ struct get_latency_params params;
TRACE("(%p)->(%p)\n", This, latency);
@@ -816,15 +816,11 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient3 *iface,
if(!This->stream)
return AUDCLNT_E_NOT_INITIALIZED;
- oss_lock(stream);
-
- /* pretend we process audio in Period chunks, so max latency includes
- * the period time. Some native machines add .6666ms in shared mode. */
- *latency = (REFERENCE_TIME)stream->period_us * 10 + 6666;
-
- oss_unlock(stream);
+ params.stream = This->stream;
+ params.latency = latency;
+ OSS_CALL(get_latency, ¶ms);
- return S_OK;
+ return params.result;
}
static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient3 *iface,
diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c
index fdad419abfa..a80557b2c15 100644
--- a/dlls/wineoss.drv/oss.c
+++ b/dlls/wineoss.drv/oss.c
@@ -762,6 +762,20 @@ static NTSTATUS get_buffer_size(void *args)
return oss_unlock_result(stream, ¶ms->result, S_OK);
}
+static NTSTATUS get_latency(void *args)
+{
+ struct get_latency_params *params = args;
+ struct oss_stream *stream = params->stream;
+
+ oss_lock(stream);
+
+ /* pretend we process audio in Period chunks, so max latency includes
+ * the period time. Some native machines add .6666ms in shared mode. */
+ *params->latency = (REFERENCE_TIME)stream->period_us * 10 + 6666;
+
+ return oss_unlock_result(stream, ¶ms->result, S_OK);
+}
+
unixlib_entry_t __wine_unix_call_funcs[] =
{
test_connect,
@@ -771,4 +785,5 @@ unixlib_entry_t __wine_unix_call_funcs[] =
is_format_supported,
get_mix_format,
get_buffer_size,
+ get_latency,
};
diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h
index b57798ef435..9f4c736fe4e 100644
--- a/dlls/wineoss.drv/unixlib.h
+++ b/dlls/wineoss.drv/unixlib.h
@@ -113,6 +113,13 @@ struct get_buffer_size_params
UINT32 *size;
};
+struct get_latency_params
+{
+ struct oss_stream *stream;
+ HRESULT result;
+ REFERENCE_TIME *latency;
+};
+
enum oss_funcs
{
oss_test_connect,
@@ -122,6 +129,7 @@ enum oss_funcs
oss_is_format_supported,
oss_get_mix_format,
oss_get_buffer_size,
+ oss_get_latency,
};
extern unixlib_handle_t oss_handle;
--
2.25.1
2
1
April 13, 2022
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/wineoss.drv/mmdevdrv.c | 12 +++++-------
dlls/wineoss.drv/oss.c | 31 +++++++++++++++++++++++++++++++
dlls/wineoss.drv/unixlib.h | 8 ++++++++
3 files changed, 44 insertions(+), 7 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index 2ea3c80f3ca..a2f75d7a479 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -783,7 +783,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
UINT32 *frames)
{
ACImpl *This = impl_from_IAudioClient3(iface);
- struct oss_stream *stream = This->stream;
+ struct get_buffer_size_params params;
TRACE("(%p)->(%p)\n", This, frames);
@@ -793,15 +793,13 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
if(!This->stream)
return AUDCLNT_E_NOT_INITIALIZED;
- oss_lock(stream);
-
- *frames = stream->bufsize_frames;
+ params.stream = This->stream;
+ params.size = frames;
+ OSS_CALL(get_buffer_size, ¶ms);
TRACE("buffer size: %u\n", *frames);
- oss_unlock(stream);
-
- return S_OK;
+ return params.result;
}
static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient3 *iface,
diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c
index 628d0c5818a..fdad419abfa 100644
--- a/dlls/wineoss.drv/oss.c
+++ b/dlls/wineoss.drv/oss.c
@@ -70,6 +70,24 @@ static int muldiv( int a, int b, int c )
return ret;
}
+static void oss_lock(struct oss_stream *stream)
+{
+ pthread_mutex_lock(&stream->lock);
+}
+
+static void oss_unlock(struct oss_stream *stream)
+{
+ pthread_mutex_unlock(&stream->lock);
+}
+
+static NTSTATUS oss_unlock_result(struct oss_stream *stream,
+ HRESULT *result, HRESULT value)
+{
+ *result = value;
+ oss_unlock(stream);
+ return STATUS_SUCCESS;
+}
+
static NTSTATUS test_connect(void *args)
{
struct test_connect_params *params = args;
@@ -732,6 +750,18 @@ static NTSTATUS get_mix_format(void *args)
return STATUS_SUCCESS;
}
+static NTSTATUS get_buffer_size(void *args)
+{
+ struct get_buffer_size_params *params = args;
+ struct oss_stream *stream = params->stream;
+
+ oss_lock(stream);
+
+ *params->size = stream->bufsize_frames;
+
+ return oss_unlock_result(stream, ¶ms->result, S_OK);
+}
+
unixlib_entry_t __wine_unix_call_funcs[] =
{
test_connect,
@@ -740,4 +770,5 @@ unixlib_entry_t __wine_unix_call_funcs[] =
release_stream,
is_format_supported,
get_mix_format,
+ get_buffer_size,
};
diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h
index c0a0b25c374..b57798ef435 100644
--- a/dlls/wineoss.drv/unixlib.h
+++ b/dlls/wineoss.drv/unixlib.h
@@ -106,6 +106,13 @@ struct get_mix_format_params
HRESULT result;
};
+struct get_buffer_size_params
+{
+ struct oss_stream *stream;
+ HRESULT result;
+ UINT32 *size;
+};
+
enum oss_funcs
{
oss_test_connect,
@@ -114,6 +121,7 @@ enum oss_funcs
oss_release_stream,
oss_is_format_supported,
oss_get_mix_format,
+ oss_get_buffer_size,
};
extern unixlib_handle_t oss_handle;
--
2.25.1
2
1
April 13, 2022
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
---
No point in special handling unexpected test failures.
This patch is to be applied on top of 232366 and 232365.
dlls/d3dxof/tests/d3dxof.c | 60 --------------------------------------
1 file changed, 60 deletions(-)
diff --git a/dlls/d3dxof/tests/d3dxof.c b/dlls/d3dxof/tests/d3dxof.c
index edb5d8547e6..820afd87426 100644
--- a/dlls/d3dxof/tests/d3dxof.c
+++ b/dlls/d3dxof/tests/d3dxof.c
@@ -418,11 +418,6 @@ static void test_refcount(void)
hr = pDirectXFileCreate(&lpDirectXFile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!lpDirectXFile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
ref = get_refcount(lpDirectXFile);
ok(ref == 1, "Unexpected refcount %ld.\n", ref);
@@ -490,11 +485,6 @@ static void test_CreateEnumObject(void)
hr = pDirectXFileCreate(&lpDirectXFile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!lpDirectXFile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template, sizeof(template) - 1);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
@@ -565,11 +555,6 @@ static void test_file_types(void)
hr = pDirectXFileCreate(&dxfile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!dxfile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
hr = IDirectXFile_RegisterTemplates(dxfile, empty_txt_file, sizeof(empty_txt_file) - 1);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
@@ -639,11 +624,6 @@ static void test_templates(void)
hr = pDirectXFileCreate(&dxfile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!dxfile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
hr = IDirectXFile_RegisterTemplates(dxfile, templates_bad_file_type1, sizeof(templates_bad_file_type1) - 1);
ok(hr == DXFILEERR_BADFILETYPE, "Unexpected hr %#lx.\n", hr);
@@ -681,11 +661,6 @@ static void test_compressed_files(void)
hr = pDirectXFileCreate(&dxfile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!dxfile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
hr = IDirectXFile_RegisterTemplates(dxfile, compressed_template, sizeof(compressed_template) - 1);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
@@ -728,11 +703,6 @@ static void test_getname(void)
hr = pDirectXFileCreate(&lpDirectXFile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!lpDirectXFile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template, sizeof(template) - 1);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
@@ -816,11 +786,6 @@ static void test_syntax(void)
hr = pDirectXFileCreate(&lpDirectXFile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!lpDirectXFile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template_syntax_array_mixed, sizeof(template_syntax_array_mixed) - 1);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
@@ -929,11 +894,6 @@ static void test_syntax_semicolon_comma(void)
hr = pDirectXFileCreate(&dxfile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!dxfile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
hr = IDirectXFile_RegisterTemplates(dxfile, template_syntax_array_mixed, sizeof(template_syntax_array_mixed) - 1);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
@@ -1029,11 +989,6 @@ static void test_complex_object(void)
hr = pDirectXFileCreate(&dxfile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!dxfile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
hr = IDirectXFile_RegisterTemplates(dxfile, templates_complex_object, sizeof(templates_complex_object) - 1);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
@@ -1063,11 +1018,6 @@ static void test_standard_templates(void)
hr = pDirectXFileCreate(&dxfile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!dxfile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
hr = IDirectXFile_RegisterTemplates(dxfile, D3DRM_XTEMPLATES, D3DRM_XTEMPLATE_BYTES);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
@@ -1088,11 +1038,6 @@ static void test_type_index_color(void)
hr = pDirectXFileCreate(&dxfile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if (!dxfile)
- {
- skip("Couldn't create DirectXFile interface\n");
- return;
- }
/* Test that 'indexColor' can be used (same as IndexedColor in standard templates) and is case sensitive */
hr = IDirectXFile_RegisterTemplates(dxfile, template_using_index_color_lower, sizeof(template_using_index_color_lower) - 1);
@@ -1241,11 +1186,6 @@ static void test_dump(void)
hr = pDirectXFileCreate(&lpDirectXFile);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- if(!lpDirectXFile)
- {
- skip("Couldn't create DirectXFile interface\n");
- goto exit;
- }
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, pvData, cbSize);
ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
--
2.34.1
2
1
April 13, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d3dxof/tests/Makefile.in | 1 -
dlls/d3dxof/tests/d3dxof.c | 382 +++++++++++++++++-----------------
2 files changed, 191 insertions(+), 192 deletions(-)
diff --git a/dlls/d3dxof/tests/Makefile.in b/dlls/d3dxof/tests/Makefile.in
index eecca6f9d8c..5144ff63b97 100644
--- a/dlls/d3dxof/tests/Makefile.in
+++ b/dlls/d3dxof/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = d3dxof.dll
IMPORTS = d3dxof
diff --git a/dlls/d3dxof/tests/d3dxof.c b/dlls/d3dxof/tests/d3dxof.c
index 9d9e4035b66..05f92bab8cb 100644
--- a/dlls/d3dxof/tests/d3dxof.c
+++ b/dlls/d3dxof/tests/d3dxof.c
@@ -416,7 +416,7 @@ static void test_refcount(void)
}
hr = pDirectXFileCreate(&lpDirectXFile);
- ok(hr == DXFILE_OK, "DirectXFileCreate: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!lpDirectXFile)
{
skip("Couldn't create DirectXFile interface\n");
@@ -424,50 +424,50 @@ static void test_refcount(void)
}
ref = getRefcount( (IUnknown *) lpDirectXFile);
- ok(ref == 1, "Got refcount %d, expected 1\n", ref);
+ ok(ref == 1, "Unexpected refcount %ld.\n", ref);
ref = IDirectXFile_AddRef(lpDirectXFile);
- ok(ref == 2, "Got refcount %d, expected 2\n", ref);
+ ok(ref == 2, "Unexpected refcount %ld.\n", ref);
ref = IDirectXFile_Release(lpDirectXFile);
- ok(ref == 1, "Got refcount %d, expected 1\n", ref);
+ ok(ref == 1, "Unexpected refcount %ld.\n", ref);
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template, sizeof(template) - 1);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
dxflm.lpMemory = &object;
dxflm.dSize = sizeof(object) - 1;
hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, DXFILELOAD_FROMMEMORY, &lpdxfeo);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
ref = getRefcount( (IUnknown *) lpDirectXFile);
- ok(ref == 1, "Got refcount %d, expected 1\n", ref);
+ ok(ref == 1, "Unexpected refcount %ld.\n", ref);
ref = getRefcount( (IUnknown *) lpdxfeo);
- ok(ref == 1, "Got refcount %d, expected 1\n", ref);
+ ok(ref == 1, "Unexpected refcount %ld.\n", ref);
hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd);
- ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
ref = getRefcount( (IUnknown *) lpDirectXFile);
- ok(ref == 1, "Got refcount %d, expected 1\n", ref);
+ ok(ref == 1, "Unexpected refcount %ld.\n", ref);
ref = getRefcount( (IUnknown *) lpdxfeo);
- ok(ref == 1, "Got refcount %d, expected 1\n", ref);
+ ok(ref == 1, "Unexpected refcount %ld.\n", ref);
/* Enum object gets references to all top level objects */
ref = getRefcount( (IUnknown *) lpdxfd);
- ok(ref == 2, "Got refcount %d, expected 2\n", ref);
+ ok(ref == 2, "Unexpected refcount %ld.\n", ref);
ref = IDirectXFile_Release(lpDirectXFile);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
/* Nothing changes for all other objects */
ref = getRefcount( (IUnknown *) lpdxfeo);
- ok(ref == 1, "Got refcount %d, expected 1\n", ref);
+ ok(ref == 1, "Unexpected refcount %ld.\n", ref);
ref = getRefcount( (IUnknown *) lpdxfd);
- ok(ref == 2, "Got refcount %d, expected 2\n", ref);
+ ok(ref == 2, "Unexpected refcount %ld.\n", ref);
ref = IDirectXFileEnumObject_Release(lpdxfeo);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
/* Enum object releases references to all top level objects */
ref = getRefcount( (IUnknown *) lpdxfd);
- ok(ref == 1, "Got refcount %d, expected 1\n", ref);
+ ok(ref == 1, "Unexpected refcount %ld.\n", ref);
ref = IDirectXFileData_Release(lpdxfd);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
}
static void test_CreateEnumObject(void)
@@ -488,7 +488,7 @@ static void test_CreateEnumObject(void)
}
hr = pDirectXFileCreate(&lpDirectXFile);
- ok(hr == DXFILE_OK, "DirectXFileCreate: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!lpDirectXFile)
{
skip("Couldn't create DirectXFile interface\n");
@@ -496,57 +496,57 @@ static void test_CreateEnumObject(void)
}
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template, sizeof(template) - 1);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
dxflm.lpMemory = &object;
dxflm.dSize = sizeof(object) - 1;
/* Check that only lowest 4 bits are relevant in DXFILELOADOPTIONS */
hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, 0xFFFFFFF0 + DXFILELOAD_FROMMEMORY, &lpdxfeo);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd);
- ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Get all data (szMember == NULL) */
hr = IDirectXFileData_GetData(lpdxfd, NULL, &size, (void**)&pdata);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- ok(size == 8, "Retrieved data size is wrong (%u instead of 8)\n", size);
+ ok(size == 8, "Unexpected data size %lu.\n", size);
ok((*((WORD*)pdata) == 1) && (*((WORD*)(pdata+2)) == 2) && (*((DWORD*)(pdata+4)) == 3), "Retrieved data is wrong\n");
/* Get only "major" member (szMember == "major") */
hr = IDirectXFileData_GetData(lpdxfd, "major", &size, (void**)&pdata);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- ok(size == 2, "Retrieved data size is wrong (%u instead of 2)\n", size);
+ ok(size == 2, "Unexpected data size %lu.\n", size);
ok(*((WORD*)pdata) == 1, "Retrieved data is wrong (%u instead of 1)\n", *((WORD*)pdata));
/* Get only "minor" member (szMember == "minor") */
hr = IDirectXFileData_GetData(lpdxfd, "minor", &size, (void**)&pdata);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- ok(size == 2, "Retrieved data size is wrong (%u instead of 2)\n", size);
+ ok(size == 2, "Unexpected data size %lu.\n", size);
ok(*((WORD*)pdata) == 2, "Retrieved data is wrong (%u instead of 2)\n", *((WORD*)pdata));
/* Get only "flags" member (szMember == "flags") */
hr = IDirectXFileData_GetData(lpdxfd, "flags", &size, (void**)&pdata);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
- ok(size == 4, "Retrieved data size is wrong (%u instead of 4)\n", size);
+ ok(size == 4, "Unexpected data size %lu.\n", size);
ok(*((WORD*)pdata) == 3, "Retrieved data is wrong (%u instead of 3)\n", *((WORD*)pdata));
/* Try to get not existing member (szMember == "unknown") */
hr = IDirectXFileData_GetData(lpdxfd, "unknown", &size, (void**)&pdata);
- ok(hr == DXFILEERR_BADDATAREFERENCE, "IDirectXFileData_GetData: %x\n", hr);
+ ok(hr == DXFILEERR_BADDATAREFERENCE, "Unexpected hr %#lx.\n", hr);
ref = IDirectXFileEnumObject_Release(lpdxfeo);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
ref = IDirectXFile_Release(lpDirectXFile);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
ref = IDirectXFileData_Release(lpdxfd);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
}
static void test_file_types(void)
@@ -563,7 +563,7 @@ static void test_file_types(void)
}
hr = pDirectXFileCreate(&dxfile);
- ok(hr == DXFILE_OK, "DirectXFileCreate: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!dxfile)
{
skip("Couldn't create DirectXFile interface\n");
@@ -571,64 +571,64 @@ static void test_file_types(void)
}
hr = IDirectXFile_RegisterTemplates(dxfile, empty_txt_file, sizeof(empty_txt_file) - 1);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFile_RegisterTemplates(dxfile, empty_bin_file, sizeof(empty_bin_file) - 1);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFile_RegisterTemplates(dxfile, empty_tzip_file, sizeof(empty_tzip_file) - 1);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFile_RegisterTemplates(dxfile, empty_bzip_file, sizeof(empty_bzip_file) - 1);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFile_RegisterTemplates(dxfile, empty_cmp_file, sizeof(empty_cmp_file) - 1);
- ok(hr == DXFILEERR_BADFILETYPE, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILEERR_BADFILETYPE, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFile_RegisterTemplates(dxfile, empty_xxxx_file, sizeof(empty_xxxx_file) - 1);
- ok(hr == DXFILEERR_BADFILETYPE, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILEERR_BADFILETYPE, "Unexpected hr %#lx.\n", hr);
lminfo.lpMemory = empty_txt_file;
lminfo.dSize = sizeof(empty_txt_file) - 1;
hr = IDirectXFile_CreateEnumObject(dxfile, &lminfo, DXFILELOAD_FROMMEMORY, &enum_object);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (hr == DXFILE_OK) IDirectXFileEnumObject_Release(enum_object);
lminfo.lpMemory = empty_bin_file;
lminfo.dSize = sizeof(empty_bin_file) - 1;
hr = IDirectXFile_CreateEnumObject(dxfile, &lminfo, DXFILELOAD_FROMMEMORY, &enum_object);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (hr == DXFILE_OK) IDirectXFileEnumObject_Release(enum_object);
lminfo.lpMemory = empty_tzip_file;
lminfo.dSize = sizeof(empty_tzip_file) - 1;
hr = IDirectXFile_CreateEnumObject(dxfile, &lminfo, DXFILELOAD_FROMMEMORY, &enum_object);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (hr == DXFILE_OK) IDirectXFileEnumObject_Release(enum_object);
lminfo.lpMemory = empty_bzip_file;
lminfo.dSize = sizeof(empty_bzip_file) - 1;
hr = IDirectXFile_CreateEnumObject(dxfile, &lminfo, DXFILELOAD_FROMMEMORY, &enum_object);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (hr == DXFILE_OK) IDirectXFileEnumObject_Release(enum_object);
lminfo.lpMemory = empty_cmp_file;
lminfo.dSize = sizeof(empty_cmp_file) - 1;
hr = IDirectXFile_CreateEnumObject(dxfile, &lminfo, DXFILELOAD_FROMMEMORY, &enum_object);
- ok(hr == DXFILEERR_BADFILETYPE, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILEERR_BADFILETYPE, "Unexpected hr %#lx.\n", hr);
lminfo.lpMemory = empty_xxxx_file;
lminfo.dSize = sizeof(empty_xxxx_file) - 1;
hr = IDirectXFile_CreateEnumObject(dxfile, &lminfo, DXFILELOAD_FROMMEMORY, &enum_object);
- ok(hr == DXFILEERR_BADFILETYPE, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILEERR_BADFILETYPE, "Unexpected hr %#lx.\n", hr);
IDirectXFile_Release(dxfile);
}
static void test_templates(void)
{
- HRESULT ret;
IDirectXFile *dxfile = NULL;
+ HRESULT hr;
if (!pDirectXFileCreate)
{
@@ -636,28 +636,28 @@ static void test_templates(void)
return;
}
- ret = pDirectXFileCreate(&dxfile);
- ok(ret == DXFILE_OK, "DirectXFileCreate: %x\n", ret);
+ hr = pDirectXFileCreate(&dxfile);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!dxfile)
{
skip("Couldn't create DirectXFile interface\n");
return;
}
- ret = IDirectXFile_RegisterTemplates(dxfile, templates_bad_file_type1, sizeof(templates_bad_file_type1) - 1);
- ok(ret == DXFILEERR_BADFILETYPE, "RegisterTemplates returned %#x, expected %#x\n", ret, DXFILEERR_BADFILETYPE);
+ hr = IDirectXFile_RegisterTemplates(dxfile, templates_bad_file_type1, sizeof(templates_bad_file_type1) - 1);
+ ok(hr == DXFILEERR_BADFILETYPE, "Unexpected hr %#lx.\n", hr);
- ret = IDirectXFile_RegisterTemplates(dxfile, templates_bad_file_version, sizeof(templates_bad_file_version) - 1);
- ok(ret == DXFILEERR_BADFILEVERSION, "RegisterTemplates returned %#x, expected %#x\n", ret, DXFILEERR_BADFILEVERSION);
+ hr = IDirectXFile_RegisterTemplates(dxfile, templates_bad_file_version, sizeof(templates_bad_file_version) - 1);
+ ok(hr == DXFILEERR_BADFILEVERSION, "Unexpected hr %#lx.\n", hr);
- ret = IDirectXFile_RegisterTemplates(dxfile, templates_bad_file_type2, sizeof(templates_bad_file_type2) - 1);
- ok(ret == DXFILEERR_BADFILETYPE, "RegisterTemplates returned %#x, expected %#x\n", ret, DXFILEERR_BADFILETYPE);
+ hr = IDirectXFile_RegisterTemplates(dxfile, templates_bad_file_type2, sizeof(templates_bad_file_type2) - 1);
+ ok(hr == DXFILEERR_BADFILETYPE, "Unexpected hr %#lx.\n", hr);
- ret = IDirectXFile_RegisterTemplates(dxfile, templates_bad_file_float_size, sizeof(templates_bad_file_float_size) - 1);
- ok(ret == DXFILEERR_BADFILEFLOATSIZE, "RegisterTemplates returned %#x, expected %#x\n", ret, DXFILEERR_BADFILEFLOATSIZE);
+ hr = IDirectXFile_RegisterTemplates(dxfile, templates_bad_file_float_size, sizeof(templates_bad_file_float_size) - 1);
+ ok(hr == DXFILEERR_BADFILEFLOATSIZE, "Unexpected hr %#lx.\n", hr);
- ret = IDirectXFile_RegisterTemplates(dxfile, templates_parse_error, sizeof(templates_parse_error) - 1);
- ok(ret == DXFILEERR_PARSEERROR, "RegisterTemplates returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = IDirectXFile_RegisterTemplates(dxfile, templates_parse_error, sizeof(templates_parse_error) - 1);
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
IDirectXFile_Release(dxfile);
}
@@ -679,7 +679,7 @@ static void test_compressed_files(void)
}
hr = pDirectXFileCreate(&dxfile);
- ok(hr == DXFILE_OK, "DirectXFileCreate: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!dxfile)
{
skip("Couldn't create DirectXFile interface\n");
@@ -687,18 +687,18 @@ static void test_compressed_files(void)
}
hr = IDirectXFile_RegisterTemplates(dxfile, compressed_template, sizeof(compressed_template) - 1);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
lminfo.lpMemory = compressed_object;
lminfo.dSize = sizeof(compressed_object) - 1;
hr = IDirectXFile_CreateEnumObject(dxfile, &lminfo, DXFILELOAD_FROMMEMORY, &enum_object);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileEnumObject_GetNextDataObject(enum_object, &file_data);
- ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetData(file_data, NULL, &size, (void**)&data);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
ok(size == 8, "Retrieved data size is wrong\n");
ok((*((WORD*)data) == 1) && (*((WORD*)(data+2)) == 2) && (*((DWORD*)(data+4)) == 3), "Retrieved data is wrong\n");
@@ -726,7 +726,7 @@ static void test_getname(void)
}
hr = pDirectXFileCreate(&lpDirectXFile);
- ok(hr == DXFILE_OK, "DirectXFileCreate: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!lpDirectXFile)
{
skip("Couldn't create DirectXFile interface\n");
@@ -734,67 +734,67 @@ static void test_getname(void)
}
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template, sizeof(template) - 1);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Check object with name */
dxflm.lpMemory = &object;
dxflm.dSize = sizeof(object) - 1;
hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, DXFILELOAD_FROMMEMORY, &lpdxfeo);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd);
- ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetName(lpdxfd, NULL, NULL);
- ok(hr == DXFILEERR_BADVALUE, "IDirectXFileData_GetName: %x\n", hr);
+ ok(hr == DXFILEERR_BADVALUE, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetName(lpdxfd, name, NULL);
- ok(hr == DXFILEERR_BADVALUE, "IDirectXFileData_GetName: %x\n", hr);
+ ok(hr == DXFILEERR_BADVALUE, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetName(lpdxfd, NULL, &length);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetName: %x\n", hr);
- ok(length == 7, "Returned length should be 7 instead of %u\n", length);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ ok(length == 7, "Unexpected length %lu.\n", length);
length = sizeof(name);
hr = IDirectXFileData_GetName(lpdxfd, name, &length);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetName: %x\n", hr);
- ok(length == 7, "Returned length should be 7 instead of %u\n", length);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ ok(length == 7, "Unexpected length %lu.\n", length);
ok(!strcmp(name, "Object"), "Returned string should be 'Object' instead of '%s'\n", name);
length = 3;
hr = IDirectXFileData_GetName(lpdxfd, name, &length);
- ok(hr == DXFILEERR_BADVALUE, "IDirectXFileData_GetName: %x\n", hr);
+ ok(hr == DXFILEERR_BADVALUE, "Unexpected hr %#lx.\n", hr);
ref = IDirectXFileEnumObject_Release(lpdxfeo);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
ref = IDirectXFileData_Release(lpdxfd);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
/* Check object without name */
dxflm.lpMemory = &object_noname;
dxflm.dSize = sizeof(object_noname) - 1;
hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, DXFILELOAD_FROMMEMORY, &lpdxfeo);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd);
- ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetName(lpdxfd, NULL, &length);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetName: %x\n", hr);
- ok(length == 0, "Returned length should be 0 instead of %u\n", length);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!length, "Unexpected length %lu.\n", length);
length = 0;
name[0] = 0x7f;
hr = IDirectXFileData_GetName(lpdxfd, name, &length);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetName: %x\n", hr);
- ok(length == 0, "Returned length should be 0 instead of %u\n", length);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!length, "Unexpected length %lu.\n", length);
ok(name[0] == 0x7f, "First character is %#x instead of 0x7f\n", name[0]);
length = sizeof(name);
name[0] = 0x7f;
hr = IDirectXFileData_GetName(lpdxfd, name, &length);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetName: %x\n", hr);
- ok(length == 0, "Returned length should be 0 instead of %u\n", length);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!length, "Unexpected length %lu.\n", length);
ok(name[0] == 0, "First character is %#x instead of 0x00\n", name[0]);
ref = IDirectXFileEnumObject_Release(lpdxfeo);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
ref = IDirectXFileData_Release(lpdxfd);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
ref = IDirectXFile_Release(lpDirectXFile);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %ld.\n", ref);
}
static void test_syntax(void)
@@ -814,7 +814,7 @@ static void test_syntax(void)
}
hr = pDirectXFileCreate(&lpDirectXFile);
- ok(hr == DXFILE_OK, "DirectXFileCreate: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!lpDirectXFile)
{
skip("Couldn't create DirectXFile interface\n");
@@ -822,32 +822,32 @@ static void test_syntax(void)
}
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template_syntax_array_mixed, sizeof(template_syntax_array_mixed) - 1);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test empty array */
dxflm.lpMemory = &object_syntax_empty_array;
dxflm.dSize = sizeof(object_syntax_empty_array) - 1;
hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, DXFILELOAD_FROMMEMORY, &lpdxfeo);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd);
- ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (hr == DXFILE_OK)
IDirectXFileData_Release(lpdxfd);
IDirectXFileEnumObject_Release(lpdxfeo);
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template_syntax_string, sizeof(template_syntax_string) - 1);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test normal string */
dxflm.lpMemory = &object_syntax_string_normal;
dxflm.dSize = sizeof(object_syntax_string_normal) - 1;
hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, DXFILELOAD_FROMMEMORY, &lpdxfeo);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd);
- ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetData(lpdxfd, NULL, &size, (void**)&string);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
- ok(size == sizeof(char*), "Got wrong data size %d\n", size);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size == sizeof(char*), "Got wrong data size %ld.\n", size);
ok(!strcmp(*string, "foobar"), "Got string %s, expected foobar\n", *string);
if (hr == DXFILE_OK)
IDirectXFileData_Release(lpdxfd);
@@ -857,12 +857,12 @@ static void test_syntax(void)
dxflm.lpMemory = &object_syntax_string_with_separator;
dxflm.dSize = sizeof(object_syntax_string_with_separator) - 1;
hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, DXFILELOAD_FROMMEMORY, &lpdxfeo);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd);
- ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetData(lpdxfd, NULL, &size, (void**)&string);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
- ok(size == sizeof(char*), "Got wrong data size %d\n", size);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size == sizeof(char*), "Got wrong data size %ld.\n", size);
ok(!strcmp(*string, "foo;bar"), "Got string %s, expected foo;bar\n", *string);
if (hr == DXFILE_OK)
IDirectXFileData_Release(lpdxfd);
@@ -872,12 +872,12 @@ static void test_syntax(void)
dxflm.lpMemory = &object_syntax_string_bin;
dxflm.dSize = sizeof(object_syntax_string_bin);
hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, DXFILELOAD_FROMMEMORY, &lpdxfeo);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd);
- ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetData(lpdxfd, NULL, &size, (void**)&string);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
- ok(size == sizeof(char*), "Got wrong data size %d\n", size);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size == sizeof(char*), "Got wrong data size %ld.\n", size);
ok(!strcmp(*string, "foobar"), "Got string %s, expected foobar\n", *string);
if (hr == DXFILE_OK)
IDirectXFileData_Release(lpdxfd);
@@ -899,14 +899,14 @@ static HRESULT test_buffer_object(IDirectXFile *dxfile, char* object_data, DWORD
load_info.lpMemory = object_data;
load_info.dSize = object_size;
hr = IDirectXFile_CreateEnumObject(dxfile, &load_info, DXFILELOAD_FROMMEMORY, &enum_object);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
ret = IDirectXFileEnumObject_GetNextDataObject(enum_object, &file_data);
if (ret == DXFILE_OK)
{
hr = IDirectXFileData_GetData(file_data, NULL, &size, (void**)&array);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
- ok(size == sizeof(values), "Got wrong data size %d\n", size);
- ok(!memcmp(array, values, sizeof(values)), "Got values [%u, %u, %u, %u, %u], expected [%u, %u, %u, %u, %u]\n",
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size == sizeof(values), "Got wrong data size %ld.\n", size);
+ ok(!memcmp(array, values, sizeof(values)), "Got values [%lu, %lu, %lu, %lu, %lu], expected [%lu, %lu, %lu, %lu, %lu]\n",
array[0], array[1], array[2], array[3], array[4], values[0], values[1], values[2], values[3], values[4]);
IDirectXFileData_Release(file_data);
}
@@ -917,8 +917,8 @@ static HRESULT test_buffer_object(IDirectXFile *dxfile, char* object_data, DWORD
static void test_syntax_semicolon_comma(void)
{
- HRESULT ret;
IDirectXFile *dxfile = NULL;
+ HRESULT hr;
if (!pDirectXFileCreate)
{
@@ -926,99 +926,99 @@ static void test_syntax_semicolon_comma(void)
return;
}
- ret = pDirectXFileCreate(&dxfile);
- ok(ret == DXFILE_OK, "DirectXFileCreate failed with %#x\n", ret);
+ hr = pDirectXFileCreate(&dxfile);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!dxfile)
{
skip("Couldn't create DirectXFile interface\n");
return;
}
- ret = IDirectXFile_RegisterTemplates(dxfile, template_syntax_array_mixed, sizeof(template_syntax_array_mixed) - 1);
- ok(ret == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates failed with %#x\n", ret);
+ hr = IDirectXFile_RegisterTemplates(dxfile, template_syntax_array_mixed, sizeof(template_syntax_array_mixed) - 1);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test semicolon separators in text mode */
- ret = test_buffer_object(dxfile, object_syntax_semicolon_txt, sizeof(object_syntax_semicolon_txt) - 1);
- ok(ret == DXFILE_OK, "test_buffer_object failed with %#x\n", ret);
+ hr = test_buffer_object(dxfile, object_syntax_semicolon_txt, sizeof(object_syntax_semicolon_txt) - 1);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test semicolon separators in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_semicolon_bin, sizeof(object_syntax_semicolon_bin));
- ok(ret == DXFILE_OK, "test_buffer_object failed with %#x\n", ret);
+ hr = test_buffer_object(dxfile, object_syntax_semicolon_bin, sizeof(object_syntax_semicolon_bin));
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test comma separators in text mode */
- ret = test_buffer_object(dxfile, object_syntax_comma_txt, sizeof(object_syntax_comma_txt) - 1);
- ok(ret == DXFILE_OK, "test_buffer_object failed with %#x\n", ret);
+ hr = test_buffer_object(dxfile, object_syntax_comma_txt, sizeof(object_syntax_comma_txt) - 1);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test comma separators in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_comma_bin, sizeof(object_syntax_comma_bin));
- ok(ret == DXFILE_OK, "test_buffer_object failed with %#x\n", ret);
+ hr = test_buffer_object(dxfile, object_syntax_comma_bin, sizeof(object_syntax_comma_bin));
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test multi-semicolons separators in text mode */
- ret = test_buffer_object(dxfile, object_syntax_multi_semicolons_txt, sizeof(object_syntax_multi_semicolons_txt) - 1);
- ok(ret == DXFILE_OK, "test_buffer_object failed with %#x\n", ret);
+ hr = test_buffer_object(dxfile, object_syntax_multi_semicolons_txt, sizeof(object_syntax_multi_semicolons_txt) - 1);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test multi-semicolons separators in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_multi_semicolons_bin, sizeof(object_syntax_multi_semicolons_bin));
- ok(ret == DXFILE_OK, "test_buffer_object failed with %#x\n", ret);
+ hr = test_buffer_object(dxfile, object_syntax_multi_semicolons_bin, sizeof(object_syntax_multi_semicolons_bin));
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test multi-commas separators in text mode */
- ret = test_buffer_object(dxfile, object_syntax_multi_commas_txt, sizeof(object_syntax_multi_semicolons_txt) - 1);
- ok(ret == DXFILEERR_PARSEERROR, "test_buffer_object returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = test_buffer_object(dxfile, object_syntax_multi_commas_txt, sizeof(object_syntax_multi_semicolons_txt) - 1);
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
/* Test multi-commas separators in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_multi_commas_bin, sizeof(object_syntax_multi_semicolons_bin));
- ok(ret == DXFILEERR_PARSEERROR, "test_buffer_object returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = test_buffer_object(dxfile, object_syntax_multi_commas_bin, sizeof(object_syntax_multi_semicolons_bin));
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
/* Test multi-semicolons + single comma separators in text mode */
- ret = test_buffer_object(dxfile, object_syntax_multi_semicolons_and_comma_txt, sizeof(object_syntax_multi_semicolons_and_comma_txt) - 1);
- ok(ret == DXFILE_OK, "test_buffer_object failed with %#x\n", ret);
+ hr = test_buffer_object(dxfile, object_syntax_multi_semicolons_and_comma_txt, sizeof(object_syntax_multi_semicolons_and_comma_txt) - 1);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test multi-semicolons + single comma separators in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_multi_semicolons_and_comma_bin, sizeof(object_syntax_multi_semicolons_and_comma_bin));
- ok(ret == DXFILE_OK, "test_buffer_object failed with %#x\n", ret);
+ hr = test_buffer_object(dxfile, object_syntax_multi_semicolons_and_comma_bin, sizeof(object_syntax_multi_semicolons_and_comma_bin));
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test comma + semicolon separators in text mode */
- ret = test_buffer_object(dxfile, object_syntax_comma_and_semicolon_txt, sizeof(object_syntax_comma_and_semicolon_txt) - 1);
- ok(ret == DXFILEERR_PARSEERROR, "test_buffer_object returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = test_buffer_object(dxfile, object_syntax_comma_and_semicolon_txt, sizeof(object_syntax_comma_and_semicolon_txt) - 1);
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
/* Test comma + semicolon separators in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_comma_and_semicolon_bin, sizeof(object_syntax_comma_and_semicolon_bin));
- ok(ret == DXFILEERR_PARSEERROR, "test_buffer_object returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = test_buffer_object(dxfile, object_syntax_comma_and_semicolon_bin, sizeof(object_syntax_comma_and_semicolon_bin));
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
/* Test no ending separator in text mode */
- ret = test_buffer_object(dxfile, object_syntax_no_ending_separator_txt, sizeof(object_syntax_no_ending_separator_txt) - 1);
- ok(ret == DXFILEERR_PARSEERROR, "test_buffer_object returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = test_buffer_object(dxfile, object_syntax_no_ending_separator_txt, sizeof(object_syntax_no_ending_separator_txt) - 1);
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
/* Test no ending separator in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_no_ending_separator_bin, sizeof(object_syntax_no_ending_separator_bin));
- ok(ret == DXFILEERR_PARSEERROR, "test_buffer_object returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = test_buffer_object(dxfile, object_syntax_no_ending_separator_bin, sizeof(object_syntax_no_ending_separator_bin));
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
/* Test no array separator in text mode */
- ret = test_buffer_object(dxfile, object_syntax_array_no_separator_txt, sizeof(object_syntax_array_no_separator_txt) - 1);
- ok(ret == DXFILEERR_PARSEERROR, "test_buffer_object returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = test_buffer_object(dxfile, object_syntax_array_no_separator_txt, sizeof(object_syntax_array_no_separator_txt) - 1);
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
/* Test no array separator in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_array_no_separator_bin, sizeof(object_syntax_array_no_separator_bin));
- ok(ret == DXFILEERR_PARSEERROR, "test_buffer_object returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = test_buffer_object(dxfile, object_syntax_array_no_separator_bin, sizeof(object_syntax_array_no_separator_bin));
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
/* Test object with a single integer list in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_full_integer_list_bin, sizeof(object_syntax_full_integer_list_bin));
- ok(ret == DXFILE_OK, "test_buffer_object failed with %#x\n", ret);
+ hr = test_buffer_object(dxfile, object_syntax_full_integer_list_bin, sizeof(object_syntax_full_integer_list_bin));
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test object with mixed integer list and integers + single comma separators in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_mixed_integer_list_bin, sizeof(object_syntax_mixed_integer_list_bin));
- ok(ret == DXFILE_OK, "test_buffer_object failed with %#x\n", ret);
+ hr = test_buffer_object(dxfile, object_syntax_mixed_integer_list_bin, sizeof(object_syntax_mixed_integer_list_bin));
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
/* Test integer list followed by a semicolon in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_integer_list_semicolon_bin, sizeof(object_syntax_integer_list_semicolon_bin));
- ok(ret == DXFILEERR_PARSEERROR, "test_buffer_object returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = test_buffer_object(dxfile, object_syntax_integer_list_semicolon_bin, sizeof(object_syntax_integer_list_semicolon_bin));
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
/* Test integer list followed by a comma in binary mode */
- ret = test_buffer_object(dxfile, object_syntax_integer_list_comma_bin, sizeof(object_syntax_integer_list_comma_bin));
- ok(ret == DXFILEERR_PARSEERROR, "test_buffer_object returned %#x, expected %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = test_buffer_object(dxfile, object_syntax_integer_list_comma_bin, sizeof(object_syntax_integer_list_comma_bin));
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
IDirectXFile_Release(dxfile);
}
static void test_complex_object(void)
{
- HRESULT ret;
IDirectXFile *dxfile = NULL;
IDirectXFileEnumObject *enum_object;
IDirectXFileData *file_data;
DXFILELOADMEMORY load_info;
+ HRESULT hr;
if (!pDirectXFileCreate)
{
@@ -1026,23 +1026,23 @@ static void test_complex_object(void)
return;
}
- ret = pDirectXFileCreate(&dxfile);
- ok(ret == DXFILE_OK, "DirectXFileCreate failed with %#x\n", ret);
+ hr = pDirectXFileCreate(&dxfile);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!dxfile)
{
skip("Couldn't create DirectXFile interface\n");
return;
}
- ret = IDirectXFile_RegisterTemplates(dxfile, templates_complex_object, sizeof(templates_complex_object) - 1);
- ok(ret == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates failed with %#x\n", ret);
+ hr = IDirectXFile_RegisterTemplates(dxfile, templates_complex_object, sizeof(templates_complex_object) - 1);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
load_info.lpMemory = object_complex;
load_info.dSize = sizeof(object_complex) - 1;
- ret = IDirectXFile_CreateEnumObject(dxfile, &load_info, DXFILELOAD_FROMMEMORY, &enum_object);
- ok(ret == DXFILE_OK, "IDirectXFile_CreateEnumObject failed with %#x\n", ret);
- ret = IDirectXFileEnumObject_GetNextDataObject(enum_object, &file_data);
- ok(ret == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject failed with %#x\n", ret);
+ hr = IDirectXFile_CreateEnumObject(dxfile, &load_info, DXFILELOAD_FROMMEMORY, &enum_object);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ hr = IDirectXFileEnumObject_GetNextDataObject(enum_object, &file_data);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
IDirectXFileData_Release(file_data);
IDirectXFileEnumObject_Release(enum_object);
@@ -1051,8 +1051,8 @@ static void test_complex_object(void)
static void test_standard_templates(void)
{
- HRESULT ret;
IDirectXFile *dxfile = NULL;
+ HRESULT hr;
if (!pDirectXFileCreate)
{
@@ -1060,24 +1060,24 @@ static void test_standard_templates(void)
return;
}
- ret = pDirectXFileCreate(&dxfile);
- ok(ret == DXFILE_OK, "DirectXFileCreate failed with %#x\n", ret);
+ hr = pDirectXFileCreate(&dxfile);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!dxfile)
{
skip("Couldn't create DirectXFile interface\n");
return;
}
- ret = IDirectXFile_RegisterTemplates(dxfile, D3DRM_XTEMPLATES, D3DRM_XTEMPLATE_BYTES);
- ok(ret == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates failed with %#x\n", ret);
+ hr = IDirectXFile_RegisterTemplates(dxfile, D3DRM_XTEMPLATES, D3DRM_XTEMPLATE_BYTES);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
IDirectXFile_Release(dxfile);
}
static void test_type_index_color(void)
{
- HRESULT ret;
IDirectXFile *dxfile = NULL;
+ HRESULT hr;
if (!pDirectXFileCreate)
{
@@ -1085,8 +1085,8 @@ static void test_type_index_color(void)
return;
}
- ret = pDirectXFileCreate(&dxfile);
- ok(ret == DXFILE_OK, "DirectXFileCreate failed with %#x\n", ret);
+ hr = pDirectXFileCreate(&dxfile);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if (!dxfile)
{
skip("Couldn't create DirectXFile interface\n");
@@ -1094,10 +1094,10 @@ static void test_type_index_color(void)
}
/* Test that 'indexColor' can be used (same as IndexedColor in standard templates) and is case sensitive */
- ret = IDirectXFile_RegisterTemplates(dxfile, template_using_index_color_lower, sizeof(template_using_index_color_lower) - 1);
- ok(ret == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates failed with %#x\n", ret);
- ret = IDirectXFile_RegisterTemplates(dxfile, template_using_index_color_upper, sizeof(template_using_index_color_upper) - 1);
- ok(ret == DXFILEERR_PARSEERROR, "IDirectXFileImpl_RegisterTemplates returned %#x instead of %#x\n", ret, DXFILEERR_PARSEERROR);
+ hr = IDirectXFile_RegisterTemplates(dxfile, template_using_index_color_lower, sizeof(template_using_index_color_lower) - 1);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
+ hr = IDirectXFile_RegisterTemplates(dxfile, template_using_index_color_upper, sizeof(template_using_index_color_upper) - 1);
+ ok(hr == DXFILEERR_PARSEERROR, "Unexpected hr %#lx.\n", hr);
IDirectXFile_Release(dxfile);
}
@@ -1120,16 +1120,16 @@ static void process_data(LPDIRECTXFILEDATA lpDirectXFileData, int level)
DWORD k, size;
hr = IDirectXFileData_GetId(lpDirectXFileData, &clsid);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetId: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetName(lpDirectXFileData, name, &len);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetName: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetType(lpDirectXFileData, &clsid_type);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetType: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileData_GetData(lpDirectXFileData, NULL, &size, (void**)&pData);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
for (i = 0; i < level; i++)
printf(" ");
- printf("Found object '%s' - %s - %s - %d\n",
+ printf("Found object '%s' - %s - %s - %ld\n",
len ? name : "", wine_dbgstr_guid(&clsid), wine_dbgstr_guid(clsid_type), size);
if (EXPAND_STRING && size == 4)
@@ -1176,9 +1176,9 @@ static void process_data(LPDIRECTXFILEDATA lpDirectXFileData, int level)
if (0)
{
hr = IDirectXFileDataReference_GetId(lpDirectXFileData, &clsid);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetId: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFileDataReference_GetName(lpDirectXFileData, name, &len);
- ok(hr == DXFILE_OK, "IDirectXFileData_GetName: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
}
IDirectXFileDataReference_Resolve(p2, &pfdo);
process_data(pfdo, level);
@@ -1196,7 +1196,7 @@ if (0)
IDirectXFileObject_Release(pChildObj);
}
- ok(hr == DXFILE_OK || hr == DXFILEERR_NOMOREOBJECTS, "IDirectXFileData_GetNextObject: %x\n", hr);
+ ok(hr == DXFILE_OK || hr == DXFILEERR_NOMOREOBJECTS, "Unexpected hr %#lx.\n", hr);
}
/* Dump an X file 'objects.x' and its related templates file 'templates.x' if they are both presents
@@ -1236,10 +1236,10 @@ static void test_dump(void)
goto exit;
}
- printf("Load templates file (%d bytes)\n", cbSize);
+ printf("Load templates file (%ld bytes)\n", cbSize);
hr = pDirectXFileCreate(&lpDirectXFile);
- ok(hr == DXFILE_OK, "DirectXFileCreate: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
if(!lpDirectXFile)
{
skip("Couldn't create DirectXFile interface\n");
@@ -1247,10 +1247,10 @@ static void test_dump(void)
}
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, pvData, cbSize);
- ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXFile_CreateEnumObject(lpDirectXFile, (LPVOID)"objects.x", DXFILELOAD_FROMFILE, &lpDirectXFileEnumObject);
- ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
+ ok(hr == DXFILE_OK, "Unexpected hr %#lx.\n", hr);
while (SUCCEEDED(hr = IDirectXFileEnumObject_GetNextDataObject(lpDirectXFileEnumObject, &lpDirectXFileData)))
{
@@ -1258,13 +1258,13 @@ static void test_dump(void)
process_data(lpDirectXFileData, 0);
IDirectXFileData_Release(lpDirectXFileData);
}
- ok(hr == DXFILE_OK || hr == DXFILEERR_NOMOREOBJECTS, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
+ ok(hr == DXFILE_OK || hr == DXFILEERR_NOMOREOBJECTS, "Unexpected hr %#lx.\n", hr);
ref = IDirectXFile_Release(lpDirectXFileEnumObject);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %lu.\n", ref);
ref = IDirectXFile_Release(lpDirectXFile);
- ok(ref == 0, "Got refcount %d, expected 0\n", ref);
+ ok(!ref, "Unexpected refcount %lu.\n", ref);
CloseHandle(hFile);
--
2.35.1
2
3
[PATCH v4 1/3] msvcr100: Add _StructuredTaskCollection::_Schedule stub.
by Torge Matthies April 13, 2022
by Torge Matthies April 13, 2022
April 13, 2022
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47375
Signed-off-by: Torge Matthies <tmatthies(a)codeweavers.com>
---
v3 -> v4:
Add dummy UnrealizedChore definition.
dlls/concrt140/concrt140.spec | 2 +-
dlls/msvcr100/msvcr100.spec | 2 +-
dlls/msvcr110/msvcr110.spec | 2 +-
dlls/msvcr120/msvcr120.spec | 2 +-
dlls/msvcr120_app/msvcr120_app.spec | 2 +-
dlls/msvcrt/concurrency.c | 25 +++++++++++++++++++++++++
6 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/dlls/concrt140/concrt140.spec b/dlls/concrt140/concrt140.spec
index 50db9348327..ab57c736672 100644
--- a/dlls/concrt140/concrt140.spec
+++ b/dlls/concrt140/concrt140.spec
@@ -596,7 +596,7 @@
@ stub -arch=win64 ?_RunAndWait(a)_TaskCollection@details(a)Concurrency@@QEAA?AW4_TaskCollectionStatus(a)23@PEAV_UnrealizedChore(a)23@@Z
@ stub -arch=arm ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAAXPAV_UnrealizedChore(a)23@@Z
@ stub -arch=i386 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAEXPAV_UnrealizedChore(a)23@@Z
-@ stub -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z
+@ thiscall -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z(ptr ptr) StructuredTaskCollection__Schedule
@ stub -arch=arm ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAAXPAV_UnrealizedChore(a)23@PAVlocation(a)3@@Z
@ stub -arch=i386 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAEXPAV_UnrealizedChore(a)23@PAVlocation(a)3@@Z
@ stub -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@PEAVlocation(a)3@@Z
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 19b4cbe96d7..68a78a6aa16 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -364,7 +364,7 @@
@ stub -arch=win32 ?_RunAndWait(a)_TaskCollection@details(a)Concurrency@@QAG?AW4_TaskCollectionStatus(a)23@PAV_UnrealizedChore(a)23@@Z
@ stub -arch=win64 ?_RunAndWait(a)_TaskCollection@details(a)Concurrency@@QEAA?AW4_TaskCollectionStatus(a)23@PEAV_UnrealizedChore(a)23@@Z
@ stub -arch=win32 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAEXPAV_UnrealizedChore(a)23@@Z
-@ stub -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z
+@ thiscall -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z(ptr ptr) StructuredTaskCollection__Schedule
@ stub -arch=win32 ?_Schedule(a)_TaskCollection@details(a)Concurrency@@QAEXPAV_UnrealizedChore(a)23@@Z
@ stub -arch=win64 ?_Schedule(a)_TaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z
@ thiscall -arch=win32 ?_SetSpinCount@?$_SpinWait@$00(a)details@Concurrency@@QAEXI(a)Z(ptr long) SpinWait__SetSpinCount
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec
index 23840f85eda..0f5eaf9ac51 100644
--- a/dlls/msvcr110/msvcr110.spec
+++ b/dlls/msvcr110/msvcr110.spec
@@ -616,7 +616,7 @@
@ stub -arch=win64 ?_RunAndWait(a)_TaskCollection@details(a)Concurrency@@QEAA?AW4_TaskCollectionStatus(a)23@PEAV_UnrealizedChore(a)23@@Z
@ stub -arch=arm ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAAXPAV_UnrealizedChore(a)23@@Z
@ stub -arch=i386 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAEXPAV_UnrealizedChore(a)23@@Z
-@ stub -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z
+@ thiscall -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z(ptr ptr) StructuredTaskCollection__Schedule
@ stub -arch=arm ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAAXPAV_UnrealizedChore(a)23@PAVlocation(a)3@@Z
@ stub -arch=i386 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAEXPAV_UnrealizedChore(a)23@PAVlocation(a)3@@Z
@ stub -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@PEAVlocation(a)3@@Z
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec
index 64ddeed42f4..332a617932e 100644
--- a/dlls/msvcr120/msvcr120.spec
+++ b/dlls/msvcr120/msvcr120.spec
@@ -598,7 +598,7 @@
@ stub -arch=win64 ?_RunAndWait(a)_TaskCollection@details(a)Concurrency@@QEAA?AW4_TaskCollectionStatus(a)23@PEAV_UnrealizedChore(a)23@@Z
@ stub -arch=arm ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAAXPAV_UnrealizedChore(a)23@@Z
@ stub -arch=i386 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAEXPAV_UnrealizedChore(a)23@@Z
-@ stub -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z
+@ thiscall -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z(ptr ptr) StructuredTaskCollection__Schedule
@ stub -arch=arm ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAAXPAV_UnrealizedChore(a)23@PAVlocation(a)3@@Z
@ stub -arch=i386 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAEXPAV_UnrealizedChore(a)23@PAVlocation(a)3@@Z
@ stub -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@PEAVlocation(a)3@@Z
diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec
index 05f408d6884..ee2ee2c42a1 100644
--- a/dlls/msvcr120_app/msvcr120_app.spec
+++ b/dlls/msvcr120_app/msvcr120_app.spec
@@ -594,7 +594,7 @@
@ stub -arch=win64 ?_RunAndWait(a)_TaskCollection@details(a)Concurrency@@QEAA?AW4_TaskCollectionStatus(a)23@PEAV_UnrealizedChore(a)23@@Z
@ stub -arch=arm ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAAXPAV_UnrealizedChore(a)23@@Z
@ stub -arch=i386 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAEXPAV_UnrealizedChore(a)23@@Z
-@ stub -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z
+@ thiscall -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z(ptr ptr) msvcr120.?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z
@ stub -arch=arm ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAAXPAV_UnrealizedChore(a)23@PAVlocation(a)3@@Z
@ stub -arch=i386 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QAEXPAV_UnrealizedChore(a)23@PAVlocation(a)3@@Z
@ stub -arch=win64 ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@PEAVlocation(a)3@@Z
diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c
index 2ca6421b0e7..b884952b314 100644
--- a/dlls/msvcrt/concurrency.c
+++ b/dlls/msvcrt/concurrency.c
@@ -174,6 +174,20 @@ typedef struct cs_queue
#endif
} cs_queue;
+#if _MSVCR_VER >= 100
+
+typedef struct
+{
+ char dummy;
+} UnrealizedChore;
+
+typedef struct
+{
+ char dummy;
+} StructuredTaskCollection;
+
+#endif /* _MSVCR_VER >= 100 */
+
typedef struct
{
ULONG_PTR unk_thread_id;
@@ -1741,6 +1755,17 @@ bool __thiscall SpinWait__SpinOnce(SpinWait *this)
}
}
+#if _MSVCR_VER >= 100
+
+/* ?_Schedule(a)_StructuredTaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@@Z */
+DEFINE_THISCALL_WRAPPER(StructuredTaskCollection__Schedule, 8)
+void __thiscall StructuredTaskCollection__Schedule(StructuredTaskCollection *this, UnrealizedChore *chore)
+{
+ FIXME("(%p %p): stub!\n", this, chore);
+}
+
+#endif /* _MSVCR_VER >= 100 */
+
/* ??0critical_section(a)Concurrency@@QAE(a)XZ */
/* ??0critical_section(a)Concurrency@@QEAA(a)XZ */
DEFINE_THISCALL_WRAPPER(critical_section_ctor, 4)
--
2.35.1
2
3
ieframe.dll uses manifest at ID 123. However, IEWinMain() is not called from rundll32.exe or
Control_RunDLL() so the manifest needs to be activated in DllMain(). This allows iexplore.exe
to enable theming.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/ieframe/ieframe.manifest | 16 ++++++++++++++++
dlls/ieframe/ieframe.rc | 3 +++
dlls/ieframe/ieframe_main.c | 28 ++++++++++++++++++++++++++++
3 files changed, 47 insertions(+)
create mode 100644 dlls/ieframe/ieframe.manifest
diff --git a/dlls/ieframe/ieframe.manifest b/dlls/ieframe/ieframe.manifest
new file mode 100644
index 00000000000..c8fd3eb4dce
--- /dev/null
+++ b/dlls/ieframe/ieframe.manifest
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity type="win32" name="Wine.Ieframe" version="0.0.0.0"/>
+<dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="*"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+</dependency>
+</assembly>
diff --git a/dlls/ieframe/ieframe.rc b/dlls/ieframe/ieframe.rc
index aed8483e4ce..eb05a98dbc4 100644
--- a/dlls/ieframe/ieframe.rc
+++ b/dlls/ieframe/ieframe.rc
@@ -108,6 +108,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include "wine/wine_common_ver.rc"
+/* @makedep: ieframe.manifest */
+123 RT_MANIFEST ieframe.manifest
+
/* @makedep: ietoolbar.bmp */
IDB_IETOOLBAR BITMAP ietoolbar.bmp
diff --git a/dlls/ieframe/ieframe_main.c b/dlls/ieframe/ieframe_main.c
index 8775e244d1c..2ef1c3784c0 100644
--- a/dlls/ieframe/ieframe_main.c
+++ b/dlls/ieframe/ieframe_main.c
@@ -17,6 +17,7 @@
*/
#include "ieframe.h"
+#include <commctrl.h>
#include "initguid.h"
#include "rpcproxy.h"
@@ -30,6 +31,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
LONG module_ref = 0;
HINSTANCE ieframe_instance;
+static HANDLE context = INVALID_HANDLE_VALUE;
+static ULONG_PTR context_cookie;
+static BOOL context_activated;
static ITypeLib *typelib;
static ITypeInfo *typeinfos[LAST_tid];
@@ -178,6 +182,27 @@ static const IClassFactoryVtbl CUrlHistoryFactoryVtbl = {
static IClassFactory CUrlHistoryFactory = { &CUrlHistoryFactoryVtbl };
+static void activate_context(void)
+{
+ ACTCTXW actctx;
+
+ memset(&actctx, 0, sizeof(actctx));
+ actctx.cbSize = sizeof(actctx);
+ actctx.hModule = ieframe_instance;
+ actctx.lpResourceName = MAKEINTRESOURCEW(123);
+ actctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID;
+ context = CreateActCtxW(&actctx);
+ if (context != INVALID_HANDLE_VALUE)
+ context_activated = ActivateActCtx(context, &context_cookie);
+}
+
+static void deactivate_context(void)
+{
+ if (context_activated)
+ DeactivateActCtx(0, context_cookie);
+ ReleaseActCtx(context);
+}
+
/******************************************************************
* DllMain (ieframe.@)
*/
@@ -189,6 +214,8 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
{
case DLL_PROCESS_ATTACH:
ieframe_instance = hInstDLL;
+ activate_context();
+ InitCommonControls();
register_iewindow_class();
DisableThreadLibraryCalls(ieframe_instance);
break;
@@ -196,6 +223,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
if (lpv) break;
unregister_iewindow_class();
release_typelib();
+ deactivate_context();
}
return TRUE;
--
2.32.0
2
1
April 13, 2022
rather use inheritange of SHELL_NO_WINDOW pseudo console in this case
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
programs/start/start.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/programs/start/start.c b/programs/start/start.c
index 7252d54e046..835128ebf28 100644
--- a/programs/start/start.c
+++ b/programs/start/start.c
@@ -516,10 +516,7 @@ int __cdecl wmain (int argc, WCHAR *argv[])
break;
}
else if (is_option(argv[i], L"/exec")) {
- /* If start.exe isn't attached to a console, force that no console would be created.
- * This is needed when target process belongs to CUI subsystem.
- */
- creation_flags = GetConsoleCP() == 0 ? DETACHED_PROCESS : 0;
+ creation_flags = 0;
sei.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE | SEE_MASK_FLAG_NO_UI;
i++;
break;
2
1
[PATCH v2 1/7] jscript: Defer lookup to the actual locals for function statements.
by Gabriel Ivăncescu April 13, 2022
by Gabriel Ivăncescu April 13, 2022
April 13, 2022
Functions declared as function statements have an associated local_ref and
can be changed from within themselves by using their name (by literally
changing the local variable), while function expressions can not.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
---
dlls/jscript/engine.c | 6 ++++--
dlls/mshtml/tests/es5.js | 28 ++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index c483f2a..73b9d86 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -587,7 +587,8 @@ static HRESULT detach_scope(script_ctx_t *ctx, call_frame_t *frame, scope_chain_
scope->obj = to_disp(scope->jsobj);
}
- if (scope == frame->base_scope && func->name && ctx->version >= SCRIPTLANGUAGEVERSION_ES5)
+ if (scope == frame->base_scope && func->name && func->local_ref == INVALID_LOCAL_REF &&
+ ctx->version >= SCRIPTLANGUAGEVERSION_ES5)
jsdisp_propput_name(scope->jsobj, func->name, jsval_obj(jsdisp_addref(frame->function_instance)));
index = scope->scope_index;
@@ -716,7 +717,8 @@ static HRESULT identifier_eval(script_ctx_t *ctx, BSTR identifier, exprval_t *re
}
/* ECMA-262 5.1 Edition 13 */
- if(func->name && ctx->version >= SCRIPTLANGUAGEVERSION_ES5 && !wcscmp(identifier, func->name)) {
+ if(func->name && ctx->version >= SCRIPTLANGUAGEVERSION_ES5 &&
+ func->local_ref == INVALID_LOCAL_REF && !wcscmp(identifier, func->name)) {
TRACE("returning a function from scope chain\n");
ret->type = EXPRVAL_JSVAL;
ret->u.val = jsval_obj(jsdisp_addref(scope->frame->function_instance));
diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js
index e8ee713..43a6ce7 100644
--- a/dlls/mshtml/tests/es5.js
+++ b/dlls/mshtml/tests/es5.js
@@ -1691,6 +1691,34 @@ sync_test("functions scope", function() {
func_outer(o);
func();
ok(ret === o, "ret != o");
+
+ func_outer = function g() {
+ var g2 = g;
+ g = 10;
+ ok(g !== 10, "g was redefined to 10");
+ g = function() {};
+ ok(g === g2, "g !== g2: " + g);
+ }
+ func_outer();
+
+ function h() {
+ h = 1;
+ ok(h === 1, "h was not redefined: " + h);
+ }
+ h();
+ ok(h === 1, "h = " + h);
+
+ function h2() { return function() { h2 = 2; }; }
+ h2()();
+ ok(h2 === 2, "h2 = " + h2);
+
+ (function e() {
+ var f = e;
+ ok(typeof(f) === "function", "f = " + f);
+ (function () { e = 1; })();
+ e = 2;
+ ok(f === e, "f != e");
+ })();
});
sync_test("console", function() {
--
2.34.1
3
14
[tools] testbot/web: Use Collection::GetSortedItems() for collection blocks.
by Francois Gouget April 13, 2022
by Francois Gouget April 13, 2022
April 13, 2022
This adds default Compare() methods to the Jobs and Patches classes
which allows removing all the CollectionBlock SortKeys() methods.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
A problem with SortKeys() is that it's passed the keys but not the other
fields of the object. But sometimes we want to sort the objects based on
non-key attributes, such as their status (scheduled for deletion or
not), a start date, etc. Such sorting is much more practical if the
function doing the comparison has access to all the fields.
This can also have large performance implications however. Specifically
it can cause a lot more property accesses and the AUTOLOAD-based ones
($Patch->Id) are really really slow. Namely, when sorting the patches
100 times I get the following results:
* 21.94 s { $b->Id <=> $a->Id } -> using the Item::AUTOLOAD mechanism
* 18.60 s still AUTOLOAD but with the substr+rindex patch (15% faster)
* 11.03 s Item::Compare() !!!
-> Much faster despite the PropertyDescriptors loop because
it replaces the AUTOLOAD mechanism with direct hash
accesses.
* 6.03 s { $b->GetColValue("Id") <=> $a->GetColValue("Id") }
* 2.47 s { $b->{ColValues}{Id} <=> $a->{ColValues}{Id} }
-> The implementation I went with in this patch.
* 0.82 s sort @{$Patches->GetKeys()} + GetItem() calls in the main
loop
So that part of generating the Wine-devel page went from ~8 ms to ~25 ms
which I think is still acceptable. But 220 ms would have started being
quite noticeable.
Now sorting the 6000-ish Patches and Jobs is easy. Where it gets dicey
is with the much larger Records (153591 entries) and RecordGroups tables
(half as much) but that's mostly an issue for the Activity and Stats
pages [1].
[1] Generating the Stats page for the full history takes ~150 seconds of
CPU. That's embarassing. At least I expect it's not a widely used
page so it shouldn't put too much load on the server. But still I've
analysed what's going on and will try to send some patches to speed
it up. Sorting is not the only or even the main issue but it does
contribute.
---
.../lib/ObjectModel/CGI/CollectionBlock.pm | 15 +++++-----
testbot/lib/WineTestBot/Jobs.pm | 8 ++++++
testbot/lib/WineTestBot/Patches.pm | 8 ++++++
testbot/lib/WineTestBot/VMs.pm | 23 ---------------
testbot/web/JobDetails.pl | 28 +++++++------------
testbot/web/Submit.pl | 13 ++++-----
testbot/web/admin/VMsList.pl | 7 -----
testbot/web/index.pl | 15 ----------
8 files changed, 39 insertions(+), 78 deletions(-)
diff --git a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
index 23825d757..f124e646b 100644
--- a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
+++ b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
@@ -176,11 +176,11 @@ sub DisplayProperty($$)
return $PropertyDescriptor->GetClass ne "Detailref";
}
-sub SortKeys($$)
+sub GetSortedItems($$)
{
- my ($self, $Keys) = @_;
+ my ($self, $Items) = @_;
- return $Keys;
+ return $self->{Collection}->GetSortedItems($Items);
}
sub GetDisplayValue($$$)
@@ -428,16 +428,15 @@ EOF
print "<tbody>\n";
my $DetailsPage = $self->GetDetailsPage();
my $Row = 0;
- my $Keys = $self->SortKeys($self->{Collection}->GetKeys());
- foreach my $Key (@$Keys)
+ my $Items = $self->{Collection}->GetSortedItems();
+ foreach my $Item (@$Items)
{
my $Class = ($Row % 2) == 0 ? "even" : "odd";
- my $Item = $self->{Collection}->GetItem($Key);
$self->GenerateDataRow($Item, $PropertyDescriptors, $DetailsPage,
$Class, $ItemActions);
$Row++;
}
- if (@$Keys == 0)
+ if (@$Items == 0)
{
print "<tr class='even'><td colspan='0'>No entries</td></tr>\n";
}
@@ -445,7 +444,7 @@ EOF
print "</tbody>\n";
print "</table>\n";
- if (@$ItemActions != 0 && @$Keys != 0)
+ if (@$ItemActions != 0 && @$Items != 0)
{
print <<EOF;
<div class='CollectionBlockActions'>
diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index a5ae13525..c082a36ab 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -111,6 +111,14 @@ sub InitializeNew($$)
$self->SUPER::InitializeNew($Collection);
}
+sub Compare($$)
+{
+ my ($self, $B) = @_;
+
+ # Hack: Use direct attribute access for performance
+ return $B->{ColValues}{Id} <=> $self->{ColValues}{Id}; # newest first by default
+}
+
=pod
=over 12
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index 6891fa509..d2ac52e4e 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -58,6 +58,14 @@ sub InitializeNew($$)
$self->SUPER::InitializeNew($Collection);
}
+sub Compare($$)
+{
+ my ($self, $B) = @_;
+
+ # Hack: Use direct attribute access for performance
+ return $B->{ColValues}{Id} <=> $self->{ColValues}{Id}; # newest first by default
+}
+
=pod
=over 12
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index 2e475b722..f0c16d19e 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -809,29 +809,6 @@ sub CreateVMs(;$)
\@PropertyDescriptors, $ScopeObject);
}
-sub SortKeysBySortOrder($$)
-{
- my ($self, $Keys) = @_;
-
- # Sort retired and deleted VMs last
- my %RoleOrders = ("retired" => 1, "deleted" => 2);
-
- my %SortOrder;
- foreach my $Key (@$Keys)
- {
- my $Item = $self->GetItem($Key);
- $SortOrder{$Key} = [$RoleOrders{$Item->Role} || 0, $Item->SortOrder, $Item->Name];
- }
-
- my @SortedKeys = sort {
- my ($soa, $sob) = ($SortOrder{$a}, $SortOrder{$b});
- return @$soa[0] <=> @$sob[0] ||
- @$soa[1] <=> @$sob[1] ||
- @$soa[2] cmp @$sob[2];
- } @$Keys;
- return \@SortedKeys;
-}
-
sub FilterEnabledRole($)
{
my ($self) = @_;
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 5a2420436..da4ad7e96 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -56,14 +56,6 @@ sub DisplayProperty($$)
$PropertyName eq "Ended" || $PropertyName eq "TestFailures";
}
-sub SortKeys($$)
-{
- my ($self, $Keys) = @_;
-
- my @SortedKeys = sort { $a <=> $b } @$Keys;
- return \@SortedKeys;
-}
-
#
# Item cell generation
@@ -361,10 +353,10 @@ sub InitMoreInfo($)
my ($self) = @_;
my $More = $self->{More} = {};
- my $Keys = $self->{CollectionBlock}->SortKeys($self->{Collection}->GetKeys());
- foreach my $Key (@$Keys)
+ my $SortedStepTasks = $self->{Collection}->GetSortedItems();
+ foreach my $StepTask (@$SortedStepTasks)
{
- my $StepTask = $self->{Collection}->GetItem($Key);
+ my $Key = $StepTask->GetKey();
$More->{$Key}->{Screenshot} = $self->GetParam("s$Key");
my $Value = $self->GetParam("f$Key");
@@ -569,17 +561,17 @@ function HideLog(event, url)
EOF
print "<div class='Content'>\n";
- my $Keys = $self->{CollectionBlock}->SortKeys($self->{Collection}->GetKeys());
- my $KeyIndex = 0;
- foreach my $Key (@$Keys)
+ my $Index = 0;
+ my $SortedStepTasks = $self->{Collection}->GetSortedItems();
+ foreach my $StepTask (@$SortedStepTasks)
{
- my $StepTask = $self->{Collection}->GetItem($Key);
+ my $Key = $StepTask->GetKey();
my $TaskDir = $StepTask->GetTaskDir();
my $VM = $StepTask->VM;
- my $Prev = $KeyIndex > 0 ? "k". $Keys->[$KeyIndex-1] : "PageTitle";
- my $Next = $KeyIndex + 1 < @$Keys ? "k". $Keys->[$KeyIndex+1] : "PageEnd";
- $KeyIndex++;
+ my $Prev = $Index > 0 ? "k". $SortedStepTasks->[$Index-1]->GetKey() : "PageTitle";
+ my $Next = $Index + 1 < @$SortedStepTasks ? "k". $SortedStepTasks->[$Index+1]->GetKey() : "PageEnd";
+ $Index++;
print "<h2><a name='k", $self->escapeHTML($Key), "'></a>",
$self->escapeHTML($StepTask->GetTitle()),
" <span class='right'><a class='title' href='#$Prev'>↑</a><a class='title' href='#$Next'>↓</a></span></h2>\n";
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 1ad94e4a4..8a1cc3c1d 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -474,10 +474,9 @@ sub _initialize($$$)
$VMs->AddFilter("Type", ["win32", "win64", "wine"]);
$VMs->FilterEnabledRole();
- my $SortedKeys = $VMs->SortKeysBySortOrder($VMs->GetKeys());
- foreach my $VMKey (@$SortedKeys)
+ my $SortedVMs = $VMs->GetSortedItems();
+ foreach my $VM (@$SortedVMs)
{
- my $VM = $VMs->GetItem($VMKey);
my ($ErrMessage, $Caps) = GetMissionCaps($VM->Missions, $VM->MissionCaps);
LogMsg "$ErrMessage\n" if (defined $ErrMessage);
@@ -492,7 +491,7 @@ sub _initialize($$$)
}
}
- my $FieldBase = $self->escapeHTML($VMKey);
+ my $FieldBase = $self->escapeHTML($VM->GetKey());
foreach my $Build (sort @Builds)
{
my $VMRow = {
@@ -752,10 +751,10 @@ sub GenerateFields($)
print "<div class='ItemProperty'><label>Branch</label>",
"<div class='ItemValue'>",
"<select name='Branch' size='1'>";
- my @SortedKeys = sort { $a cmp $b } @{$Branches->GetKeys()};
- foreach my $Key (@SortedKeys)
+ my $SortedBranches = $Branches->GetSortedItems();
+ foreach my $Branch (@$SortedBranches)
{
- my $Branch = $Branches->GetItem($Key);
+ my $Key = $Branch->GetKey();
print "<option value='", $self->escapeHTML($Key), "'";
if (defined $self->{Branch} and $Key eq $self->{Branch})
{
diff --git a/testbot/web/admin/VMsList.pl b/testbot/web/admin/VMsList.pl
index cfd5b91f5..f8162c63e 100644
--- a/testbot/web/admin/VMsList.pl
+++ b/testbot/web/admin/VMsList.pl
@@ -43,13 +43,6 @@ sub DisplayProperty($$)
$PropertyName eq "Description";
}
-sub SortKeys($$)
-{
- my ($self, $Keys) = @_;
-
- return $self->{Collection}->SortKeysBySortOrder($Keys);
-}
-
sub OnItemAction($$$)
{
my ($self, $VM, $Action) = @_;
diff --git a/testbot/web/index.pl b/testbot/web/index.pl
index 85f8df39f..478cb61c1 100644
--- a/testbot/web/index.pl
+++ b/testbot/web/index.pl
@@ -35,14 +35,6 @@ use WineTestBot::Utils;
my $DAYS_DEFAULT = 4;
-sub SortKeys($$)
-{
- my ($self, $Keys) = @_;
-
- my @SortedKeys = sort { $b <=> $a } @$Keys;
- return \@SortedKeys;
-}
-
sub DisplayProperty($$)
{
my ($self, $PropertyDescriptor) = @_;
@@ -188,13 +180,6 @@ use ObjectModel::CGI::CollectionBlock;
our @ISA = qw(ObjectModel::CGI::CollectionBlock);
-sub SortKeys($$)
-{
- my ($self, $Keys) = @_;
-
- return $self->{Collection}->SortKeysBySortOrder($Keys);
-}
-
sub DisplayProperty($$)
{
my ($self, $PropertyDescriptor) = @_;
--
2.30.2
1
0