Recent win10 (1709 or older) added checks for WER_REPORT_TYPE and reject invalid values WerReportCreate always succeeded in older dll versions.
Example failures (full report with 90 failures after upgrading from win7 to win10) http://test.winehq.org/queue/errksCfJ/report
cw1 (1709): http://test.winehq.org/data/829170f3d6b875f7a6f065072cc3334a20ff805e/win10_c...
Patch was tested: https://testbot.winehq.org/JobDetails.pl?Key=49979
-- ... bye bye Detlef
Signed-off-by: Detlef Riekenberg wine.dev@web.de --- dlls/wer/main.c | 2 +- dlls/wer/tests/main.c | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/dlls/wer/main.c b/dlls/wer/main.c index 75a22a51d0..e4bda46b7d 100644 --- a/dlls/wer/main.c +++ b/dlls/wer/main.c @@ -278,7 +278,7 @@ HRESULT WINAPI WerReportCreate(PCWSTR eventtype, WER_REPORT_TYPE reporttype, PWE }
if (phandle) *phandle = NULL; - if (!eventtype || !eventtype[0] || !phandle) { + if (!eventtype || !eventtype[0] || !phandle || (reporttype >= WerReportInvalid)) { return E_INVALIDARG; }
diff --git a/dlls/wer/tests/main.c b/dlls/wer/tests/main.c index 11a02fb18e..8be1e8721c 100644 --- a/dlls/wer/tests/main.c +++ b/dlls/wer/tests/main.c @@ -1,7 +1,7 @@ /* * Unit test suite for windows error reporting in Vista and above * - * Copyright 2010 Detlef Riekenberg + * Copyright 2010,2019 Detlef Riekenberg * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -207,8 +207,8 @@ static void test_WerReportCreate(void) hr = WerReportCreate(empty, WerReportCritical, NULL, &report); ok(hr == E_INVALIDARG, "got 0x%x and %p(expected E_INVALIDARG)\n", hr, report);
- /* WER_REPORT_TYPE is not checked during WerReportCreate */ - for (i = 0; i <= WerReportInvalid + 1; i++) { + /* a valid WER_REPORT_TYPE works */ + for (i = 0; i < WerReportInvalid; i++) { report = (void *) 0xdeadbeef; hr = WerReportCreate(appcrash, i, NULL, &report); ok(hr == S_OK, "%d: got 0x%x and %p (expected S_OK)\n", i, hr, report); @@ -217,9 +217,26 @@ static void test_WerReportCreate(void) ok(hr == S_OK, "%d: got 0x%x for %p (expected S_OK)\n", i, hr, report);
} + + /* values for WER_REPORT_TYPE are checked and invalid values are rejected since recent win10, + but older windows versions did not check the report type and WerReportCreate always succeeded */ + + report = (void *) 0xdeadbeef; + hr = WerReportCreate(appcrash, WerReportInvalid, NULL, &report); + ok((hr == E_INVALIDARG) | broken(hr == S_OK), + "%d: got 0x%x and %p (expected E_INVALIDARG or a broken S_OK)\n", i, hr, report); + if (hr == S_OK) { + hr = WerReportCloseHandle(report); + ok(hr == S_OK, "%d: got 0x%x for %p (expected S_OK)\n", i, hr, report); + } + report = (void *) 0xdeadbeef; hr = WerReportCreate(appcrash, 42, NULL, &report); ok(hr == S_OK, "42: got 0x%x and %p (expected S_OK)\n", hr, report); + if (hr == S_OK) { + hr = WerReportCloseHandle(report); + ok(hr == S_OK, "%d: got 0x%x for %p (expected S_OK)\n", i, hr, report); + }
/* multiple active reports are possible */ memset(table, 0, sizeof(table)); -- 2.21.0.windows.1
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=50019
Your paranoid android.
=== w2008s64 (task log) ===
Task errors: Unable to set the VM system time: network read timed out (settime/connect:AgentVersion.h:0/9). Maybe the TestAgentd process is missing the required privileges.
=== debian9 (32 bit report) ===
wer: main.c:235: Test failed: 42: got 0x80070057 and (nil) (expected S_OK)
=== debian9 (32 bit French report) ===
wer: main.c:235: Test failed: 42: got 0x80070057 and (nil) (expected S_OK)
=== debian9 (32 bit Japanese:Japan report) ===
wer: main.c:235: Test failed: 42: got 0x80070057 and (nil) (expected S_OK)
=== debian9 (32 bit Chinese:China report) ===
wer: main.c:235: Test failed: 42: got 0x80070057 and (nil) (expected S_OK)
=== debian9 (32 bit WoW report) ===
wer: main.c:235: Test failed: 42: got 0x80070057 and (nil) (expected S_OK)
=== debian9 (64 bit WoW report) ===
wer: main.c:235: Test failed: 42: got 0x80070057 and (nil) (expected S_OK)