-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathIddController.h
More file actions
161 lines (147 loc) · 4.52 KB
/
Copy pathIddController.h
File metadata and controls
161 lines (147 loc) · 4.52 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#pragma once
#include <Windows.h>
#include <tchar.h>
#include <swdevice.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Install or Update RustDeskIddDriver.
*
* @param fullInfPath [in] Full path of the driver inf file.
* @param rebootRequired [out] Indicates whether a restart is required.
*
* @return TRUE/FALSE. If FALSE returned, error message can be retrieved by GetLastMsg()
*
* @see GetLastMsg#GetLastMsg
*/
BOOL InstallUpdate(LPCTSTR fullInfPath, PBOOL rebootRequired);
/**
* @brief Uninstall RustDeskIddDriver.
*
* @param fullInfPath [in] Full path of the driver inf file.
* @param rebootRequired [out] Indicates whether a restart is required.
*
* @return TRUE/FALSE. If FALSE returned, error message can be retrieved by GetLastMsg()
*
* @see GetLastMsg#GetLastMsg
*/
BOOL Uninstall(LPCTSTR fullInfPath, PBOOL rebootRequired);
/**
* @brief Check if RustDeskIddDriver device is created before.
* The driver device(adapter) should be single instance.
*
* @param created [out] Indicates whether the device is created before.
*
* @return TRUE/FALSE. If FALSE returned, error message can be retrieved by GetLastMsg()
*
* @see GetLastMsg#GetLastMsg
*
*/
BOOL IsDeviceCreated(PBOOL created);
/**
* @brief Create device.
* Only one device should be created.
* If device is installed ealier, this function returns FALSE.
*
* @param hSwDevice [out] Handler of software device, used by DeviceCreate(). Should be **NULL**.
*
* @return TRUE/FALSE. If FALSE returned, error message can be retrieved by GetLastMsg()
*
* @see GetLastMsg#GetLastMsg
*
*/
BOOL DeviceCreate(PHSWDEVICE hSwDevice);
/**
* @brief Create device and set the lifetime.
* Only one device should be created.
* If device is installed ealier, this function returns FALSE.
*
* @param lifetime [in] The lifetime to set after creating the device. NULL means do not set the lifetime.
* https://learn.microsoft.com/en-us/windows/win32/api/swdevice/nf-swdevice-swdevicesetlifetime
* @param hSwDevice [out] Handler of software device, used by DeviceCreate(). Should be **NULL**.
*
* @return TRUE/FALSE. If FALSE returned, error message can be retrieved by GetLastMsg()
*
* @see GetLastMsg#GetLastMsg
*
*/
BOOL DeviceCreateWithLifetime(SW_DEVICE_LIFETIME * lifetime, PHSWDEVICE hSwDevice);
/**
* @brief Close device.
*
* @param hSwDevice Handler of software device, used by SwDeviceClose().
* If hSwDevice is INVALID_HANDLE_VALUE or NULL, try find and close the device.
*
*/
VOID DeviceClose(HSWDEVICE hSwDevice);
/**
* @brief Plug in monitor.
*
* @param index [in] Monitor index, should be 0, 1, 2.
* @param edid [in] Monitor edid.
* 0 Modified EDID from Dell S2719DGF
* 1 Modified EDID from Lenovo Y27fA
* @param retries [in] Retry times. Retry 1 time / sec. 25~30 seconds may be good choices.
* -1 is invalid.
* 0 means doing once and no retries.
* 1 means doing once and retry one time...
*
* @return TRUE/FALSE. If FALSE returned, error message can be retrieved by GetLastMsg()
*
* @see GetLastMsg#GetLastMsg
*
* @remark Plug in monitor may fail if device is created in a very short time.
* System need some time to prepare the device.
*
*/
BOOL MonitorPlugIn(UINT index, UINT edid, INT retries);
/**
* @brief Plug out monitor.
*
* @param index [in] Monitor index, should be 0, 1, 2.
*
* @return TRUE/FALSE. If FALSE returned, error message can be retrieved by GetLastMsg()
*
* @see GetLastMsg#GetLastMsg
*
*/
BOOL MonitorPlugOut(UINT index);
typedef struct _MonitorMode {
DWORD width;
DWORD height;
// Sync affects frequency.
DWORD sync;
} MonitorMode, *PMonitorMode;
/**
* @brief Update monitor mode.
*
* @param index [in] Monitor index, should be 0, 1, 2.
* @param modeCount [in] Monitor mode count.
* @param MonitorMode [in] Monitor mode data.
*
* @return TRUE/FALSE. If FALSE returned, error message can be retrieved by GetLastMsg()
*
* @see GetLastMsg#GetLastMsg
*
*/
BOOL MonitorModesUpdate(UINT index, UINT modeCount, PMonitorMode modes);
/**
* @brief Get last error message.
*
* @return Message string. The string is at most 1024 bytes.
*
*/
const char* GetLastMsg();
/**
* @brief Set if print error message when debug.
*
* @param b [in] TRUE to enable printing message.
*
* @remark For now, no need to read evironment variable to check if should print.
*
*/
VOID SetPrintErrMsg(BOOL b);
#ifdef __cplusplus
}
#endif