mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 07:01:30 +00:00
[idd] win32: use wait result constants
Use the documented Win32 wait constants throughout the pipe, clipboard, and input workers instead of local numeric aliases. Select the WDK NT-status definitions before including Windows headers. Include wudfwdm.h privately in the affected translation units so UMDF 2 provides NTSTATUS without exposing WDF headers through LGCommon's public interface to the desktop Helper.
This commit is contained in:
@@ -18,8 +18,12 @@
|
||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <ntstatus.h>
|
||||
|
||||
#include "transport/lgmp/CLGMPClipboardTransport.h"
|
||||
|
||||
#include <wudfwdm.h>
|
||||
|
||||
#include "CDebug.h"
|
||||
#include "Seq.h"
|
||||
#include "transport/lgmp/CLGMPHost.h"
|
||||
@@ -29,8 +33,6 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
static constexpr DWORD WAIT_FIRST_OBJECT_VALUE = 0;
|
||||
|
||||
static_assert(sizeof(LGMPStreamDescriptor) ==
|
||||
sizeof(KVMFRStreamDescriptor),
|
||||
"LGMP and KVMFR stream descriptor sizes differ");
|
||||
@@ -1899,14 +1901,14 @@ void CLGMPClipboardTransport::Thread()
|
||||
const HANDLE handles[] = { m_stopEvent, m_wakeEvent };
|
||||
const DWORD wait = WaitForMultipleObjects(
|
||||
_countof(handles), handles, FALSE, timeout);
|
||||
if (wait == WAIT_FIRST_OBJECT_VALUE)
|
||||
if (wait == WAIT_OBJECT_0)
|
||||
break;
|
||||
if (wait == WAIT_FIRST_OBJECT_VALUE + 1)
|
||||
if (wait == WAIT_OBJECT_0 + 1)
|
||||
{
|
||||
lgmpStreamPollActivity(&streamPoll);
|
||||
continue;
|
||||
}
|
||||
if (wait != WAIT_FIRST_OBJECT_VALUE + 1 && wait != WAIT_TIMEOUT)
|
||||
if (wait != WAIT_OBJECT_0 + 1 && wait != WAIT_TIMEOUT)
|
||||
{
|
||||
DEBUG_ERROR_HR(GetLastError(),
|
||||
"LGMP clipboard worker wait failed");
|
||||
|
||||
@@ -18,8 +18,12 @@
|
||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <ntstatus.h>
|
||||
|
||||
#include "transport/lgmp/CLGMPInputTransport.h"
|
||||
|
||||
#include <wudfwdm.h>
|
||||
|
||||
#include "config/CSettings.h"
|
||||
#include "transport/lgmp/CLGMPHost.h"
|
||||
#include "Atomic.h"
|
||||
@@ -53,8 +57,6 @@ static constexpr int32_t MAX_MOUSE_WHEEL =
|
||||
INT8_MAX * MAX_SPLIT_REPORTS;
|
||||
static constexpr int32_t MIN_MOUSE_WHEEL =
|
||||
-INT8_MAX * MAX_SPLIT_REPORTS;
|
||||
static constexpr DWORD WAIT_FIRST_OBJECT_VALUE = 0;
|
||||
|
||||
static bool IsZero(const void * data, size_t size)
|
||||
{
|
||||
const uint8_t * byte = static_cast<const uint8_t *>(data);
|
||||
@@ -446,7 +448,7 @@ bool CLGMPInputTransport::Start(IInputTarget& target)
|
||||
const DWORD state = WaitForSingleObject(m_thread, 0);
|
||||
if (state == WAIT_TIMEOUT)
|
||||
return true;
|
||||
if (state != WAIT_FIRST_OBJECT_VALUE)
|
||||
if (state != WAIT_OBJECT_0)
|
||||
{
|
||||
DEBUG_ERROR_HR(GetLastError(),
|
||||
"Failed to inspect LGMP input worker");
|
||||
@@ -1006,12 +1008,12 @@ void CLGMPInputTransport::Thread()
|
||||
|
||||
const DWORD wait = WaitForMultipleObjects(
|
||||
_countof(waitHandles), waitHandles, FALSE, INFINITE);
|
||||
if (wait == WAIT_FIRST_OBJECT_VALUE)
|
||||
if (wait == WAIT_OBJECT_0)
|
||||
{
|
||||
failed = Atomic::Load(m_statusFailed, std::memory_order_acquire);
|
||||
break;
|
||||
}
|
||||
if (wait != WAIT_FIRST_OBJECT_VALUE + 1)
|
||||
if (wait != WAIT_OBJECT_0 + 1)
|
||||
{
|
||||
DEBUG_ERROR_HR(GetLastError(), "LGMP input worker wait failed");
|
||||
failed = true;
|
||||
|
||||
Reference in New Issue
Block a user