add virtual display

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-03-12 19:51:55 +08:00
parent e6bf858ae1
commit b734e8aee9
13 changed files with 153 additions and 13 deletions

View File

@@ -282,7 +282,7 @@ VOID DeviceClose(HSWDEVICE hSwDevice)
}
}
BOOL MonitorPlugIn(UINT index, INT retries)
BOOL MonitorPlugIn(UINT index, UINT edid, INT retries)
{
SetLastMsg("Sucess");
@@ -315,6 +315,7 @@ BOOL MonitorPlugIn(UINT index, INT retries)
DWORD junk = 0;
CtlPlugIn plugIn;
plugIn.ConnectorIndex = index;
plugIn.MonitorEDID = edid;
HRESULT hr = CoCreateGuid(&plugIn.ContainerId);
if (!SUCCEEDED(hr))
{

View File

@@ -70,6 +70,9 @@ 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.
@@ -83,7 +86,7 @@ VOID DeviceClose(HSWDEVICE hSwDevice);
* System need some time to prepare the device.
*
*/
BOOL MonitorPlugIn(UINT index, INT retries);
BOOL MonitorPlugIn(UINT index, UINT edid, INT retries);
/**
* @brief Plug out monitor.

View File

@@ -26,8 +26,12 @@
#define STATUS_ERROR_MONITOR_INVALID_PARAM (3 << 30) + 53
#define STATUS_ERROR_MONITOR_OOM (3 << 30) + 54
#define MONITOR_EDID_MOD_DELL_S2719DGF 0
#define MONITOR_EDID_MOD_LENOVO_Y27fA 1
typedef struct _CtlPlugIn {
UINT ConnectorIndex;
UINT MonitorEDID;
GUID ContainerId;
} CtlPlugIn, *PCtlPlugIn;

View File

@@ -206,7 +206,7 @@ extern "C" {
extern "C" {
pub fn Uninstall(fullInfPath: LPCTSTR, rebootRequired: PBOOL) -> BOOL;
pub fn MonitorPlugIn(index: UINT, retries: INT) -> BOOL;
pub fn MonitorPlugIn(index: UINT, edid: UINT, retries: INT) -> BOOL;
pub fn MonitorPlugOut(index: UINT) -> BOOL;
pub fn MonitorModesUpdate(index: UINT, modeCount: UINT, modes: PMonitorMode) -> BOOL;

View File

@@ -1 +1,4 @@
pub mod idd;
pub mod idd;
pub const DRIVER_INSTALL_PATH: &str = "RustDeskIddDriver/RustDeskIddDriver.inf";
pub const DRIVER_DOWNLOAD_URL: &str = "";