winex11: Directly use ntdll in more places.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f4b9ff7850
commit
c736411fb8
|
@ -512,7 +512,7 @@ NTSTATUS X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
|
|||
DWORD EVENT_x11_time_to_win32_time(Time time)
|
||||
{
|
||||
static DWORD adjust = 0;
|
||||
DWORD now = GetTickCount();
|
||||
DWORD now = NtGetTickCount();
|
||||
DWORD ret;
|
||||
|
||||
if (! adjust && time != 0)
|
||||
|
@ -1365,7 +1365,7 @@ void wait_for_withdrawn_state( HWND hwnd, BOOL set )
|
|||
{
|
||||
Display *display = thread_display();
|
||||
struct x11drv_win_data *data;
|
||||
DWORD end = GetTickCount() + 2000;
|
||||
DWORD end = NtGetTickCount() + 2000;
|
||||
|
||||
TRACE( "waiting for window %p to become %swithdrawn\n", hwnd, set ? "" : "not " );
|
||||
|
||||
|
@ -1401,7 +1401,7 @@ void wait_for_withdrawn_state( HWND hwnd, BOOL set )
|
|||
if (!count)
|
||||
{
|
||||
struct pollfd pfd;
|
||||
int timeout = end - GetTickCount();
|
||||
int timeout = end - NtGetTickCount();
|
||||
|
||||
pfd.fd = ConnectionNumber(display);
|
||||
pfd.events = POLLIN;
|
||||
|
|
|
@ -1525,7 +1525,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
|
|||
|
||||
static HKL get_locale_kbd_layout(void)
|
||||
{
|
||||
ULONG_PTR layout;
|
||||
LCID layout;
|
||||
LANGID langid;
|
||||
|
||||
/* FIXME:
|
||||
|
@ -1539,7 +1539,7 @@ static HKL get_locale_kbd_layout(void)
|
|||
* locale id we return the US one.
|
||||
*/
|
||||
|
||||
layout = GetUserDefaultLCID();
|
||||
NtQueryDefaultLocale( TRUE, &layout );
|
||||
|
||||
/*
|
||||
* Microsoft Office expects this value to be something specific
|
||||
|
@ -1553,7 +1553,7 @@ static HKL get_locale_kbd_layout(void)
|
|||
else
|
||||
layout |= layout << 16;
|
||||
|
||||
return (HKL)layout;
|
||||
return (HKL)(UINT_PTR)layout;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -513,7 +513,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND prev_clip_hwnd, HWND new_clip_hwnd )
|
|||
{
|
||||
TRACE( "clip hwnd reset from %p\n", hwnd );
|
||||
data->clip_hwnd = 0;
|
||||
data->clip_reset = GetTickCount();
|
||||
data->clip_reset = NtGetTickCount();
|
||||
disable_xinput2();
|
||||
NtUserDestroyWindow( hwnd );
|
||||
}
|
||||
|
@ -553,7 +553,7 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset )
|
|||
release_win_data( data );
|
||||
if (!fullscreen) return FALSE;
|
||||
if (!(thread_data = x11drv_thread_data())) return FALSE;
|
||||
if (GetTickCount() - thread_data->clip_reset < 1000) return FALSE;
|
||||
if (NtGetTickCount() - thread_data->clip_reset < 1000) return FALSE;
|
||||
if (!reset && clipping_cursor && thread_data->clip_hwnd) return FALSE; /* already clipping */
|
||||
|
||||
monitor = NtUserMonitorFromWindow( hwnd, MONITOR_DEFAULTTONEAREST );
|
||||
|
@ -1472,9 +1472,9 @@ void X11DRV_DestroyCursorIcon( HCURSOR handle )
|
|||
void X11DRV_SetCursor( HCURSOR handle )
|
||||
{
|
||||
if (InterlockedExchangePointer( (void **)&last_cursor, handle ) != handle ||
|
||||
GetTickCount() - last_cursor_change > 100)
|
||||
NtGetTickCount() - last_cursor_change > 100)
|
||||
{
|
||||
last_cursor_change = GetTickCount();
|
||||
last_cursor_change = NtGetTickCount();
|
||||
if (cursor_window) send_notify_message( cursor_window, WM_X11DRV_SET_CURSOR, 0, (LPARAM)handle );
|
||||
}
|
||||
}
|
||||
|
@ -1667,7 +1667,7 @@ void move_resize_window( HWND hwnd, int dir )
|
|||
input.u.mi.dy = pos.y;
|
||||
input.u.mi.mouseData = button_up_data[button - 1];
|
||||
input.u.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
|
||||
input.u.mi.time = GetTickCount();
|
||||
input.u.mi.time = NtGetTickCount();
|
||||
input.u.mi.dwExtraInfo = 0;
|
||||
__wine_send_input( hwnd, &input, NULL );
|
||||
}
|
||||
|
|
|
@ -650,7 +650,7 @@ static VkResult X11DRV_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *
|
|||
static long prev_time, start_time;
|
||||
DWORD time;
|
||||
|
||||
time = GetTickCount();
|
||||
time = NtGetTickCount();
|
||||
frames++;
|
||||
frames_total++;
|
||||
if (time - prev_time > 1500)
|
||||
|
|
|
@ -1861,8 +1861,8 @@ static LRESULT CALLBACK desktop_wndproc_wrapper( HWND hwnd, UINT msg, WPARAM wp,
|
|||
{
|
||||
case WM_WINE_NOTIFY_ACTIVITY:
|
||||
{
|
||||
static ULONGLONG last = 0;
|
||||
ULONGLONG now = GetTickCount64();
|
||||
static ULONG last = 0;
|
||||
ULONG now = NtGetTickCount();
|
||||
/* calling XResetScreenSaver too often can cause performance
|
||||
* problems, so throttle it */
|
||||
if (now > last + 5000)
|
||||
|
|
|
@ -722,7 +722,7 @@ static void set_queue_display_fd( Display *display )
|
|||
if (wine_server_fd_to_handle( ConnectionNumber(display), GENERIC_READ | SYNCHRONIZE, 0, &handle ))
|
||||
{
|
||||
MESSAGE( "x11drv: Can't allocate handle for display fd\n" );
|
||||
ExitProcess(1);
|
||||
NtTerminateProcess( 0, 1 );
|
||||
}
|
||||
SERVER_START_REQ( set_queue_fd )
|
||||
{
|
||||
|
@ -733,9 +733,9 @@ static void set_queue_display_fd( Display *display )
|
|||
if (ret)
|
||||
{
|
||||
MESSAGE( "x11drv: Can't store handle for display fd\n" );
|
||||
ExitProcess(1);
|
||||
NtTerminateProcess( 0, 1 );
|
||||
}
|
||||
CloseHandle( handle );
|
||||
NtClose( handle );
|
||||
}
|
||||
|
||||
|
||||
|
@ -751,12 +751,12 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
|
|||
if (!(data = calloc( 1, sizeof(*data) )))
|
||||
{
|
||||
ERR( "could not create data\n" );
|
||||
ExitProcess(1);
|
||||
NtTerminateProcess( 0, 1 );
|
||||
}
|
||||
if (!(data->display = XOpenDisplay(NULL)))
|
||||
{
|
||||
ERR_(winediag)( "x11drv: Can't open display: %s. Please ensure that your X server is running and that $DISPLAY is set correctly.\n", XDisplayName(NULL));
|
||||
ExitProcess(1);
|
||||
NtTerminateProcess( 0, 1 );
|
||||
}
|
||||
|
||||
fcntl( ConnectionNumber(data->display), F_SETFD, 1 ); /* set close on exec flag */
|
||||
|
|
Loading…
Reference in New Issue