mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-12 21:11:28 +03:00
https://github.com/rustdesk/rustdesk/discussions/937#discussioncomment-12373814 try to support citrix session
This commit is contained in:
@@ -543,6 +543,9 @@ extern "C"
|
|||||||
DWORD count;
|
DWORD count;
|
||||||
auto rdp = "rdp";
|
auto rdp = "rdp";
|
||||||
auto nrdp = strlen(rdp);
|
auto nrdp = strlen(rdp);
|
||||||
|
// https://github.com/rustdesk/rustdesk/discussions/937#discussioncomment-12373814 citrix session
|
||||||
|
auto ica = "ica";
|
||||||
|
auto nica = strlen(ica);
|
||||||
if (WTSEnumerateSessionsA(WTS_CURRENT_SERVER_HANDLE, NULL, 1, &pInfos, &count))
|
if (WTSEnumerateSessionsA(WTS_CURRENT_SERVER_HANDLE, NULL, 1, &pInfos, &count))
|
||||||
{
|
{
|
||||||
for (DWORD i = 0; i < count; i++)
|
for (DWORD i = 0; i < count; i++)
|
||||||
@@ -558,7 +561,7 @@ extern "C"
|
|||||||
WTSFreeMemory(pInfos);
|
WTSFreeMemory(pInfos);
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
if (!strnicmp(info.pWinStationName, rdp, nrdp))
|
if (!strnicmp(info.pWinStationName, rdp, nrdp) || !strnicmp(info.pWinStationName, ica, nica))
|
||||||
{
|
{
|
||||||
rdp_or_console = info.SessionId;
|
rdp_or_console = info.SessionId;
|
||||||
}
|
}
|
||||||
@@ -614,6 +617,8 @@ extern "C"
|
|||||||
auto info = pInfos[i];
|
auto info = pInfos[i];
|
||||||
auto rdp = "rdp";
|
auto rdp = "rdp";
|
||||||
auto nrdp = strlen(rdp);
|
auto nrdp = strlen(rdp);
|
||||||
|
auto ica = "ica";
|
||||||
|
auto nica = strlen(ica);
|
||||||
if (info.State == WTSActive) {
|
if (info.State == WTSActive) {
|
||||||
if (info.pWinStationName == NULL)
|
if (info.pWinStationName == NULL)
|
||||||
continue;
|
continue;
|
||||||
@@ -626,6 +631,9 @@ extern "C"
|
|||||||
else if (include_rdp && !strnicmp(info.pWinStationName, rdp, nrdp)) {
|
else if (include_rdp && !strnicmp(info.pWinStationName, rdp, nrdp)) {
|
||||||
sessionIds.push_back(std::wstring(L"RDP:") + std::to_wstring(info.SessionId));
|
sessionIds.push_back(std::wstring(L"RDP:") + std::to_wstring(info.SessionId));
|
||||||
}
|
}
|
||||||
|
else if (include_rdp && !strnicmp(info.pWinStationName, ica, nica)) {
|
||||||
|
sessionIds.push_back(std::wstring(L"ICA:") + std::to_wstring(info.SessionId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WTSFreeMemory(pInfos);
|
WTSFreeMemory(pInfos);
|
||||||
|
|||||||
Reference in New Issue
Block a user