Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- 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
February 2018
- 74 participants
- 1541 messages
[PATCH 1/2] gdiplus: Fix argument check in GdipLoadImageFromStream()
by Nikolay Sivov
From: Louis Lenders <xerox.xerox2000x(a)gmail.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
For https://bugs.winehq.org/show_bug.cgi?id=42851
dlls/gdiplus/image.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index c0b54d04d8..b03630c55c 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -4314,6 +4314,11 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream *stream, GpImage **image)
HRESULT hr;
const struct image_codec *codec=NULL;
+ TRACE("%p %p\n", stream, image);
+
+ if (!stream || !image)
+ return InvalidParameter;
+
/* choose an appropriate image decoder */
stat = get_decoder_info(stream, &codec);
if (stat != Ok) return stat;
--
2.16.1
Feb. 28, 2018
[PATCH 5/5] usp10/tests: Cleanup test_ScriptGetFontFunctions().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/usp10/tests/usp10.c | 205 ++++++++++++++++++++++++-----------------------
1 file changed, 103 insertions(+), 102 deletions(-)
diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c
index cd2c129..f548b57 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -3701,116 +3701,117 @@ static void test_newlines(void)
static void test_ScriptGetFontFunctions(HDC hdc)
{
+ static const WCHAR test_phagspa[] = {0xa84f, 0xa861, 0xa843, 0x0020, 0xa863, 0xa861, 0xa859,
+ 0x0020, 0xa850, 0xa85c, 0xa85e};
+ SCRIPT_CONTROL control;
+ SCRIPT_CACHE sc = NULL;
+ SCRIPT_ITEM items[15];
+ OPENTYPE_TAG tags[5];
+ SCRIPT_STATE state;
+ int count = 0;
HRESULT hr;
+
if (!pScriptGetFontScriptTags || !pScriptGetFontLanguageTags || !pScriptGetFontFeatureTags)
{
- win_skip("ScriptGetFontScriptTags,ScriptGetFontLanguageTags or ScriptGetFontFeatureTags not available on this platform\n");
+ win_skip("ScriptGetFontScriptTags, ScriptGetFontLanguageTags or "
+ "ScriptGetFontFeatureTags not available on this platform.\n");
+ return;
}
+
+ hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, NULL, NULL);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, NULL, &count);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontScriptTags(hdc, &sc, NULL, ARRAY_SIZE(tags), tags, NULL);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, tags, &count);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontScriptTags(NULL, &sc, NULL, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontScriptTags(hdc, &sc, NULL, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
+ if (hr == S_OK)
+ ok(count <= 5, "Got unexpected count %d.\n", count);
else
- {
- SCRIPT_CACHE sc = NULL;
- OPENTYPE_TAG tags[5];
- int count = 0;
- int outnItems=0;
- SCRIPT_ITEM outpItems[15];
- SCRIPT_CONTROL Control;
- SCRIPT_STATE State;
- static const WCHAR test_phagspa[] = {0xa84f, 0xa861, 0xa843, 0x0020, 0xa863, 0xa861, 0xa859, 0x0020, 0xa850, 0xa85c, 0xa85e};
-
- hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, NULL, NULL);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, NULL, &count);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 5, tags, NULL);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, tags, &count);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontScriptTags(NULL, &sc, NULL, 5, tags, &count);
- ok(hr == E_PENDING,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 5, tags, &count);
- ok((hr == S_OK || hr == E_OUTOFMEMORY),"Incorrect return code\n");
- if (hr == S_OK)
- ok(count <= 5, "Count should be less or equal to 5 with S_OK return\n");
- else if (hr == E_OUTOFMEMORY)
- ok(count == 0, "Count should be 0 with E_OUTOFMEMORY return\n");
- ok(sc != NULL, "ScriptCache should be initialized\n");
+ ok(!count, "Got unexpected count %d.\n", count);
+ ok(!!sc, "Got unexpected script cache %p.\n", sc);
- ScriptFreeCache(&sc);
- sc = NULL;
-
- hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, NULL, NULL);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, NULL, &count);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 5, tags, NULL);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, tags, &count);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontLanguageTags(NULL, &sc, NULL, latn_tag, 5, tags, &count);
- ok(hr == E_PENDING,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 5, tags, &count);
- ok((hr == S_OK || hr == E_OUTOFMEMORY),"Incorrect return code\n");
- if (hr == S_OK)
- ok(count <= 5, "Count should be less or equal to 5 with S_OK return\n");
- else if (hr == E_OUTOFMEMORY)
- ok(count == 0, "Count should be 0 with E_OUTOFMEMORY return\n");
+ ScriptFreeCache(&sc);
+ sc = NULL;
- ScriptFreeCache(&sc);
- sc = NULL;
-
- hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, NULL, NULL);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, NULL, &count);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 5, tags, NULL);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, tags, &count);
- ok(hr == E_INVALIDARG,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontFeatureTags(NULL, &sc, NULL, latn_tag, 0x0, 5, tags, &count);
- ok(hr == E_PENDING,"Incorrect return code\n");
- ok(sc == NULL, "ScriptCache should remain uninitialized\n");
- hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 5, tags, &count);
- ok((hr == S_OK || hr == E_OUTOFMEMORY),"Incorrect return code\n");
- if (hr == S_OK)
- ok(count <= 5, "Count should be less or equal to 5 with S_OK return\n");
- else if (hr == E_OUTOFMEMORY)
- ok(count == 0, "Count should be 0 with E_OUTOFMEMORY return\n");
-
- memset(&Control, 0, sizeof(Control));
- memset(&State, 0, sizeof(State));
-
- hr = ScriptItemize(test_phagspa, 10, 15, &Control, &State, outpItems, &outnItems);
- ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
- memset(tags,0,sizeof(tags));
- hr = pScriptGetFontScriptTags(hdc, &sc, &outpItems[0].a, 5, tags, &count);
- ok( hr == USP_E_SCRIPT_NOT_IN_FONT || broken(hr == S_OK), "wrong return code\n");
-
- hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, dsrt_tag, 5, tags, &count);
- ok( hr == S_OK, "wrong return code\n");
- hr = pScriptGetFontLanguageTags(hdc, &sc, &outpItems[0].a, dsrt_tag, 5, tags, &count);
- ok( hr == E_INVALIDARG || broken(hr == S_OK), "wrong return code\n");
-
- hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, dsrt_tag, 0x0, 5, tags, &count);
- ok( hr == S_OK, "wrong return code\n");
- hr = pScriptGetFontFeatureTags(hdc, &sc, &outpItems[0].a, dsrt_tag, 0x0, 5, tags, &count);
- ok( hr == E_INVALIDARG || broken(hr == S_OK), "wrong return code\n");
+ hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, NULL, NULL);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, NULL, &count);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, NULL);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, tags, &count);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontLanguageTags(NULL, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
+ if (hr == S_OK)
+ ok(count <= 5, "Got unexpected count %d.\n", count);
+ else
+ ok(!count, "Got unexpected count %d.\n", count);
- ScriptFreeCache(&sc);
- }
+ ScriptFreeCache(&sc);
+ sc = NULL;
+
+ hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, NULL, NULL);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, NULL, &count);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, NULL);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, tags, &count);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontFeatureTags(NULL, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
+ ok(!sc, "Got unexpected script cache %p.\n", sc);
+ hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
+ if (hr == S_OK)
+ ok(count <= 5, "Got unexpected count %d.\n", count);
+ else
+ ok(!count, "Got unexpected count %d.\n", count);
+
+ memset(&control, 0, sizeof(control));
+ memset(&state, 0, sizeof(state));
+
+ hr = ScriptItemize(test_phagspa, ARRAY_SIZE(test_phagspa), ARRAY_SIZE(items),
+ &control, &state, items, &count);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ memset(tags, 0, sizeof(tags));
+ hr = pScriptGetFontScriptTags(hdc, &sc, &items[0].a, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == USP_E_SCRIPT_NOT_IN_FONT || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
+
+ hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, dsrt_tag, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = pScriptGetFontLanguageTags(hdc, &sc, &items[0].a, dsrt_tag, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == E_INVALIDARG || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
+
+ hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, dsrt_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = pScriptGetFontFeatureTags(hdc, &sc, &items[0].a, dsrt_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
+ ok(hr == E_INVALIDARG || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
+
+ ScriptFreeCache(&sc);
}
struct logical_width_test
--
2.1.4
Feb. 28, 2018
[PATCH 4/5] wined3d: Explicitly calculate the sub-resource level in fb_copy_to_texture_direct().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/surface.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 36ecfaf..12370ed 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1607,12 +1607,12 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
struct wined3d_texture *src_texture = src_surface->container;
struct wined3d_texture *dst_texture = dst_surface->container;
struct wined3d_device *device = dst_texture->resource.device;
+ unsigned int src_height, src_level, dst_level;
const struct wined3d_gl_info *gl_info;
float xrel, yrel;
struct wined3d_context *context;
BOOL upsidedown = FALSE;
RECT dst_rect = *dst_rect_in;
- unsigned int src_height;
GLenum dst_target;
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -1660,14 +1660,17 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
ERR("Texture filtering not supported in direct blit\n");
}
- src_height = wined3d_texture_get_level_height(src_texture, src_surface->texture_level);
+ src_level = src_sub_resource_idx % src_texture->level_count;
+ dst_level = dst_sub_resource_idx % dst_texture->level_count;
+
+ src_height = wined3d_texture_get_level_height(src_texture, src_level);
dst_target = wined3d_texture_get_sub_resource_target(dst_texture, dst_sub_resource_idx);
if (upsidedown
&& !((xrel - 1.0f < -eps) || (xrel - 1.0f > eps))
&& !((yrel - 1.0f < -eps) || (yrel - 1.0f > eps)))
{
/* Upside down copy without stretching is nice, one glCopyTexSubImage call will do. */
- gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_surface->texture_level,
+ gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_level,
dst_rect.left /*xoffset */, dst_rect.top /* y offset */,
src_rect->left, src_height - src_rect->bottom,
dst_rect.right - dst_rect.left, dst_rect.bottom - dst_rect.top);
@@ -1692,14 +1695,14 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
for (col = dst_rect.left; col < dst_rect.right; ++col)
{
- gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_surface->texture_level,
+ gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_level,
dst_rect.left + col /* x offset */, row /* y offset */,
src_rect->left + col * xrel, yoffset - (int) (row * yrel), 1, 1);
}
}
else
{
- gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_surface->texture_level,
+ gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_level,
dst_rect.left /* x offset */, row /* y offset */,
src_rect->left, yoffset - (int) (row * yrel), dst_rect.right - dst_rect.left, 1);
}
--
2.1.4
Feb. 28, 2018
[PATCH 3/5] wined3d: Explicitly calculate the sub-resource level in surface_load_fb_texture().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/surface.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 751424d..36ecfaf 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1563,6 +1563,7 @@ void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context = old_ctx;
struct wined3d_surface *restore_rt = NULL;
+ unsigned int level;
GLenum target;
restore_rt = context_get_rt_surface(old_ctx);
@@ -1585,10 +1586,11 @@ void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct
gl_info->gl_ops.gl.p_glReadBuffer(wined3d_texture_get_gl_buffer(texture));
checkGLcall("glReadBuffer");
+ level = sub_resource_idx % texture->level_count;
target = wined3d_texture_get_sub_resource_target(texture, sub_resource_idx);
- gl_info->gl_ops.gl.p_glCopyTexSubImage2D(target, surface->texture_level,
- 0, 0, 0, 0, wined3d_texture_get_level_width(texture, surface->texture_level),
- wined3d_texture_get_level_height(texture, surface->texture_level));
+ gl_info->gl_ops.gl.p_glCopyTexSubImage2D(target, level, 0, 0, 0, 0,
+ wined3d_texture_get_level_width(texture, level),
+ wined3d_texture_get_level_height(texture, level));
checkGLcall("glCopyTexSubImage2D");
if (restore_rt)
--
2.1.4
Feb. 28, 2018
[PATCH 2/5] wined3d: Explicitly calculate the sub-resource level in read_from_framebuffer().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/surface.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 22156b6..751424d 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1433,8 +1433,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
struct wined3d_surface *restore_rt = NULL;
const struct wined3d_gl_info *gl_info;
unsigned int row_pitch, slice_pitch;
+ unsigned int width, height, level;
struct wined3d_bo_address data;
- unsigned int width, height;
BYTE *row, *top, *bottom;
BOOL src_is_upside_down;
unsigned int i;
@@ -1488,14 +1488,15 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
checkGLcall("glBindBuffer");
}
- wined3d_texture_get_pitch(texture, surface->texture_level, &row_pitch, &slice_pitch);
+ level = sub_resource_idx % texture->level_count;
+ wined3d_texture_get_pitch(texture, level, &row_pitch, &slice_pitch);
/* Setup pixel store pack state -- to glReadPixels into the correct place */
gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, row_pitch / texture->resource.format->byte_count);
checkGLcall("glPixelStorei");
- width = wined3d_texture_get_level_width(texture, surface->texture_level);
- height = wined3d_texture_get_level_height(texture, surface->texture_level);
+ width = wined3d_texture_get_level_width(texture, level);
+ height = wined3d_texture_get_level_height(texture, level);
gl_info->gl_ops.gl.p_glReadPixels(0, 0, width, height,
texture->resource.format->glFormat,
texture->resource.format->glType, data.addr);
--
2.1.4
Feb. 28, 2018
[PATCH 1/5] wined3d: Explicitly calculate the sub-resource level in surface_set_compatible_renderbuffer().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/surface.c | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ada7193..22156b6 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -981,36 +981,42 @@ static HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface,
/* Context activation is done by the caller. */
void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, const struct wined3d_rendertarget_info *rt)
{
- const struct wined3d_gl_info *gl_info = &surface->container->resource.device->adapter->gl_info;
+ unsigned int sub_resource_idx, width, height, level;
struct wined3d_renderbuffer_entry *entry;
+ const struct wined3d_texture *texture;
+ const struct wined3d_gl_info *gl_info;
unsigned int src_width, src_height;
- unsigned int width, height;
GLuint renderbuffer = 0;
+ texture = surface->container;
+ gl_info = &texture->resource.device->adapter->gl_info;
+ sub_resource_idx = surface_get_sub_resource_idx(surface);
+ level = sub_resource_idx % texture->level_count;
+
if (rt && rt->resource->format->id != WINED3DFMT_NULL)
{
- struct wined3d_texture *texture;
- unsigned int level;
+ struct wined3d_texture *rt_texture;
+ unsigned int rt_level;
if (rt->resource->type == WINED3D_RTYPE_BUFFER)
{
FIXME("Unsupported resource type %s.\n", debug_d3dresourcetype(rt->resource->type));
return;
}
- texture = wined3d_texture_from_resource(rt->resource);
- level = rt->sub_resource_idx % texture->level_count;
+ rt_texture = wined3d_texture_from_resource(rt->resource);
+ rt_level = rt->sub_resource_idx % rt_texture->level_count;
- width = wined3d_texture_get_level_pow2_width(texture, level);
- height = wined3d_texture_get_level_pow2_height(texture, level);
+ width = wined3d_texture_get_level_pow2_width(rt_texture, rt_level);
+ height = wined3d_texture_get_level_pow2_height(rt_texture, rt_level);
}
else
{
- width = wined3d_texture_get_level_pow2_width(surface->container, surface->texture_level);
- height = wined3d_texture_get_level_pow2_height(surface->container, surface->texture_level);
+ width = wined3d_texture_get_level_pow2_width(texture, level);
+ height = wined3d_texture_get_level_pow2_height(texture, level);
}
- src_width = wined3d_texture_get_level_pow2_width(surface->container, surface->texture_level);
- src_height = wined3d_texture_get_level_pow2_height(surface->container, surface->texture_level);
+ src_width = wined3d_texture_get_level_pow2_width(texture, level);
+ src_height = wined3d_texture_get_level_pow2_height(texture, level);
/* A depth stencil smaller than the render target is not valid */
if (width > src_width || height > src_height) return;
@@ -1039,7 +1045,7 @@ void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, const
gl_info->fbo_ops.glGenRenderbuffers(1, &renderbuffer);
gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER,
- surface->container->resource.format->glInternal, width, height);
+ texture->resource.format->glInternal, width, height);
entry = heap_alloc(sizeof(*entry));
entry->width = width;
--
2.1.4
Feb. 28, 2018
[PATCH] user32/tests: Remove commented out traces, use test calls instead of traces
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/user32/tests/win.c | 46 ++++++++++++++--------------------------------
1 file changed, 14 insertions(+), 32 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 96a2467da0..ab39ee84a4 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -2786,7 +2786,6 @@ static void check_z_order_debug(HWND hwnd, HWND next, HWND prev, HWND owner,
UlongToHandle(GetWindowLongPtrA(test, GWLP_HINSTANCE)) != GetModuleHandleA(NULL) ||
GetWindow(test, GW_OWNER) == next))
{
- /*trace("skipping next %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/
test = GetWindow(test, GW_HWNDNEXT);
}
ok_(file, line)(next == test, "%p: expected next %p, got %p\n", hwnd, next, test);
@@ -2798,7 +2797,6 @@ static void check_z_order_debug(HWND hwnd, HWND next, HWND prev, HWND owner,
UlongToHandle(GetWindowLongPtrA(test, GWLP_HINSTANCE)) != GetModuleHandleA(NULL) ||
GetWindow(test, GW_OWNER) == hwnd))
{
- /*trace("skipping prev %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/
test = GetWindow(test, GW_HWNDPREV);
}
ok_(file, line)(prev == test, "%p: expected prev %p, got %p\n", hwnd, prev, test);
@@ -3060,8 +3058,6 @@ static void test_SetActiveWindow(HWND hwnd)
SetActiveWindow(0);
check_wnd_state(0, 0, 0, 0);
- /*trace("testing SetActiveWindow %p\n", hwnd);*/
-
ShowWindow(hwnd, SW_SHOW);
check_wnd_state(hwnd, hwnd, hwnd, 0);
@@ -3084,7 +3080,7 @@ static void test_SetActiveWindow(HWND hwnd)
ShowWindow(hwnd, SW_HIDE);
check_wnd_state(0, 0, 0, 0);
- /*trace("testing SetActiveWindow on an invisible window %p\n", hwnd);*/
+ /* Invisible window. */
SetActiveWindow(hwnd);
check_wnd_state(hwnd, hwnd, hwnd, 0);
@@ -3176,8 +3172,6 @@ static void test_SetForegroundWindow(HWND hwnd)
SetActiveWindow(0);
check_wnd_state(0, 0, 0, 0);
- /*trace("testing SetForegroundWindow %p\n", hwnd);*/
-
ShowWindow(hwnd, SW_SHOW);
check_wnd_state(hwnd, hwnd, hwnd, 0);
@@ -3219,7 +3213,7 @@ static void test_SetForegroundWindow(HWND hwnd)
ShowWindow(hwnd, SW_HIDE);
check_wnd_state(0, 0, 0, 0);
- /*trace("testing SetForegroundWindow on an invisible window %p\n", hwnd);*/
+ /* Invisible window. */
ret = SetForegroundWindow(hwnd);
ok(ret, "SetForegroundWindow returned FALSE instead of TRUE\n");
check_wnd_state(hwnd, hwnd, hwnd, 0);
@@ -5206,10 +5200,8 @@ static void test_AWRwindow(LPCSTR class, LONG style, LONG exStyle, BOOL menu)
0,
menu ? hmenu : 0,
0, 0);
- if (!hwnd) {
- trace("Failed to create window class=%s, style=0x%08x, exStyle=0x%08x\n", class, style, exStyle);
- return;
- }
+ ok(hwnd != NULL, "Failed to create window class=%s, style=0x%08x, exStyle=0x%08x\n", class, style, exStyle);
+
ShowWindow(hwnd, SW_SHOW);
test_nonclient_area(hwnd);
@@ -5354,6 +5346,7 @@ static void test_redrawnow(void)
{
WNDCLASSA cls;
HWND hwndMain;
+ BOOL ret;
cls.style = CS_DBLCLKS;
cls.lpfnWndProc = redraw_window_procA;
@@ -5365,11 +5358,8 @@ static void test_redrawnow(void)
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "RedrawWindowClass";
-
- if(!RegisterClassA(&cls)) {
- trace("Register failed %d\n", GetLastError());
- return;
- }
+ ret = RegisterClassA(&cls);
+ ok(ret, "Failed to register a test class.\n");
hwndMain = CreateWindowA("RedrawWindowClass", "Main Window", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, 100, 100, NULL, NULL, 0, NULL);
@@ -5471,6 +5461,7 @@ static void test_csparentdc(void)
{
WNDCLASSA clsMain, cls;
HWND hwndMain, hwnd1, hwnd2;
+ BOOL ret;
RECT rc;
struct parentdc_test test_answer;
@@ -5536,11 +5527,8 @@ static void test_csparentdc(void)
clsMain.hbrBackground = GetStockObject(WHITE_BRUSH);
clsMain.lpszMenuName = NULL;
clsMain.lpszClassName = "ParentDcMainWindowClass";
-
- if(!RegisterClassA(&clsMain)) {
- trace("Register failed %d\n", GetLastError());
- return;
- }
+ ret = RegisterClassA(&clsMain);
+ ok(ret, "Failed to register a test class.\n");
cls.style = CS_DBLCLKS | CS_PARENTDC;
cls.lpfnWndProc = parentdc_window_procA;
@@ -5552,11 +5540,8 @@ static void test_csparentdc(void)
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "ParentDcWindowClass";
-
- if(!RegisterClassA(&cls)) {
- trace("Register failed %d\n", GetLastError());
- return;
- }
+ ret = RegisterClassA(&cls);
+ ok(ret, "Failed to register a test class.\n");
SetRect(&rc, 0, 0, 150, 150);
AdjustWindowRectEx(&rc, WS_OVERLAPPEDWINDOW, FALSE, 0);
@@ -7041,11 +7026,8 @@ static void test_GetUpdateRect(void)
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = classNameA;
-
- if(!RegisterClassA(&cls)) {
- trace("Register failed %d\n", GetLastError());
- return;
- }
+ ret = RegisterClassA(&cls);
+ ok(ret, "Failed to register a test class.\n");
hgrandparent = CreateWindowA(classNameA, "grandparent", WS_OVERLAPPEDWINDOW,
0, 0, 100, 100, NULL, NULL, 0, NULL);
--
2.16.1
Feb. 28, 2018
[resend PATCH] comctl32/tooltips: Set window size before TTN_SHOW and preserve it after
by Nikolay Sivov
From: Roman Pišl <rpisl(a)seznam.cz>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
Resending so bot can pick it up this time.
dlls/comctl32/tests/tooltips.c | 1 -
dlls/comctl32/tooltips.c | 27 +++++++++++++--------------
2 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c
index 7f37d5fc97..af95a569bb 100644
--- a/dlls/comctl32/tests/tooltips.c
+++ b/dlls/comctl32/tests/tooltips.c
@@ -304,7 +304,6 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
break;
case TTN_SHOW:
GetWindowRect(hdr->hwndFrom, &rect);
- todo_wine
ok(!EqualRect(&g_ttip_rect, &rect), "Unexpected window rectangle.\n");
break;
}
diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c
index e5b966a004..54601017d6 100644
--- a/dlls/comctl32/tooltips.c
+++ b/dlls/comctl32/tooltips.c
@@ -624,18 +624,10 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
}
toolPtr = &infoPtr->tools[nTool];
-
- TRACE("Show tooltip %d\n", nTool);
-
- hdr.hwndFrom = infoPtr->hwndSelf;
- hdr.idFrom = toolPtr->uId;
- hdr.code = TTN_SHOW;
- SendMessageW (toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&hdr);
-
- TRACE("%s\n", debugstr_w(infoPtr->szTipText));
-
TOOLTIPS_CalcTipSize (infoPtr, &size);
- TRACE("size %d x %d\n", size.cx, size.cy);
+
+ TRACE("Show tooltip %d, %s, size %d x %d\n", nTool, debugstr_w(infoPtr->szTipText),
+ size.cx, size.cy);
if (track_activate && (toolPtr->uFlags & TTF_TRACK))
{
@@ -824,9 +816,16 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
* it is no longer needed */
}
- SetWindowPos (infoPtr->hwndSelf, HWND_TOPMOST, rect.left, rect.top,
- rect.right - rect.left, rect.bottom - rect.top,
- SWP_SHOWWINDOW | SWP_NOACTIVATE);
+ SetWindowPos (infoPtr->hwndSelf, NULL, rect.left, rect.top,
+ rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_NOACTIVATE);
+
+ hdr.hwndFrom = infoPtr->hwndSelf;
+ hdr.idFrom = toolPtr->uId;
+ hdr.code = TTN_SHOW;
+ SendMessageW (toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&hdr);
+
+ SetWindowPos (infoPtr->hwndSelf, HWND_TOPMOST, 0, 0, 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOACTIVATE);
/* repaint the tooltip */
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
--
2.16.1
Feb. 28, 2018
[PATCH] comctl32/tests: Run some Progress control tests on version 6
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/comctl32/tests/progress.c | 49 +++++++++++++++++++++++++++---------------
1 file changed, 32 insertions(+), 17 deletions(-)
diff --git a/dlls/comctl32/tests/progress.c b/dlls/comctl32/tests/progress.c
index d3b219ccca..b911021be0 100644
--- a/dlls/comctl32/tests/progress.c
+++ b/dlls/comctl32/tests/progress.c
@@ -27,8 +27,9 @@
#include "wine/test.h"
+#include "v6util.h"
-static HWND hProgressParentWnd, hProgressWnd;
+static HWND hProgressParentWnd;
static const char progressTestClass[] = "ProgressBarTestClass";
static BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
@@ -119,16 +120,6 @@ static void init(void)
CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, GetModuleHandleA(NULL), 0);
ok(hProgressParentWnd != NULL, "failed to create parent wnd\n");
- GetClientRect(hProgressParentWnd, &rect);
- hProgressWnd = CreateWindowExA(0, PROGRESS_CLASSA, "", WS_CHILD | WS_VISIBLE,
- 0, 0, rect.right, rect.bottom, hProgressParentWnd, NULL, GetModuleHandleA(NULL), 0);
- ok(hProgressWnd != NULL, "Failed to create progress bar.\n");
- progress_wndproc = (WNDPROC)SetWindowLongPtrA(hProgressWnd, GWLP_WNDPROC, (LPARAM)progress_subclass_proc);
-
- ShowWindow(hProgressParentWnd, SW_SHOWNORMAL);
- ok(GetUpdateRect(hProgressParentWnd, NULL, FALSE), "GetUpdateRect: There should be a region that needs to be updated\n");
- flush_events();
- update_window(hProgressParentWnd);
}
static void cleanup(void)
@@ -151,9 +142,21 @@ static void cleanup(void)
*/
static void test_redraw(void)
{
- RECT client_rect;
+ RECT client_rect, rect;
+ HWND hProgressWnd;
LRESULT ret;
+ GetClientRect(hProgressParentWnd, &rect);
+ hProgressWnd = CreateWindowExA(0, PROGRESS_CLASSA, "", WS_CHILD | WS_VISIBLE,
+ 0, 0, rect.right, rect.bottom, hProgressParentWnd, NULL, GetModuleHandleA(NULL), 0);
+ ok(hProgressWnd != NULL, "Failed to create progress bar.\n");
+ progress_wndproc = (WNDPROC)SetWindowLongPtrA(hProgressWnd, GWLP_WNDPROC, (LPARAM)progress_subclass_proc);
+
+ ShowWindow(hProgressParentWnd, SW_SHOWNORMAL);
+ ok(GetUpdateRect(hProgressParentWnd, NULL, FALSE), "GetUpdateRect: There should be a region that needs to be updated\n");
+ flush_events();
+ update_window(hProgressParentWnd);
+
SendMessageA(hProgressWnd, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
SendMessageA(hProgressWnd, PBM_SETPOS, 10, 0);
SendMessageA(hProgressWnd, PBM_SETSTEP, 20, 0);
@@ -162,15 +165,15 @@ static void test_redraw(void)
/* PBM_SETPOS */
ok(SendMessageA(hProgressWnd, PBM_SETPOS, 50, 0) == 10, "PBM_SETPOS must return the previous position\n");
ok(!GetUpdateRect(hProgressWnd, NULL, FALSE), "PBM_SETPOS: The progress bar should be redrawn immediately\n");
-
+
/* PBM_DELTAPOS */
ok(SendMessageA(hProgressWnd, PBM_DELTAPOS, 15, 0) == 50, "PBM_DELTAPOS must return the previous position\n");
ok(!GetUpdateRect(hProgressWnd, NULL, FALSE), "PBM_DELTAPOS: The progress bar should be redrawn immediately\n");
-
+
/* PBM_SETPOS */
ok(SendMessageA(hProgressWnd, PBM_SETPOS, 80, 0) == 65, "PBM_SETPOS must return the previous position\n");
ok(!GetUpdateRect(hProgressWnd, NULL, FALSE), "PBM_SETPOS: The progress bar should be redrawn immediately\n");
-
+
/* PBM_STEPIT */
ok(SendMessageA(hProgressWnd, PBM_STEPIT, 0, 0) == 80, "PBM_STEPIT must return the previous position\n");
ok(!GetUpdateRect(hProgressWnd, NULL, FALSE), "PBM_STEPIT: The progress bar should be redrawn immediately\n");
@@ -179,7 +182,7 @@ static void test_redraw(void)
win_skip("PBM_GETPOS needs comctl32 > 4.70\n");
else
ok(ret == 100, "PBM_GETPOS returned a wrong position : %d\n", (UINT)ret);
-
+
/* PBM_SETRANGE and PBM_SETRANGE32:
Usually the progress bar doesn't repaint itself immediately. If the
position is not in the new range, it does.
@@ -207,6 +210,8 @@ static void test_redraw(void)
wine_dbgstr_rect(&last_paint_rect), wine_dbgstr_rect(&client_rect));
update_window(hProgressWnd);
ok(erased, "Progress bar should have erased the background\n");
+
+ DestroyWindow(hProgressWnd);
}
static void test_setcolors(void)
@@ -299,6 +304,8 @@ static void init_functions(void)
START_TEST(progress)
{
INITCOMMONCONTROLSEX iccex;
+ ULONG_PTR ctx_cookie;
+ HANDLE hCtx;
init_functions();
@@ -307,10 +314,18 @@ START_TEST(progress)
pInitCommonControlsEx(&iccex);
init();
-
+
test_redraw();
test_setcolors();
test_PBM_STEPIT();
+ if (!load_v6_module(&ctx_cookie, &hCtx))
+ return;
+
+ test_setcolors();
+ test_PBM_STEPIT();
+
+ unload_v6_module(ctx_cookie, hCtx);
+
cleanup();
}
--
2.16.1
Feb. 28, 2018
[PATCH] wshom: Use global memory allocation helpers
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/wshom.ocx/shell.c | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/dlls/wshom.ocx/shell.c b/dlls/wshom.ocx/shell.c
index d7b36cf6c7..1aa353a17a 100644
--- a/dlls/wshom.ocx/shell.c
+++ b/dlls/wshom.ocx/shell.c
@@ -24,6 +24,7 @@
#include "dispex.h"
#include "wine/debug.h"
+#include "wine/heap.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(wshom);
@@ -130,7 +131,7 @@ static ULONG WINAPI WshExec_Release(IWshExec *iface)
if (!ref) {
CloseHandle(This->info.hThread);
CloseHandle(This->info.hProcess);
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
}
return ref;
@@ -325,7 +326,7 @@ static HRESULT WshExec_create(BSTR command, IWshExec **ret)
*ret = NULL;
- This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+ This = heap_alloc(sizeof(*This));
if (!This)
return E_OUTOFMEMORY;
@@ -333,7 +334,7 @@ static HRESULT WshExec_create(BSTR command, IWshExec **ret)
This->ref = 1;
if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &This->info)) {
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return HRESULT_FROM_WIN32(GetLastError());
}
@@ -383,7 +384,7 @@ static ULONG WINAPI WshEnvironment_Release(IWshEnvironment *iface)
TRACE("(%p) ref = %d\n", This, ref);
if (!ref)
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return ref;
}
@@ -519,7 +520,7 @@ static HRESULT WshEnvironment_Create(IWshEnvironment **env)
{
WshEnvironment *This;
- This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+ This = heap_alloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY;
This->IWshEnvironment_iface.lpVtbl = &WshEnvironmentVtbl;
@@ -572,7 +573,7 @@ static ULONG WINAPI WshCollection_Release(IWshCollection *iface)
TRACE("(%p) ref = %d\n", This, ref);
if (!ref)
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return ref;
}
@@ -721,7 +722,7 @@ static HRESULT WshCollection_Create(IWshCollection **collection)
{
WshCollection *This;
- This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+ This = heap_alloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY;
This->IWshCollection_iface.lpVtbl = &WshCollectionVtbl;
@@ -778,7 +779,7 @@ static ULONG WINAPI WshShortcut_Release(IWshShortcut *iface)
{
SysFreeString(This->path_link);
IShellLinkW_Release(This->link);
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
}
return ref;
@@ -1077,7 +1078,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
*shortcut = NULL;
- This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+ This = heap_alloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY;
This->IWshShortcut_iface.lpVtbl = &WshShortcutVtbl;
@@ -1087,7 +1088,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
&IID_IShellLinkW, (void**)&This->link);
if (FAILED(hr))
{
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return hr;
}
@@ -1095,7 +1096,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
if (!This->path_link)
{
IShellLinkW_Release(This->link);
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return E_OUTOFMEMORY;
}
@@ -1426,7 +1427,7 @@ static HRESULT split_reg_path(const WCHAR *path, WCHAR **subkey, WCHAR **value)
unsigned int len = *value - *subkey - 1;
WCHAR *ret;
- ret = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR));
+ ret = heap_alloc((len + 1)*sizeof(WCHAR));
if (!ret)
return E_OUTOFMEMORY;
@@ -1466,7 +1467,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
if (ret == ERROR_SUCCESS) {
void *data;
- data = HeapAlloc(GetProcessHeap(), 0, datalen);
+ data = heap_alloc(datalen);
if (!data) {
hr = E_OUTOFMEMORY;
goto fail;
@@ -1474,7 +1475,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
ret = RegGetValueW(root, subkey, val, RRF_RT_ANY, &type, data, &datalen);
if (ret) {
- HeapFree(GetProcessHeap(), 0, data);
+ heap_free(data);
hr = HRESULT_FROM_WIN32(ret);
goto fail;
}
@@ -1564,7 +1565,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
hr = E_FAIL;
};
- HeapFree(GetProcessHeap(), 0, data);
+ heap_free(data);
if (FAILED(hr))
VariantInit(value);
}
@@ -1573,7 +1574,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
fail:
if (val)
- HeapFree(GetProcessHeap(), 0, subkey);
+ heap_free(subkey);
return hr;
}
@@ -1661,7 +1662,7 @@ static HRESULT WINAPI WshShell3_RegWrite(IWshShell3 *iface, BSTR name, VARIANT *
fail:
VariantClear(&v);
if (val)
- HeapFree(GetProcessHeap(), 0, subkey);
+ heap_free(subkey);
return hr;
}
--
2.16.1
Feb. 28, 2018