Windows 10 1507 still deleted it but 1607 no longer does.
Signed-off-by: Francois Gouget fgouget@free.fr ---
Even calling GetObjectType() after calling DeleteMetaFile() still returns OBJ_METADC so I don't know when Windows actually destroys the metafile hdc. Maybe it does destroy it but GetObjectType() does not notice until the corresponding memory area is reused for something else?
From time to time there is a run with only two failures which I
think gives credit to the above theory: https://test.winehq.org/data/aa3d01e65019fb2f135f74cf26cfa1661ca09325/index_...
In any case this behavior seems broken so I'm marking it as such in the test.
dlls/gdi32/tests/metafile.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index f1978f7bdfd..6adafa37b82 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -2082,7 +2082,9 @@ static void test_mf_Blank(void) ok(hMetafile != 0, "CloseMetaFile error %d\n", GetLastError()); type = GetObjectType(hMetafile); ok(type == OBJ_METAFILE, "CloseMetaFile created object with type %d\n", type); - ok(!GetObjectType(hdcMetafile), "CloseMetaFile has to destroy metafile hdc\n"); + type = GetObjectType(hdcMetafile); + ok(type == 0 || broken(type == OBJ_METADC) /* win10 >=1607 */, + "CloseMetaFile has to destroy metafile hdc (%d)\n", type);
if (compare_mf_bits (hMetafile, MF_BLANK_BITS, sizeof(MF_BLANK_BITS), "mf_blank") != 0) @@ -2249,6 +2251,7 @@ static void test_mf_Graphics(void) HDC hdcMetafile; HMETAFILE hMetafile; POINT oldpoint; + INT type; BOOL ret;
hdcMetafile = CreateMetaFileA(NULL); @@ -2275,7 +2278,9 @@ static void test_mf_Graphics(void)
hMetafile = CloseMetaFile(hdcMetafile); ok(hMetafile != 0, "CloseMetaFile error %d\n", GetLastError()); - ok(!GetObjectType(hdcMetafile), "CloseMetaFile has to destroy metafile hdc\n"); + type = GetObjectType(hdcMetafile); + ok(type == 0 || broken(type == OBJ_METADC) /* win10 >=1607 */, + "CloseMetaFile has to destroy metafile hdc (%d)\n", type);
if (compare_mf_bits (hMetafile, MF_GRAPHICS_BITS, sizeof(MF_GRAPHICS_BITS), "mf_Graphics") != 0) @@ -2296,6 +2301,7 @@ static void test_mf_PatternBrush(void) LOGBRUSH *orig_lb; HBRUSH hBrush; BOOL ret; + INT type;
orig_lb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LOGBRUSH));
@@ -2316,7 +2322,9 @@ static void test_mf_PatternBrush(void)
hMetafile = CloseMetaFile(hdcMetafile); ok(hMetafile != 0, "CloseMetaFile error %d\n", GetLastError()); - ok(!GetObjectType(hdcMetafile), "CloseMetaFile has to destroy metafile hdc\n"); + type = GetObjectType(hdcMetafile); + ok(type == 0 || broken(type == OBJ_METADC) /* win10 >=1607 */, + "CloseMetaFile has to destroy metafile hdc (%d)\n", type);
if (compare_mf_bits (hMetafile, MF_PATTERN_BRUSH_BITS, sizeof(MF_PATTERN_BRUSH_BITS), "mf_Pattern_Brush") != 0)
On Thu, Nov 21, 2019 at 04:08:46PM +0100, Francois Gouget wrote:
Windows 10 1507 still deleted it but 1607 no longer does.
Signed-off-by: Francois Gouget fgouget@free.fr
Even calling GetObjectType() after calling DeleteMetaFile() still returns OBJ_METADC so I don't know when Windows actually destroys the metafile hdc. Maybe it does destroy it but GetObjectType() does not notice until the corresponding memory area is reused for something else?
From time to time there is a run with only two failures which I think gives credit to the above theory: https://test.winehq.org/data/aa3d01e65019fb2f135f74cf26cfa1661ca09325/index_...
In any case this behavior seems broken so I'm marking it as such in the test.
How about using something similar to: 9cffe80fdc gdi32/tests: Fix a test failure on Win10 1809. ?
Huw.
On Mon, 25 Nov 2019, Huw Davies wrote:
On Thu, Nov 21, 2019 at 04:08:46PM +0100, Francois Gouget wrote:
Windows 10 1507 still deleted it but 1607 no longer does.
Signed-off-by: Francois Gouget fgouget@free.fr
Even calling GetObjectType() after calling DeleteMetaFile() still returns OBJ_METADC so I don't know when Windows actually destroys the metafile hdc. Maybe it does destroy it but GetObjectType() does not notice until the corresponding memory area is reused for something else?
From time to time there is a run with only two failures which I think gives credit to the above theory: https://test.winehq.org/data/aa3d01e65019fb2f135f74cf26cfa1661ca09325/index_...
In any case this behavior seems broken so I'm marking it as such in the test.
How about using something similar to: 9cffe80fdc gdi32/tests: Fix a test failure on Win10 1809. ?
GetDeviceCaps() still returns DT_METAFILE after CloseMetaFile(). What's worse is it does that even on Windows 2003 which probably means most Windows versions.
https://testbot.winehq.org/JobDetails.pl?Key=60980&f201=exe32.report
On Wed, Nov 27, 2019 at 10:35:36PM +0100, Francois Gouget wrote:
On Mon, 25 Nov 2019, Huw Davies wrote:
On Thu, Nov 21, 2019 at 04:08:46PM +0100, Francois Gouget wrote:
Windows 10 1507 still deleted it but 1607 no longer does.
Signed-off-by: Francois Gouget fgouget@free.fr
Even calling GetObjectType() after calling DeleteMetaFile() still returns OBJ_METADC so I don't know when Windows actually destroys the metafile hdc. Maybe it does destroy it but GetObjectType() does not notice until the corresponding memory area is reused for something else?
From time to time there is a run with only two failures which I think gives credit to the above theory: https://test.winehq.org/data/aa3d01e65019fb2f135f74cf26cfa1661ca09325/index_...
In any case this behavior seems broken so I'm marking it as such in the test.
How about using something similar to: 9cffe80fdc gdi32/tests: Fix a test failure on Win10 1809. ?
GetDeviceCaps() still returns DT_METAFILE after CloseMetaFile(). What's worse is it does that even on Windows 2003 which probably means most Windows versions.
https://testbot.winehq.org/JobDetails.pl?Key=60980&f201=exe32.report
Ok, let's go with the original patch then. Another alternative would be to remove the failing tests.
Huw.