win32u: Return an NTSTATUS from NtUserEnumDisplayDevices.
Signed-off-by: Torge Matthies <openglfreak@googlemail.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8930d6a00e
commit
28b77c9b72
|
@ -1216,7 +1216,7 @@ BOOL WINAPI EnumDisplayDevicesW( LPCWSTR device, DWORD index, DISPLAY_DEVICEW *i
|
|||
{
|
||||
UNICODE_STRING str;
|
||||
RtlInitUnicodeString( &str, device );
|
||||
return NtUserEnumDisplayDevices( &str, index, info, flags );
|
||||
return NT_SUCCESS(NtUserEnumDisplayDevices( &str, index, info, flags ));
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
|
@ -1562,8 +1562,8 @@ static struct adapter *find_adapter( UNICODE_STRING *name )
|
|||
/***********************************************************************
|
||||
* NtUserEnumDisplayDevices (win32u.@)
|
||||
*/
|
||||
BOOL WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
|
||||
DISPLAY_DEVICEW *info, DWORD flags )
|
||||
NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
|
||||
DISPLAY_DEVICEW *info, DWORD flags )
|
||||
{
|
||||
struct display_device *found = NULL;
|
||||
struct adapter *adapter;
|
||||
|
@ -1571,7 +1571,7 @@ BOOL WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
|
|||
|
||||
TRACE( "%s %u %p %#x\n", debugstr_us( device ), index, info, flags );
|
||||
|
||||
if (!lock_display_devices()) return FALSE;
|
||||
if (!lock_display_devices()) return STATUS_UNSUCCESSFUL;
|
||||
|
||||
if (!device || !device->Length)
|
||||
{
|
||||
|
@ -1613,7 +1613,7 @@ BOOL WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
|
|||
lstrcpyW( info->DeviceKey, found->device_key );
|
||||
}
|
||||
unlock_display_devices();
|
||||
return !!found;
|
||||
return found ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
#define _X_FIELD(prefix, bits) \
|
||||
|
|
|
@ -32,13 +32,12 @@ static void test_NtUserEnumDisplayDevices(void)
|
|||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = NtUserEnumDisplayDevices( NULL, 0, &info, 0 );
|
||||
todo_wine ok( !ret && GetLastError() == 0xdeadbeef,
|
||||
"NtUserEnumDisplayDevices returned %x %u\n", ret,
|
||||
GetLastError() );
|
||||
ok( !ret && GetLastError() == 0xdeadbeef,
|
||||
"NtUserEnumDisplayDevices returned %x %u\n", ret, GetLastError() );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = NtUserEnumDisplayDevices( NULL, 12345, &info, 0 );
|
||||
todo_wine ok( ret == STATUS_UNSUCCESSFUL && GetLastError() == 0xdeadbeef,
|
||||
ok( ret == STATUS_UNSUCCESSFUL && GetLastError() == 0xdeadbeef,
|
||||
"NtUserEnumDisplayDevices returned %x %u\n", ret,
|
||||
GetLastError() );
|
||||
|
||||
|
@ -52,7 +51,7 @@ static void test_NtUserEnumDisplayDevices(void)
|
|||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = NtUserEnumDisplayDevices( NULL, 12345, &info, 0 );
|
||||
todo_wine ok( ret == STATUS_UNSUCCESSFUL && GetLastError() == 0xdeadbeef,
|
||||
ok( ret == STATUS_UNSUCCESSFUL && GetLastError() == 0xdeadbeef,
|
||||
"NtUserEnumDisplayDevices returned %x %u\n", ret,
|
||||
GetLastError() );
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ struct unix_funcs
|
|||
LONG (WINAPI *pNtUserChangeDisplaySettings)( UNICODE_STRING *devname, DEVMODEW *devmode, HWND hwnd,
|
||||
DWORD flags, void *lparam );
|
||||
INT (WINAPI *pNtUserCountClipboardFormats)(void);
|
||||
BOOL (WINAPI *pNtUserEnumDisplayDevices)( UNICODE_STRING *device, DWORD index,
|
||||
NTSTATUS (WINAPI *pNtUserEnumDisplayDevices)( UNICODE_STRING *device, DWORD index,
|
||||
DISPLAY_DEVICEW *info, DWORD flags );
|
||||
BOOL (WINAPI *pNtUserEnumDisplayMonitors)( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp );
|
||||
BOOL (WINAPI *pNtUserEnumDisplaySettings)( UNICODE_STRING *device, DWORD mode,
|
||||
|
|
|
@ -726,8 +726,8 @@ INT WINAPI NtUserCountClipboardFormats(void)
|
|||
return unix_funcs->pNtUserCountClipboardFormats();
|
||||
}
|
||||
|
||||
BOOL WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
|
||||
DISPLAY_DEVICEW *info, DWORD flags )
|
||||
NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
|
||||
DISPLAY_DEVICEW *info, DWORD flags )
|
||||
{
|
||||
if (!unix_funcs) return FALSE;
|
||||
return unix_funcs->pNtUserEnumDisplayDevices( device, index, info, flags );
|
||||
|
|
|
@ -117,8 +117,8 @@ HDESK WINAPI NtUserCreateDesktopEx( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *d
|
|||
ULONG heap_size );
|
||||
HWINSTA WINAPI NtUserCreateWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK mask, ULONG arg3,
|
||||
ULONG arg4, ULONG arg5, ULONG arg6, ULONG arg7 );
|
||||
BOOL WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
|
||||
DISPLAY_DEVICEW *info, DWORD flags );
|
||||
NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
|
||||
DISPLAY_DEVICEW *info, DWORD flags );
|
||||
BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp );
|
||||
BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode,
|
||||
DEVMODEW *dev_mode, DWORD flags );
|
||||
|
|
Loading…
Reference in New Issue