ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2026
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
List overview
Download
Ros-diffs
December 2019
----- 2026 -----
March 2026
February 2026
January 2026
----- 2025 -----
December 2025
November 2025
October 2025
September 2025
August 2025
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
18 participants
225 discussions
Start a n
N
ew thread
[reactos] 01/01: [ROSTESTS] Skip some flaky test / do not count successes
by Timo Kreuzer
04 Dec '19
04 Dec '19
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e26c8bc66f9bf2bb053d0…
commit e26c8bc66f9bf2bb053d0aa56a771c99c8accb52 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Sep 15 15:07:32 2019 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Wed Dec 4 01:24:49 2019 +0100 [ROSTESTS] Skip some flaky test / do not count successes --- modules/rostests/apitests/kernel32/TunnelCache.c | 1 + .../apitests/ntdll/NtQueryInformationProcess.c | 4 ++ modules/rostests/apitests/user32/RedrawWindow.c | 1 + modules/rostests/apitests/user32/SetProp.c | 1 + modules/rostests/winetests/gdi32/bitmap.c | 8 +-- modules/rostests/winetests/gdi32/path.c | 3 ++ modules/rostests/winetests/kernel32/mailslot.c | 1 + modules/rostests/winetests/kernel32/pipe.c | 3 ++ modules/rostests/winetests/kernel32/process.c | 4 +- modules/rostests/winetests/kernel32/sync.c | 4 ++ modules/rostests/winetests/mshtml/xmlhttprequest.c | 3 ++ modules/rostests/winetests/msi/msi.c | 12 ++++- modules/rostests/winetests/msxml3/domdoc.c | 2 +- modules/rostests/winetests/ntdll/exception.c | 1 + modules/rostests/winetests/ntdll/info.c | 12 +++-- modules/rostests/winetests/ntdll/process.c | 2 + modules/rostests/winetests/ole32/compobj.c | 1 + modules/rostests/winetests/qmgr/job.c | 3 ++ modules/rostests/winetests/quartz/filtermapper.c | 1 + modules/rostests/winetests/quartz/referenceclock.c | 1 + modules/rostests/winetests/riched20/editor.c | 1 + modules/rostests/winetests/rpcrt4/server.c | 5 ++ modules/rostests/winetests/user32/listbox.c | 1 + modules/rostests/winetests/user32/msg.c | 2 + modules/rostests/winetests/user32/win.c | 8 +++ modules/rostests/winetests/usp10/usp10.c | 2 + modules/rostests/winetests/wininet/ftp.c | 6 +++ modules/rostests/winetests/wininet/http.c | 10 ++++ sdk/include/reactos/wine/test.h | 62 +++++++++++++++++++++- 29 files changed, 152 insertions(+), 13 deletions(-) diff --git a/modules/rostests/apitests/kernel32/TunnelCache.c b/modules/rostests/apitests/kernel32/TunnelCache.c index 9e67e74404d..8081da4a496 100644 --- a/modules/rostests/apitests/kernel32/TunnelCache.c +++ b/modules/rostests/apitests/kernel32/TunnelCache.c @@ -176,6 +176,7 @@ Test_LongTests(void) ok(GetFileTime(hFile, &File1Time, NULL, NULL) != FALSE, "GetFileTime() failed\n"); CloseHandle(hFile); + ros_skip_flaky ok(RtlCompareMemory(&FileTime, &File1Time, sizeof(FILETIME)) == sizeof(FILETIME), "Tunnel cache failed\n"); DeleteFile("file2"); diff --git a/modules/rostests/apitests/ntdll/NtQueryInformationProcess.c b/modules/rostests/apitests/ntdll/NtQueryInformationProcess.c index ec6c56d170a..bdbfc3f726a 100644 --- a/modules/rostests/apitests/ntdll/NtQueryInformationProcess.c +++ b/modules/rostests/apitests/ntdll/NtQueryInformationProcess.c @@ -119,6 +119,7 @@ Test_ProcessTimes(void) sizeof(KERNEL_USER_TIMES), NULL); ok_hex(Status, STATUS_SUCCESS); + ros_skip_flaky ok(Times1.CreateTime.QuadPart < TestStartTime.QuadPart, "CreateTime is %I64u, expected < %I64u\n", Times1.CreateTime.QuadPart, TestStartTime.QuadPart); ok(Times1.CreateTime.QuadPart > TestStartTime.QuadPart - 100000000LL, @@ -126,6 +127,7 @@ Test_ProcessTimes(void) ok(Times1.ExitTime.QuadPart == 0, "ExitTime is %I64u, expected 0\n", Times1.ExitTime.QuadPart); ok(Times1.KernelTime.QuadPart != 0, "KernelTime is 0\n"); + ros_skip_flaky ok(Times1.UserTime.QuadPart != 0, "UserTime is 0\n"); /* Do some busy waiting to increase UserTime */ @@ -162,9 +164,11 @@ Test_ProcessTimes(void) /* Time values must have increased */ ok(Times2.KernelTime.QuadPart > Times1.KernelTime.QuadPart, "KernelTime values inconsistent. Expected %I64u > %I64u\n", Times2.KernelTime.QuadPart, Times1.KernelTime.QuadPart); + ros_skip_flaky ok(Times2.UserTime.QuadPart > Times1.UserTime.QuadPart, "UserTime values inconsistent. Expected %I64u > %I64u\n", Times2.UserTime.QuadPart, Times1.UserTime.QuadPart); /* They can't have increased by more than wall clock time difference (we only have one thread) */ + ros_skip_flaky ok(Times2.KernelTime.QuadPart - Times1.KernelTime.QuadPart < Time2.QuadPart - Time1.QuadPart, "KernelTime values inconsistent. Expected %I64u - %I64u < %I64u\n", Times2.KernelTime.QuadPart, Times1.KernelTime.QuadPart, Time2.QuadPart - Time1.QuadPart); diff --git a/modules/rostests/apitests/user32/RedrawWindow.c b/modules/rostests/apitests/user32/RedrawWindow.c index 8cd2b38e6fb..50ed0ea19e8 100644 --- a/modules/rostests/apitests/user32/RedrawWindow.c +++ b/modules/rostests/apitests/user32/RedrawWindow.c @@ -19,6 +19,7 @@ WndProc( _In_ WPARAM wParam, _In_ LPARAM lParam) { + disable_success_count ok(GetCurrentThreadId() == dwThreadId, "Thread 0x%lx instead of 0x%lx\n", GetCurrentThreadId(), dwThreadId); if (message == WM_PAINT) { diff --git a/modules/rostests/apitests/user32/SetProp.c b/modules/rostests/apitests/user32/SetProp.c index 3d656fd9936..838dc5e78cf 100644 --- a/modules/rostests/apitests/user32/SetProp.c +++ b/modules/rostests/apitests/user32/SetProp.c @@ -158,6 +158,7 @@ START_TEST(SetProp) /* In particular we shouldn't see these from WM_SETICON */ SysICAtom = RegisterWindowMessageW(L"SysIC"); Prop = GetPropW(hWnd, (PCWSTR)MAKEINTATOM(SysICAtom)); + ros_skip_flaky ok(Prop == NULL, "SysIC prop (0x%04x) is %p\n", SysICAtom, Prop); SysICSAtom = RegisterWindowMessageW(L"SysICS"); diff --git a/modules/rostests/winetests/gdi32/bitmap.c b/modules/rostests/winetests/gdi32/bitmap.c index 2409bd3f898..88c827c5657 100644 --- a/modules/rostests/winetests/gdi32/bitmap.c +++ b/modules/rostests/winetests/gdi32/bitmap.c @@ -5586,8 +5586,8 @@ static void test_SetDIBitsToDevice_RLE8(void) for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); for (i = 24; i < 64; i++) if (i == 52) ok( dib_bits[i] == 0x00808080, "%d: got %08x\n", i, dib_bits[i] ); - else if (i & 4) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - else ok( dib_bits[i] == bottom_up[i - 20], "%d: got %08x\n", i, dib_bits[i] ); + else if (i & 4) ros_skip_flaky ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + else ros_skip_flaky ok(dib_bits[i] == bottom_up[i - 20], "%d: got %08x\n", i, dib_bits[i]); memset( dib_bits, 0xaa, 64 * 4 ); /* top-down compressed dibs are invalid */ @@ -5653,8 +5653,8 @@ static void test_SetDIBitsToDevice_RLE8(void) ok( ret == 37, "got %d\n", ret ); for (i = 0; i < 40; i++) if (i == 12) ok( dib_bits[i] == 0x00808080, "%d: got %08x\n", i, dib_bits[i] ); - else if (i & 4) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - else ok( dib_bits[i] == top_down[i + 28], "%d: got %08x\n", i, dib_bits[i] ); + else if (i & 4) ros_skip_flaky ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + else ros_skip_flaky ok( dib_bits[i] == top_down[i + 28], "%d: got %08x\n", i, dib_bits[i] ); for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 ); diff --git a/modules/rostests/winetests/gdi32/path.c b/modules/rostests/winetests/gdi32/path.c index 48ef4f016a1..abceadd0c1c 100644 --- a/modules/rostests/winetests/gdi32/path.c +++ b/modules/rostests/winetests/gdi32/path.c @@ -420,6 +420,7 @@ static void ok_path(HDC hdc, const char *path_name, const path_test_t *expected, size = GetPath(hdc, pnt, types, size); assert(size > 0); + ros_skip_flaky ok( size == expected_size, "%s: Path size %d does not match expected size %d\n", path_name, size, expected_size); @@ -429,11 +430,13 @@ static void ok_path(HDC hdc, const char *path_name, const path_test_t *expected, * floating point to integer conversion */ static const int fudge = 2; + ros_skip_flaky ok( types[idx] == expected[idx].type, "%s: Expected #%d: %s (%d,%d) but got %s (%d,%d)\n", path_name, idx, type_string[expected[idx].type], expected[idx].x, expected[idx].y, type_string[types[idx]], pnt[idx].x, pnt[idx].y); if (types[idx] == expected[idx].type) + ros_skip_flaky ok( (pnt[idx].x >= expected[idx].x - fudge && pnt[idx].x <= expected[idx].x + fudge) && (pnt[idx].y >= expected[idx].y - fudge && pnt[idx].y <= expected[idx].y + fudge), "%s: Expected #%d: %s position (%d,%d) but got (%d,%d)\n", path_name, idx, diff --git a/modules/rostests/winetests/kernel32/mailslot.c b/modules/rostests/winetests/kernel32/mailslot.c index da595e97143..27258247287 100644 --- a/modules/rostests/winetests/kernel32/mailslot.c +++ b/modules/rostests/winetests/kernel32/mailslot.c @@ -324,6 +324,7 @@ todo_wine ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot read\n"); ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); dwTimeout = GetTickCount() - dwTimeout; + ros_skip_flaky ok( dwTimeout >= 990, "timeout too short %u\n", dwTimeout ); ok( CloseHandle( hSlot ), "closing the mailslot\n"); diff --git a/modules/rostests/winetests/kernel32/pipe.c b/modules/rostests/winetests/kernel32/pipe.c index 8e5c07ff56e..b2f673400a5 100644 --- a/modules/rostests/winetests/kernel32/pipe.c +++ b/modules/rostests/winetests/kernel32/pipe.c @@ -117,6 +117,7 @@ static BOOL RpcReadFile(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, LPDWORD static void _test_not_signaled(unsigned line, HANDLE handle) { DWORD res = WaitForSingleObject(handle, 0); + disable_success_count ok_(__FILE__,line)(res == WAIT_TIMEOUT, "WaitForSingleObject returned %u (%u)\n", res, GetLastError()); } @@ -2784,7 +2785,9 @@ static void _overlapped_write_async(unsigned line, HANDLE writer, void *buf, DWO memset(overlapped, 0, sizeof(*overlapped)); overlapped->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); res = WriteFile(writer, buf, size, &written_bytes, overlapped); + disable_success_count ok_(__FILE__,line)(!res && GetLastError() == ERROR_IO_PENDING, "WriteFile returned %x(%u)\n", res, GetLastError()); + disable_success_count ok_(__FILE__,line)(!written_bytes, "written_bytes = %u\n", written_bytes); _test_not_signaled(line, overlapped->hEvent); diff --git a/modules/rostests/winetests/kernel32/process.c b/modules/rostests/winetests/kernel32/process.c index 0c973ad366d..b0bf22a0951 100644 --- a/modules/rostests/winetests/kernel32/process.c +++ b/modules/rostests/winetests/kernel32/process.c @@ -2572,7 +2572,7 @@ static void test_TerminateJobObject(void) ret = GetExitCodeProcess(pi.hProcess, &dwret); ok(ret, "GetExitCodeProcess error %u\n", GetLastError()); - ok(dwret == 123 || broken(dwret == 0) /* randomly fails on Win 2000 / XP */, + ok(dwret == 123 || broken(dwret == 0) || broken(dwret == 259) /* randomly fails on Win 2000 / XP */, "wrong exitcode %u\n", dwret); CloseHandle(pi.hProcess); @@ -3419,7 +3419,9 @@ static void test_SuspendProcessState(void) #endif ret = ReadProcessMemory( pi.hProcess, peb_ptr, &child_peb, sizeof(child_peb), NULL ); + ros_skip_flaky ok( ret, "Failed to read PEB (%u)\n", GetLastError() ); + ros_skip_flaky ok( child_peb.ImageBaseAddress == exe_base, "wrong base %p/%p\n", child_peb.ImageBaseAddress, exe_base ); ok( entry_ptr == (char *)exe_base + nt_header.OptionalHeader.AddressOfEntryPoint, diff --git a/modules/rostests/winetests/kernel32/sync.c b/modules/rostests/winetests/kernel32/sync.c index 0de706bd26d..fced98bf217 100644 --- a/modules/rostests/winetests/kernel32/sync.c +++ b/modules/rostests/winetests/kernel32/sync.c @@ -778,6 +778,7 @@ static void test_iocp_callback(void) static void CALLBACK timer_queue_cb1(PVOID p, BOOLEAN timedOut) { int *pn = p; + disable_success_count ok(timedOut, "Timer callbacks should always time out\n"); ++*pn; } @@ -2571,12 +2572,14 @@ static DWORD WINAPI apc_deadlock_thread(void *param) size = 0x1000; status = pNtAllocateVirtualMemory(pi->hProcess, &base, 0, &size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + disable_success_count ok(!status, "expected STATUS_SUCCESS, got %08x\n", status); ok(base != NULL, "expected base != NULL, got %p\n", base); SetEvent(info->event); size = 0; status = pNtFreeVirtualMemory(pi->hProcess, &base, &size, MEM_RELEASE); + disable_success_count ok(!status, "expected STATUS_SUCCESS, got %08x\n", status); SetEvent(info->event); } @@ -2613,6 +2616,7 @@ static void test_apc_deadlock(void) result = WaitForSingleObject(event, 1000); ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + disable_success_count for (i = 0; i < 1000; i++) { result = SuspendThread(pi.hThread); diff --git a/modules/rostests/winetests/mshtml/xmlhttprequest.c b/modules/rostests/winetests/mshtml/xmlhttprequest.c index 8a4bd1793be..8706e2b1f52 100644 --- a/modules/rostests/winetests/mshtml/xmlhttprequest.c +++ b/modules/rostests/winetests/mshtml/xmlhttprequest.c @@ -231,9 +231,11 @@ static HRESULT WINAPI xmlhttprequest_onreadystatechange(IDispatchEx *iface, DISP LONG val; HRESULT hres; + if (!expect_xmlhttprequest_onreadystatechange_loading) test_event_args(&DIID_DispHTMLXMLHttpRequest, id, wFlags, pdp, pvarRes, pei, pspCaller); hres = IHTMLXMLHttpRequest_get_readyState(xhr, &val); + disable_success_count ok(hres == S_OK, "get_readyState failed: %08x\n", hres); readystatechange_cnt++; @@ -246,6 +248,7 @@ static HRESULT WINAPI xmlhttprequest_onreadystatechange(IDispatchEx *iface, DISP break; case 3: loading_cnt++; + disable_success_count CHECK_EXPECT2(xmlhttprequest_onreadystatechange_loading); break; case 4: diff --git a/modules/rostests/winetests/msi/msi.c b/modules/rostests/winetests/msi/msi.c index 4b545f2d5a9..fcb7d66eaae 100644 --- a/modules/rostests/winetests/msi/msi.c +++ b/modules/rostests/winetests/msi/msi.c @@ -13505,6 +13505,7 @@ static void test_MsiEnumProducts(void) ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %u\n", r); ok(found1, "product1 not found\n"); ok(found2, "product2 not found\n"); + ros_skip_flaky ok(found3, "product3 not found\n"); delete_key(key1, "", access & KEY_WOW64_64KEY); @@ -13693,18 +13694,25 @@ static void test_MsiEnumProductsEx(void) ok( !sid[0], "got \"%s\"\n", sid ); ok( !len, "unexpected length %u\n", len ); } - if (!strcmp( product2, guid )) + else if (!strcmp( product2, guid )) { ok( context == MSIINSTALLCONTEXT_USERMANAGED, "got %u\n", context ); ok( sid[0], "empty sid\n" ); ok( len == strlen(sid), "unexpected length %u\n", len ); } - if (!strcmp( product3, guid )) + else if (!strcmp( product3, guid )) { ok( context == MSIINSTALLCONTEXT_USERUNMANAGED, "got %u\n", context ); ok( sid[0], "empty sid\n" ); ok( len == strlen(sid), "unexpected length %u\n", len ); } + else + { + trace("Unexpected guid: %s (have %s | %s | %s)\n", guid, product1, product2, product3); + ok(context != MSIINSTALLCONTEXT_NONE, "got %u\n", context); + ok(sid[0], "empty sid\n"); + ok(len == strlen(sid), "unexpected length %u\n", len); + } index++; guid[0] = 0; context = 0xdeadbeef; diff --git a/modules/rostests/winetests/msxml3/domdoc.c b/modules/rostests/winetests/msxml3/domdoc.c index 9fd83dda7dd..fbd0f8edef6 100644 --- a/modules/rostests/winetests/msxml3/domdoc.c +++ b/modules/rostests/winetests/msxml3/domdoc.c @@ -8027,7 +8027,7 @@ static void test_get_ownerDocument(void) IXMLDOMDocument_Release(doc2); IXMLDOMDocument_Release(doc3); IXMLDOMDocument2_Release(doc); - IXMLDOMDocument2_Release(doc_owner); + //IXMLDOMDocument2_Release(doc_owner); FIXME: double-free! free_bstrs(); } diff --git a/modules/rostests/winetests/ntdll/exception.c b/modules/rostests/winetests/ntdll/exception.c index 7d3c89acafb..d5a197b4a31 100644 --- a/modules/rostests/winetests/ntdll/exception.c +++ b/modules/rostests/winetests/ntdll/exception.c @@ -782,6 +782,7 @@ static DWORD bpx_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD * ok( context->Eip == (DWORD)code_mem, "eip is wrong: %x instead of %x\n", context->Eip, (DWORD)code_mem); ok( (context->Dr6 & 0xf) == 1, "B0 flag is not set in Dr6\n"); + ros_skip_flaky ok( !(context->Dr6 & 0x4000), "BS flag is set in Dr6\n"); context->Dr0 = context->Dr0 + 1; /* set hw bp again on next instruction */ context->EFlags |= 0x100; /* enable single stepping */ diff --git a/modules/rostests/winetests/ntdll/info.c b/modules/rostests/winetests/ntdll/info.c index e641a8d0ff2..a1a131e41c6 100644 --- a/modules/rostests/winetests/ntdll/info.c +++ b/modules/rostests/winetests/ntdll/info.c @@ -353,6 +353,7 @@ static void test_query_process(void) last_pid = (DWORD_PTR)spi->UniqueProcessId; + disable_success_count ok( spi->dwThreadCount > 0, "Expected some threads for this process, got 0\n"); /* Loop through the threads, skip NT4 for now */ @@ -363,6 +364,7 @@ static void test_query_process(void) for ( j = 0; j < spi->dwThreadCount; j++) { k++; + disable_success_count ok ( spi->ti[j].ClientId.UniqueProcess == spi->UniqueProcessId, "The owning pid of the thread (%p) doesn't equal the pid (%p) of the process\n", spi->ti[j].ClientId.UniqueProcess, spi->UniqueProcessId); @@ -1691,12 +1693,14 @@ static void test_query_process_debug_flags(int argc, char **argv) for (;;) { ret = WaitForDebugEvent(&ev, 1000); + disable_success_count ok(ret, "WaitForDebugEvent failed, last error %#x.\n", GetLastError()); if (!ret) break; if (ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT) break; ret = ContinueDebugEvent(ev.dwProcessId, ev.dwThreadId, DBG_CONTINUE); + disable_success_count ok(ret, "ContinueDebugEvent failed, last error %#x.\n", GetLastError()); if (!ret) break; } @@ -1733,6 +1737,7 @@ static void test_query_process_debug_flags(int argc, char **argv) for (j = 0; j < 100; j++) { ret = WaitForDebugEvent(&ev, 1000); + disable_success_count ok(ret || broken(GetLastError() == ERROR_SEM_TIMEOUT), "WaitForDebugEvent failed, last error %#x.\n", GetLastError()); if (!ret) break; @@ -1740,6 +1745,7 @@ static void test_query_process_debug_flags(int argc, char **argv) if (ev.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT) break; ret = ContinueDebugEvent(ev.dwProcessId, ev.dwThreadId, DBG_CONTINUE); + disable_success_count ok(ret, "ContinueDebugEvent failed, last error %#x.\n", GetLastError()); if (!ret) break; } @@ -2248,12 +2254,12 @@ START_TEST(info) char **argv; int argc; - if(!InitFunctionPtrs()) - return; - argc = winetest_get_mainargs(&argv); if (argc >= 3) return; /* Child */ + if (!InitFunctionPtrs()) + return; + /* NtQuerySystemInformation */ /* 0x0 SystemBasicInformation */ diff --git a/modules/rostests/winetests/ntdll/process.c b/modules/rostests/winetests/ntdll/process.c index 41303b7e9ae..f10ed527834 100644 --- a/modules/rostests/winetests/ntdll/process.c +++ b/modules/rostests/winetests/ntdll/process.c @@ -123,6 +123,7 @@ static void test_NtSuspendProcess(char *process_name) ret = WaitForSingleObject(event, 200); ok(ret == WAIT_TIMEOUT, "Expected timeout, got: %d\n", ret); + disable_success_count for (;;) { ret = WaitForDebugEvent(&ev, INFINITE); @@ -158,6 +159,7 @@ static void test_NtSuspendProcess(char *process_name) ok(ret, "ContinueDebugEvent failed, last error %#x.\n", GetLastError()); ret = WaitForSingleObject(event, 200); + ros_skip_flaky ok(ret == WAIT_OBJECT_0, "Event was not signaled: %d\n", ret); TerminateProcess(info.hProcess, 0); diff --git a/modules/rostests/winetests/ole32/compobj.c b/modules/rostests/winetests/ole32/compobj.c index 49faabdece3..435ef803041 100644 --- a/modules/rostests/winetests/ole32/compobj.c +++ b/modules/rostests/winetests/ole32/compobj.c @@ -841,6 +841,7 @@ static DWORD WINAPI MessageFilter_MessagePending( DWORD dwPendingType) { trace("MessagePending\n"); + ros_skip_flaky todo_wine ok(0, "unexpected call\n"); return PENDINGMSG_WAITNOPROCESS; } diff --git a/modules/rostests/winetests/qmgr/job.c b/modules/rostests/winetests/qmgr/job.c index 6d8185a078d..2bee0a37ef6 100644 --- a/modules/rostests/winetests/qmgr/job.c +++ b/modules/rostests/winetests/qmgr/job.c @@ -359,6 +359,7 @@ static void test_CompleteLocal(void) hres = IBackgroundCopyJob_Resume(test_job); ok(hres == S_OK, "IBackgroundCopyJob_Resume\n"); + disable_success_count for (i = 0; i < timeout_sec; ++i) { hres = IBackgroundCopyJob_GetState(test_job, &state); @@ -428,6 +429,7 @@ static void test_CompleteLocalURL(void) hres = IBackgroundCopyJob_Resume(test_job); ok(hres == S_OK, "IBackgroundCopyJob_Resume\n"); + disable_success_count for (i = 0; i < timeout_sec; ++i) { hres = IBackgroundCopyJob_GetState(test_job, &state); @@ -570,6 +572,7 @@ static void test_HttpOptions(void) hr = IBackgroundCopyJob_Resume(test_job); ok(hr == S_OK, "got 0x%08x\n", hr); + disable_success_count for (i = 0; i < timeout; i++) { hr = IBackgroundCopyJob_GetState(test_job, &state); diff --git a/modules/rostests/winetests/quartz/filtermapper.c b/modules/rostests/winetests/quartz/filtermapper.c index 613d98d60f6..f5fe6464b86 100644 --- a/modules/rostests/winetests/quartz/filtermapper.c +++ b/modules/rostests/winetests/quartz/filtermapper.c @@ -39,6 +39,7 @@ static BOOL enum_find_filter(const WCHAR *wszFilterName, IEnumMoniker *pEnum) HRESULT hr; static const WCHAR wszFriendlyName[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0}; + disable_success_count while(!found && IEnumMoniker_Next(pEnum, 1, &pMoniker, &nb) == S_OK) { IPropertyBag * pPropBagCat = NULL; diff --git a/modules/rostests/winetests/quartz/referenceclock.c b/modules/rostests/winetests/quartz/referenceclock.c index 4721675c055..f72cd905415 100644 --- a/modules/rostests/winetests/quartz/referenceclock.c +++ b/modules/rostests/winetests/quartz/referenceclock.c @@ -86,6 +86,7 @@ static void test_IReferenceClock_methods(const char * clockdesc, IReferenceClock /* FIXME: How much deviation should be allowed after a sleep? */ /* 0.3% is common, and 0.4% is sometimes observed. */ diff = time2 - time1; + ros_skip_flaky ok (9940000 <= diff && diff <= 10240000, "%s - Expected difference around 10000000, got %u\n", clockdesc, diff); } diff --git a/modules/rostests/winetests/riched20/editor.c b/modules/rostests/winetests/riched20/editor.c index 28f9849cba0..c2b30c06794 100644 --- a/modules/rostests/winetests/riched20/editor.c +++ b/modules/rostests/winetests/riched20/editor.c @@ -657,6 +657,7 @@ static void test_EM_POSFROMCHAR(void) } else { + ros_skip_flaky ok(HIWORD(result) == i * height, "EM_POSFROMCHAR reports y=%d, expected %d\n", HIWORD(result), i * height); ok(LOWORD(result) == xpos, "EM_POSFROMCHAR reports x=%d, expected 1\n", LOWORD(result)); } diff --git a/modules/rostests/winetests/rpcrt4/server.c b/modules/rostests/winetests/rpcrt4/server.c index 592ee9d9a90..05252877d4e 100644 --- a/modules/rostests/winetests/rpcrt4/server.c +++ b/modules/rostests/winetests/rpcrt4/server.c @@ -1553,7 +1553,9 @@ pointer_tests(void) names = NULL; get_names(&n, &names); ok(n == 2, "expected 2, got %d\n", n); + ros_skip_flaky ok(!strcmp(names[0], "Hello"), "expected Hello, got %s\n", names[0]); + ros_skip_flaky ok(!strcmp(names[1], "World!"), "expected World!, got %s\n", names[1]); MIDL_user_free(names[0]); MIDL_user_free(names[1]); @@ -1563,7 +1565,9 @@ pointer_tests(void) namesw = NULL; get_namesw(&n, &namesw); ok(n == 2, "expected 2, got %d\n", n); + ros_skip_flaky ok(!lstrcmpW(namesw[0], helloW), "expected Hello, got %s\n", wine_dbgstr_w(namesw[0])); + ros_skip_flaky ok(!lstrcmpW(namesw[1], worldW), "expected World!, got %s\n", wine_dbgstr_w(namesw[1])); MIDL_user_free(namesw[0]); MIDL_user_free(namesw[1]); @@ -1573,6 +1577,7 @@ pointer_tests(void) if (!is_interp) { /* broken in widl */ pa2 = a; + ros_skip_flaky ok(sum_pcarr2(4, &pa2) == 10, "RPC sum_pcarr2\n"); } diff --git a/modules/rostests/winetests/user32/listbox.c b/modules/rostests/winetests/user32/listbox.c index 8d8115131ef..3f83b5ac3ef 100644 --- a/modules/rostests/winetests/user32/listbox.c +++ b/modules/rostests/winetests/user32/listbox.c @@ -1720,6 +1720,7 @@ static void test_listbox_dlgdir(void) memset(tempBuffer, 0, MAX_PATH); driveletter = '\0'; SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)itemBuffer); + if (!strstr(itemBuffer, ".exe")) continue; // skip downloaded/generated files from other tests res = SendMessageA(g_listBox, LB_SETCURSEL, i, 0); ok (res == i, "SendMessageA(LB_SETCURSEL, %d) failed\n", i); if (sscanf(itemBuffer, "[-%c-]", &driveletter) == 1) { diff --git a/modules/rostests/winetests/user32/msg.c b/modules/rostests/winetests/user32/msg.c index e66d0dcdcf1..7df4ba021db 100644 --- a/modules/rostests/winetests/user32/msg.c +++ b/modules/rostests/winetests/user32/msg.c @@ -10289,6 +10289,7 @@ static void test_timers(void) start = GetTickCount(); while (GetTickCount()-start < 1001 && GetMessageA(&msg, info.hWnd, 0, 0)) DispatchMessageA(&msg); +ros_skip_flaky todo_wine ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE /* xp */ || broken(abs(count-64) < TIMER_COUNT_TOLERANCE) /* most common */ @@ -16902,6 +16903,7 @@ static void test_hotkey(void) keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0); while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) { + ros_skip_flaky ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message); DispatchMessageA(&msg); } diff --git a/modules/rostests/winetests/user32/win.c b/modules/rostests/winetests/user32/win.c index 74fb11251d0..4e98d2a7abf 100644 --- a/modules/rostests/winetests/user32/win.c +++ b/modules/rostests/winetests/user32/win.c @@ -149,6 +149,7 @@ static void check_wnd_state_(const char *file, int line, /* foreground can be moved to a different app pretty much at any time */ if (foreground && GetForegroundWindow() && GetWindowThreadProcessId(GetForegroundWindow(), NULL) == GetCurrentThreadId()) + disable_success_count ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow()); ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus()); ok_(file, line)(capture == GetCapture(), "GetCapture() = %p\n", GetCapture()); @@ -164,6 +165,7 @@ static void check_active_state_(const char *file, int line, /* foreground can be moved to a different app pretty much at any time */ if (foreground && GetForegroundWindow() && GetWindowThreadProcessId(GetForegroundWindow(), NULL) == GetCurrentThreadId()) + disable_success_count ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow()); ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus()); } @@ -774,6 +776,7 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR break; } case WM_WINDOWPOSCHANGED: + disable_success_count { RECT rc1, rc2; WINDOWPOS *winpos = (WINDOWPOS *)lparam; @@ -966,6 +969,8 @@ static void verify_window_info(const char *hook, HWND hwnd, const WINDOWINFO *in if (GetForegroundWindow()) ok(info->dwWindowStatus == status, "wrong dwWindowStatus: %04x != %04x active %p fg %p in hook %s\n", info->dwWindowStatus, status, GetActiveWindow(), GetForegroundWindow(), hook); + else + ok(1, "Just counting"); /* win2k and XP return broken border info in GetWindowInfo most of * the time, so there is no point in testing it. @@ -981,6 +986,7 @@ if (0) } ok(info->atomWindowType == GetClassLongA(hwnd, GCW_ATOM), "wrong atomWindowType for %p in hook %s\n", hwnd, hook); + todo_ros ok(info->wCreatorVersion == 0x0400 /* NT4, Win2000, XP, Win2003 */ || info->wCreatorVersion == 0x0500 /* Vista */, "wrong wCreatorVersion %04x for %p in hook %s\n", info->wCreatorVersion, hwnd, hook); @@ -3091,8 +3097,10 @@ static void test_SetActiveWindow(HWND hwnd) ok(hwnd2 == hwnd, "SetActiveWindow returned %p instead of %p\n", hwnd2, hwnd); if (!GetActiveWindow()) /* doesn't always work on vista */ { + ros_skip_flaky check_wnd_state(0, 0, 0, 0); hwnd2 = SetActiveWindow(hwnd); + ros_skip_flaky ok(hwnd2 == 0, "SetActiveWindow returned %p instead of 0\n", hwnd2); } check_wnd_state(hwnd, hwnd, hwnd, 0); diff --git a/modules/rostests/winetests/usp10/usp10.c b/modules/rostests/winetests/usp10/usp10.c index 9e870ee3a5f..3a74ca32556 100644 --- a/modules/rostests/winetests/usp10/usp10.c +++ b/modules/rostests/winetests/usp10/usp10.c @@ -1713,6 +1713,8 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } + hfont = NULL; + ros_skip_flaky test_valid = find_font_for_range(hdc, "Estrangelo Edessa", 71, test_syriac[0], &hfont, &hfont_orig, &fingerprint_estrangelo); if (hfont != NULL) { diff --git a/modules/rostests/winetests/wininet/ftp.c b/modules/rostests/winetests/wininet/ftp.c index d2118fadedd..baf20ffa118 100644 --- a/modules/rostests/winetests/wininet/ftp.c +++ b/modules/rostests/winetests/wininet/ftp.c @@ -74,10 +74,12 @@ static void test_connect(HINTERNET hInternet) hFtp = InternetConnectA(hInternet, "
ftp.winehq.org
", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); if (hFtp) /* some servers accept an empty password */ { + ros_skip_flaky ok ( GetLastError() == ERROR_SUCCESS, "ERROR_SUCCESS, got %d\n", GetLastError()); InternetCloseHandle(hFtp); } else + ros_skip_flaky ok ( GetLastError() == ERROR_INTERNET_LOGIN_FAILURE, "Expected ERROR_INTERNET_LOGIN_FAILURE, got %d\n", GetLastError()); @@ -109,7 +111,9 @@ static void test_connect(HINTERNET hInternet) SetLastError(0xdeadbeef); hFtp = InternetConnectA(hInternet, "
ftp.winehq.org
", INTERNET_DEFAULT_FTP_PORT, "anonymous", "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); } + ros_skip_flaky ok ( hFtp != NULL, "InternetConnect failed : %d\n", GetLastError()); + ros_skip_flaky ok ( GetLastError() == ERROR_SUCCESS, "ERROR_SUCCESS, got %d\n", GetLastError()); InternetCloseHandle(hFtp); @@ -119,11 +123,13 @@ static void test_connect(HINTERNET hInternet) INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); if (!hFtp) { + ros_skip_flaky ok(GetLastError() == ERROR_INTERNET_LOGIN_FAILURE, "Expected ERROR_INTERNET_LOGIN_FAILURE, got %d\n", GetLastError()); } else { + ros_skip_flaky ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError()); InternetCloseHandle(hFtp); diff --git a/modules/rostests/winetests/wininet/http.c b/modules/rostests/winetests/wininet/http.c index 1f61b9218a1..1c5cbfe834b 100644 --- a/modules/rostests/winetests/wininet/http.c +++ b/modules/rostests/winetests/wininet/http.c @@ -351,6 +351,7 @@ static VOID WINAPI callback( DWORD dwStatusInformationLength ) { + ros_skip_flaky CHECK_EXPECT(dwInternetStatus); switch (dwInternetStatus) { @@ -4800,9 +4801,11 @@ static void test_async_read(int port) ret = InternetReadFileExA( req, &ib, 0, 0xdeadbeef ); if (!count) /* the first part should arrive immediately */ ok( ret, "InternetReadFileExA failed %u\n", GetLastError() ); + ros_skip_flaky if (!ret) { ok( GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %u\n", GetLastError() ); + ros_skip_flaky CHECK_NOTIFIED( INTERNET_STATUS_RECEIVING_RESPONSE ); SET_EXPECT( INTERNET_STATUS_REQUEST_COMPLETE ); if (!pending_reads++) @@ -4891,6 +4894,7 @@ static void test_async_read(int port) { ok( GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %u\n", GetLastError() ); ok( bytes == 0, "expected 0, got %u\n", bytes ); + ros_skip_flaky CHECK_NOTIFIED( INTERNET_STATUS_RECEIVING_RESPONSE ); SET_EXPECT( INTERNET_STATUS_REQUEST_COMPLETE ); if (!pending_reads++) @@ -4902,9 +4906,13 @@ static void test_async_read(int port) res = WaitForSingleObject( complete_event, INFINITE ); ok( res == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", res ); ok( req_error == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", req_error ); + ros_skip_flaky { todo_wine_if( pending_reads > 1 ) ok( bytes != 0, "expected bytes != 0\n" ); + } + ros_skip_flaky CHECK_NOTIFIED( INTERNET_STATUS_RESPONSE_RECEIVED ); + ros_skip_flaky CHECK_NOTIFIED( INTERNET_STATUS_REQUEST_COMPLETE ); } @@ -4913,6 +4921,7 @@ static void test_async_read(int port) if (!bytes) break; } + ros_skip_flaky ok( pending_reads == 1, "expected 1 pending read, got %u\n", pending_reads ); ok( !strcmp(buffer, page1), "unexpected buffer content\n" ); close_async_handle( ses, 2 ); @@ -6160,6 +6169,7 @@ static void test_security_flags(void) } HeapFree(GetProcessHeap(), 0, cert); + ros_skip_flaky CHECK_NOTIFIED2(INTERNET_STATUS_CONNECTING_TO_SERVER, 2); CHECK_NOTIFIED2(INTERNET_STATUS_CONNECTED_TO_SERVER, 2); CHECK_NOTIFIED2(INTERNET_STATUS_CLOSING_CONNECTION, 2); diff --git a/sdk/include/reactos/wine/test.h b/sdk/include/reactos/wine/test.h index 0b4c54019c1..52bad3a8f84 100644 --- a/sdk/include/reactos/wine/test.h +++ b/sdk/include/reactos/wine/test.h @@ -53,6 +53,8 @@ extern "C" { /* debug level */ extern int winetest_debug; +extern int report_success; + /* running in interactive mode? */ extern int winetest_interactive; @@ -65,8 +67,13 @@ extern int winetest_loop_todo(void); extern void winetest_end_todo(void); extern int winetest_get_mainargs( char*** pargv ); extern LONG winetest_get_failures(void); +extern LONG winetest_get_successes(void); extern void winetest_add_failures( LONG new_failures ); extern void winetest_wait_child_process( HANDLE process ); +extern void winetest_disable_success_count_start(); +extern int winetest_disable_success_count_end(); +extern int winetest_disable_success_count_get(); +extern int winetest_disable_success_count_set(); extern const char *wine_dbgstr_wn( const WCHAR *str, intptr_t n ); extern const char *wine_dbgstr_guid( const GUID *guid ); @@ -121,6 +128,7 @@ extern void __winetest_cdecl winetest_ok( int condition, const char *msg, ... ) extern void __winetest_cdecl winetest_skip( const char *msg, ... ) __attribute__((format (printf,1,2))); extern void __winetest_cdecl winetest_win_skip( const char *msg, ... ) __attribute__((format (printf,1,2))); extern void __winetest_cdecl winetest_trace( const char *msg, ... ) __attribute__((format (printf,1,2))); +extern void __winetest_cdecl winetest_print(const char* msg, ...) __attribute__((format(printf, 1, 2))); #else /* __GNUC__ */ # define WINETEST_PRINTF_ATTR(fmt,args) @@ -128,6 +136,7 @@ extern void __winetest_cdecl winetest_ok( int condition, const char *msg, ... ); extern void __winetest_cdecl winetest_skip( const char *msg, ... ); extern void __winetest_cdecl winetest_win_skip( const char *msg, ... ); extern void __winetest_cdecl winetest_trace( const char *msg, ... ); +extern void __winetest_cdecl winetest_print(const char* msg, ...); #endif /* __GNUC__ */ @@ -155,6 +164,14 @@ extern void __winetest_cdecl winetest_trace( const char *msg, ... ); #define todo_wine_if(is_todo) todo_if((is_todo) && !strcmp(winetest_platform, "wine")) #endif +#define ros_skip_flaky for (winetest_print("Skipping flaky test\n");0;) + +#define disable_success_count for (winetest_disable_success_count_start(); \ + (winetest_disable_success_count_get() ? \ + winetest_disable_success_count_end() : \ + winetest_disable_success_count_set()); \ + ) + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #ifdef NONAMELESSUNION @@ -241,7 +258,7 @@ int winetest_interactive = 0; const char *winetest_platform = "windows"; /* report successful tests (BOOL) */ -static int report_success = 0; +int report_success = 0; /* passing arguments around */ static int winetest_argc; @@ -261,6 +278,7 @@ typedef struct const char* current_file; /* file of current check */ int current_line; /* line of current check */ unsigned int todo_level; /* current todo nesting level */ + unsigned int nocount_level; int todo_do_loop; char *str_pos; /* position in debug buffer */ char strings[2000]; /* buffer for debug strings */ @@ -368,6 +386,7 @@ int winetest_vok( int condition, const char *msg, __winetest_va_list args ) data->current_file, data->current_line ); vfprintf(stdout, msg, args); } + if (data->nocount_level == 0) InterlockedIncrement(&todo_successes); return 1; } @@ -384,9 +403,10 @@ int winetest_vok( int condition, const char *msg, __winetest_va_list args ) } else { - if (report_success) + if (report_success && data->nocount_level == 0) fprintf( stdout, __winetest_file_line_prefix ": Test succeeded\n", data->current_file, data->current_line); + if (data->nocount_level == 0) InterlockedIncrement(&successes); return 1; } @@ -416,6 +436,17 @@ void __winetest_cdecl winetest_trace( const char *msg, ... ) } } +void __winetest_cdecl winetest_print(const char* msg, ...) +{ + __winetest_va_list valist; + tls_data* data = get_tls_data(); + + fprintf(stdout, __winetest_file_line_prefix ": ", data->current_file, data->current_line); + __winetest_va_start(valist, msg); + vfprintf(stdout, msg, valist); + __winetest_va_end(valist); +} + void winetest_vskip( const char *msg, __winetest_va_list args ) { tls_data* data=get_tls_data(); @@ -480,6 +511,11 @@ LONG winetest_get_failures(void) return failures; } +LONG winetest_get_successes(void) +{ + return successes; +} + void winetest_add_failures( LONG new_failures ) { while (new_failures-- > 0) @@ -512,6 +548,28 @@ void winetest_wait_child_process( HANDLE process ) } } +void winetest_disable_success_count_start() +{ + get_tls_data()->nocount_level <<= 1; +} + +int winetest_disable_success_count_end() +{ + get_tls_data()->nocount_level >>= 1; + return 0; +} + +int winetest_disable_success_count_get() +{ + return get_tls_data()->nocount_level & 1; +} + +int winetest_disable_success_count_set() +{ + get_tls_data()->nocount_level |= 1; + return 1; +} + const char *wine_dbgstr_wn( const WCHAR *str, intptr_t n ) { char *dst, *res;
1
0
0
0
[reactos] 01/01: [SHELL32] Delete unused CNewMenu::m_wszPath
by Katayama Hirofumi MZ
03 Dec '19
03 Dec '19
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c082d08cf34cf09e00300…
commit c082d08cf34cf09e003009dc5862fc7e0a6c38c1 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Dec 3 13:46:22 2019 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Tue Dec 3 13:46:35 2019 +0900 [SHELL32] Delete unused CNewMenu::m_wszPath --- dll/win32/shell32/CNewMenu.cpp | 1 - dll/win32/shell32/CNewMenu.h | 1 - 2 files changed, 2 deletions(-) diff --git a/dll/win32/shell32/CNewMenu.cpp b/dll/win32/shell32/CNewMenu.cpp index b0e8052070c..87559e017f4 100644 --- a/dll/win32/shell32/CNewMenu.cpp +++ b/dll/win32/shell32/CNewMenu.cpp @@ -27,7 +27,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); CNewMenu::CNewMenu() : m_pidlFolder(NULL), - m_wszPath(NULL), m_pItems(NULL), m_pLinkItem(NULL), m_pSite(NULL), diff --git a/dll/win32/shell32/CNewMenu.h b/dll/win32/shell32/CNewMenu.h index 45aaa624f26..6d0bbe6b927 100644 --- a/dll/win32/shell32/CNewMenu.h +++ b/dll/win32/shell32/CNewMenu.h @@ -54,7 +54,6 @@ private: }; LPITEMIDLIST m_pidlFolder; - LPWSTR m_wszPath; SHELLNEW_ITEM *m_pItems; SHELLNEW_ITEM *m_pLinkItem; // Points to the link handler item in the m_pItems list. CComPtr<IUnknown> m_pSite;
1
0
0
0
[reactos] 01/01: [VIDEOPRT] Protect access to HwResetAdaptersList with spinlock.
by Hermès Bélusca-Maïto
03 Dec '19
03 Dec '19
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=44314189991059109e60f…
commit 44314189991059109e60f4b101171aaf1c735f8a Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Tue Dec 3 02:08:34 2019 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Tue Dec 3 02:46:38 2019 +0100 [VIDEOPRT] Protect access to HwResetAdaptersList with spinlock. --- win32ss/drivers/videoprt/dispatch.c | 45 ++++++++++++++++++++++++++++--------- win32ss/drivers/videoprt/videoprt.c | 13 ++++++----- win32ss/drivers/videoprt/videoprt.h | 1 + 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/win32ss/drivers/videoprt/dispatch.c b/win32ss/drivers/videoprt/dispatch.c index 42f7023b0b1..b116cf1100b 100644 --- a/win32ss/drivers/videoprt/dispatch.c +++ b/win32ss/drivers/videoprt/dispatch.c @@ -74,22 +74,35 @@ IntVideoPortResetDisplayParametersEx( _In_ ULONG Rows, _In_ BOOLEAN CalledByInbv) { - BOOLEAN Success = TRUE; + BOOLEAN Success = TRUE; // Suppose we don't need to perform a full reset. + KIRQL OldIrql; PLIST_ENTRY PrevEntry, Entry; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DRIVER_EXTENSION DriverExtension; + /* Check if we are at dispatch level or lower, and acquire the lock */ + OldIrql = KeGetCurrentIrql(); + if (OldIrql <= DISPATCH_LEVEL) + { + /* Loop until the lock is free, then raise IRQL to dispatch level */ + while (!KeTestSpinLock(&HwResetAdaptersLock)); + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + } + KeAcquireSpinLockAtDpcLevel(&HwResetAdaptersLock); + + /* Bail out early if we don't have any resettable adapter */ if (IsListEmpty(&HwResetAdaptersList)) - return FALSE; + { + Success = FALSE; // No adapter found: request HAL to perform a full reset. + goto Quit; + } + /* + * If we have been unexpectedly called via a callback from + * InbvAcquireDisplayOwnership(), start monitoring INBV. + */ if (CalledByInbv) - { - /* - * We have been unexpectedly called via a callback from - * InbvAcquireDisplayOwnership(): start monitoring INBV. - */ InbvMonitoring = TRUE; - } for (PrevEntry = &HwResetAdaptersList, Entry = PrevEntry->Flink; Entry != &HwResetAdaptersList; @@ -102,7 +115,10 @@ IntVideoPortResetDisplayParametersEx( */ // #define IS_ALIGNED(addr, align) (((ULONG64)(addr) & (align - 1)) == 0) if (((ULONG_PTR)Entry & (sizeof(ULONG_PTR) - 1)) != 0) - return FALSE; + { + Success = FALSE; // We failed: request HAL to perform a full reset. + goto Quit; + } DeviceExtension = CONTAINING_RECORD(Entry, VIDEO_PORT_DEVICE_EXTENSION, @@ -118,7 +134,10 @@ IntVideoPortResetDisplayParametersEx( ASSERT(DriverExtension); if (DeviceExtension->HwResetListEntry.Blink != PrevEntry) - _SEH2_YIELD(return FALSE); + { + Success = FALSE; // We failed: request HAL to perform a full reset. + _SEH2_YIELD(goto Quit); + } if ((DeviceExtension->DeviceOpened >= 1) && (DriverExtension->InitializationData.HwResetHw != NULL)) @@ -134,6 +153,12 @@ IntVideoPortResetDisplayParametersEx( _SEH2_END; } +Quit: + /* Release the lock and restore the old IRQL if we were at dispatch level or lower */ + KeReleaseSpinLockFromDpcLevel(&HwResetAdaptersLock); + if (OldIrql <= DISPATCH_LEVEL) + KeLowerIrql(OldIrql); + return Success; } diff --git a/win32ss/drivers/videoprt/videoprt.c b/win32ss/drivers/videoprt/videoprt.c index 6e75d563ea9..b4207309e93 100644 --- a/win32ss/drivers/videoprt/videoprt.c +++ b/win32ss/drivers/videoprt/videoprt.c @@ -33,6 +33,7 @@ PKPROCESS CsrProcess = NULL; ULONG VideoPortDeviceNumber = 0; KMUTEX VideoPortInt10Mutex; +KSPIN_LOCK HwResetAdaptersLock; RTL_STATIC_LIST_HEAD(HwResetAdaptersList); /* PRIVATE FUNCTIONS **********************************************************/ @@ -410,8 +411,9 @@ IntVideoPortFindAdapter( InitializeListHead(&DeviceExtension->HwResetListEntry); if (DriverExtension->InitializationData.HwResetHw != NULL) { - InsertTailList(&HwResetAdaptersList, - &DeviceExtension->HwResetListEntry); + ExInterlockedInsertTailList(&HwResetAdaptersList, + &DeviceExtension->HwResetListEntry, + &HwResetAdaptersLock); } /* Query children of the device. */ @@ -471,14 +473,15 @@ VideoPortInitialize( NTSTATUS Status; PVIDEO_PORT_DRIVER_EXTENSION DriverExtension; BOOLEAN PnpDriver = FALSE, LegacyDetection = FALSE; - static BOOLEAN Int10MutexInitialized; + static BOOLEAN FirstInitialization; TRACE_(VIDEOPRT, "VideoPortInitialize\n"); - if (!Int10MutexInitialized) + if (!FirstInitialization) { KeInitializeMutex(&VideoPortInt10Mutex, 0); - Int10MutexInitialized = TRUE; + KeInitializeSpinLock(&HwResetAdaptersLock); + FirstInitialization = TRUE; } /* As a first thing do parameter checks. */ diff --git a/win32ss/drivers/videoprt/videoprt.h b/win32ss/drivers/videoprt/videoprt.h index 94289dc031a..8035278e349 100644 --- a/win32ss/drivers/videoprt/videoprt.h +++ b/win32ss/drivers/videoprt/videoprt.h @@ -246,6 +246,7 @@ IntVideoPortMapPhysicalMemory( extern PKPROCESS CsrProcess; extern ULONG VideoPortDeviceNumber; extern KMUTEX VideoPortInt10Mutex; +extern KSPIN_LOCK HwResetAdaptersLock; extern LIST_ENTRY HwResetAdaptersList; VOID FASTCALL
1
0
0
0
[reactos] 01/01: [NTOS:PO] PopShutdownHandler(): Fully screen-center images. Addendum to 55aed4f8. CORE-16342
by Serge Gautherie
03 Dec '19
03 Dec '19
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ad21227ac8babb9b5f45c…
commit ad21227ac8babb9b5f45c83e0d26a3c766b38657 Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr> AuthorDate: Mon Dec 2 19:21:39 2019 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Tue Dec 3 02:10:37 2019 +0100 [NTOS:PO] PopShutdownHandler(): Fully screen-center images. Addendum to 55aed4f8. CORE-16342 --- ntoskrnl/po/poshtdwn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/po/poshtdwn.c b/ntoskrnl/po/poshtdwn.c index aca63dae7ee..23071faad28 100644 --- a/ntoskrnl/po/poshtdwn.c +++ b/ntoskrnl/po/poshtdwn.c @@ -168,8 +168,9 @@ PopShutdownHandler(VOID) Logo2 = InbvGetResourceAddress(IDB_LOGO_DEFAULT); if ((Logo1) && (Logo2)) { - InbvBitBlt(Logo1, 211, 352); - InbvBitBlt(Logo2, 222, 111); + /* 16px space between logo and message */ + InbvBitBlt(Logo1, 213, 354); + InbvBitBlt(Logo2, 225, 114); } } else
1
0
0
0
[reactos] 01/01: [CPL][INPUT] Fix bullet (#2124)
by Katayama Hirofumi MZ
02 Dec '19
02 Dec '19
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4420f4e0cad506c8b34e6…
commit 4420f4e0cad506c8b34e6d35bf36743546255df9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Dec 2 18:04:41 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Dec 2 18:04:41 2019 +0900 [CPL][INPUT] Fix bullet (#2124) CORE-13807 --- dll/cpl/input/settings_page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/cpl/input/settings_page.c b/dll/cpl/input/settings_page.c index 8c093986475..28b9f9969db 100644 --- a/dll/cpl/input/settings_page.c +++ b/dll/cpl/input/settings_page.c @@ -64,7 +64,7 @@ CreateLayoutIcon(LPWSTR szLayout, BOOL bIsDefault) ExtTextOutW(hdc, rect.left, rect.top, ETO_OPAQUE, &rect, L"", 0, NULL); SelectObject(hdc, hFont); - DrawTextW(hdc, L"\x2022", 1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER); + DrawFrameControl(hdc, &rect, DFC_MENU, DFCS_MENUBULLET); } else {
1
0
0
0
[reactos] 01/01: [NTOSKRNL][INBV] Fix IDB_SHUTDOWN_MSG position
by Katayama Hirofumi MZ
02 Dec '19
02 Dec '19
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=55aed4f8fa919ce3b210e…
commit 55aed4f8fa919ce3b210e14bff7aec1919202848 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Dec 2 16:55:02 2019 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Dec 2 16:55:02 2019 +0900 [NTOSKRNL][INBV] Fix IDB_SHUTDOWN_MSG position Make "shutdown.bmp" (IDB_SHUTDOWN_MSG: 213x11px) horizontally centered. --- ntoskrnl/po/poshtdwn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/po/poshtdwn.c b/ntoskrnl/po/poshtdwn.c index 17adbc2a415..aca63dae7ee 100644 --- a/ntoskrnl/po/poshtdwn.c +++ b/ntoskrnl/po/poshtdwn.c @@ -168,7 +168,7 @@ PopShutdownHandler(VOID) Logo2 = InbvGetResourceAddress(IDB_LOGO_DEFAULT); if ((Logo1) && (Logo2)) { - InbvBitBlt(Logo1, 220, 352); + InbvBitBlt(Logo1, 211, 352); InbvBitBlt(Logo2, 222, 111); } }
1
0
0
0
[reactos] 01/01: [WIN32K][VIDEOPRT] Improve initialization and interfacing with INBV. CORE-12149
by Hermès Bélusca-Maïto
02 Dec '19
02 Dec '19
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0ad65796bbb57be739840…
commit 0ad65796bbb57be739840c6f666cd9f8f8a1efda Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Tue Nov 26 02:49:35 2019 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Dec 2 02:33:20 2019 +0100 [WIN32K][VIDEOPRT] Improve initialization and interfacing with INBV. CORE-12149 VIDEOPRT: ========= Improve interfacing with INBV, so as to detect when an external module acquired INBV display ownership, and whether ownership is being released later on. (This does NOT rely on hooking!) For this purpose we improve the IntVideoPortResetDisplayParameters(Ex) callback that gets registered with an InbvNotifyDisplayOwnershipLost() call during initialization, and we add a monitoring thread. The callback is called whenever an external module calls InbvAcquireDisplayOwnership(), for example the bugcheck code or the KDBG debugger in SCREEN mode. When this happens, a flag that tells the monitoring thread to start monitoring INBV is set (ReactOS-specific), and the display adapters get reset with HwResetHw() (as done on Windows). Due to the fact that this INBV callback can be called at *ANY* IRQL, we cannot use dispatcher synchronization mechanisms such as events to tell the INBV monitoring thread to start its operations, so we need to rely instead on a flag to be set. And, since INBV doesn't provide with any proper callback/notification system either, we need to actively monitor its state by pooling. To reduce the load on the system the monitoring thread performs 1-second waits between each check for the flag set by the INBV callback, and during checking the INBV ownership status. When the INBV ownership is detected to be released by an external module, the INBV callback is re-registered (this is *MANDATORY* since the external module has called InbvNotifyDisplayOwnershipLost() with a different callback parameter!), and then we callout to Win32k for re-enabling the display. This has the virtue of correctly resetting the display once the KDBG debugger in SCREEN mode is being exited, and fixes CORE-12149 . The following additional fixes were needed: VIDEOPRT & WIN32K: ================== Remove the registration with INBV that was previously done in a ReactOS- specific hacked IRP_MJ_WRITE call; it is now done correctly during the video device opening done by EngpRegisterGraphicsDevice() in the VIDEOPRT's IRP_MJ_CREATE handler, as done on Windows. WIN32K: ======= - Stub the VideoPortCallout() support, for VIDEOPRT -> WIN32 callbacks. This function gets registered with VIDEOPRT through an IOCTL_VIDEO_INIT_WIN32K_CALLBACKS call in EngpRegisterGraphicsDevice(). - Only partially implement the 'VideoFindAdapterCallout' case, that just re-enables the primary display by refreshing it (using the new function UserRefreshDisplay()). VIDEOPRT: ========= - PVIDEO_WIN32K_CALLOUT is an NTAPI (stdcall) callback. - In the IntVideoPortResetDisplayParameters(Ex) callback, reset all the "resettable" adapters registered in the HwResetAdaptersList list. We thus get rid of the global ResetDisplayParametersDeviceExtension. - Make the IntVideoPortResetDisplayParameters(Ex) callback slightly more robust (using SEH) against potential HwResetListEntry list corruption or invalid DriverExtension->InitializationData.HwResetHw() that would otherwise trigger a BSOD, and this would be disastrous since that callback is precisely called when INBV is acquired, typically when the BSOD code initializes the display for displaying its information... Extras: - Validate the IrpStack->MajorFunction in IntVideoPortDispatchDeviceControl() and implement IRP_MJ_SHUTDOWN handling. Stub out the other IOCTLs that are handled by VIDEOPRT only (and not by the miniports). - VIDEOPRT doesn't require IRP_MJ_INTERNAL_DEVICE_CONTROL (unused). - Implement IOCTL_VIDEO_PREPARE_FOR_EARECOVERY that just resets the display to standard VGA 80x25 text mode. --- sdk/include/psdk/ntddvdeo.h | 4 +- win32ss/drivers/videoprt/CMakeLists.txt | 1 + win32ss/drivers/videoprt/dispatch.c | 438 +++++++++++++++++++++++++------- win32ss/drivers/videoprt/int10.c | 2 +- win32ss/drivers/videoprt/videoprt.c | 28 +- win32ss/drivers/videoprt/videoprt.h | 21 +- win32ss/gdi/eng/device.c | 99 +++++++- win32ss/user/ntuser/display.c | 39 +++ 8 files changed, 509 insertions(+), 123 deletions(-) diff --git a/sdk/include/psdk/ntddvdeo.h b/sdk/include/psdk/ntddvdeo.h index 8fcd361f502..5e2b63b7214 100644 --- a/sdk/include/psdk/ntddvdeo.h +++ b/sdk/include/psdk/ntddvdeo.h @@ -75,7 +75,7 @@ extern "C" { CTL_CODE(FILE_DEVICE_VIDEO, 0x0b, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_VIDEO_DISABLE_CURSOR \ - CTL_CODE (FILE_DEVICE_VIDEO, 0x109, METHOD_BUFFERED, FILE_ANY_ACCESS) + CTL_CODE(FILE_DEVICE_VIDEO, 0x109, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_VIDEO_DISABLE_POINTER \ CTL_CODE(FILE_DEVICE_VIDEO, 0x10f, METHOD_BUFFERED, FILE_ANY_ACCESS) @@ -254,7 +254,7 @@ typedef struct _VIDEO_WIN32K_CALLBACKS_PARAMS { typedef VOID -(*PVIDEO_WIN32K_CALLOUT)( +(NTAPI *PVIDEO_WIN32K_CALLOUT)( _In_ PVOID Params); typedef struct _VIDEO_WIN32K_CALLBACKS { diff --git a/win32ss/drivers/videoprt/CMakeLists.txt b/win32ss/drivers/videoprt/CMakeLists.txt index 664f8cb7c62..be116547d59 100644 --- a/win32ss/drivers/videoprt/CMakeLists.txt +++ b/win32ss/drivers/videoprt/CMakeLists.txt @@ -29,6 +29,7 @@ add_library(videoprt MODULE ${CMAKE_CURRENT_BINARY_DIR}/videoprt.def) set_module_type(videoprt kernelmodedriver) +target_link_libraries(videoprt ${PSEH_LIB}) add_importlibs(videoprt ntoskrnl hal) add_pch(videoprt videoprt.h SOURCE) add_cd_file(TARGET videoprt DESTINATION reactos/system32/drivers FOR all) diff --git a/win32ss/drivers/videoprt/dispatch.c b/win32ss/drivers/videoprt/dispatch.c index d1682549185..42f7023b0b1 100644 --- a/win32ss/drivers/videoprt/dispatch.c +++ b/win32ss/drivers/videoprt/dispatch.c @@ -22,6 +22,7 @@ #include "videoprt.h" #include <ndk/inbvfuncs.h> +#include <ndk/obfuncs.h> #include <ndk/psfuncs.h> #define NDEBUG @@ -29,40 +30,280 @@ /* GLOBAL VARIABLES ***********************************************************/ -PVIDEO_PORT_DEVICE_EXTENSION ResetDisplayParametersDeviceExtension = NULL; -PVIDEO_WIN32K_CALLOUT Win32kCallout; +static PVIDEO_WIN32K_CALLOUT Win32kCallout = NULL; +static HANDLE InbvThreadHandle = NULL; +static BOOLEAN InbvMonitoring = FALSE; /* PRIVATE FUNCTIONS **********************************************************/ +static VOID +VideoPortWin32kCallout( + _In_ PVIDEO_WIN32K_CALLBACKS_PARAMS CallbackParams) +{ + if (!Win32kCallout) + return; + + /* Perform the call in the context of CSRSS */ + if (!CsrProcess) + return; + + KeAttachProcess(CsrProcess); + Win32kCallout(CallbackParams); + KeDetachProcess(); +} + /* - * Reset display to blue screen + * Reinitialize the display to base VGA mode. + * + * Returns TRUE if it completely resets the adapter to the given character mode. + * Returns FALSE otherwise, indicating that the HAL should perform the VGA mode + * reset itself after HwVidResetHw() returns control. + * + * This callback has been registered with InbvNotifyDisplayOwnershipLost() + * and is called by InbvAcquireDisplayOwnership(), typically when the bugcheck + * code regains display access. Therefore this routine can be called at any + * IRQL, and in particular at IRQL = HIGH_LEVEL. This routine must also reside + * completely in non-paged pool, and cannot perform the following actions: + * Allocate memory, access pageable memory, use any synchronization mechanisms + * or call any routine that must execute at IRQL = DISPATCH_LEVEL or below. */ -BOOLEAN +static BOOLEAN NTAPI -IntVideoPortResetDisplayParameters(ULONG Columns, ULONG Rows) +IntVideoPortResetDisplayParametersEx( + _In_ ULONG Columns, + _In_ ULONG Rows, + _In_ BOOLEAN CalledByInbv) { + BOOLEAN Success = TRUE; + PLIST_ENTRY PrevEntry, Entry; + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DRIVER_EXTENSION DriverExtension; - if (ResetDisplayParametersDeviceExtension == NULL) + if (IsListEmpty(&HwResetAdaptersList)) return FALSE; - DriverExtension = ResetDisplayParametersDeviceExtension->DriverExtension; + if (CalledByInbv) + { + /* + * We have been unexpectedly called via a callback from + * InbvAcquireDisplayOwnership(): start monitoring INBV. + */ + InbvMonitoring = TRUE; + } - if (DriverExtension->InitializationData.HwResetHw != NULL) + for (PrevEntry = &HwResetAdaptersList, Entry = PrevEntry->Flink; + Entry != &HwResetAdaptersList; + PrevEntry = Entry, Entry = Entry->Flink) { - if (DriverExtension->InitializationData.HwResetHw( - &ResetDisplayParametersDeviceExtension->MiniPortDeviceExtension, - Columns, Rows)) + /* + * Check whether the entry address is properly aligned, + * the device and driver extensions must be readable and + * the device extension properly back-linked to the last entry. + */ +// #define IS_ALIGNED(addr, align) (((ULONG64)(addr) & (align - 1)) == 0) + if (((ULONG_PTR)Entry & (sizeof(ULONG_PTR) - 1)) != 0) + return FALSE; + + DeviceExtension = CONTAINING_RECORD(Entry, + VIDEO_PORT_DEVICE_EXTENSION, + HwResetListEntry); + /* + * As this function can be called as part of the INBV initialization + * by the bugcheck code, avoid any problems and protect all accesses + * within SEH. + */ + _SEH2_TRY + { + DriverExtension = DeviceExtension->DriverExtension; + ASSERT(DriverExtension); + + if (DeviceExtension->HwResetListEntry.Blink != PrevEntry) + _SEH2_YIELD(return FALSE); + + if ((DeviceExtension->DeviceOpened >= 1) && + (DriverExtension->InitializationData.HwResetHw != NULL)) + { + Success &= DriverExtension->InitializationData.HwResetHw( + &DeviceExtension->MiniPortDeviceExtension, + Columns, Rows); + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - ResetDisplayParametersDeviceExtension = NULL; - return TRUE; } + _SEH2_END; } - ResetDisplayParametersDeviceExtension = NULL; - return FALSE; + return Success; } +/* This callback is registered with InbvNotifyDisplayOwnershipLost() */ +static BOOLEAN +NTAPI +IntVideoPortResetDisplayParameters(ULONG Columns, ULONG Rows) +{ + /* Call the extended function, specifying we were called by INBV */ + return IntVideoPortResetDisplayParametersEx(Columns, Rows, TRUE); +} + +/* + * (Adapted for ReactOS/Win2k3 from an original comment + * by Gé van Geldorp, June 2003, r4937) + * + * DISPLAY OWNERSHIP + * + * So, who owns the physical display and is allowed to write to it? + * + * In NT 5.x (Win2k/Win2k3), upon boot INBV/BootVid owns the display, unless + * /NOGUIBOOT has been specified in the boot command line. Later in the boot + * sequence, WIN32K.SYS opens the DISPLAY device. This open call ends up in + * VIDEOPRT.SYS. This component takes ownership of the display by calling + * InbvNotifyDisplayOwnershipLost() -- effectively telling INBV to release + * ownership of the display it previously had. From that moment on, the display + * is owned by that component and can be switched to graphics mode. The display + * is not supposed to return to text mode, except in case of a bugcheck. + * The bugcheck code calls InbvAcquireDisplayOwnership() so as to make INBV + * re-take display ownership, and calls back the function previously registered + * by VIDEOPRT.SYS with InbvNotifyDisplayOwnershipLost(). After the bugcheck, + * execution is halted. So, under NT, the only possible sequence of display + * modes is text mode -> graphics mode -> text mode (the latter hopefully + * happening very infrequently). + * + * In ReactOS things are a little bit different. We want to have a functional + * interactive text mode. We should be able to switch back and forth from + * text mode to graphics mode when a GUI app is started and then finished. + * Also, when the system bugchecks in graphics mode we want to switch back to + * text mode and show the bugcheck information. Last but not least, when using + * KDBG in /DEBUGPORT=SCREEN mode, breaking into the debugger would trigger a + * switch to text mode, and the user would expect that by continuing execution + * a switch back to graphics mode is done. + */ +static VOID +NTAPI +InbvMonitorThread( + _In_ PVOID Context) +{ + VIDEO_WIN32K_CALLBACKS_PARAMS CallbackParams; + LARGE_INTEGER Delay; + USHORT i; + + KeSetPriorityThread(KeGetCurrentThread(), LOW_REALTIME_PRIORITY); + + while (TRUE) + { + /* + * During one second, check the INBV status each 100 milliseconds, + * then revert to 1 second delay. + */ + i = 10; + Delay.QuadPart = (LONGLONG)-100*1000*10; // 100 millisecond delay + while (!InbvMonitoring) + { + KeDelayExecutionThread(KernelMode, FALSE, &Delay); + + if ((i > 0) && (--i == 0)) + Delay.QuadPart = (LONGLONG)-1*1000*1000*10; // 1 second delay + } + + /* + * Loop while the display is owned by INBV. We cannot do anything else + * than polling since INBV does not offer a proper notification system. + * + * During one second, check the INBV status each 100 milliseconds, + * then revert to 1 second delay. + */ + i = 10; + Delay.QuadPart = (LONGLONG)-100*1000*10; // 100 millisecond delay + while (InbvCheckDisplayOwnership()) + { + KeDelayExecutionThread(KernelMode, FALSE, &Delay); + + if ((i > 0) && (--i == 0)) + Delay.QuadPart = (LONGLONG)-1*1000*1000*10; // 1 second delay + } + + /* Reset the monitoring */ + InbvMonitoring = FALSE; + + /* + * Somebody released INBV display ownership, usually by invoking + * InbvNotifyDisplayOwnershipLost(). However the caller of this + * function certainly specified a different callback than ours. + * As we are going to be the only owner of the active display, + * we need to re-register our own display reset callback. + */ + InbvNotifyDisplayOwnershipLost(IntVideoPortResetDisplayParameters); + + /* Tell Win32k to reset the display */ + CallbackParams.CalloutType = VideoFindAdapterCallout; + // CallbackParams.PhysDisp = NULL; + CallbackParams.Param = (ULONG_PTR)TRUE; // TRUE: Re-enable display; FALSE: Disable display. + VideoPortWin32kCallout(&CallbackParams); + } + + // FIXME: See IntVideoPortInbvCleanup(). + // PsTerminateSystemThread(STATUS_SUCCESS); +} + +static NTSTATUS +IntVideoPortInbvInitialize(VOID) +{ + /* Create the INBV monitoring thread if needed */ + if (!InbvThreadHandle) + { + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes = RTL_CONSTANT_OBJECT_ATTRIBUTES(NULL, OBJ_KERNEL_HANDLE); + + Status = PsCreateSystemThread(&InbvThreadHandle, + 0, + &ObjectAttributes, + NULL, + NULL, + InbvMonitorThread, + NULL); + if (!NT_SUCCESS(Status)) + InbvThreadHandle = NULL; + } + + /* Re-register the display reset callback with INBV */ + InbvNotifyDisplayOwnershipLost(IntVideoPortResetDisplayParameters); + + return STATUS_SUCCESS; +} + +static NTSTATUS +IntVideoPortInbvCleanup( + IN PDEVICE_OBJECT DeviceObject) +{ + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; + // HANDLE ThreadHandle; + + DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + if ((DeviceExtension->DeviceOpened >= 1) && + (InterlockedDecrement((PLONG)&DeviceExtension->DeviceOpened) == 0)) + { + // RemoveEntryList(&DeviceExtension->HwResetListEntry); + InbvNotifyDisplayOwnershipLost(NULL); + IntVideoPortResetDisplayParametersEx(80, 50, FALSE); + // or InbvAcquireDisplayOwnership(); ? + } + +#if 0 + // TODO: Find the best way to communicate the request. + /* Signal the INBV monitoring thread and wait for it to terminate */ + ThreadHandle = InterlockedExchangePointer((PVOID*)&InbvThreadHandle, NULL); + if (ThreadHandle) + { + KeWaitForSingleObject(&ThreadHandle, Executive, KernelMode, FALSE, NULL); + /* Close its handle */ + ObCloseHandle(ThreadHandle, KernelMode); + } +#endif + + return STATUS_SUCCESS; +} + + NTSTATUS NTAPI IntVideoPortAddDevice( @@ -101,36 +342,39 @@ IntVideoPortDispatchOpen( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { + NTSTATUS Status; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; PVIDEO_PORT_DRIVER_EXTENSION DriverExtension; - NTSTATUS Status; TRACE_(VIDEOPRT, "IntVideoPortDispatchOpen\n"); - if (CsrssInitialized == FALSE) + if (!CsrProcess) { /* * We know the first open call will be from the CSRSS process * to let us know its handle. */ - INFO_(VIDEOPRT, "Referencing CSRSS\n"); - Csrss = (PKPROCESS)PsGetCurrentProcess(); - INFO_(VIDEOPRT, "Csrss %p\n", Csrss); + CsrProcess = (PKPROCESS)PsGetCurrentProcess(); + ObReferenceObject(CsrProcess); + INFO_(VIDEOPRT, "CsrProcess 0x%p\n", CsrProcess); Status = IntInitializeVideoAddressSpace(); if (!NT_SUCCESS(Status)) { ERR_(VIDEOPRT, "IntInitializeVideoAddressSpace() failed: 0x%lx\n", Status); + ObDereferenceObject(CsrProcess); + CsrProcess = NULL; return Status; } - - CsrssInitialized = TRUE; } DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension; DriverExtension = DeviceExtension->DriverExtension; + // FIXME: (Re-)initialize INBV only if DeviceObject doesn't belong to a mirror driver. + IntVideoPortInbvInitialize(); + if (DriverExtension->InitializationData.HwInitialize(&DeviceExtension->MiniPortDeviceExtension)) { Irp->IoStatus.Status = STATUS_SUCCESS; @@ -161,30 +405,19 @@ IntVideoPortDispatchClose( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; - TRACE_(VIDEOPRT, "IntVideoPortDispatchClose\n"); - DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - if ((DeviceExtension->DeviceOpened >= 1) && - (InterlockedDecrement((PLONG)&DeviceExtension->DeviceOpened) == 0)) - { - ResetDisplayParametersDeviceExtension = NULL; - InbvNotifyDisplayOwnershipLost(NULL); - ResetDisplayParametersDeviceExtension = DeviceExtension; - IntVideoPortResetDisplayParameters(80, 50); - } + IntVideoPortInbvCleanup(DeviceObject); Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; } PSTR IoctlName(ULONG Ioctl) { - switch(Ioctl) + switch (Ioctl) { case IOCTL_VIDEO_ENABLE_VDM: return "IOCTL_VIDEO_ENABLE_VDM"; // CTL_CODE(FILE_DEVICE_VIDEO, 0x00, METHOD_BUFFERED, FILE_ANY_ACCESS) @@ -296,7 +529,7 @@ IoctlName(ULONG Ioctl) return "IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS"; // CTL_CODE(FILE_DEVICE_VIDEO, 0x127, METHOD_BUFFERED, FILE_ANY_ACCESS) } - return "<unknown ioctl code"; + return "<unknown ioctl code>"; } static @@ -376,7 +609,7 @@ VideoPortInitWin32kCallbacks( /* Save the callout function globally */ Win32kCallout = Win32kCallbacks->Callout; - /* Return reasonable values to win32k */ + /* Return reasonable values to Win32k */ Win32kCallbacks->bACPI = FALSE; Win32kCallbacks->pPhysDeviceObject = DeviceObject; Win32kCallbacks->DualviewFlags = 0; @@ -465,12 +698,64 @@ IntVideoPortDispatchDeviceControl( IrpStack = IoGetCurrentIrpStackLocation(Irp); + switch (IrpStack->MajorFunction) + { + case IRP_MJ_DEVICE_CONTROL: + /* This is the main part of this function and is handled below */ + break; + + case IRP_MJ_SHUTDOWN: + { + /* Dereference CSRSS */ + PKPROCESS OldCsrProcess; + OldCsrProcess = InterlockedExchangePointer((PVOID*)&CsrProcess, NULL); + if (OldCsrProcess) + ObDereferenceObject(OldCsrProcess); + + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + } + + default: + ERR_(VIDEOPRT, "- Unknown MajorFunction 0x%x\n", IrpStack->MajorFunction); + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + } + IoControlCode = IrpStack->Parameters.DeviceIoControl.IoControlCode; - INFO_(VIDEOPRT, "- IoControlCode: %x: %s\n", IoControlCode, IoctlName(IoControlCode)); + INFO_(VIDEOPRT, "- IoControlCode: 0x%x: %s\n", IoControlCode, IoctlName(IoControlCode)); - switch(IoControlCode) + switch (IoControlCode) { + case IOCTL_VIDEO_ENABLE_VDM: + case IOCTL_VIDEO_DISABLE_VDM: + case IOCTL_VIDEO_REGISTER_VDM: + WARN_(VIDEOPRT, "- IOCTL_VIDEO_*_VDM are UNIMPLEMENTED!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case IOCTL_VIDEO_SET_OUTPUT_DEVICE_POWER_STATE: + case IOCTL_VIDEO_GET_OUTPUT_DEVICE_POWER_STATE: + WARN_(VIDEOPRT, "- IOCTL_VIDEO_GET/SET_OUTPUT_DEVICE_POWER_STATE are UNIMPLEMENTED!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case IOCTL_VIDEO_SET_POWER_MANAGEMENT: + case IOCTL_VIDEO_GET_POWER_MANAGEMENT: + WARN_(VIDEOPRT, "- IOCTL_VIDEO_GET/SET_POWER_MANAGEMENT are UNIMPLEMENTED!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS: + case IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS: + case IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS: + WARN_(VIDEOPRT, "- IOCTL_VIDEO_*_BRIGHTNESS are UNIMPLEMENTED!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + case IOCTL_VIDEO_INIT_WIN32K_CALLBACKS: INFO_(VIDEOPRT, "- IOCTL_VIDEO_INIT_WIN32K_CALLBACKS\n"); Status = VideoPortInitWin32kCallbacks(DeviceObject, @@ -479,6 +764,11 @@ IntVideoPortDispatchDeviceControl( &Irp->IoStatus.Information); break; + case IOCTL_VIDEO_IS_VGA_DEVICE: + WARN_(VIDEOPRT, "- IOCTL_VIDEO_IS_VGA_DEVICE is UNIMPLEMENTED!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + case IOCTL_VIDEO_USE_DEVICE_IN_SESSION: INFO_(VIDEOPRT, "- IOCTL_VIDEO_USE_DEVICE_IN_SESSION\n"); Status = VideoPortUseDeviceInSession(DeviceObject, @@ -487,71 +777,35 @@ IntVideoPortDispatchDeviceControl( &Irp->IoStatus.Information); break; + case IOCTL_VIDEO_PREPARE_FOR_EARECOVERY: + INFO_(VIDEOPRT, "- IOCTL_VIDEO_PREPARE_FOR_EARECOVERY\n"); + /* + * The Win32k Watchdog Timer detected that a thread spent more time + * in a display driver than the allotted time its threshold specified, + * and thus is going to attempt to recover by switching to VGA mode. + * If this attempt fails, the watchdog generates bugcheck 0xEA + * "THREAD_STUCK_IN_DEVICE_DRIVER". + * + * Prepare the recovery by resetting the display adapters to + * standard VGA 80x25 text mode. + */ + IntVideoPortResetDisplayParametersEx(80, 25, FALSE); + Status = STATUS_SUCCESS; + break; + default: /* Forward to the Miniport Driver */ Status = VideoPortForwardDeviceControl(DeviceObject, Irp); break; } - INFO_(VIDEOPRT, "- Returned status: %x\n", Irp->IoStatus.Status); + INFO_(VIDEOPRT, "- Returned status: 0x%x\n", Status); Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); - return Status; } -/* - * IntVideoPortWrite - * - * This is a bit of a hack. We want to take ownership of the display as late - * as possible, just before the switch to graphics mode. Win32k knows when - * this happens, we don't. So we need Win32k to inform us. This could be done - * using an IOCTL, but there's no way of knowing which IOCTL codes are unused - * in the communication between GDI driver and miniport driver. So we use - * IRP_MJ_WRITE as the signal that win32k is ready to switch to graphics mode, - * since we know for certain that there is no read/write activity going on - * between GDI and miniport drivers. - * We don't actually need the data that is passed, we just trigger on the fact - * that an IRP_MJ_WRITE was sent. - * - * Run Level - * PASSIVE_LEVEL - */ -NTSTATUS -NTAPI -IntVideoPortDispatchWrite( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) -{ - PIO_STACK_LOCATION piosStack = IoGetCurrentIrpStackLocation(Irp); - PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; - NTSTATUS nErrCode; - - DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - - /* - * Storing the device extension pointer in a static variable is an - * ugly hack. Unfortunately, we need it in IntVideoPortResetDisplayParameters - * and InbvNotifyDisplayOwnershipLost doesn't allow us to pass a userdata - * parameter. On the bright side, the DISPLAY device is opened - * exclusively, so there can be only one device extension active at - * any point in time. - * - * FIXME: We should process all opened display devices in - * IntVideoPortResetDisplayParameters. - */ - ResetDisplayParametersDeviceExtension = DeviceExtension; - InbvNotifyDisplayOwnershipLost(IntVideoPortResetDisplayParameters); - - nErrCode = STATUS_SUCCESS; - Irp->IoStatus.Information = piosStack->Parameters.Write.Length; - Irp->IoStatus.Status = nErrCode; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return nErrCode; -} - NTSTATUS NTAPI IntVideoPortPnPStartDevice( diff --git a/win32ss/drivers/videoprt/int10.c b/win32ss/drivers/videoprt/int10.c index f83ed0f3dd2..caa50ddfc35 100644 --- a/win32ss/drivers/videoprt/int10.c +++ b/win32ss/drivers/videoprt/int10.c @@ -393,7 +393,7 @@ VideoPortInt10( INT10_BIOS_ARGUMENTS Int10BiosArguments; VP_STATUS Status; - if (!CsrssInitialized) + if (!CsrProcess) { return ERROR_INVALID_PARAMETER; } diff --git a/win32ss/drivers/videoprt/videoprt.c b/win32ss/drivers/videoprt/videoprt.c index 812f55ad6af..6e75d563ea9 100644 --- a/win32ss/drivers/videoprt/videoprt.c +++ b/win32ss/drivers/videoprt/videoprt.c @@ -30,10 +30,10 @@ /* GLOBAL VARIABLES ***********************************************************/ -ULONG CsrssInitialized = FALSE; -PKPROCESS Csrss = NULL; +PKPROCESS CsrProcess = NULL; ULONG VideoPortDeviceNumber = 0; KMUTEX VideoPortInt10Mutex; +RTL_STATIC_LIST_HEAD(HwResetAdaptersList); /* PRIVATE FUNCTIONS **********************************************************/ @@ -406,6 +406,14 @@ IntVideoPortFindAdapter( goto Failure; } + /* If the device can be reset, insert it in the list of resettable adapters */ + InitializeListHead(&DeviceExtension->HwResetListEntry); + if (DriverExtension->InitializationData.HwResetHw != NULL) + { + InsertTailList(&HwResetAdaptersList, + &DeviceExtension->HwResetListEntry); + } + /* Query children of the device. */ VideoPortEnumerateChildren(&DeviceExtension->MiniPortDeviceExtension, NULL); @@ -427,9 +435,9 @@ IntAttachToCSRSS( PKAPC_STATE ApcState) { *CallingProcess = (PKPROCESS)PsGetCurrentProcess(); - if (*CallingProcess != Csrss) + if (*CallingProcess != CsrProcess) { - KeStackAttachProcess(Csrss, ApcState); + KeStackAttachProcess(CsrProcess, ApcState); } } @@ -439,7 +447,7 @@ IntDetachFromCSRSS( PKPROCESS *CallingProcess, PKAPC_STATE ApcState) { - if (*CallingProcess != Csrss) + if (*CallingProcess != CsrProcess) { KeUnstackDetachProcess(ApcState); } @@ -516,10 +524,8 @@ VideoPortInitialize( DriverObject->MajorFunction[IRP_MJ_CLOSE] = IntVideoPortDispatchClose; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = IntVideoPortDispatchDeviceControl; - DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = + DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = IntVideoPortDispatchDeviceControl; - DriverObject->MajorFunction[IRP_MJ_WRITE] = - IntVideoPortDispatchWrite; // ReactOS-specific hack DriverObject->DriverUnload = IntVideoPortUnload; /* Determine type of the miniport driver */ @@ -608,8 +614,8 @@ VideoPortInitialize( DriverExtension->HwContext = HwContext; /* - * Plug & Play drivers registers the device in AddDevice routine. For - * legacy drivers we must do it now. + * Plug & Play drivers registers the device in AddDevice routine. + * For legacy drivers we must do it now. */ if (LegacyDetection) { @@ -617,7 +623,7 @@ VideoPortInitialize( if (HwInitializationData->HwInitDataSize != SIZE_OF_NT4_VIDEO_HW_INITIALIZATION_DATA) { - /* power management */ + /* Power management */ DriverObject->MajorFunction[IRP_MJ_POWER] = IntVideoPortDispatchPower; } diff --git a/win32ss/drivers/videoprt/videoprt.h b/win32ss/drivers/videoprt/videoprt.h index 3490e5625ba..94289dc031a 100644 --- a/win32ss/drivers/videoprt/videoprt.h +++ b/win32ss/drivers/videoprt/videoprt.h @@ -32,11 +32,14 @@ #include <windef.h> #include <wdmguid.h> -#define TAG_VIDEO_PORT 'PDIV' -#define TAG_VIDEO_PORT_BUFFER '\0mpV' -#define TAG_REQUEST_PACKET 'qRpV' +/* PSEH for SEH Support */ +#include <pseh/pseh2.h> -#define GUID_STRING_LENGTH 38 * sizeof(WCHAR) +#define TAG_VIDEO_PORT 'PDIV' +#define TAG_VIDEO_PORT_BUFFER '\0mpV' +#define TAG_REQUEST_PACKET 'qRpV' + +#define GUID_STRING_LENGTH (38 * sizeof(WCHAR)) typedef struct _VIDEO_PORT_ADDRESS_MAPPING { @@ -102,6 +105,7 @@ typedef struct _VIDEO_PORT_DEVICE_EXTENSTION AGP_BUS_INTERFACE_STANDARD AgpInterface; KMUTEX DeviceLock; LIST_ENTRY DmaAdapterList, ChildDeviceList; + LIST_ENTRY HwResetListEntry; ULONG SessionId; CHAR MiniPortDeviceExtension[1]; } VIDEO_PORT_DEVICE_EXTENSION, *PVIDEO_PORT_DEVICE_EXTENSION; @@ -204,11 +208,6 @@ IntVideoPortDispatchSystemControl( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); -NTSTATUS NTAPI -IntVideoPortDispatchWrite( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); - VOID NTAPI IntVideoPortUnload(PDRIVER_OBJECT DriverObject); @@ -244,10 +243,10 @@ IntVideoPortMapPhysicalMemory( /* videoprt.c */ -extern ULONG CsrssInitialized; -extern PKPROCESS Csrss; +extern PKPROCESS CsrProcess; extern ULONG VideoPortDeviceNumber; extern KMUTEX VideoPortInt10Mutex; +extern LIST_ENTRY HwResetAdaptersList; VOID FASTCALL IntAttachToCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState); diff --git a/win32ss/gdi/eng/device.c b/win32ss/gdi/eng/device.c index 7691aad92f5..21f63f86a7c 100644 --- a/win32ss/gdi/eng/device.c +++ b/win32ss/gdi/eng/device.c @@ -8,7 +8,9 @@ */ #include <win32k.h> -DBG_DEFAULT_CHANNEL(EngDev) +#include <ntddvdeo.h> + +DBG_DEFAULT_CHANNEL(EngDev); PGRAPHICS_DEVICE gpPrimaryGraphicsDevice; PGRAPHICS_DEVICE gpVgaGraphicsDevice; @@ -156,6 +158,70 @@ EngpPopulateDeviceModeList( return TRUE; } +extern VOID +UserRefreshDisplay(IN PPDEVOBJ ppdev); + +// PVIDEO_WIN32K_CALLOUT +VOID +NTAPI +VideoPortCallout( + _In_ PVOID Params) +{ +/* + * IMPORTANT NOTICE!! On Windows XP/2003 this function triggers the creation of + * a specific VideoPortCalloutThread() system thread using the same mechanism + * as the RIT/desktop/Ghost system threads. + */ + + PVIDEO_WIN32K_CALLBACKS_PARAMS CallbackParams = (PVIDEO_WIN32K_CALLBACKS_PARAMS)Params; + + TRACE("VideoPortCallout(0x%p, 0x%x)\n", + CallbackParams, CallbackParams ? CallbackParams->CalloutType : -1); + + if (!CallbackParams) + return; + + switch (CallbackParams->CalloutType) + { + case VideoFindAdapterCallout: + { + TRACE("VideoPortCallout: VideoFindAdapterCallout called - Param = %s\n", + CallbackParams->Param ? "TRUE" : "FALSE"); + if (CallbackParams->Param == TRUE) + { + /* Re-enable the display */ + UserRefreshDisplay(gppdevPrimary); + } + else + { + /* Disable the display */ + NOTHING; // Nothing to do for the moment... + } + + CallbackParams->Status = STATUS_SUCCESS; + break; + } + + case VideoPowerNotifyCallout: + case VideoDisplaySwitchCallout: + case VideoEnumChildPdoNotifyCallout: + case VideoWakeupCallout: + case VideoChangeDisplaySettingsCallout: + case VideoPnpNotifyCallout: + case VideoDxgkDisplaySwitchCallout: + case VideoDxgkMonitorEventCallout: + case VideoDxgkFindAdapterTdrCallout: + ERR("VideoPortCallout: CalloutType 0x%x is UNIMPLEMENTED!\n", CallbackParams->CalloutType); + CallbackParams->Status = STATUS_NOT_IMPLEMENTED; + break; + + default: + ERR("VideoPortCallout: Unknown CalloutType 0x%x\n", CallbackParams->CalloutType); + CallbackParams->Status = STATUS_UNSUCCESSFUL; + break; + } +} + PGRAPHICS_DEVICE NTAPI EngpRegisterGraphicsDevice( @@ -168,10 +234,10 @@ EngpRegisterGraphicsDevice( PDEVICE_OBJECT pDeviceObject; PFILE_OBJECT pFileObject; NTSTATUS Status; + VIDEO_WIN32K_CALLBACKS Win32kCallbacks; + ULONG ulReturn; PWSTR pwsz; ULONG cj; - SIZE_T cjWritten; - BOOL bEnable = TRUE; TRACE("EngpRegisterGraphicsDevice(%wZ)\n", pustrDeviceName); @@ -197,13 +263,34 @@ EngpRegisterGraphicsDevice( return NULL; } - /* Enable the device */ - EngFileWrite(pFileObject, &bEnable, sizeof(BOOL), &cjWritten); - /* Copy the device and file object pointers */ pGraphicsDevice->DeviceObject = pDeviceObject; pGraphicsDevice->FileObject = pFileObject; + /* Initialize and register the device with videoprt for Win32k callbacks */ + Win32kCallbacks.PhysDisp = pGraphicsDevice; + Win32kCallbacks.Callout = VideoPortCallout; + // Reset the data being returned prior to the call. + Win32kCallbacks.bACPI = FALSE; + Win32kCallbacks.pPhysDeviceObject = NULL; + Win32kCallbacks.DualviewFlags = 0; + Status = (NTSTATUS)EngDeviceIoControl((HANDLE)pDeviceObject, + IOCTL_VIDEO_INIT_WIN32K_CALLBACKS, + &Win32kCallbacks, + sizeof(Win32kCallbacks), + &Win32kCallbacks, + sizeof(Win32kCallbacks), + &ulReturn); + if (Status != ERROR_SUCCESS) + { + ERR("EngDeviceIoControl(0x%p, IOCTL_VIDEO_INIT_WIN32K_CALLBACKS) failed, Status 0x%lx\n", + pDeviceObject, Status); + } + // TODO: Set flags according to the results. + // if (Win32kCallbacks.bACPI) + // if (Win32kCallbacks.DualviewFlags & ???) + // Win32kCallbacks.pPhysDeviceObject; + /* Copy the device name */ RtlStringCbCopyNW(pGraphicsDevice->szNtDeviceName, sizeof(pGraphicsDevice->szNtDeviceName), diff --git a/win32ss/user/ntuser/display.c b/win32ss/user/ntuser/display.c index cebaf8c1148..be0335c52da 100644 --- a/win32ss/user/ntuser/display.c +++ b/win32ss/user/ntuser/display.c @@ -285,6 +285,45 @@ InitVideo(VOID) return STATUS_SUCCESS; } +VOID +UserRefreshDisplay(IN PPDEVOBJ ppdev) +{ + ULONG_PTR ulResult; + // PVOID pvOldCursor; + + // TODO: Re-enable the cursor reset code once this function becomes called + // from within a Win32 thread... Indeed UserSetCursor() requires this, but + // at the moment this function is directly called from a separate thread + // from within videoprt, instead of by a separate win32k system thread. + + if (!ppdev) + return; + + PDEVOBJ_vReference(ppdev); + + /* Remove mouse pointer */ + // pvOldCursor = UserSetCursor(NULL, TRUE); + + /* Do the mode switch -- Use the actual same current mode */ + ulResult = PDEVOBJ_bSwitchMode(ppdev, ppdev->pdmwDev); + ASSERT(ulResult); + + /* Restore mouse pointer, no hooks called */ + // pvOldCursor = UserSetCursor(pvOldCursor, TRUE); + // ASSERT(pvOldCursor == NULL); + + /* Update the system metrics */ + InitMetrics(); + + /* Set new size of the monitor */ + // UserUpdateMonitorSize((HDEV)ppdev); + + //co_IntShowDesktop(pdesk, ppdev->gdiinfo.ulHorzRes, ppdev->gdiinfo.ulVertRes); + UserRedrawDesktop(); + + PDEVOBJ_vRelease(ppdev); +} + NTSTATUS NTAPI UserEnumDisplayDevices(
1
0
0
0
[reactos] 01/01: [USERENV] Improve Japanese translation again
by Katayama Hirofumi MZ
01 Dec '19
01 Dec '19
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c076d5819cfacb22a1156…
commit c076d5819cfacb22a115664a2eca935dd410eef7 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Dec 2 07:05:57 2019 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Dec 2 07:05:57 2019 +0900 [USERENV] Improve Japanese translation again --- dll/win32/userenv/lang/ja-JP.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/userenv/lang/ja-JP.rc b/dll/win32/userenv/lang/ja-JP.rc index c2b5f2120d7..df17904974a 100644 --- a/dll/win32/userenv/lang/ja-JP.rc +++ b/dll/win32/userenv/lang/ja-JP.rc @@ -20,5 +20,5 @@ BEGIN IDS_TEMP "Local Settings\\Temp" IDS_CACHE "Local Settings\\Temporary Internet Files" IDS_HISTORY "Local Settings\\History" - IDS_COOKIES "Cookies" + IDS_COOKIES "クッã‚ー" END
1
0
0
0
[reactos] 01/01: [SHELL32] Improve and fix SendTo (#2122)
by Katayama Hirofumi MZ
01 Dec '19
01 Dec '19
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b582d6ff459e49a5b0c84…
commit b582d6ff459e49a5b0c8459c10fedbae02fb3239 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Dec 2 04:06:20 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Dec 2 04:06:20 2019 +0900 [SHELL32] Improve and fix SendTo (#2122) Because of timing of SendTo folder initialization, SendTo My Documents didn't work well. Now My Documents item is working well. CORE-12562 --- dll/win32/shell32/CSendToMenu.cpp | 159 +++++++++++++++++++++++++++++++++++++ dll/win32/shell32/CSendToMenu.h | 3 + dll/win32/shell32/wine/shellpath.c | 128 ----------------------------- 3 files changed, 162 insertions(+), 128 deletions(-) diff --git a/dll/win32/shell32/CSendToMenu.cpp b/dll/win32/shell32/CSendToMenu.cpp index 9e9fbe8afeb..8a7e1bc0bd8 100644 --- a/dll/win32/shell32/CSendToMenu.cpp +++ b/dll/win32/shell32/CSendToMenu.cpp @@ -156,10 +156,169 @@ void CSendToMenu::UnloadAllItems() } } +BOOL CSendToMenu::FolderHasAnyItems() const +{ + WCHAR szPath[MAX_PATH]; + SHGetSpecialFolderPathW(NULL, szPath, CSIDL_SENDTO, FALSE); + + PathAppendW(szPath, L"*"); + + WIN32_FIND_DATAW find; + HANDLE hFind = FindFirstFileW(szPath, &find); + if (hFind == INVALID_HANDLE_VALUE) + return FALSE; + + BOOL bFound = FALSE; + do + { + if (wcscmp(find.cFileName, L".") == 0 || + wcscmp(find.cFileName, L"..") == 0 || + _wcsicmp(find.cFileName, L"desktop.ini") == 0) + { + continue; + } + + bFound = TRUE; + break; + } while (FindNextFileW(hFind, &find)); + + FindClose(hFind); + return bFound; +} + +static BOOL CreateEmptyFile(LPCWSTR pszFile) +{ + HANDLE hFile; + hFile = CreateFileW(pszFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + CloseHandle(hFile); + return hFile != INVALID_HANDLE_VALUE; +} + +static HRESULT +CreateShellLink( + LPCWSTR pszLinkPath, + LPCWSTR pszTargetPath OPTIONAL, + LPCITEMIDLIST pidlTarget OPTIONAL, + LPCWSTR pszArg OPTIONAL, + LPCWSTR pszDir OPTIONAL, + LPCWSTR pszIconPath OPTIONAL, + INT iIconNr OPTIONAL, + LPCWSTR pszComment OPTIONAL) +{ + CComPtr<IShellLinkW> psl; + HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IShellLinkW, &psl)); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + if (pszTargetPath) + { + hr = psl->SetPath(pszTargetPath); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + } + else if (pidlTarget) + { + hr = psl->SetIDList(pidlTarget); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + } + else + { + ERR("invalid argument\n"); + return E_INVALIDARG; + } + + if (pszArg) + hr = psl->SetArguments(pszArg); + + if (pszDir) + hr = psl->SetWorkingDirectory(pszDir); + + if (pszIconPath) + hr = psl->SetIconLocation(pszIconPath, iIconNr); + + if (pszComment) + hr = psl->SetDescription(pszComment); + + CComPtr<IPersistFile> ppf; + hr = psl->QueryInterface(IID_PPV_ARG(IPersistFile, &ppf)); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + hr = ppf->Save(pszLinkPath, TRUE); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + return hr; +} + +HRESULT CSendToMenu::CreateSendToFiles(LPCWSTR pszSendTo) +{ + WCHAR szTarget[MAX_PATH]; + WCHAR szSendToFile[MAX_PATH]; + WCHAR szShell32[MAX_PATH]; + HRESULT hr; + + /* create my documents */ + SHGetSpecialFolderPathW(NULL, szTarget, CSIDL_MYDOCUMENTS, FALSE); + + StringCbCopyW(szSendToFile, sizeof(szSendToFile), pszSendTo); + PathAppendW(szSendToFile, PathFindFileNameW(szTarget)); + StringCbCatW(szSendToFile, sizeof(szSendToFile), L".lnk"); + + GetSystemDirectoryW(szShell32, ARRAY_SIZE(szShell32)); + PathAppendW(szShell32, L"shell32.dll"); + hr = CreateShellLink(szSendToFile, szTarget, NULL, NULL, NULL, + szShell32, -IDI_SHELL_MY_DOCUMENTS, NULL); + if (FAILED_UNEXPECTEDLY(hr)) + ; + + /* create desklink */ + StringCbCopyW(szSendToFile, sizeof(szSendToFile), pszSendTo); + LoadStringW(shell32_hInstance, IDS_DESKLINK, szTarget, _countof(szTarget)); + StringCbCatW(szTarget, sizeof(szTarget), L".DeskLink"); + PathAppendW(szSendToFile, szTarget); + if (!CreateEmptyFile(szSendToFile)) + { + ERR("CreateEmptyFile\n"); + } + + /* create zipped compressed folder */ + HINSTANCE hZipFldr = + LoadLibraryExW(L"zipfldr.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); + if (hZipFldr) + { +#define IDS_FRIENDLYNAME 10195 + LoadStringW(hZipFldr, IDS_FRIENDLYNAME, szTarget, _countof(szTarget)); +#undef IDS_FRIENDLYNAME + FreeLibrary(hZipFldr); + + StringCbCopyW(szSendToFile, sizeof(szSendToFile), pszSendTo); + PathAppendW(szSendToFile, szTarget); + StringCbCatW(szSendToFile, sizeof(szSendToFile), L".ZFSendToTarget"); + if (!CreateEmptyFile(szSendToFile)) + { + ERR("CreateEmptyFile\n"); + } + } + + return S_OK; +} + HRESULT CSendToMenu::LoadAllItems(HWND hwnd) { UnloadAllItems(); + if (!FolderHasAnyItems()) + { + WCHAR szPath[MAX_PATH]; + SHGetSpecialFolderPathW(NULL, szPath, CSIDL_SENDTO, FALSE); + CreateSendToFiles(szPath); + } + CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidlSendTo; m_pSendTo.Release(); diff --git a/dll/win32/shell32/CSendToMenu.h b/dll/win32/shell32/CSendToMenu.h index 2f59319921e..2156f1ee75e 100644 --- a/dll/win32/shell32/CSendToMenu.h +++ b/dll/win32/shell32/CSendToMenu.h @@ -69,6 +69,9 @@ private: HRESULT LoadAllItems(HWND hwnd); void UnloadAllItems(); + BOOL FolderHasAnyItems() const; + HRESULT CreateSendToFiles(LPCWSTR pszSendTo); + UINT InsertSendToItems(HMENU hMenu, UINT idFirst, UINT idMenu); SENDTO_ITEM *FindItemFromIdOffset(UINT IdOffset); diff --git a/dll/win32/shell32/wine/shellpath.c b/dll/win32/shell32/wine/shellpath.c index 984116f8a38..9ca628f4bbe 100644 --- a/dll/win32/shell32/wine/shellpath.c +++ b/dll/win32/shell32/wine/shellpath.c @@ -2146,129 +2146,6 @@ cleanup: return hr; } -static HRESULT -CreateShellLink( - LPCWSTR pszLinkPath, - LPCWSTR pszCmd, - LPCWSTR pszArg OPTIONAL, - LPCWSTR pszDir OPTIONAL, - LPCWSTR pszIconPath OPTIONAL, - INT iIconNr OPTIONAL, - LPCWSTR pszComment OPTIONAL) -{ - IShellLinkW *psl; - IPersistFile *ppf; - - HRESULT hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLink, (LPVOID*)&psl); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - hr = IShellLinkW_SetPath(psl, pszCmd); - if (FAILED_UNEXPECTEDLY(hr)) - { - IShellLinkW_Release(psl); - return hr; - } - - if (pszArg) - hr = IShellLinkW_SetArguments(psl, pszArg); - - if (pszDir) - hr = IShellLinkW_SetWorkingDirectory(psl, pszDir); - - if (pszIconPath) - hr = IShellLinkW_SetIconLocation(psl, pszIconPath, iIconNr); - - if (pszComment) - hr = IShellLinkW_SetDescription(psl, pszComment); - - hr = IShellLinkW_QueryInterface(psl, &IID_IPersistFile, (LPVOID*)&ppf); - - if (SUCCEEDED(hr)) - { - hr = IPersistFile_Save(ppf, pszLinkPath, TRUE); - IPersistFile_Release(ppf); - } - - IShellLinkW_Release(psl); - - return hr; -} - -static HRESULT -CreateShellLinkCoInit( - LPCWSTR pszLinkPath, - LPCWSTR pszCmd, - LPCWSTR pszArg OPTIONAL, - LPCWSTR pszDir OPTIONAL, - LPCWSTR pszIconPath OPTIONAL, - INT iIconNr OPTIONAL, - LPCWSTR pszComment OPTIONAL) -{ - HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); - BOOL bCoInit = (hr == S_OK); - - hr = CreateShellLink(pszLinkPath, pszCmd, pszArg, pszDir, - pszIconPath, iIconNr, pszComment); - - if (bCoInit) - CoUninitialize(); - - return hr; -} - -HRESULT DoCreateSendToFiles(LPCWSTR pszSendTo) -{ - WCHAR szTarget[MAX_PATH]; - WCHAR szSendToFile[MAX_PATH]; - WCHAR szShell32[MAX_PATH]; - HRESULT hr; - HANDLE hFile; - HINSTANCE hZipFldr; - - /* create my documents */ - SHGetSpecialFolderPathW(NULL, szTarget, CSIDL_MYDOCUMENTS, TRUE); - - StringCbCopyW(szSendToFile, sizeof(szSendToFile), pszSendTo); - PathAppendW(szSendToFile, PathFindFileNameW(szTarget)); - StringCbCatW(szSendToFile, sizeof(szSendToFile), L".lnk"); - - GetSystemDirectoryW(szShell32, ARRAY_SIZE(szShell32)); - PathAppendW(szShell32, L"shell32.dll"); - hr = CreateShellLinkCoInit(szSendToFile, szTarget, NULL, NULL, - szShell32, -IDI_SHELL_MY_DOCUMENTS, NULL); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - - /* create desklink */ - StringCbCopyW(szSendToFile, sizeof(szSendToFile), pszSendTo); - LoadStringW(shell32_hInstance, IDS_DESKLINK, szTarget, _countof(szTarget)); - StringCbCatW(szTarget, sizeof(szTarget), L".DeskLink"); - PathAppendW(szSendToFile, szTarget); - hFile = CreateFileW(szSendToFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - CloseHandle(hFile); - - /* create zipped compressed folder */ - hZipFldr = LoadLibraryW(L"zipfldr.dll"); - if (hZipFldr) - { -#define IDS_FRIENDLYNAME 10195 - LoadStringW(hZipFldr, IDS_FRIENDLYNAME, szTarget, _countof(szTarget)); -#undef IDS_FRIENDLYNAME - FreeLibrary(hZipFldr); - - StringCbCopyW(szSendToFile, sizeof(szSendToFile), pszSendTo); - PathAppendW(szSendToFile, szTarget); - StringCbCatW(szSendToFile, sizeof(szSendToFile), L".ZFSendToTarget"); - hFile = CreateFileW(szSendToFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - CloseHandle(hFile); - } - - return S_OK; -} - /************************************************************************* * SHGetFolderPathAndSubDirW [SHELL32.@] */ @@ -2408,11 +2285,6 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( TRACE("Created missing system directory %s\n", debugstr_w(szBuildPath)); end: - if ((nFolder & CSIDL_FLAG_CREATE) && folder == CSIDL_SENDTO) - { - DoCreateSendToFiles(szBuildPath); - } - /* create desktop.ini for custom icon */ if ((nFolder & CSIDL_FLAG_CREATE) && CSIDL_Data[folder].nShell32IconIndex)
1
0
0
0
[reactos] 01/01: [WBEMPROX_WINETEST] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
01 Dec '19
01 Dec '19
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=92c3c814bb57107379628…
commit 92c3c814bb571073796287df4eb0eb3fc58e4c6e Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:45:25 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:45:25 2019 +0100 [WBEMPROX_WINETEST] Sync with Wine Staging 4.18. CORE-16441 --- modules/rostests/winetests/wbemprox/query.c | 959 +++++++++++++--------------- 1 file changed, 454 insertions(+), 505 deletions(-) diff --git a/modules/rostests/winetests/wbemprox/query.c b/modules/rostests/winetests/wbemprox/query.c index 0fa6b5e9668..40eaefee4c7 100644 --- a/modules/rostests/winetests/wbemprox/query.c +++ b/modules/rostests/winetests/wbemprox/query.c @@ -46,6 +46,8 @@ static HRESULT exec_query( IWbemServices *services, const WCHAR *str, IEnumWbemC for (;;) { VARIANT var; + IWbemQualifierSet *qualifiers; + SAFEARRAY *names; IEnumWbemClassObject_Next( *result, 10000, 1, &obj, &count ); if (!count) break; @@ -60,6 +62,15 @@ static HRESULT exec_query( IWbemServices *services, const WCHAR *str, IEnumWbemC trace("description: %s\n", wine_dbgstr_w(V_BSTR(&var))); VariantClear( &var ); } + + hr = IWbemClassObject_GetQualifierSet( obj, &qualifiers ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = IWbemQualifierSet_GetNames( qualifiers, 0, &names ); + ok( hr == S_OK, "got %08x\n", hr ); + + SafeArrayDestroy( names ); + IWbemQualifierSet_Release( qualifiers ); IWbemClassObject_Release( obj ); } } @@ -112,8 +123,14 @@ static void test_select( IWbemServices *services ) static const WCHAR query13[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_','B','I','O','S', ' ','W','H','E','R','E',' ','N','U','L','L',' ','=',' ','N','A','M','E', 0}; + static const WCHAR query14[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k','T','o','P','a','r','t','i','t','i','o','n',0}; + static const WCHAR query15[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'D','i','s','k','D','r','i','v','e','T','o','D','i','s','k','P','a','r','t','i','t','i','o','n',0}; static const WCHAR *test[] = { query1, query2, query3, query4, query5, query6, query7, query8, query9, query10, - query11, query12, query13 }; + query11, query12, query13, query14, query15 }; HRESULT hr; IEnumWbemClassObject *result; BSTR wql = SysAllocString( wqlW ); @@ -156,14 +173,37 @@ static void test_select( IWbemServices *services ) static void test_associators( IWbemServices *services ) { static const WCHAR query1[] = - {'A','S','S','O','C','I','A','T','O','R','S',' ','O','F',' ','{','W','i','n','3','2','_', + {'A','S','S','O','C','I','A','T','O','R','S',' ',' ','O','F','{','W','i','n','3','2','_', 'L','o','g','i','c','a','l','D','i','s','k','.','D','e','v','i','c','e','I','D','=','"','C',':','"','}',0}; static const WCHAR query2[] = {'A','S','S','O','C','I','A','T','O','R','S',' ','O','F',' ','{','W','i','n','3','2','_', 'L','o','g','i','c','a','l','D','i','s','k','.','D','e','v','i','c','e','I','D','=','"','C',':','"','}',' ', - 'W','H','E','R','E',' ','A','s','s','o','c','C','l','a','s','s',' ','=',' ','W','i','n','3','2','_', + 'W','H','E','R','E',' ','A','s','s','o','c','C','l','a','s','s','=','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k','T','o','P','a','r','t','i','t','i','o','n',0}; + static const WCHAR query3[] = + {'A','S','S','O','C','I','A','T','O','R','S',' ',' ','O','F',' ','{','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k','.','D','e','v','i','c','e','I','D','}',0}; + static const WCHAR query4[] = + {'A','S','S','O','C','I','A','T','O','R','S',' ',' ','O','F',' ','{','W','i','n','3','2','_', + 'D','i','s','k','D','r','i','v','e','.','D','e','v','i','c','e','I','D','=', + '\'','\\','\\','.','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0','\'','}',0}; + static const WCHAR query5[] = + {'A','S','S','O','C','I','A','T','O','R','S',' ','O','F',' ','{','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k','.','D','e','v','i','c','e','I','D','=','"','C',':','"','}',' ', + 'W','H','E','R','E',' ','A','s','s','o','c','C','l','a','s','s','=','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k','T','o','P','a','r','t','i','t','i','o','n',' ', + 'C','l','a','s','s','D','e','f','s','O','n','l','y',0}; + static const WCHAR query6[] = + {'A','S','S','O','C','I','A','T','O','R','S',' ','O','F',' ','{','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k','.','D','e','v','i','c','e','I','D','=','"','C',':','"','}',' ', + 'W','H','E','R','E',' ','C','l','a','s','s','D','e','f','s','O','n','l','y',0}; + static const WCHAR query7[] = + {'A','S','S','O','C','I','A','T','O','R','S',' ','O','F',' ','{','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k','.','D','e','v','i','c','e','I','D','=','"','C',':','"','}',' ', + 'W','H','E','R','E',' ','C','l','a','s','s','D','e','f','s','O','n','l','y',' ', + 'A','s','s','o','c','C','l','a','s','s',' ','=',' ','W','i','n','3','2','_', 'L','o','g','i','c','a','l','D','i','s','k','T','o','P','a','r','t','i','t','i','o','n',0}; - static const WCHAR *test[] = { query1, query2 }; + static const WCHAR *test[] = { query1, query2, query3, query4, query5, query6, query7 }; HRESULT hr; IEnumWbemClassObject *result; UINT i; @@ -171,22 +211,55 @@ static void test_associators( IWbemServices *services ) for (i = 0; i < ARRAY_SIZE( test ); i++) { hr = exec_query( services, test[i], &result ); - todo_wine ok( hr == S_OK, "query %u failed: %08x\n", i, hr ); + ok( hr == S_OK, "query %u failed: %08x\n", i, hr ); if (result) IEnumWbemClassObject_Release( result ); } } +static void _check_property( ULONG line, IWbemClassObject *obj, const WCHAR *prop, VARTYPE vartype, CIMTYPE cimtype ) +{ + CIMTYPE type = 0xdeadbeef; + VARIANT val; + HRESULT hr; + + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, prop, 0, &val, &type, NULL ); + ok( hr == S_OK, "%u: failed to get description %08x\n", line, hr ); + ok( V_VT( &val ) == vartype, "%u: unexpected variant type 0x%x\n", line, V_VT(&val) ); + ok( type == cimtype, "%u: unexpected type 0x%x\n", line, type ); + switch (V_VT(&val)) + { + case VT_BSTR: + trace( "%s: %s\n", wine_dbgstr_w(prop), wine_dbgstr_w(V_BSTR(&val)) ); + break; + case VT_I2: + trace( "%s: %d\n", wine_dbgstr_w(prop), V_I2(&val) ); + break; + case VT_I4: + trace( "%s: %d\n", wine_dbgstr_w(prop), V_I4(&val) ); + break; + case VT_R4: + trace( "%s: %f\n", wine_dbgstr_w(prop), V_R4(&val) ); + break; + default: + break; + } + VariantClear( &val ); +} +#define check_property(a,b,c,d) _check_property(__LINE__,a,b,c,d) + static void test_Win32_Service( IWbemServices *services ) { - static const WCHAR returnvalueW[] = {'R','e','t','u','r','n','V','a','l','u','e',0}; static const WCHAR pauseserviceW[] = {'P','a','u','s','e','S','e','r','v','i','c','e',0}; + static const WCHAR processidW[] = {'P','r','o','c','e','s','s','I','D',0}; static const WCHAR resumeserviceW[] = {'R','e','s','u','m','e','S','e','r','v','i','c','e',0}; + static const WCHAR returnvalueW[] = {'R','e','t','u','r','n','V','a','l','u','e',0}; + static const WCHAR serviceW[] = {'W','i','n','3','2','_','S','e','r','v','i','c','e','.', + 'N','a','m','e','=','"','S','p','o','o','l','e','r','"',0}; static const WCHAR startserviceW[] = {'S','t','a','r','t','S','e','r','v','i','c','e',0}; - static const WCHAR stopserviceW[] = {'S','t','o','p','S','e','r','v','i','c','e',0}; static const WCHAR stateW[] = {'S','t','a','t','e',0}; static const WCHAR stoppedW[] = {'S','t','o','p','p','e','d',0}; - static const WCHAR serviceW[] = {'W','i','n','3','2','_','S','e','r','v','i','c','e','.', - 'N','a','m','e','=','"','S','p','o','o','l','e','r','"',0}; + static const WCHAR stopserviceW[] = {'S','t','o','p','S','e','r','v','i','c','e',0}; static const WCHAR emptyW[] = {0}; BSTR class = SysAllocString( serviceW ), empty = SysAllocString( emptyW ), method; IWbemClassObject *service, *out; @@ -200,6 +273,8 @@ static void test_Win32_Service( IWbemServices *services ) win_skip( "Win32_Service not available\n" ); goto out; } + + check_property( service, processidW, VT_I4, CIM_UINT32 ); type = 0xdeadbeef; VariantInit( &state ); hr = IWbemClassObject_Get( service, stateW, 0, &state, &type, NULL ); @@ -280,7 +355,7 @@ out: static void test_Win32_Bios( IWbemServices *services ) { static const WCHAR queryW[] = - {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', 'B','i','o','s',0}; + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_','B','i','o','s',0}; static const WCHAR descriptionW[] = {'D','e','s','c','r','i','p','t','i','o','n',0}; static const WCHAR identificationcodeW[] = {'I','d','e','n','t','i','f','i','c','a','t','i','o','n','C','o','d','e',0}; static const WCHAR manufacturerW[] = {'M','a','n','u','f','a','c','t','u','r','e','r',0}; @@ -305,49 +380,11 @@ static void test_Win32_Bios( IWbemServices *services ) hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); ok( hr == S_OK, "IEnumWbemClassObject_Next failed %08x\n", hr ); - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, descriptionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get description %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "description: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, identificationcodeW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get identication code %08x\n", hr ); - ok( V_VT( &val ) == VT_NULL, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, manufacturerW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get manufacturer %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "manufacturer: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, nameW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get name %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "name: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, releasedateW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get release date %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_DATETIME, "unexpected type 0x%x\n", type ); - trace( "release date: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); + check_property( obj, descriptionW, VT_BSTR, CIM_STRING ); + check_property( obj, identificationcodeW, VT_NULL, CIM_STRING ); + check_property( obj, manufacturerW, VT_BSTR, CIM_STRING ); + check_property( obj, nameW, VT_BSTR, CIM_STRING ); + check_property( obj, releasedateW, VT_BSTR, CIM_DATETIME ); type = 0xdeadbeef; VariantInit( &val ); @@ -358,40 +395,62 @@ static void test_Win32_Bios( IWbemServices *services ) ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); VariantClear( &val ); - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, smbiosbiosversionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get bios version %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "bios version: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); + check_property( obj, smbiosbiosversionW, VT_BSTR, CIM_STRING ); + check_property( obj, smbiosmajorversionW, VT_I4, CIM_UINT16 ); + check_property( obj, smbiosminorversionW, VT_I4, CIM_UINT16 ); + check_property( obj, versionW, VT_BSTR, CIM_STRING ); - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, smbiosmajorversionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get bios major version %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT16, "unexpected type 0x%x\n", type ); - trace( "bios major version: %u\n", V_I4( &val ) ); + IWbemClassObject_Release( obj ); + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, smbiosminorversionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get bios minor version %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT16, "unexpected type 0x%x\n", type ); - trace( "bios minor version: %u\n", V_I4( &val ) ); +static void test_Win32_Baseboard( IWbemServices *services ) +{ + static const WCHAR queryW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_','B','a','s','e','b','o','a','r','d',0}; + static const WCHAR manufacturerW[] = {'M','a','n','u','f','a','c','t','u','r','e','r',0}; + static const WCHAR modelW[] = {'M','o','d','e','l',0}; + static const WCHAR nameW[] = {'N','a','m','e',0}; + static const WCHAR productW[] = {'P','r','o','d','u','c','t',0}; + static const WCHAR tagW[] = {'T','a','g',0}; + static const WCHAR versionW[] = {'V','e','r','s','i','o','n',0}; + BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + CIMTYPE type; + ULONG count; + VARIANT val; + HRESULT hr; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK, "IWbemServices_ExecQuery failed %08x\n", hr ); + + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (hr != S_OK) + { + win_skip( "Win32_Baseboard not available\n" ); + return; + } + ok( hr == S_OK, "IEnumWbemClassObject_Next failed %08x\n", hr ); + + check_property( obj, manufacturerW, VT_BSTR, CIM_STRING ); type = 0xdeadbeef; VariantInit( &val ); - hr = IWbemClassObject_Get( obj, versionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get version %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + hr = IWbemClassObject_Get( obj, modelW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get model %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR || V_VT( &val ) == VT_NULL, "unexpected variant type 0x%x\n", V_VT( &val ) ); ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "version: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + trace( "model: %s\n", wine_dbgstr_w(V_BSTR(&val)) ); VariantClear( &val ); + check_property( obj, nameW, VT_BSTR, CIM_STRING ); + check_property( obj, productW, VT_BSTR, CIM_STRING ); + check_property( obj, tagW, VT_BSTR, CIM_STRING ); + check_property( obj, versionW, VT_BSTR, CIM_STRING ); + IWbemClassObject_Release( obj ); IEnumWbemClassObject_Release( result ); SysFreeString( query ); @@ -417,7 +476,7 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path ) BSTR class, method; IWbemClassObject *process, *sig_in, *out; IWbemQualifierSet *qualifiers; - VARIANT user, domain, retval, val; + VARIANT retval, val; DWORD full_path_len = 0; LONG flavor; CIMTYPE type; @@ -466,21 +525,8 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path ) ok( !V_I4( &retval ), "unexpected error %u\n", V_I4( &retval ) ); ok( type == CIM_UINT32, "unexpected type 0x%x\n", type ); - type = 0xdeadbeef; - VariantInit( &user ); - hr = IWbemClassObject_Get( out, userW, 0, &user, &type, NULL ); - ok( hr == S_OK, "failed to get user %08x\n", hr ); - ok( V_VT( &user ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &user ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace("%s\n", wine_dbgstr_w(V_BSTR(&user))); - - type = 0xdeadbeef; - VariantInit( &domain ); - hr = IWbemClassObject_Get( out, domainW, 0, &domain, &type, NULL ); - ok( hr == S_OK, "failed to get domain %08x\n", hr ); - ok( V_VT( &domain ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &domain ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace("%s\n", wine_dbgstr_w(V_BSTR(&domain))); + check_property( out, userW, VT_BSTR, CIM_STRING ); + check_property( out, domainW, VT_BSTR, CIM_STRING ); hr = IWbemClassObject_GetPropertyQualifierSet( out, userW, &qualifiers ); ok( hr == S_OK, "failed to get qualifier set %08x\n", hr ); @@ -517,8 +563,6 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path ) ok( hr == WBEM_E_NOT_FOUND, "got %08x\n", hr ); IWbemQualifierSet_Release( qualifiers ); - VariantClear( &user ); - VariantClear( &domain ); IWbemClassObject_Release( out ); } @@ -529,12 +573,16 @@ static void test_Win32_ComputerSystem( IWbemServices *services ) static const WCHAR modelW[] = {'M','o','d','e','l',0}; static const WCHAR nameW[] = {'N','a','m','e',0}; static const WCHAR usernameW[] = {'U','s','e','r','N','a','m','e',0}; + static const WCHAR numprocessorsW[] = + {'N','u','m','b','e','r','O','f','P','r','o','c','e','s','s','o','r','s',0}; + static const WCHAR numlogicalprocessorsW[] = + {'N','u','m','b','e','r','O','f','L','o','g','i','c','a','l','P','r','o','c','e','s','s','o','r','s',0}; static const WCHAR queryW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', 'C','o','m','p','u','t','e','r','S','y','s','t','e','m',0}; BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); IEnumWbemClassObject *result; - IWbemClassObject *service; + IWbemClassObject *obj; VARIANT value; CIMTYPE type; HRESULT hr; @@ -565,26 +613,19 @@ static void test_Win32_ComputerSystem( IWbemServices *services ) goto out; } - hr = IEnumWbemClassObject_Next( result, 10000, 1, &service, &count ); + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); ok( hr == S_OK, "got %08x\n", hr ); type = 0xdeadbeef; VariantInit( &value ); - hr = IWbemClassObject_Get( service, memorytypeW, 0, &value, &type, NULL ); + hr = IWbemClassObject_Get( obj, memorytypeW, 0, &value, &type, NULL ); ok( hr == WBEM_E_NOT_FOUND, "got %08x\n", hr ); - type = 0xdeadbeef; - VariantInit( &value ); - hr = IWbemClassObject_Get( service, modelW, 0, &value, &type, NULL ); - ok( hr == S_OK, "failed to get model %08x\n", hr ); - ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "model: %s\n", wine_dbgstr_w(V_BSTR( &value )) ); - VariantClear( &value ); + check_property( obj, modelW, VT_BSTR, CIM_STRING ); type = 0xdeadbeef; VariantInit( &value ); - hr = IWbemClassObject_Get( service, nameW, 0, &value, &type, NULL ); + hr = IWbemClassObject_Get( obj, nameW, 0, &value, &type, NULL ); ok( hr == S_OK, "failed to get computer name %08x\n", hr ); ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); @@ -593,14 +634,27 @@ static void test_Win32_ComputerSystem( IWbemServices *services ) type = 0xdeadbeef; VariantInit( &value ); - hr = IWbemClassObject_Get( service, usernameW, 0, &value, &type, NULL ); + hr = IWbemClassObject_Get( obj, numlogicalprocessorsW, 0, &value, &type, NULL ); + ok( hr == S_OK || broken(hr == WBEM_E_NOT_FOUND) /* win2k3 */, "got %08x\n", hr ); + if (hr == S_OK) + { + ok( V_VT( &value ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &value ) ); + ok( type == CIM_UINT32, "unexpected type 0x%x\n", type ); + trace( "numlogicalprocessors %u\n", V_I4( &value ) ); + } + + check_property( obj, numprocessorsW, VT_I4, CIM_UINT32 ); + + type = 0xdeadbeef; + VariantInit( &value ); + hr = IWbemClassObject_Get( obj, usernameW, 0, &value, &type, NULL ); ok( hr == S_OK, "failed to get computer name %08x\n", hr ); ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); ok( !lstrcmpiW( V_BSTR( &value ), username ), "got %s, expected %s\n", wine_dbgstr_w(V_BSTR(&value)), wine_dbgstr_w(username) ); VariantClear( &value ); - IWbemClassObject_Release( service ); + IWbemClassObject_Release( obj ); IEnumWbemClassObject_Release( result ); out: SysFreeString( query ); @@ -634,14 +688,7 @@ static void test_Win32_SystemEnclosure( IWbemServices *services ) hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); ok( hr == S_OK, "IEnumWbemClassObject_Next failed %08x\n", hr ); - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, captionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get caption %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "caption: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); + check_property( obj, captionW, VT_BSTR, CIM_STRING ); type = 0xdeadbeef; VariantInit( &val ); @@ -669,50 +716,11 @@ static void test_Win32_SystemEnclosure( IWbemServices *services ) } VariantClear( &val ); - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, descriptionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get description %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "description: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, lockpresentW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get lockpresent %08x\n", hr ); - ok( V_VT( &val ) == VT_BOOL, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_BOOLEAN, "unexpected type 0x%x\n", type ); - trace( "lockpresent: %u\n", V_BOOL( &val ) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, manufacturerW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get manufacturer %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "manufacturer: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, nameW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get name %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "name: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, tagW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get tag %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "tag: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); + check_property( obj, descriptionW, VT_BSTR, CIM_STRING ); + check_property( obj, lockpresentW, VT_BOOL, CIM_BOOLEAN ); + check_property( obj, manufacturerW, VT_BSTR, CIM_STRING ); + check_property( obj, nameW, VT_BSTR, CIM_STRING ); + check_property( obj, tagW, VT_BSTR, CIM_STRING ); IWbemClassObject_Release( obj ); IEnumWbemClassObject_Release( result ); @@ -742,7 +750,7 @@ static void test_StdRegProv( IWbemServices *services ) {'S','o','f','t','w','a','r','e','\\','S','t','d','R','e','g','P','r','o','v','T','e','s','t',0}; BSTR class = SysAllocString( stdregprovW ), method, name; IWbemClassObject *reg, *sig_in, *sig_out, *in, *out; - VARIANT defkey, subkey, retval, names, types, value, valuename; + VARIANT defkey, subkey, retval, valuename; CIMTYPE type; HRESULT hr; LONG res; @@ -844,14 +852,8 @@ static void test_StdRegProv( IWbemServices *services ) ok( !V_I4( &retval ), "unexpected error %u\n", V_UI4( &retval ) ); ok( type == CIM_UINT32, "unexpected type 0x%x\n", type ); - type = 0xdeadbeef; - VariantInit( &names ); - hr = IWbemClassObject_Get( out, namesW, 0, &names, &type, NULL ); - ok( hr == S_OK, "failed to get names %08x\n", hr ); - ok( V_VT( &names ) == (VT_BSTR|VT_ARRAY), "unexpected variant type 0x%x\n", V_VT( &names ) ); - ok( type == (CIM_STRING|CIM_FLAG_ARRAY), "unexpected type 0x%x\n", type ); + check_property( out, namesW, VT_BSTR|VT_ARRAY, CIM_STRING|CIM_FLAG_ARRAY ); - VariantClear( &names ); VariantClear( &subkey ); IWbemClassObject_Release( in ); IWbemClassObject_Release( out ); @@ -887,22 +889,9 @@ static void test_StdRegProv( IWbemServices *services ) ok( !V_I4( &retval ), "unexpected error %u\n", V_I4( &retval ) ); ok( type == CIM_UINT32, "unexpected type 0x%x\n", type ); - type = 0xdeadbeef; - VariantInit( &names ); - hr = IWbemClassObject_Get( out, namesW, 0, &names, &type, NULL ); - ok( hr == S_OK, "failed to get names %08x\n", hr ); - ok( V_VT( &names ) == (VT_BSTR|VT_ARRAY), "unexpected variant type 0x%x\n", V_VT( &names ) ); - ok( type == (CIM_STRING|CIM_FLAG_ARRAY), "unexpected type 0x%x\n", type ); + check_property( out, namesW, VT_BSTR|VT_ARRAY, CIM_STRING|CIM_FLAG_ARRAY ); + check_property( out, typesW, VT_I4|VT_ARRAY, CIM_SINT32|CIM_FLAG_ARRAY ); - type = 0xdeadbeef; - VariantInit( &types ); - hr = IWbemClassObject_Get( out, typesW, 0, &types, &type, NULL ); - ok( hr == S_OK, "failed to get names %08x\n", hr ); - ok( V_VT( &types ) == (VT_I4|VT_ARRAY), "unexpected variant type 0x%x\n", V_VT( &types ) ); - ok( type == (CIM_SINT32|CIM_FLAG_ARRAY), "unexpected type 0x%x\n", type ); - - VariantClear( &types ); - VariantClear( &names ); VariantClear( &subkey ); IWbemClassObject_Release( in ); IWbemClassObject_Release( out ); @@ -943,14 +932,8 @@ static void test_StdRegProv( IWbemServices *services ) ok( !V_I4( &retval ), "unexpected error %u\n", V_I4( &retval ) ); ok( type == CIM_UINT32, "unexpected type 0x%x\n", type ); - type = 0xdeadbeef; - VariantInit( &value ); - hr = IWbemClassObject_Get( out, valueW, 0, &value, &type, NULL ); - ok( hr == S_OK, "failed to get value %08x\n", hr ); - ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + check_property( out, valueW, VT_BSTR, CIM_STRING ); - VariantClear( &value ); VariantClear( &valuename ); VariantClear( &subkey ); IWbemClassObject_Release( in ); @@ -1061,6 +1044,34 @@ static void test_query_async( IWbemServices *services ) SysFreeString( query ); } +static void test_query_semisync( IWbemServices *services ) +{ + static const WCHAR queryW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_','D','u','m','m','y',0}; + BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + ULONG count; + HRESULT hr; + + hr = IWbemServices_ExecQuery( services, wql, query, WBEM_FLAG_RETURN_IMMEDIATELY | WBEM_FLAG_FORWARD_ONLY, + NULL, &result ); + ok( hr == S_OK, "got %08x\n", hr ); + + count = 1; + obj = (void *)0xdeadbeef; + hr = IEnumWbemClassObject_Next( result, -1, 1, &obj, &count ); +todo_wine + ok( hr == WBEM_E_INVALID_CLASS, "Unexpected hr %#x.\n", hr ); + ok( count == 0, "Unexpected count %u.\n", count ); + ok( obj == (void *)0xdeadbeef, "Got object %p\n", obj ); + + IEnumWbemClassObject_Release( result ); + + SysFreeString( wql ); + SysFreeString( query ); +} + static void test_GetNames( IWbemServices *services ) { static const WCHAR queryW[] = @@ -1181,8 +1192,12 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) static const WCHAR buildnumberW[] = {'B','u','i','l','d','N','u','m','b','e','r',0}; static const WCHAR captionW[] = {'C','a','p','t','i','o','n',0}; static const WCHAR csdversionW[] = {'C','S','D','V','e','r','s','i','o','n',0}; + static const WCHAR csnameW[] = {'C','S','N','a','m','e',0}; + static const WCHAR currenttimezoneW[] = {'C','u','r','r','e','n','t','T','i','m','e','Z','o','n','e',0}; static const WCHAR freephysicalmemoryW[] = {'F','r','e','e','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; + static const WCHAR manufacturerW[] = {'M','a','n','u','f','a','c','t','u','r','e','r',0}; static const WCHAR nameW[] = {'N','a','m','e',0}; + static const WCHAR operatingsystemskuW[] = {'O','p','e','r','a','t','i','n','g','S','y','s','t','e','m','S','K','U',0}; static const WCHAR osproductsuiteW[] = {'O','S','P','r','o','d','u','c','t','S','u','i','t','e',0}; static const WCHAR ostypeW[] = {'O','S','T','y','p','e',0}; static const WCHAR suitemaskW[] = {'S','u','i','t','e','M','a','s','k',0}; @@ -1191,6 +1206,8 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) {'S','e','r','v','i','c','e','P','a','c','k','M','a','j','o','r','V','e','r','s','i','o','n',0}; static const WCHAR servicepackminorW[] = {'S','e','r','v','i','c','e','P','a','c','k','M','i','n','o','r','V','e','r','s','i','o','n',0}; + static const WCHAR systemdriveW[] = + {'S','y','s','t','e','m','D','r','i','v','e',0}; static const WCHAR totalvisiblememorysizeW[] = {'T','o','t','a','l','V','i','s','i','b','l','e','M','e','m','o','r','y','S','i','z','e',0}; static const WCHAR totalvirtualmemorysizeW[] = @@ -1217,23 +1234,8 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) hr = IWbemClassObject_EndEnumeration( obj ); ok( hr == S_OK, "got %08x\n", hr ); - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, buildnumberW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get buildnumber %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "buildnumber: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, captionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get caption %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "caption: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); + check_property( obj, buildnumberW, VT_BSTR, CIM_STRING ); + check_property( obj, captionW, VT_BSTR, CIM_STRING ); type = 0xdeadbeef; VariantInit( &val ); @@ -1244,23 +1246,20 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) trace( "csdversion: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); VariantClear( &val ); - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, freephysicalmemoryW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get free physical memory size %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT64, "unexpected type 0x%x\n", type ); - trace( "freephysicalmemory %s\n", wine_dbgstr_w(V_BSTR(&val)) ); - VariantClear( &val ); + check_property( obj, freephysicalmemoryW, VT_BSTR, CIM_UINT64 ); + check_property( obj, nameW, VT_BSTR, CIM_STRING ); type = 0xdeadbeef; VariantInit( &val ); - hr = IWbemClassObject_Get( obj, nameW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get name %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "name: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); + hr = IWbemClassObject_Get( obj, operatingsystemskuW, 0, &val, &type, NULL ); + ok( hr == S_OK || broken(hr == WBEM_E_NOT_FOUND) /* winxp */, "failed to get operatingsystemsku %08x\n", hr ); + if (hr == S_OK) + { + ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_UINT32, "unexpected type 0x%x\n", type ); + trace( "operatingsystemsku: %08x\n", V_I4( &val ) ); + VariantClear( &val ); + } type = 0xdeadbeef; VariantInit( &val ); @@ -1271,68 +1270,17 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) trace( "osproductsuite: %d (%08x)\n", V_I4( &val ), V_I4( &val ) ); VariantClear( &val ); - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, ostypeW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get ostype %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT16, "unexpected type 0x%x\n", type ); - trace( "ostype: %d\n", V_I4( &val ) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, servicepackmajorW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get servicepackmajor %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT16, "unexpected type 0x%x\n", type ); - trace( "servicepackmajor: %d\n", V_I4( &val ) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, servicepackminorW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get servicepackminor %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT16, "unexpected type 0x%x\n", type ); - trace( "servicepackminor: %d\n", V_I4( &val ) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, suitemaskW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get suitemask %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT32, "unexpected type 0x%x\n", type ); - trace( "suitemask: %d (%08x)\n", V_I4( &val ), V_I4( &val ) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, versionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get version %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "version: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, totalvisiblememorysizeW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get visible memory size %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT64, "unexpected type 0x%x\n", type ); - trace( "totalvisiblememorysize %s\n", wine_dbgstr_w(V_BSTR(&val)) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, totalvirtualmemorysizeW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get virtual memory size %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT64, "unexpected type 0x%x\n", type ); - trace( "totalvirtualmemorysize %s\n", wine_dbgstr_w(V_BSTR(&val)) ); - VariantClear( &val ); + check_property( obj, csnameW, VT_BSTR, CIM_STRING ); + check_property( obj, currenttimezoneW, VT_I2, CIM_SINT16 ); + check_property( obj, manufacturerW, VT_BSTR, CIM_STRING ); + check_property( obj, ostypeW, VT_I4, CIM_UINT16 ); + check_property( obj, servicepackmajorW, VT_I4, CIM_UINT16 ); + check_property( obj, servicepackminorW, VT_I4, CIM_UINT16 ); + check_property( obj, suitemaskW, VT_I4, CIM_UINT32 ); + check_property( obj, versionW, VT_BSTR, CIM_STRING ); + check_property( obj, totalvisiblememorysizeW, VT_BSTR, CIM_UINT64 ); + check_property( obj, totalvirtualmemorysizeW, VT_BSTR, CIM_UINT64 ); + check_property( obj, systemdriveW, VT_BSTR, CIM_STRING ); IWbemClassObject_Release( obj ); IEnumWbemClassObject_Release( result ); @@ -1360,8 +1308,6 @@ static void test_Win32_ComputerSystemProduct( IWbemServices *services ) BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); IEnumWbemClassObject *result; IWbemClassObject *obj; - VARIANT value; - CIMTYPE type; HRESULT hr; DWORD count; @@ -1375,58 +1321,12 @@ static void test_Win32_ComputerSystemProduct( IWbemServices *services ) hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); ok( hr == S_OK, "got %08x\n", hr ); - type = 0xdeadbeef; - VariantInit( &value ); - hr = IWbemClassObject_Get( obj, identifyingnumberW, 0, &value, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "identifyingnumber %s\n", wine_dbgstr_w(V_BSTR(&value)) ); - VariantClear( &value ); - - type = 0xdeadbeef; - VariantInit( &value ); - hr = IWbemClassObject_Get( obj, nameW, 0, &value, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "name %s\n", wine_dbgstr_w(V_BSTR(&value)) ); - VariantClear( &value ); - - type = 0xdeadbeef; - VariantInit( &value ); - hr = IWbemClassObject_Get( obj, skunumberW, 0, &value, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &value ) == VT_NULL, "unexpected variant type 0x%x\n", V_VT( &value ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - VariantClear( &value ); - - type = 0xdeadbeef; - VariantInit( &value ); - hr = IWbemClassObject_Get( obj, uuidW, 0, &value, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "uuid %s\n", wine_dbgstr_w(V_BSTR(&value)) ); - VariantClear( &value ); - - type = 0xdeadbeef; - VariantInit( &value ); - hr = IWbemClassObject_Get( obj, vendorW, 0, &value, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "vendor %s\n", wine_dbgstr_w(V_BSTR(&value)) ); - VariantClear( &value ); - - type = 0xdeadbeef; - VariantInit( &value ); - hr = IWbemClassObject_Get( obj, versionW, 0, &value, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "version %s\n", wine_dbgstr_w(V_BSTR(&value)) ); - VariantClear( &value ); + check_property( obj, identifyingnumberW, VT_BSTR, CIM_STRING ); + check_property( obj, nameW, VT_BSTR, CIM_STRING ); + check_property( obj, skunumberW, VT_NULL, CIM_STRING ); + check_property( obj, uuidW, VT_BSTR, CIM_STRING ); + check_property( obj, vendorW, VT_BSTR, CIM_STRING ); + check_property( obj, versionW, VT_BSTR, CIM_STRING ); IWbemClassObject_Release( obj ); IEnumWbemClassObject_Release( result ); @@ -1438,14 +1338,13 @@ static void test_Win32_PhysicalMemory( IWbemServices *services ) { static const WCHAR capacityW[] = {'C','a','p','a','c','i','t','y',0}; static const WCHAR memorytypeW[] = {'M','e','m','o','r','y','T','y','p','e',0}; + static const WCHAR devicelocatorW[] = {'D','e','v','i','c','e','L','o','c','a','t','o','r',0}; static const WCHAR queryW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', 'P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); IEnumWbemClassObject *result; IWbemClassObject *obj; - VARIANT val; - CIMTYPE type; HRESULT hr; DWORD count; @@ -1461,24 +1360,9 @@ static void test_Win32_PhysicalMemory( IWbemServices *services ) if (count > 0) { - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, capacityW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get capacity %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT64, "unexpected type 0x%x\n", type ); - trace( "capacity %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, memorytypeW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get memory type %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT16, "unexpected type 0x%x\n", type ); - trace( "memorytype %u\n", V_I4( &val ) ); - VariantClear( &val ); - + check_property( obj, capacityW, VT_BSTR, CIM_UINT64 ); + check_property( obj, devicelocatorW, VT_BSTR, CIM_STRING ); + check_property( obj, memorytypeW, VT_I4, CIM_UINT16 ); IWbemClassObject_Release( obj ); } IEnumWbemClassObject_Release( result ); @@ -1497,8 +1381,6 @@ static void test_Win32_IP4RouteTable( IWbemServices *services ) BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); IEnumWbemClassObject *result; IWbemClassObject *obj; - VARIANT val; - CIMTYPE type; HRESULT hr; DWORD count; @@ -1514,33 +1396,9 @@ static void test_Win32_IP4RouteTable( IWbemServices *services ) hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); if (hr != S_OK) break; - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, destinationW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get destination %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "destination %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, interfaceindexW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get interface index %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_SINT32, "unexpected type 0x%x\n", type ); - trace( "interfaceindex %d\n", V_I4( &val ) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, nexthopW, 0, &val, &type, NULL ); - ok( hr == S_OK, "failed to get nexthop %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "nexthop %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - + check_property( obj, destinationW, VT_BSTR, CIM_STRING ); + check_property( obj, interfaceindexW, VT_I4, CIM_SINT32 ); + check_property( obj, nexthopW, VT_BSTR, CIM_STRING ); IWbemClassObject_Release( obj ); } @@ -1553,6 +1411,10 @@ static void test_Win32_Processor( IWbemServices *services ) { static const WCHAR architectureW[] = {'A','r','c','h','i','t','e','c','t','u','r','e',0}; + static const WCHAR captionW[] = + {'C','a','p','t','i','o','n',0}; + static const WCHAR cpustatusW[] = + {'C','p','u','S','t','a','t','u','s',0}; static const WCHAR familyW[] = {'F','a','m','i','l','y',0}; static const WCHAR levelW[] = @@ -1561,6 +1423,10 @@ static void test_Win32_Processor( IWbemServices *services ) {'M','a','n','u','f','a','c','t','u','r','e','r',0}; static const WCHAR nameW[] = {'N','a','m','e',0}; + static const WCHAR numcoresW[] = + {'N','u','m','b','e','r','O','f','C','o','r','e','s',0}; + static const WCHAR numlogicalprocessorsW[] = + {'N','u','m','b','e','r','O','f','L','o','g','i','c','a','l','P','r','o','c','e','s','s','o','r','s',0}; static const WCHAR processoridW[] = {'P','r','o','c','e','s','s','o','r','I','d',0}; static const WCHAR revisionW[] = @@ -1586,73 +1452,38 @@ static void test_Win32_Processor( IWbemServices *services ) hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); if (hr != S_OK) break; - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, architectureW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT16, "unexpected type 0x%x\n", type ); - trace( "architecture %u\n", V_I4( &val ) ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, familyW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT16, "unexpected type 0x%x\n", type ); - trace( "family %u\n", V_I4( &val ) ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, levelW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT16, "unexpected type 0x%x\n", type ); - trace( "level %u\n", V_I4( &val ) ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, manufacturerW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "manufacturer %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, nameW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "name %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, processoridW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "processorid %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); + check_property( obj, architectureW, VT_I4, CIM_UINT16 ); + check_property( obj, captionW, VT_BSTR, CIM_STRING ); + check_property( obj, cpustatusW, VT_I4, CIM_UINT16 ); + check_property( obj, familyW, VT_I4, CIM_UINT16 ); + check_property( obj, levelW, VT_I4, CIM_UINT16 ); + check_property( obj, manufacturerW, VT_BSTR, CIM_STRING ); + check_property( obj, nameW, VT_BSTR, CIM_STRING ); + check_property( obj, processoridW, VT_BSTR, CIM_STRING ); + check_property( obj, revisionW, VT_I4, CIM_UINT16 ); + check_property( obj, versionW, VT_BSTR, CIM_STRING ); type = 0xdeadbeef; VariantInit( &val ); - hr = IWbemClassObject_Get( obj, revisionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT16, "unexpected type 0x%x\n", type ); - trace( "revision %u\n", V_I4( &val ) ); + hr = IWbemClassObject_Get( obj, numlogicalprocessorsW, 0, &val, &type, NULL ); + ok( hr == S_OK || broken(hr == WBEM_E_NOT_FOUND) /* win2k3 */, "got %08x\n", hr ); + if (hr == S_OK) + { + ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_UINT32, "unexpected type 0x%x\n", type ); + trace( "numlogicalprocessors %u\n", V_I4( &val ) ); + } type = 0xdeadbeef; VariantInit( &val ); - hr = IWbemClassObject_Get( obj, versionW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "version %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); + hr = IWbemClassObject_Get( obj, numcoresW, 0, &val, &type, NULL ); + ok( hr == S_OK || broken(hr == WBEM_E_NOT_FOUND) /* win2k3 */, "got %08x\n", hr ); + if (hr == S_OK) + { + ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_UINT32, "unexpected type 0x%x\n", type ); + trace( "numcores %u\n", V_I4( &val ) ); + } IWbemClassObject_Release( obj ); } @@ -1664,6 +1495,8 @@ static void test_Win32_Processor( IWbemServices *services ) static void test_Win32_VideoController( IWbemServices *services ) { + static const WCHAR availabilityW[] = + {'A','v','a','i','l','a','b','i','l','i','t','y',0}; static const WCHAR configmanagererrorcodeW[] = {'C','o','n','f','i','g','M','a','n','a','g','e','r','E','r','r','o','r','C','o','d','e',0}; static const WCHAR driverdateW[] = @@ -1695,22 +1528,9 @@ static void test_Win32_VideoController( IWbemServices *services ) hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); if (hr != S_OK) break; - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, configmanagererrorcodeW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_UINT32, "unexpected type 0x%x\n", type ); - trace( "configmanagererrorcode %d\n", V_I4( &val ) ); - - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, driverdateW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_DATETIME, "unexpected type 0x%x\n", type ); - trace( "driverdate %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); + check_property( obj, availabilityW, VT_I4, CIM_UINT16 ); + check_property( obj, configmanagererrorcodeW, VT_I4, CIM_UINT32 ); + check_property( obj, driverdateW, VT_BSTR, CIM_DATETIME ); type = 0xdeadbeef; VariantInit( &val ); @@ -1721,15 +1541,7 @@ static void test_Win32_VideoController( IWbemServices *services ) trace( "installeddisplaydrivers %s\n", wine_dbgstr_w(V_BSTR( &val )) ); VariantClear( &val ); - type = 0xdeadbeef; - VariantInit( &val ); - hr = IWbemClassObject_Get( obj, statusW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "status %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - + check_property( obj, statusW, VT_BSTR, CIM_STRING ); IWbemClassObject_Release( obj ); } @@ -1740,8 +1552,12 @@ static void test_Win32_VideoController( IWbemServices *services ) static void test_Win32_Printer( IWbemServices *services ) { + static const WCHAR attributesW[] = + {'A','t','t','r','i','b','u','t','e','s',0}; static const WCHAR deviceidW[] = {'D','e','v','i','c','e','I','d',0}; + static const WCHAR horizontalresolutionW[] = + {'H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0}; static const WCHAR locationW[] = {'L','o','c','a','t','i','o','n',0}; static const WCHAR portnameW[] = @@ -1769,14 +1585,9 @@ static void test_Win32_Printer( IWbemServices *services ) hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); if (hr != S_OK) break; - type = 0xdeadbeef; - memset( &val, 0, sizeof(val) ); - hr = IWbemClassObject_Get( obj, deviceidW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "deviceid %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); + check_property( obj, attributesW, VT_I4, CIM_UINT32 ); + check_property( obj, deviceidW, VT_BSTR, CIM_STRING ); + check_property( obj, horizontalresolutionW, VT_I4, CIM_UINT32 ); type = 0xdeadbeef; memset( &val, 0, sizeof(val) ); @@ -1787,15 +1598,7 @@ static void test_Win32_Printer( IWbemServices *services ) trace( "location %s\n", wine_dbgstr_w(V_BSTR( &val )) ); VariantClear( &val ); - type = 0xdeadbeef; - memset( &val, 0, sizeof(val) ); - hr = IWbemClassObject_Get( obj, portnameW, 0, &val, &type, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); - ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); - trace( "portname %s\n", wine_dbgstr_w(V_BSTR( &val )) ); - VariantClear( &val ); - + check_property( obj, portnameW, VT_BSTR, CIM_STRING ); IWbemClassObject_Release( obj ); } @@ -1847,6 +1650,7 @@ static void test_Win32_PnPEntity( IWbemServices *services ) VariantClear( &val ); } } + IWbemClassObject_Release( obj ); } SysFreeString( bstr ); @@ -1854,6 +1658,144 @@ static void test_Win32_PnPEntity( IWbemServices *services ) IEnumWbemClassObject_Release( enm ); } +static void test_Win32_WinSAT( IWbemServices *services ) +{ + static const WCHAR cpuscoreW[] = + {'C','P','U','S','c','o','r','e',0}; + static const WCHAR d3dscoreW[] = + {'D','3','D','S','c','o','r','e',0}; + static const WCHAR diskscoreW[] = + {'D','i','s','k','S','c','o','r','e',0}; + static const WCHAR graphicsscoreW[] = + {'G','r','a','p','h','i','c','s','S','c','o','r','e',0}; + static const WCHAR memoryscoreW[] = + {'M','e','m','o','r','y','S','c','o','r','e',0}; + static const WCHAR winsatassessmentstateW[] = + {'W','i','n','S','A','T','A','s','s','e','s','s','m','e','n','t','S','t','a','t','e',0}; + static const WCHAR winsprlevelW[] = + {'W','i','n','S','P','R','L','e','v','e','l',0}; + static const WCHAR queryW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_','W','i','n','S','A','T',0}; + BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + HRESULT hr; + DWORD count; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK || broken(hr == WBEM_E_INVALID_CLASS) /* win2k8 */, "got %08x\n", hr ); + if (hr == WBEM_E_INVALID_CLASS) + { + win_skip( "class not found\n" ); + return; + } + + for (;;) + { + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (hr != S_OK) break; + + check_property( obj, cpuscoreW, VT_R4, CIM_REAL32 ); + check_property( obj, d3dscoreW, VT_R4, CIM_REAL32 ); + check_property( obj, diskscoreW, VT_R4, CIM_REAL32 ); + check_property( obj, graphicsscoreW, VT_R4, CIM_REAL32 ); + check_property( obj, memoryscoreW, VT_R4, CIM_REAL32 ); + check_property( obj, winsatassessmentstateW, VT_I4, CIM_UINT32 ); + check_property( obj, winsprlevelW, VT_R4, CIM_REAL32 ); + IWbemClassObject_Release( obj ); + } + + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + +static void test_Win32_DisplayControllerConfiguration( IWbemServices *services ) +{ + static const WCHAR bitsperpixelW[] = + {'B','i','t','s','P','e','r','P','i','x','e','l',0}; + static const WCHAR captionW[] = + {'C','a','p','t','i','o','n',0}; + static const WCHAR horizontalresolutionW[] = + {'H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0}; + static const WCHAR nameW[] = + {'N','a','m','e',0}; + static const WCHAR queryW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'D','i','s','p','l','a','y','C','o','n','t','r','o','l','l','e','r', + 'C','o','n','f','i','g','u','r','a','t','i','o','n',0}; + static const WCHAR verticalresolutionW[] = + {'V','e','r','t','i','c','a','l','R','e','s','o','l','u','t','i','o','n',0}; + BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + HRESULT hr; + DWORD count; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK, "got %08x\n", hr ); + + for (;;) + { + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (hr != S_OK) break; + + check_property( obj, bitsperpixelW, VT_I4, CIM_UINT32 ); + check_property( obj, captionW, VT_BSTR, CIM_STRING ); + check_property( obj, horizontalresolutionW, VT_I4, CIM_UINT32 ); + check_property( obj, nameW, VT_BSTR, CIM_STRING ); + check_property( obj, verticalresolutionW, VT_I4, CIM_UINT32 ); + IWbemClassObject_Release( obj ); + } + + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + +static void test_Win32_QuickFixEngineering( IWbemServices *services ) +{ + static const WCHAR captionW[] = + {'C','a','p','t','i','o','n',0}; + static const WCHAR hotfixidW[] = + {'H','o','t','F','i','x','I','D',0}; + static const WCHAR queryW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'Q','u','i','c','k','F','i','x','E','n','g','i','n','e','e','r','i','n','g',0}; + BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + HRESULT hr; + DWORD count, total = 0; + VARIANT caption; + CIMTYPE type; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK, "got %08x\n", hr ); + + for (;;) + { + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (hr != S_OK) break; + + type = 0xdeadbeef; + VariantInit( &caption ); + hr = IWbemClassObject_Get( obj, captionW, 0, &caption, &type, NULL ); + ok( hr == S_OK, "failed to get caption %08x\n", hr ); + ok( V_VT( &caption ) == VT_BSTR || V_VT( &caption ) == VT_NULL /* winxp */, + "unexpected variant type 0x%x\n", V_VT( &caption ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + + check_property( obj, hotfixidW, VT_BSTR, CIM_STRING ); + IWbemClassObject_Release( obj ); + if (total++ >= 10) break; + } + + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + START_TEST(query) { static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0}; @@ -1879,27 +1821,34 @@ START_TEST(query) RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE ); ok( hr == S_OK, "failed to set proxy blanket %08x\n", hr ); - test_select( services ); + test_GetNames( services ); test_associators( services ); - test_Win32_Bios( services ); - test_Win32_Process( services, FALSE ); - test_Win32_Process( services, TRUE ); - test_Win32_Service( services ); - test_Win32_ComputerSystem( services ); - test_Win32_SystemEnclosure( services ); - test_StdRegProv( services ); test_notification_query_async( services ); test_query_async( services ); - test_GetNames( services ); + test_query_semisync( services ); + test_select( services ); + + /* classes */ + test_StdRegProv( services ); test_SystemSecurity( services ); - test_Win32_OperatingSystem( services ); + test_Win32_Baseboard( services ); + test_Win32_ComputerSystem( services ); test_Win32_ComputerSystemProduct( services ); - test_Win32_PhysicalMemory( services ); + test_Win32_Bios( services ); + test_Win32_DisplayControllerConfiguration( services ); test_Win32_IP4RouteTable( services ); + test_Win32_OperatingSystem( services ); + test_Win32_PhysicalMemory( services ); + test_Win32_PnPEntity( services ); + test_Win32_Printer( services ); + test_Win32_Process( services, FALSE ); + test_Win32_Process( services, TRUE ); test_Win32_Processor( services ); + test_Win32_QuickFixEngineering( services ); + test_Win32_Service( services ); + test_Win32_SystemEnclosure( services ); test_Win32_VideoController( services ); - test_Win32_Printer( services ); - test_Win32_PnPEntity( services ); + test_Win32_WinSAT( services ); SysFreeString( path ); IWbemServices_Release( services );
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Results per page:
10
25
50
100
200