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
November 2019
- 85 participants
- 2191 messages
[PATCH 1/2] dwrite: Update to IDWriteColorGlyphRunEnumerator1.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/dwrite/font.c | 138 +++++++++++++++++++++++----------------
dlls/dwrite/tests/font.c | 30 +++++++++
2 files changed, 112 insertions(+), 56 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index d9b22b15b4..306f431d65 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -177,15 +177,16 @@ struct dwrite_glyphrunanalysis {
UINT32 max_glyph_bitmap_size;
};
-struct dwrite_colorglyphenum {
- IDWriteColorGlyphRunEnumerator IDWriteColorGlyphRunEnumerator_iface;
- LONG ref;
+struct dwrite_colorglyphenum
+{
+ IDWriteColorGlyphRunEnumerator1 IDWriteColorGlyphRunEnumerator1_iface;
+ LONG refcount;
FLOAT origin_x; /* original run origin */
FLOAT origin_y;
IDWriteFontFace4 *fontface; /* for convenience */
- DWRITE_COLOR_GLYPH_RUN colorrun; /* returned with GetCurrentRun() */
+ DWRITE_COLOR_GLYPH_RUN1 colorrun; /* returned with GetCurrentRun() */
DWRITE_GLYPH_RUN run; /* base run */
UINT32 palette; /* palette index to get layer color from */
FLOAT *advances; /* original or measured advances for base glyphs */
@@ -309,9 +310,9 @@ static inline struct dwrite_glyphrunanalysis *impl_from_IDWriteGlyphRunAnalysis(
return CONTAINING_RECORD(iface, struct dwrite_glyphrunanalysis, IDWriteGlyphRunAnalysis_iface);
}
-static inline struct dwrite_colorglyphenum *impl_from_IDWriteColorGlyphRunEnumerator(IDWriteColorGlyphRunEnumerator *iface)
+static inline struct dwrite_colorglyphenum *impl_from_IDWriteColorGlyphRunEnumerator1(IDWriteColorGlyphRunEnumerator1 *iface)
{
- return CONTAINING_RECORD(iface, struct dwrite_colorglyphenum, IDWriteColorGlyphRunEnumerator_iface);
+ return CONTAINING_RECORD(iface, struct dwrite_colorglyphenum, IDWriteColorGlyphRunEnumerator1_iface);
}
static inline struct dwrite_fontlist *impl_from_IDWriteFontList2(IDWriteFontList2 *iface)
@@ -5623,18 +5624,17 @@ HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc *desc, IDWrit
return S_OK;
}
-/* IDWriteColorGlyphRunEnumerator */
-static HRESULT WINAPI colorglyphenum_QueryInterface(IDWriteColorGlyphRunEnumerator *iface, REFIID riid, void **ppv)
+/* IDWriteColorGlyphRunEnumerator1 */
+static HRESULT WINAPI colorglyphenum_QueryInterface(IDWriteColorGlyphRunEnumerator1 *iface, REFIID riid, void **ppv)
{
- struct dwrite_colorglyphenum *This = impl_from_IDWriteColorGlyphRunEnumerator(iface);
-
- TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
+ TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), ppv);
- if (IsEqualIID(riid, &IID_IDWriteColorGlyphRunEnumerator) ||
+ if (IsEqualIID(riid, &IID_IDWriteColorGlyphRunEnumerator1) ||
+ IsEqualIID(riid, &IID_IDWriteColorGlyphRunEnumerator) ||
IsEqualIID(riid, &IID_IUnknown))
{
*ppv = iface;
- IDWriteColorGlyphRunEnumerator_AddRef(iface);
+ IDWriteColorGlyphRunEnumerator1_AddRef(iface);
return S_OK;
}
@@ -5644,35 +5644,38 @@ static HRESULT WINAPI colorglyphenum_QueryInterface(IDWriteColorGlyphRunEnumerat
return E_NOINTERFACE;
}
-static ULONG WINAPI colorglyphenum_AddRef(IDWriteColorGlyphRunEnumerator *iface)
+static ULONG WINAPI colorglyphenum_AddRef(IDWriteColorGlyphRunEnumerator1 *iface)
{
- struct dwrite_colorglyphenum *This = impl_from_IDWriteColorGlyphRunEnumerator(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
- TRACE("(%p)->(%u)\n", This, ref);
- return ref;
+ struct dwrite_colorglyphenum *glyphenum = impl_from_IDWriteColorGlyphRunEnumerator1(iface);
+ ULONG refcount = InterlockedIncrement(&glyphenum->refcount);
+
+ TRACE("%p, refcount %u.\n", iface, refcount);
+
+ return refcount;
}
-static ULONG WINAPI colorglyphenum_Release(IDWriteColorGlyphRunEnumerator *iface)
+static ULONG WINAPI colorglyphenum_Release(IDWriteColorGlyphRunEnumerator1 *iface)
{
- struct dwrite_colorglyphenum *This = impl_from_IDWriteColorGlyphRunEnumerator(iface);
- ULONG ref = InterlockedDecrement(&This->ref);
+ struct dwrite_colorglyphenum *glyphenum = impl_from_IDWriteColorGlyphRunEnumerator1(iface);
+ ULONG refcount = InterlockedDecrement(&glyphenum->refcount);
- TRACE("(%p)->(%u)\n", This, ref);
+ TRACE("%p, refcount %u.\n", iface, refcount);
- if (!ref) {
- heap_free(This->advances);
- heap_free(This->color_advances);
- heap_free(This->offsets);
- heap_free(This->color_offsets);
- heap_free(This->glyphindices);
- heap_free(This->glyphs);
- if (This->colr.context)
- IDWriteFontFace4_ReleaseFontTable(This->fontface, This->colr.context);
- IDWriteFontFace4_Release(This->fontface);
- heap_free(This);
+ if (!refcount)
+ {
+ heap_free(glyphenum->advances);
+ heap_free(glyphenum->color_advances);
+ heap_free(glyphenum->offsets);
+ heap_free(glyphenum->color_offsets);
+ heap_free(glyphenum->glyphindices);
+ heap_free(glyphenum->glyphs);
+ if (glyphenum->colr.context)
+ IDWriteFontFace4_ReleaseFontTable(glyphenum->fontface, glyphenum->colr.context);
+ IDWriteFontFace4_Release(glyphenum->fontface);
+ heap_free(glyphenum);
}
- return ref;
+ return refcount;
}
static FLOAT get_glyph_origin(const struct dwrite_colorglyphenum *glyphenum, UINT32 g)
@@ -5690,7 +5693,7 @@ static FLOAT get_glyph_origin(const struct dwrite_colorglyphenum *glyphenum, UIN
static BOOL colorglyphenum_build_color_run(struct dwrite_colorglyphenum *glyphenum)
{
- DWRITE_COLOR_GLYPH_RUN *colorrun = &glyphenum->colorrun;
+ DWRITE_COLOR_GLYPH_RUN1 *colorrun = &glyphenum->colorrun;
FLOAT advance_adj = 0.0f;
BOOL got_palette_index;
UINT32 g;
@@ -5776,48 +5779,69 @@ static BOOL colorglyphenum_build_color_run(struct dwrite_colorglyphenum *glyphen
return colorrun->glyphRun.glyphCount > 0;
}
-static HRESULT WINAPI colorglyphenum_MoveNext(IDWriteColorGlyphRunEnumerator *iface, BOOL *has_run)
+static HRESULT WINAPI colorglyphenum_MoveNext(IDWriteColorGlyphRunEnumerator1 *iface, BOOL *has_run)
{
- struct dwrite_colorglyphenum *This = impl_from_IDWriteColorGlyphRunEnumerator(iface);
+ struct dwrite_colorglyphenum *glyphenum = impl_from_IDWriteColorGlyphRunEnumerator1(iface);
- TRACE("(%p)->(%p)\n", This, has_run);
+ TRACE("%p, %p.\n", iface, has_run);
*has_run = FALSE;
- This->colorrun.glyphRun.glyphCount = 0;
- while (This->current_layer < This->max_layer_num) {
- if (colorglyphenum_build_color_run(This))
+ glyphenum->colorrun.glyphRun.glyphCount = 0;
+ while (glyphenum->current_layer < glyphenum->max_layer_num)
+ {
+ if (colorglyphenum_build_color_run(glyphenum))
break;
else
- This->current_layer++;
+ glyphenum->current_layer++;
}
- *has_run = This->colorrun.glyphRun.glyphCount > 0;
+ *has_run = glyphenum->colorrun.glyphRun.glyphCount > 0;
return S_OK;
}
-static HRESULT WINAPI colorglyphenum_GetCurrentRun(IDWriteColorGlyphRunEnumerator *iface, DWRITE_COLOR_GLYPH_RUN const **run)
+static HRESULT colorglyphenum_get_current_run(const struct dwrite_colorglyphenum *glyphenum,
+ DWRITE_COLOR_GLYPH_RUN1 const **run)
{
- struct dwrite_colorglyphenum *This = impl_from_IDWriteColorGlyphRunEnumerator(iface);
-
- TRACE("(%p)->(%p)\n", This, run);
-
- if (This->colorrun.glyphRun.glyphCount == 0) {
+ if (glyphenum->colorrun.glyphRun.glyphCount == 0)
+ {
*run = NULL;
return E_NOT_VALID_STATE;
}
- *run = &This->colorrun;
+ *run = &glyphenum->colorrun;
return S_OK;
}
-static const IDWriteColorGlyphRunEnumeratorVtbl colorglyphenumvtbl = {
+static HRESULT WINAPI colorglyphenum_GetCurrentRun(IDWriteColorGlyphRunEnumerator1 *iface,
+ DWRITE_COLOR_GLYPH_RUN const **run)
+{
+ struct dwrite_colorglyphenum *glyphenum = impl_from_IDWriteColorGlyphRunEnumerator1(iface);
+
+ TRACE("%p, %p.\n", iface, run);
+
+ return colorglyphenum_get_current_run(glyphenum, (DWRITE_COLOR_GLYPH_RUN1 const **)run);
+}
+
+static HRESULT WINAPI colorglyphenum1_GetCurrentRun(IDWriteColorGlyphRunEnumerator1 *iface,
+ DWRITE_COLOR_GLYPH_RUN1 const **run)
+{
+ struct dwrite_colorglyphenum *glyphenum = impl_from_IDWriteColorGlyphRunEnumerator1(iface);
+
+ TRACE("%p, %p.\n", iface, run);
+
+ return colorglyphenum_get_current_run(glyphenum, run);
+}
+
+static const IDWriteColorGlyphRunEnumerator1Vtbl colorglyphenumvtbl =
+{
colorglyphenum_QueryInterface,
colorglyphenum_AddRef,
colorglyphenum_Release,
colorglyphenum_MoveNext,
- colorglyphenum_GetCurrentRun
+ colorglyphenum_GetCurrentRun,
+ colorglyphenum1_GetCurrentRun,
};
HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_RUN *run,
@@ -5842,8 +5866,8 @@ HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_R
if (!colorglyphenum)
return E_OUTOFMEMORY;
- colorglyphenum->IDWriteColorGlyphRunEnumerator_iface.lpVtbl = &colorglyphenumvtbl;
- colorglyphenum->ref = 1;
+ colorglyphenum->IDWriteColorGlyphRunEnumerator1_iface.lpVtbl = &colorglyphenumvtbl;
+ colorglyphenum->refcount = 1;
colorglyphenum->origin_x = originX;
colorglyphenum->origin_y = originY;
colorglyphenum->fontface = &fontface->IDWriteFontFace4_iface;
@@ -5876,7 +5900,7 @@ HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_R
/* It's acceptable to have a subset of glyphs mapped to color layers, for regular runs client
is supposed to proceed normally, like if font had no color info at all. */
if (!has_colored_glyph) {
- IDWriteColorGlyphRunEnumerator_Release(&colorglyphenum->IDWriteColorGlyphRunEnumerator_iface);
+ IDWriteColorGlyphRunEnumerator1_Release(&colorglyphenum->IDWriteColorGlyphRunEnumerator1_iface);
return DWRITE_E_NOCOLOR;
}
@@ -5895,6 +5919,8 @@ HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_R
colorglyphenum->colorrun.glyphRun.glyphAdvances = colorglyphenum->color_advances;
colorglyphenum->colorrun.glyphRun.glyphOffsets = colorglyphenum->color_offsets;
colorglyphenum->colorrun.glyphRunDescription = NULL; /* FIXME */
+ colorglyphenum->colorrun.measuringMode = measuring_mode;
+ colorglyphenum->colorrun.glyphImageFormat = DWRITE_GLYPH_IMAGE_FORMATS_NONE; /* FIXME */
if (run->glyphAdvances)
memcpy(colorglyphenum->advances, run->glyphAdvances, run->glyphCount * sizeof(FLOAT));
@@ -5905,7 +5931,7 @@ HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_R
run->fontEmSize, 1.0f, transform, run->glyphIndices[i], run->isSideways);
}
- *ret = &colorglyphenum->IDWriteColorGlyphRunEnumerator_iface;
+ *ret = (IDWriteColorGlyphRunEnumerator *)&colorglyphenum->IDWriteColorGlyphRunEnumerator1_iface;
return S_OK;
}
diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index c2f9dc0b1f..67947e3e1f 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -7350,7 +7350,9 @@ static void test_GetPaletteEntries(void)
static void test_TranslateColorGlyphRun(void)
{
+ IDWriteColorGlyphRunEnumerator1 *layers1;
IDWriteColorGlyphRunEnumerator *layers;
+ const DWRITE_COLOR_GLYPH_RUN1 *colorrun1;
const DWRITE_COLOR_GLYPH_RUN *colorrun;
IDWriteFontFace2 *fontface2;
IDWriteFontFace *fontface;
@@ -7416,6 +7418,13 @@ static void test_TranslateColorGlyphRun(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(layers != NULL, "got %p\n", layers);
+ hr = IDWriteColorGlyphRunEnumerator_QueryInterface(layers, &IID_IDWriteColorGlyphRunEnumerator1, (void **)&layers1);
+ if (FAILED(hr))
+ {
+ layers1 = NULL;
+ win_skip("IDWriteColorGlyphRunEnumerator1 is not supported.\n");
+ }
+
for (;;) {
hasrun = FALSE;
hr = IDWriteColorGlyphRunEnumerator_MoveNext(layers, &hasrun);
@@ -7431,13 +7440,34 @@ static void test_TranslateColorGlyphRun(void)
ok(colorrun->glyphRun.glyphCount > 0, "got wrong glyph count %u\n", colorrun->glyphRun.glyphCount);
ok(colorrun->glyphRun.glyphIndices != NULL, "got null glyph indices %p\n", colorrun->glyphRun.glyphIndices);
ok(colorrun->glyphRun.glyphAdvances != NULL, "got null glyph advances %p\n", colorrun->glyphRun.glyphAdvances);
+
+ if (layers1)
+ {
+ hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
+ ok(hr == S_OK, "Failed to get color runt, hr %#x.\n", hr);
+ ok(colorrun1->glyphRun.fontFace != NULL, "Unexpected fontface %p.\n", colorrun1->glyphRun.fontFace);
+ ok(colorrun1->glyphRun.fontEmSize == 20.0f, "Unexpected font size %f.\n", colorrun1->glyphRun.fontEmSize);
+ ok(colorrun1->glyphRun.glyphCount > 0, "Unexpected glyph count %u\n", colorrun1->glyphRun.glyphCount);
+ ok(colorrun1->glyphRun.glyphIndices != NULL, "Unexpected indices array.\n");
+ ok(colorrun1->glyphRun.glyphAdvances != NULL, "Unexpected advances array.\n");
+ ok(colorrun1->measuringMode == DWRITE_MEASURING_MODE_NATURAL, "Unexpected measuring mode %d.\n",
+ colorrun1->measuringMode);
+ }
}
/* iterated all way through */
hr = IDWriteColorGlyphRunEnumerator_GetCurrentRun(layers, &colorrun);
ok(hr == E_NOT_VALID_STATE, "got 0x%08x\n", hr);
+ if (layers1)
+ {
+ hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
+ ok(hr == E_NOT_VALID_STATE, "Unexpected hr %#x.\n", hr);
+ }
+
IDWriteColorGlyphRunEnumerator_Release(layers);
+ if (layers1)
+ IDWriteColorGlyphRunEnumerator1_Release(layers1);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (void**)&fontface2);
ok(hr == S_OK, "got 0x%08x\n", hr);
--
2.24.0
Nov. 29, 2019
Re: [PATCH vkd3d] vkd3d/shader: Print more info about skipped dxbc chunks.
by Henri Verbeet
On Wed, 27 Nov 2019 at 18:48, Conor McCarthy <cmccarthy(a)codeweavers.com> wrote:
> +#define TAG_ICFE MAKE_TAG('I', 'C', 'F', 'E')
> +#define TAG_RDEF MAKE_TAG('R', 'D', 'E', 'F')
> +#define TAG_SFI0 MAKE_TAG('S', 'F', 'I', '0')
> +#define TAG_SPDB MAKE_TAG('S', 'P', 'D', 'B')
> +#define TAG_STAT MAKE_TAG('S', 'T', 'A', 'T')
>
Where do these come from? Should that be "IFCE"?
> default:
> - TRACE("Skipping chunk %#x.\n", tag);
> + memcpy(tag_chars, &tag, sizeof(tag));
> + tag_chars[sizeof(tag)] = 0;
> + TRACE("Skipping chunk %s.\n", tag_chars);
> break;
That's not safe, "tag" can contain arbitrary data.
Nov. 29, 2019
Re: [PATCH] d3d9/tests: Fix a typo in a field name of the visual test.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Nov. 29, 2019
Re: [PATCH v2 1/6] ddraw: Track some more render states in the primary stateblock.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Nov. 29, 2019
Re: [PATCH v2 2/6] wined3d: Introduce wined3d_stateblock_get_state().
by Henri Verbeet
On Thu, 28 Nov 2019 at 09:24, Zebediah Figura <z.figura12(a)gmail.com> wrote:
> +#define LIGHTMAP_SIZE 43
> +#define LIGHTMAP_HASHFUNC(x) ((x) % LIGHTMAP_SIZE)
Although wined3d is an internal Wine interface, it still seems
unfortunate to expose this particular implementation detail in the
public wined3d interface.
Nov. 29, 2019
[PATCH] ntoskrnl.exe: Remove a superfluous condition.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/ntoskrnl.exe/sync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
index 365ddc069f..647d427ee5 100644
--- a/dlls/ntoskrnl.exe/sync.c
+++ b/dlls/ntoskrnl.exe/sync.c
@@ -1251,7 +1251,7 @@ void WINAPI IoReleaseRemoveLockAndWaitEx( IO_REMOVE_LOCK *lock, void *tag, ULONG
lock->Common.Removed = TRUE;
- if (!(count = InterlockedDecrement( &lock->Common.IoCount )) && lock->Common.Removed)
+ if (!(count = InterlockedDecrement( &lock->Common.IoCount )))
KeSetEvent( &lock->Common.RemoveEvent, IO_NO_INCREMENT, FALSE );
else if (count < 0)
ERR("Lock %p is not acquired!\n", lock);
--
2.24.0
Nov. 29, 2019
Re: [PATCH] kernelbase: Implement GetOverlappedResultEx().
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=61069
Your paranoid android.
=== w1064v1809_ja (32 bit report) ===
kernel32:
pipe.c:2856: Test failed: FlushFileBuffers failed: 87
=== debian10 (32 bit report) ===
kernel32:
comm.c:918: Test failed: OutQueue should not be empty
=== debian10 (32 bit Chinese:China report) ===
kernel32:
debugger: Timeout
Nov. 29, 2019
[PATCH] dmband: Stop corruption of output string
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/dmband/dmutils.c | 2 +-
dlls/dmcompos/dmcompos_main.c | 2 +-
dlls/dmloader/debug.c | 4 ++--
dlls/dmscript/dmscript_main.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c
index c76bde1146..5d38d06d1d 100644
--- a/dlls/dmband/dmutils.c
+++ b/dlls/dmband/dmutils.c
@@ -141,7 +141,7 @@ static const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p\n", pDesc->pStream);
- return wine_dbg_sprintf("%s", buffer);
+ return wine_dbg_printf("%s", buffer);
} else {
return "(NULL)";
}
diff --git a/dlls/dmcompos/dmcompos_main.c b/dlls/dmcompos/dmcompos_main.c
index 21e896cc3e..1580e215bb 100644
--- a/dlls/dmcompos/dmcompos_main.c
+++ b/dlls/dmcompos/dmcompos_main.c
@@ -472,7 +472,7 @@ const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", pDesc->pStream);
- return wine_dbg_sprintf("%s", buffer);
+ return wine_dbg_printf("%s", buffer);
} else {
return wine_dbg_sprintf("(NULL)");
}
diff --git a/dlls/dmloader/debug.c b/dlls/dmloader/debug.c
index 30b23c2ade..af76404b57 100644
--- a/dlls/dmloader/debug.c
+++ b/dlls/dmloader/debug.c
@@ -503,7 +503,7 @@ const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeade
ptr += sprintf(ptr, "DMUS_IO_CONTAINER_HEADER (%p):", pHeader);
ptr += sprintf(ptr, "\n - dwFlags = %s", debugstr_DMUS_CONTAINER_FLAGS(pHeader->dwFlags));
- return wine_dbg_sprintf("%s", buffer);
+ return wine_dbg_printf("%s", buffer);
} else {
return wine_dbg_sprintf("(NULL)");
}
@@ -519,7 +519,7 @@ const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT
ptr += sprintf(ptr, "\n - ckid = %s", debugstr_fourcc (pHeader->ckid));
ptr += sprintf(ptr, "\n - fccType = %s", debugstr_fourcc (pHeader->fccType));
- return wine_dbg_sprintf("%s", buffer);
+ return wine_dbg_printf("%s", buffer);
} else {
return wine_dbg_sprintf("(NULL)");
}
diff --git a/dlls/dmscript/dmscript_main.c b/dlls/dmscript/dmscript_main.c
index 7a96679302..4055ea6a93 100644
--- a/dlls/dmscript/dmscript_main.c
+++ b/dlls/dmscript/dmscript_main.c
@@ -502,7 +502,7 @@ const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", pDesc->pStream);
- return wine_dbg_sprintf("%s", buffer);
+ return wine_dbg_printf("%s", buffer);
} else {
return wine_dbg_sprintf("(NULL)");
}
--
2.17.1
Nov. 29, 2019
[PATCH] kernelbase: Implement GetOverlappedResultEx().
by Zebediah Figura
Mentioned in https://bugs.winehq.org/show_bug.cgi?id=38830.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/kernel32/kernel32.spec | 1 +
dlls/kernel32/tests/pipe.c | 54 +++++++++++++++++++++++++++++++++
dlls/kernelbase/file.c | 23 ++++++++++++--
dlls/kernelbase/kernelbase.spec | 2 +-
include/winbase.h | 1 +
5 files changed, 77 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 82e10850a8..172be2a6e2 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -760,6 +760,7 @@
@ stdcall GetNumberOfConsoleMouseButtons(ptr)
@ stdcall -import GetOEMCP()
@ stdcall -import GetOverlappedResult(long ptr ptr long)
+@ stdcall -import GetOverlappedResultEx(long ptr ptr long long)
@ stdcall GetUserPreferredUILanguages(long ptr ptr ptr)
@ stdcall GetPackageFullName(long ptr ptr)
@ stdcall -import GetPhysicallyInstalledSystemMemory(ptr)
diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c
index d8d5726f1a..20f3450c6d 100644
--- a/dlls/kernel32/tests/pipe.c
+++ b/dlls/kernel32/tests/pipe.c
@@ -42,6 +42,7 @@ static BOOL (WINAPI *pGetNamedPipeClientProcessId)(HANDLE,ULONG*);
static BOOL (WINAPI *pGetNamedPipeServerProcessId)(HANDLE,ULONG*);
static BOOL (WINAPI *pGetNamedPipeClientSessionId)(HANDLE,ULONG*);
static BOOL (WINAPI *pGetNamedPipeServerSessionId)(HANDLE,ULONG*);
+static BOOL (WINAPI *pGetOverlappedResultEx)(HANDLE,OVERLAPPED *,DWORD *,DWORD,BOOL);
static BOOL user_apc_ran;
static void CALLBACK user_apc(ULONG_PTR param)
@@ -4065,6 +4066,57 @@ static void test_nowait(DWORD pipe_type)
ok(CloseHandle(pipewrite), "CloseHandle for the write pipe failed\n");
}
+static void test_GetOverlappedResultEx(void)
+{
+ HANDLE client, server;
+ OVERLAPPED ovl;
+ char buffer[8000];
+ DWORD ret_size;
+ BOOL ret;
+
+ if (!pGetOverlappedResultEx)
+ {
+ win_skip("GetOverlappedResultEx() is not available\n");
+ return;
+ }
+
+ create_overlapped_pipe(PIPE_TYPE_BYTE, &client, &server);
+
+ overlapped_write_async(client, buffer, sizeof(buffer), &ovl);
+
+ user_apc_ran = FALSE;
+ QueueUserAPC(user_apc, GetCurrentThread(), 0);
+
+ SetLastError(0xdeadbeef);
+ ret = pGetOverlappedResultEx(client, &ovl, &ret_size, 0, FALSE);
+ ok(!ret, "expected failure\n");
+ ok(GetLastError() == ERROR_IO_INCOMPLETE, "wrong error %u\n", GetLastError());
+ ok(!user_apc_ran, "APC should not have run\n");
+
+ SetLastError(0xdeadbeef);
+ ret = pGetOverlappedResultEx(client, &ovl, &ret_size, 0, TRUE);
+ ok(!ret, "expected failure\n");
+ ok(GetLastError() == ERROR_IO_INCOMPLETE, "wrong error %u\n", GetLastError());
+ ok(!user_apc_ran, "APC should not have run\n");
+
+ SetLastError(0xdeadbeef);
+ ret = pGetOverlappedResultEx(client, &ovl, &ret_size, 10, FALSE);
+ ok(!ret, "expected failure\n");
+ ok(GetLastError() == WAIT_TIMEOUT, "wrong error %u\n", GetLastError());
+ ok(!user_apc_ran, "APC should not have run\n");
+
+ SetLastError(0xdeadbeef);
+ ret = pGetOverlappedResultEx(client, &ovl, &ret_size, 10, TRUE);
+ ok(!ret, "expected failure\n");
+ ok(GetLastError() == WAIT_IO_COMPLETION, "wrong error %u\n", GetLastError());
+ ok(user_apc_ran, "APC should have run\n");
+
+ CloseHandle(ovl.hEvent);
+
+ CloseHandle(client);
+ CloseHandle(server);
+}
+
START_TEST(pipe)
{
char **argv;
@@ -4080,6 +4132,7 @@ START_TEST(pipe)
pGetNamedPipeServerProcessId = (void *) GetProcAddress(hmod, "GetNamedPipeServerProcessId");
pGetNamedPipeClientSessionId = (void *) GetProcAddress(hmod, "GetNamedPipeClientSessionId");
pGetNamedPipeServerSessionId = (void *) GetProcAddress(hmod, "GetNamedPipeServerSessionId");
+ pGetOverlappedResultEx = (void *)GetProcAddress(hmod, "GetOverlappedResultEx");
argc = winetest_get_mainargs(&argv);
@@ -4134,4 +4187,5 @@ START_TEST(pipe)
test_wait_pipe();
test_nowait(PIPE_TYPE_BYTE);
test_nowait(PIPE_TYPE_MESSAGE);
+ test_GetOverlappedResultEx();
}
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index aa2ebfcc69..8e601c7cb2 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -2002,21 +2002,38 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetFileType( HANDLE file )
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetOverlappedResult( HANDLE file, LPOVERLAPPED overlapped,
LPDWORD result, BOOL wait )
+{
+ return GetOverlappedResultEx( file, overlapped, result, wait ? INFINITE : 0, FALSE );
+}
+
+
+/***********************************************************************
+ * GetOverlappedResultEx (kernelbase.@)
+ */
+BOOL WINAPI DECLSPEC_HOTPATCH GetOverlappedResultEx( HANDLE file, OVERLAPPED *overlapped,
+ DWORD *result, DWORD timeout, BOOL alertable )
{
NTSTATUS status;
+ DWORD ret;
- TRACE( "(%p %p %p %x)\n", file, overlapped, result, wait );
+ TRACE( "(%p %p %p %u %d)\n", file, overlapped, result, timeout, alertable );
status = overlapped->Internal;
if (status == STATUS_PENDING)
{
- if (!wait)
+ if (!timeout)
{
SetLastError( ERROR_IO_INCOMPLETE );
return FALSE;
}
- if (WaitForSingleObject( overlapped->hEvent ? overlapped->hEvent : file, INFINITE ) == WAIT_FAILED)
+ ret = WaitForSingleObjectEx( overlapped->hEvent ? overlapped->hEvent : file, timeout, alertable );
+ if (ret == WAIT_FAILED)
return FALSE;
+ else if (ret)
+ {
+ SetLastError(ret);
+ return FALSE;
+ }
status = overlapped->Internal;
if (status == STATUS_PENDING) status = STATUS_SUCCESS;
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
index 14ee402089..ed5d1f73f8 100644
--- a/dlls/kernelbase/kernelbase.spec
+++ b/dlls/kernelbase/kernelbase.spec
@@ -584,7 +584,7 @@
# @ stub GetOsManufacturingMode
# @ stub GetOsSafeBootMode
@ stdcall GetOverlappedResult(long ptr ptr long)
-# @ stub GetOverlappedResultEx
+@ stdcall GetOverlappedResultEx(long ptr ptr long long)
# @ stub GetPackageApplicationContext
# @ stub GetPackageApplicationIds
# @ stub GetPackageApplicationProperty
diff --git a/include/winbase.h b/include/winbase.h
index 8b30c5a69a..2d01dcb606 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -2215,6 +2215,7 @@ WINBASEAPI BOOL WINAPI GetNumaProximityNodeEx(ULONG,PUSHORT);
WINADVAPI BOOL WINAPI GetNumberOfEventLogRecords(HANDLE,PDWORD);
WINADVAPI BOOL WINAPI GetOldestEventLogRecord(HANDLE,PDWORD);
WINBASEAPI BOOL WINAPI GetOverlappedResult(HANDLE,LPOVERLAPPED,LPDWORD,BOOL);
+WINBASEAPI BOOL WINAPI GetOverlappedResultEx(HANDLE,OVERLAPPED*,DWORD*,DWORD,BOOL);
WINBASEAPI DWORD WINAPI GetPriorityClass(HANDLE);
WINADVAPI BOOL WINAPI GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD);
WINBASEAPI UINT WINAPI GetPrivateProfileIntA(LPCSTR,LPCSTR,INT,LPCSTR);
--
2.24.0
Nov. 29, 2019
[PATCH 4/4] strmbase: Swap the lock order in IPin::EndFlush().
by Zebediah Figura
This more closely resembles the threading model prescribed by the DirectX SDK
documentation. In particular, the page "Flushing Data" recommends that
IPin::BeginFlush() do the following steps in order:
1. take the filter lock
2. signal the streaming thread to complete
3. take the streaming lock, if necessary
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/strmbase/renderer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c
index 0ef9c5b225..cacbb90e59 100644
--- a/dlls/strmbase/renderer.c
+++ b/dlls/strmbase/renderer.c
@@ -133,8 +133,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface)
TRACE("iface %p.\n", iface);
- EnterCriticalSection(&pFilter->csRenderLock);
EnterCriticalSection(&pFilter->filter.csFilter);
+ EnterCriticalSection(&pFilter->csRenderLock);
pFilter->eos = FALSE;
hr = BaseInputPinImpl_EndFlush(iface);
if (SUCCEEDED(hr))
@@ -146,8 +146,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface)
if (pFilter->pFuncsTable->pfnEndFlush)
hr = pFilter->pFuncsTable->pfnEndFlush(pFilter);
}
- LeaveCriticalSection(&pFilter->filter.csFilter);
LeaveCriticalSection(&pFilter->csRenderLock);
+ LeaveCriticalSection(&pFilter->filter.csFilter);
return hr;
}
--
2.24.0
Nov. 28, 2019