-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
360 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
// Author: Kang Lin <[email protected]> | ||
|
||
// See: | ||
// - Overview of RemoteApp: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc755055(v=ws.11)?redirectedfrom=MSDN | ||
// - RAIL exec error: execResult=RAIL_EXEC_E_NOT_IN_ALLOWLIST NtError=0x15. | ||
// See: https://github.com/FreeRDP/FreeRDP/issues/998 | ||
// this is a configuration problem on your server see #595 on how to add a command to the allow list or | ||
// set "fAllowUnlistedRemotePrograms" to 1 in "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" to allow all commands. | ||
|
||
#include <QLoggingCategory> | ||
#include "winpr/string.h" | ||
#include "Rail.h" | ||
|
@@ -8,6 +15,9 @@ | |
static Q_LOGGING_CATEGORY(log, "FreeRDP.Rail") | ||
static Q_LOGGING_CATEGORY(logWinInfo, "FreeRDP.Rail.Window.Info") | ||
|
||
int g_CRailInfo = qRegisterMetaType<CRailInfo>("CRailInfo"); | ||
int g_QSharedPointer_CRailInfo = qRegisterMetaType<QSharedPointer<CRailInfo> >("QSharedPointer<CRailInfo>"); | ||
|
||
CRail::CRail(CConnectFreeRDP* pConnect, QObject *parent) | ||
: QObject{parent} | ||
, m_pConnect(pConnect) | ||
|
@@ -74,7 +84,7 @@ QString GetTitle(const WINDOW_STATE_ORDER *windowState) | |
} else | ||
qCritical(log) << "failed to convert window title"; | ||
|
||
qDebug(log) << "Window title:" << szTitle; | ||
//qDebug(log) << "Window title:" << szTitle; | ||
return szTitle; | ||
} | ||
|
||
|
@@ -196,8 +206,8 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, | |
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_STYLE) | ||
{ | ||
qDebug(logWinInfo, "\tStyle: 0x%08X ExtendedStyle: 0x%08X", windowState->style, | ||
windowState->extendedStyle); | ||
qDebug(logWinInfo, "\tStyle: 0x%08X ExtendedStyle: 0x%08X", | ||
windowState->style, windowState->extendedStyle); | ||
PrintWindowStyles(windowState->style); | ||
PrintExtendedWindowStyles(windowState->extendedStyle); | ||
} | ||
|
@@ -217,14 +227,14 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, | |
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET) | ||
{ | ||
qDebug(logWinInfo, "\tClientOffsetX: %d ClientOffsetY: %d", windowState->clientOffsetX, | ||
windowState->clientOffsetY); | ||
qDebug(logWinInfo, "\tClientOffsetX: %d ClientOffsetY: %d", | ||
windowState->clientOffsetX, windowState->clientOffsetY); | ||
} | ||
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE) | ||
{ | ||
qDebug(logWinInfo, "\tClientAreaWidth: %u ClientAreaHeight: %u", windowState->clientAreaWidth, | ||
windowState->clientAreaHeight); | ||
qDebug(logWinInfo, "\tClientAreaWidth: %u ClientAreaHeight: %u", | ||
windowState->clientAreaWidth, windowState->clientAreaHeight); | ||
} | ||
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_RP_CONTENT) | ||
|
@@ -234,13 +244,14 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, | |
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_ROOT_PARENT) | ||
{ | ||
qDebug(logWinInfo, "\tRootParentHandle: 0x%08X", windowState->rootParentHandle); | ||
qDebug(logWinInfo, "\tRootParentHandle: 0x%08X", | ||
windowState->rootParentHandle); | ||
} | ||
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) | ||
{ | ||
qDebug(logWinInfo, "\tWindowOffsetX: %d WindowOffsetY: %d", windowState->windowOffsetX, | ||
windowState->windowOffsetY); | ||
qDebug(logWinInfo, "\tWindowOffsetX: %d WindowOffsetY: %d", | ||
windowState->windowOffsetX, windowState->windowOffsetY); | ||
} | ||
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_CLIENT_DELTA) | ||
|
@@ -251,8 +262,8 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, | |
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE) | ||
{ | ||
qDebug(logWinInfo, "\tWindowWidth: %u WindowHeight: %u", windowState->windowWidth, | ||
windowState->windowHeight); | ||
qDebug(logWinInfo, "\tWindowWidth: %u WindowHeight: %u", | ||
windowState->windowWidth, windowState->windowHeight); | ||
} | ||
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS) | ||
|
@@ -270,14 +281,15 @@ static void PrintRailWindowState(const WINDOW_ORDER_INFO* orderInfo, | |
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VIS_OFFSET) | ||
{ | ||
qDebug(logWinInfo, "\tvisibileOffsetX: %d visibleOffsetY: %d", windowState->visibleOffsetX, | ||
windowState->visibleOffsetY); | ||
qDebug(logWinInfo, "\tvisibileOffsetX: %d visibleOffsetY: %d", | ||
windowState->visibleOffsetX, windowState->visibleOffsetY); | ||
} | ||
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY) | ||
{ | ||
RECTANGLE_16* rect; | ||
qDebug(logWinInfo, "\tnumVisibilityRects: %u", windowState->numVisibilityRects); | ||
qDebug(logWinInfo, "\tnumVisibilityRects: %u", | ||
windowState->numVisibilityRects); | ||
|
||
for (UINT32 index = 0; index < windowState->numVisibilityRects; index++) | ||
{ | ||
|
@@ -447,7 +459,10 @@ UINT CRail::cbServerLocalMoveSize( | |
RailClientContext *context, | ||
const RAIL_LOCALMOVESIZE_ORDER *localMoveSize) | ||
{ | ||
qDebug(log) << Q_FUNC_INFO; | ||
qDebug(log) << Q_FUNC_INFO << localMoveSize->windowId | ||
<< localMoveSize->isMoveSizeStart | ||
<< localMoveSize->moveSizeType | ||
<< localMoveSize->posX << localMoveSize->posY; | ||
return CHANNEL_RC_OK; | ||
} | ||
|
||
|
@@ -504,8 +519,12 @@ CRail* CRail::GetRail(rdpContext *context) | |
} | ||
|
||
CRailInfo::CRailInfo() | ||
: m_x(0), m_y(0), m_Width(0), m_Height(0), m_ShowStatus(0) | ||
{} | ||
: m_Style(0) | ||
, m_ExtendedStyle(0) | ||
, m_ShowStatus(0) | ||
{ | ||
memset(&m_OrderInfo, 0, sizeof(WINDOW_ORDER_INFO)); | ||
} | ||
|
||
CRailInfo::CRailInfo(const WINDOW_ORDER_INFO *orderInfo, | ||
const WINDOW_STATE_ORDER *windowState) | ||
|
@@ -515,21 +534,66 @@ CRailInfo::CRailInfo(const WINDOW_ORDER_INFO *orderInfo, | |
memcpy(&m_OrderInfo, orderInfo, sizeof(WINDOW_ORDER_INFO)); | ||
if(!windowState) | ||
return; | ||
m_x = windowState->windowOffsetX; | ||
m_y = windowState->windowOffsetY; | ||
m_Width = windowState->windowWidth; | ||
m_Height = windowState->windowHeight; | ||
m_ShowStatus = windowState->showState; | ||
m_OwnerWindowId = windowState->ownerWindowId; | ||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_STYLE) { | ||
m_Style = windowState->style; | ||
m_ExtendedStyle = windowState->extendedStyle; | ||
} | ||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) { | ||
m_rectWindow.setX(windowState->windowOffsetX); | ||
m_rectWindow.setY(windowState->windowOffsetY); | ||
} | ||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE) { | ||
m_rectWindow.setWidth(windowState->windowWidth); | ||
m_rectWindow.setHeight(windowState->windowHeight); | ||
} | ||
if ((orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) | ||
|| (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE)) { | ||
qDebug(log) << "CRailInfo: windowOffsetX:" << windowState->windowOffsetX | ||
<< "windowOffsetY:" << windowState->windowOffsetY | ||
<< "width:" << windowState->windowWidth | ||
<< "height:" << windowState->windowHeight | ||
<< "rect:" << m_rectWindow; | ||
} | ||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_SHOW) | ||
m_ShowStatus = windowState->showState; | ||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS) { | ||
for(int i = 0; i < windowState->numWindowRects; i++) | ||
{ | ||
RECTANGLE_16* p = &windowState->windowRects[i]; | ||
QRect r; | ||
r.setLeft(p->left); | ||
r.setTop(p->top); | ||
r.setWidth(p->right - p->left); | ||
r.setHeight(p->bottom - p->top); | ||
m_UpdateRects.push_back(r); | ||
} | ||
qDebug(log) << "CRailInfo: refresh rects:" << m_UpdateRects; | ||
} | ||
|
||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY) { | ||
for(int i = 0; i < windowState->numVisibilityRects; i++) { | ||
RECTANGLE_16* p = &windowState->visibilityRects[i]; | ||
QRect r; | ||
r.setLeft(p->left); | ||
r.setTop(p->top); | ||
r.setWidth(p->right - p->left); | ||
r.setHeight(p->bottom - p->top); | ||
m_VisibilityRects.push_back(r); | ||
} | ||
} | ||
} | ||
|
||
CRailInfo::CRailInfo(const CRailInfo &info) | ||
{ | ||
m_OrderInfo = info.m_OrderInfo; | ||
m_x = info.m_x; | ||
m_y = info.m_y; | ||
m_Width = info.m_Width; | ||
m_Height = info.m_Height; | ||
m_OwnerWindowId = info.m_OwnerWindowId; | ||
m_Style = info.m_Style; | ||
m_ExtendedStyle = info.m_ExtendedStyle; | ||
m_rectWindow = info.m_rectWindow; | ||
m_ShowStatus = info.m_ShowStatus; | ||
m_UpdateRects = info.m_UpdateRects; | ||
m_VisibilityRects = info.m_VisibilityRects; | ||
} | ||
|
||
BOOL CRail::cbWindowCreate(rdpContext *context, | ||
|
Oops, something went wrong.