Commit 35a59e07 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use syscall interface for NtUserSystemParametersInfo.

parent 2ebfe2fd
......@@ -1143,8 +1143,6 @@ static struct unix_funcs unix_funcs =
NtUserReleaseDC,
NtUserScrollDC,
NtUserSelectPalette,
NtUserSystemParametersInfo,
NtUserSystemParametersInfoForDpi,
NtUserUpdateLayeredWindow,
SetDIBits,
......
......@@ -281,6 +281,8 @@ static void * const syscalls[] =
NtUserShowScrollBar,
NtUserShowWindow,
NtUserShowWindowAsync,
NtUserSystemParametersInfo,
NtUserSystemParametersInfoForDpi,
NtUserThunkedMenuInfo,
NtUserThunkedMenuItemInfo,
NtUserToUnicodeEx,
......
......@@ -1271,8 +1271,8 @@
@ stub NtUserSoundSentry
@ stub NtUserStopAndEndInertia
@ stub NtUserSwitchDesktop
@ stdcall NtUserSystemParametersInfo(long long ptr long)
@ stdcall NtUserSystemParametersInfoForDpi(long long ptr long long)
@ stdcall -syscall NtUserSystemParametersInfo(long long ptr long)
@ stdcall -syscall NtUserSystemParametersInfoForDpi(long long ptr long long)
@ stub NtUserTestForInteractiveUser
@ stdcall -syscall NtUserThunkedMenuInfo(long ptr)
@ stdcall -syscall NtUserThunkedMenuItemInfo(long long long long ptr ptr)
......
......@@ -195,9 +195,6 @@ struct unix_funcs
BOOL (WINAPI *pNtUserScrollDC)( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip,
HRGN ret_update_rgn, RECT *update_rect );
HPALETTE (WINAPI *pNtUserSelectPalette)( HDC hdc, HPALETTE hpal, WORD bkg );
BOOL (WINAPI *pNtUserSystemParametersInfo)( UINT action, UINT val, PVOID ptr, UINT winini );
BOOL (WINAPI *pNtUserSystemParametersInfoForDpi)( UINT action, UINT val, PVOID ptr,
UINT winini, UINT dpi );
BOOL (WINAPI *pNtUserUpdateLayeredWindow)( HWND hwnd, HDC hdc_dst, const POINT *pts_dst,
const SIZE *size, HDC hdc_src, const POINT *pts_src,
COLORREF key, const BLENDFUNCTION *blend,
......
......@@ -763,18 +763,6 @@ HPALETTE WINAPI NtUserSelectPalette( HDC hdc, HPALETTE hpal, WORD bkg )
return unix_funcs->pNtUserSelectPalette( hdc, hpal, bkg );
}
BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, PVOID ptr, UINT winini )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserSystemParametersInfo( action, val, ptr, winini );
}
BOOL WINAPI NtUserSystemParametersInfoForDpi( UINT action, UINT val, PVOID ptr, UINT winini, UINT dpi )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserSystemParametersInfoForDpi( action, val, ptr, winini, dpi );
}
BOOL WINAPI NtUserUpdateLayeredWindow( HWND hwnd, HDC hdc_dst, const POINT *pts_dst, const SIZE *size,
HDC hdc_src, const POINT *pts_src, COLORREF key,
const BLENDFUNCTION *blend, DWORD flags, const RECT *dirty )
......
......@@ -268,6 +268,8 @@
SYSCALL_ENTRY( NtUserShowScrollBar ) \
SYSCALL_ENTRY( NtUserShowWindow ) \
SYSCALL_ENTRY( NtUserShowWindowAsync ) \
SYSCALL_ENTRY( NtUserSystemParametersInfo ) \
SYSCALL_ENTRY( NtUserSystemParametersInfoForDpi ) \
SYSCALL_ENTRY( NtUserThunkedMenuInfo ) \
SYSCALL_ENTRY( NtUserThunkedMenuItemInfo ) \
SYSCALL_ENTRY( NtUserToUnicodeEx ) \
......
......@@ -2286,6 +2286,116 @@ NTSTATUS WINAPI wow64_NtUserShowWindowAsync( UINT *args )
return NtUserShowWindowAsync( hwnd, cmd );
}
NTSTATUS WINAPI wow64_NtUserSystemParametersInfo( UINT *args )
{
UINT action = get_ulong( &args );
UINT val = get_ulong( &args );
void *ptr = get_ptr( &args );
UINT winini = get_ulong( &args );
switch (action)
{
case SPI_GETSERIALKEYS:
if (ptr)
{
struct
{
UINT cbSize;
DWORD dwFlags;
ULONG lpszActivePort;
ULONG lpszPort;
UINT iBaudRate;
UINT iPortState;
UINT iActive;
} *keys32 = ptr;
SERIALKEYSW keys;
if (keys32->cbSize != sizeof(*keys32)) return FALSE;
keys.cbSize = sizeof(keys);
if (!NtUserSystemParametersInfo( action, val, &keys, winini )) return FALSE;
keys32->dwFlags = keys.dwFlags;
keys32->lpszActivePort = PtrToUlong( keys.lpszActivePort );
keys32->lpszPort = PtrToUlong( keys.lpszPort );
keys32->iBaudRate = keys.iBaudRate;
keys32->iPortState = keys.iPortState;
keys32->iActive = keys.iActive;
return TRUE;
}
break;
case SPI_GETSOUNDSENTRY:
if (ptr)
{
struct
{
UINT cbSize;
DWORD dwFlags;
DWORD iFSTextEffect;
DWORD iFSTextEffectMSec;
DWORD iFSTextEffectColorBits;
DWORD iFSGrafEffect;
DWORD iFSGrafEffectMSec;
DWORD iFSGrafEffectColor;
DWORD iWindowsEffect;
DWORD iWindowsEffectMSec;
ULONG lpszWindowsEffectDLL;
DWORD iWindowsEffectOrdinal;
} *entry32 = ptr;
SOUNDSENTRYW entry;
if (entry32->cbSize != sizeof(*entry32)) return FALSE;
entry.cbSize = sizeof(entry);
if (!NtUserSystemParametersInfo( action, val, &entry, winini )) return FALSE;
entry32->dwFlags = entry.dwFlags;
entry32->iFSTextEffect = entry.iFSTextEffect;
entry32->iFSTextEffectMSec = entry.iFSTextEffectMSec;
entry32->iFSTextEffectColorBits = entry.iFSTextEffectColorBits;
entry32->iFSGrafEffect = entry.iFSGrafEffect;
entry32->iFSGrafEffectMSec = entry.iFSGrafEffectMSec;
entry32->iFSGrafEffectColor = entry.iFSGrafEffectColor;
entry32->iWindowsEffect = entry.iWindowsEffect;
entry32->iWindowsEffectMSec = entry.iWindowsEffectMSec;
entry32->lpszWindowsEffectDLL = PtrToUlong( entry.lpszWindowsEffectDLL );
entry32->iWindowsEffectOrdinal = entry.iWindowsEffectOrdinal;
return TRUE;
}
break;
case SPI_GETHIGHCONTRAST:
if (ptr)
{
struct
{
UINT cbSize;
DWORD dwFlags;
ULONG lpszDefaultScheme;
} *info32 = ptr;
HIGHCONTRASTW info;
if (info32->cbSize != sizeof(*info32)) return FALSE;
info.cbSize = sizeof(info);
if (!NtUserSystemParametersInfo( action, val, &info, winini )) return FALSE;
info32->dwFlags = info.dwFlags;
info32->lpszDefaultScheme = PtrToUlong( info.lpszDefaultScheme );
return TRUE;
}
break;
}
return NtUserSystemParametersInfo( action, val, ptr, winini );
}
NTSTATUS WINAPI wow64_NtUserSystemParametersInfoForDpi( UINT *args )
{
UINT action = get_ulong( &args );
UINT val = get_ulong( &args );
void *ptr = get_ptr( &args );
UINT winini = get_ulong( &args );
UINT dpi = get_ulong( &args );
return NtUserSystemParametersInfoForDpi( action, val, ptr, winini, dpi );
}
NTSTATUS WINAPI wow64_NtUserThunkedMenuInfo( UINT *args )
{
HMENU menu = get_handle( &args );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment