-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeviceComm.h
More file actions
56 lines (41 loc) · 1.42 KB
/
Copy pathDeviceComm.h
File metadata and controls
56 lines (41 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- DeviceComm.h
Abstract:
- This module assists in communicating via IOCTL messages to and from a Device server handle.
Author:
- Michael Niksa (MiNiksa) 14-Sept-2016
Revision History:
--*/
#pragma once
#include "..\host\conapi.h"
#include <wil\resource.h>
class DeviceComm
{
public:
DeviceComm(_In_ HANDLE Server);
~DeviceComm();
[[nodiscard]]
HRESULT SetServerInformation(_In_ CD_IO_SERVER_INFORMATION* const pServerInfo) const;
[[nodiscard]]
HRESULT ReadIo(_In_opt_ CD_IO_COMPLETE* const pCompletion,
_Out_ CONSOLE_API_MSG* const pMessage) const;
[[nodiscard]]
HRESULT CompleteIo(_In_ CD_IO_COMPLETE* const pCompletion) const;
[[nodiscard]]
HRESULT ReadInput(_In_ CD_IO_OPERATION* const pIoOperation) const;
[[nodiscard]]
HRESULT WriteOutput(_In_ CD_IO_OPERATION* const pIoOperation) const;
[[nodiscard]]
HRESULT AllowUIAccess() const;
private:
[[nodiscard]]
HRESULT _CallIoctl(_In_ DWORD dwIoControlCode,
_In_reads_bytes_opt_(cbInBufferSize) PVOID pInBuffer,
_In_ DWORD cbInBufferSize,
_Out_writes_bytes_opt_(cbOutBufferSize) PVOID pOutBuffer,
_In_ DWORD cbOutBufferSize) const;
wil::unique_handle _Server;
};