X



トップページLinux
1002コメント351KB
今夜も Wine で乾杯! - 21本目 [無断転載禁止]©2ch.net
■ このスレッドは過去ログ倉庫に格納されています
0001login:Penguin
垢版 |
2017/08/12(土) 21:18:15.22ID:tNr8ii2i
Linux上でWindowsのアプリを動作させるソフトウェア
Wineに関する情報交換スレ。

前スレ
今夜も Wine で乾杯! - 20本目
https://mao.2ch.net/test/read.cgi/linux/1455088008/

Wine本家
http://www.winehq.org/
http://wiki.winehq.org/

動作報告Wikiや過去ログなど
http://www.2chlinux.org/index.php?FrontPage

ここにパッチをうpするときはgzipやbzip2で圧縮した上で
base64などでエンコードしてください。おながいします。
動作報告は>>2のテンプレ使用を推奨。
0449396
垢版 |
2018/02/21(水) 17:57:13.78ID:SJPTXnf1
以下のコードが気になる。

message_count を減少させるのは唯一、wait_message() しか見つからなかった。
後は、check_for_driver_events() の中で単調増加してしまう。
メッセージがたまって初めて、flush_window_surfaces() が呼び出されるような
コードにも

/* check for driver events if we detect that the app is not properly consuming messages */
static inline void check_for_driver_events( UINT msg )
{
  if (get_user_thread_info()->message_count > 200) {
    flush_window_surfaces( FALSE );
    USER_Driver->pMsgWaitForMultipleObjectsEx( 0, NULL, 0, QS_ALLINPUT, 0 );
  }
  else if (msg == WM_TIMER || msg == WM_SYSTIMER) {
    /* driver events should have priority over timers, so make sure we'll check for them soon */
    get_user_thread_info()->message_count += 100;
  }
  else get_user_thread_info()->message_count++;
}

static DWORD wait_message( DWORD count, const HANDLE *handles, DWORD timeout, DWORD mask, DWORD flags )
{
  DWORD ret = USER_Driver->pMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags );
  if (ret == WAIT_TIMEOUT && !count && !timeout) NtYieldExecution();
  if ((mask & QS_INPUT) == QS_INPUT) get_user_thread_info()->message_count = 0;
  return ret;
}
0450396
垢版 |
2018/02/21(水) 17:58:18.49ID:SJPTXnf1
BOOL WINAPI DECLSPEC_HOTPATCH PeekMessageW( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT flags )
{
  MSG msg;

  USER_CheckNotLock();
  check_for_driver_events( 0 );

  if (!peek_message( &msg, hwnd, first, last, flags, 0 ))
  {
    DWORD ret;

    flush_window_surfaces( TRUE );
    ret = wow_handlers.wait_message( 0, NULL, 0, QS_ALLINPUT, 0 );
    /* if we received driver events, check again for a pending message */
    if (ret == WAIT_TIMEOUT || !peek_message( &msg, hwnd, first, last, flags, 0 )) return FALSE;
  }

  check_for_driver_events( msg.message );

  /* copy back our internal safe copy of message data to msg_out.
   * msg_out is a variable from the *program*, so it can't be used
   * internally as it can get "corrupted" by our use of SendMessage()
   * (back to the program) inside the message handling itself. */
  if (!msg_out)
  {
    SetLastError( ERROR_NOACCESS );
    return FALSE;
  }
  *msg_out = msg;
  return TRUE;
}
■ このスレッドは過去ログ倉庫に格納されています

ニューススポーツなんでも実況