Signed-off-by: Torge Matthies openglfreak@googlemail.com --- dlls/win32u/sysparams.c | 2 ++ dlls/win32u/tests/win32u.c | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index b3d2b6c7d11..e06a63bd4cd 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1571,6 +1571,8 @@ NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
TRACE( "%s %u %p %#x\n", debugstr_us( device ), index, info, flags );
+ if (!info || !info->cb) return STATUS_UNSUCCESSFUL; + if (!lock_display_devices()) return STATUS_UNSUCCESSFUL;
if (!device || !device->Length) diff --git a/dlls/win32u/tests/win32u.c b/dlls/win32u/tests/win32u.c index 10ffd36d134..13c732b7748 100644 --- a/dlls/win32u/tests/win32u.c +++ b/dlls/win32u/tests/win32u.c @@ -45,15 +45,23 @@ static void test_NtUserEnumDisplayDevices(void)
SetLastError( 0xdeadbeef ); ret = NtUserEnumDisplayDevices( NULL, 0, &info, 0 ); - todo_wine ok( ret == STATUS_UNSUCCESSFUL && GetLastError() == 0xdeadbeef, - "NtUserEnumDisplayDevices returned %x %u\n", ret, - GetLastError() ); + ok( ret == STATUS_UNSUCCESSFUL && GetLastError() == 0xdeadbeef, + "NtUserEnumDisplayDevices returned %x %u\n", ret, GetLastError() );
SetLastError( 0xdeadbeef ); ret = NtUserEnumDisplayDevices( NULL, 12345, &info, 0 ); ok( ret == STATUS_UNSUCCESSFUL && GetLastError() == 0xdeadbeef, - "NtUserEnumDisplayDevices returned %x %u\n", ret, - GetLastError() ); + "NtUserEnumDisplayDevices returned %x %u\n", ret, GetLastError() ); + + SetLastError( 0xdeadbeef ); + ret = NtUserEnumDisplayDevices( NULL, 0, NULL, 0 ); + ok( ret == STATUS_UNSUCCESSFUL && GetLastError() == 0xdeadbeef, + "NtUserEnumDisplayDevices returned %x %u\n", ret, GetLastError() ); + + SetLastError( 0xdeadbeef ); + ret = NtUserEnumDisplayDevices( NULL, 12345, NULL, 0 ); + ok( ret == STATUS_UNSUCCESSFUL && GetLastError() == 0xdeadbeef, + "NtUserEnumDisplayDevices returned %x %u\n", ret, GetLastError() ); }
static void test_NtUserCloseWindowStation(void)