Merge branch 'master' of https://github.com/FreeRDP/xrdp
This commit is contained in:
commit
f3cc2a5154
@ -1750,6 +1750,19 @@ g_strlen(const char *text)
|
||||
return strlen(text);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* locates char in text */
|
||||
char* APP_CC
|
||||
g_strchr(const char* text, int c)
|
||||
{
|
||||
if (text == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return strchr(text,c);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* returns dest */
|
||||
char *APP_CC
|
||||
|
@ -172,6 +172,8 @@ g_file_get_size(const char* filename);
|
||||
int APP_CC
|
||||
g_strlen(const char* text);
|
||||
char* APP_CC
|
||||
g_strchr(const char* text, int c);
|
||||
char* APP_CC
|
||||
g_strcpy(char* dest, const char* src);
|
||||
char* APP_CC
|
||||
g_strncpy(char* dest, const char* src, int len);
|
||||
|
@ -1,10 +1,18 @@
|
||||
EXTRA_DIST = xrdp-freerdp.h
|
||||
EXTRA_DEFINES =
|
||||
|
||||
if XRDP_DEBUG
|
||||
EXTRA_DEFINES += -DXRDP_DEBUG
|
||||
else
|
||||
EXTRA_DEFINES += -DXRDP_NODEBUG
|
||||
endif
|
||||
|
||||
AM_CFLAGS = \
|
||||
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
|
||||
-DXRDP_SBIN_PATH=\"${sbindir}\" \
|
||||
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
|
||||
-DXRDP_PID_PATH=\"${localstatedir}/run\"
|
||||
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
|
||||
$(EXTRA_DEFINES)
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir)/common \
|
||||
|
@ -21,7 +21,12 @@
|
||||
#include "xrdp-color.h"
|
||||
#include "xrdp_rail.h"
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#ifdef XRDP_DEBUG
|
||||
#define LOG_LEVEL 99
|
||||
#else
|
||||
#define LOG_LEVEL 0
|
||||
#endif
|
||||
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
@ -43,15 +48,15 @@ lxrdp_start(struct mod *mod, int w, int h, int bpp)
|
||||
|
||||
LLOGLN(10, ("lxrdp_start: w %d h %d bpp %d", w, h, bpp));
|
||||
settings = mod->inst->settings;
|
||||
settings->width = w;
|
||||
settings->height = h;
|
||||
settings->color_depth = bpp;
|
||||
settings->DesktopWidth = w;
|
||||
settings->DesktopHeight = h;
|
||||
settings->ColorDepth = bpp;
|
||||
mod->bpp = bpp;
|
||||
|
||||
settings->encryption = 1;
|
||||
settings->tls_security = 1;
|
||||
settings->nla_security = 0;
|
||||
settings->rdp_security = 1;
|
||||
// TODO what does this really become
|
||||
settings->DisableEncryption = 1; // settings->encryption = 1;
|
||||
settings->TlsSecurity = 1;
|
||||
settings->NlaSecurity = 0;
|
||||
settings->RdpSecurity = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -61,7 +66,7 @@ lxrdp_start(struct mod *mod, int w, int h, int bpp)
|
||||
static int DEFAULT_CC
|
||||
lxrdp_connect(struct mod *mod)
|
||||
{
|
||||
boolean ok;
|
||||
BOOL ok;
|
||||
|
||||
LLOGLN(10, ("lxrdp_connect:"));
|
||||
|
||||
@ -81,7 +86,7 @@ lxrdp_connect(struct mod *mod)
|
||||
{
|
||||
if (strerror_r(connectErrorCode, buf, 128) != 0)
|
||||
{
|
||||
snprintf(buf, 128, "Errorcode from connect : %d", connectErrorCode);
|
||||
g_snprintf(buf, 128, "Errorcode from connect : %d", connectErrorCode);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -89,40 +94,40 @@ lxrdp_connect(struct mod *mod)
|
||||
switch (connectErrorCode)
|
||||
{
|
||||
case PREECONNECTERROR:
|
||||
snprintf(buf, 128, "The error code from connect is "
|
||||
g_snprintf(buf, 128, "The error code from connect is "
|
||||
"PREECONNECTERROR");
|
||||
break;
|
||||
case UNDEFINEDCONNECTERROR:
|
||||
snprintf(buf, 128, "The error code from connect is "
|
||||
g_snprintf(buf, 128, "The error code from connect is "
|
||||
"UNDEFINEDCONNECTERROR");
|
||||
break;
|
||||
case POSTCONNECTERROR:
|
||||
snprintf(buf, 128, "The error code from connect is "
|
||||
g_snprintf(buf, 128, "The error code from connect is "
|
||||
"POSTCONNECTERROR");
|
||||
break;
|
||||
case DNSERROR:
|
||||
snprintf(buf, 128, "The DNS system generated an error");
|
||||
g_snprintf(buf, 128, "The DNS system generated an error");
|
||||
break;
|
||||
case DNSNAMENOTFOUND:
|
||||
snprintf(buf, 128, "The DNS system could not find the "
|
||||
g_snprintf(buf, 128, "The DNS system could not find the "
|
||||
"specified name");
|
||||
break;
|
||||
case CONNECTERROR:
|
||||
snprintf(buf, 128, "A general connect error was returned");
|
||||
g_snprintf(buf, 128, "A general connect error was returned");
|
||||
break;
|
||||
case MCSCONNECTINITIALERROR:
|
||||
snprintf(buf, 128, "The error code from connect is "
|
||||
g_snprintf(buf, 128, "The error code from connect is "
|
||||
"MCSCONNECTINITIALERROR");
|
||||
break;
|
||||
case TLSCONNECTERROR:
|
||||
snprintf(buf, 128, "Error in TLS handshake");
|
||||
g_snprintf(buf, 128, "Error in TLS handshake");
|
||||
break;
|
||||
case AUTHENTICATIONERROR:
|
||||
snprintf(buf, 128, "Authentication error check your password "
|
||||
g_snprintf(buf, 128, "Authentication error check your password "
|
||||
"and username");
|
||||
break;
|
||||
default:
|
||||
snprintf(buf, 128, "Unhandled Errorcode from connect : %d",
|
||||
g_snprintf(buf, 128, "Unhandled Errorcode from connect : %d",
|
||||
connectErrorCode);
|
||||
break;
|
||||
}
|
||||
@ -237,7 +242,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
|
||||
rectangle->right = (((param2 >> 16) & 0xffff) + rectangle->left) - 1;
|
||||
rectangle->bottom = ((param2 & 0xffff) + rectangle->top) - 1;
|
||||
|
||||
if (mod->inst->settings->refresh_rect)
|
||||
if (mod->inst->settings->RefreshRect)
|
||||
{
|
||||
if (mod->inst->update != NULL)
|
||||
{
|
||||
@ -279,13 +284,13 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
|
||||
total_size = (int)param4;
|
||||
LLOGLN(10, ("lxrdp_event: client to server flags %d", flags));
|
||||
|
||||
if ((chanid < 0) || (chanid >= mod->inst->settings->num_channels))
|
||||
if ((chanid < 0) || (chanid >= mod->inst->settings->ChannelDefArraySize))
|
||||
{
|
||||
LLOGLN(0, ("lxrdp_event: error chanid %d", chanid));
|
||||
break;
|
||||
}
|
||||
|
||||
lchid = mod->inst->settings->channels[chanid].channel_id;
|
||||
lchid = mod->inst->settings->ChannelDefArray[chanid].ChannelId;
|
||||
|
||||
switch (flags & 3)
|
||||
{
|
||||
@ -375,18 +380,18 @@ lxrdp_set_param(struct mod *mod, char *name, char *value)
|
||||
LLOGLN(10, ("lxrdp_set_param: name [%s] value [%s]", name, value));
|
||||
settings = mod->inst->settings;
|
||||
|
||||
LLOGLN(10, ("%p %d", settings->hostname, settings->encryption));
|
||||
LLOGLN(10, ("%p %d", settings->ServerHostname, settings->DisableEncryption));
|
||||
|
||||
if (g_strcmp(name, "hostname") == 0)
|
||||
{
|
||||
}
|
||||
else if (g_strcmp(name, "ip") == 0)
|
||||
{
|
||||
settings->hostname = g_strdup(value);
|
||||
settings->ServerHostname = g_strdup(value);
|
||||
}
|
||||
else if (g_strcmp(name, "port") == 0)
|
||||
{
|
||||
settings->port = g_atoi(value);
|
||||
settings->ServerPort = g_atoi(value);
|
||||
}
|
||||
else if (g_strcmp(name, "keylayout") == 0)
|
||||
{
|
||||
@ -434,7 +439,7 @@ lxrdp_get_wait_objs(struct mod *mod, tbus *read_objs, int *rcount,
|
||||
{
|
||||
void **rfds;
|
||||
void **wfds;
|
||||
boolean ok;
|
||||
BOOL ok;
|
||||
|
||||
LLOGLN(10, ("lxrdp_get_wait_objs:"));
|
||||
rfds = (void **)read_objs;
|
||||
@ -454,7 +459,7 @@ lxrdp_get_wait_objs(struct mod *mod, tbus *read_objs, int *rcount,
|
||||
static int DEFAULT_CC
|
||||
lxrdp_check_wait_objs(struct mod *mod)
|
||||
{
|
||||
boolean ok;
|
||||
BOOL ok;
|
||||
|
||||
LLOGLN(10, ("lxrdp_check_wait_objs:"));
|
||||
ok = freerdp_check_fds(mod->inst);
|
||||
@ -539,7 +544,7 @@ lfreerdp_bitmap_update(rdpContext *context, BITMAP_UPDATE *bitmap)
|
||||
mod = ((struct mod_context *)context)->modi;
|
||||
LLOGLN(10, ("lfreerdp_bitmap_update: %d %d", bitmap->number, bitmap->count));
|
||||
|
||||
server_bpp = mod->inst->settings->color_depth;
|
||||
server_bpp = mod->inst->settings->ColorDepth;
|
||||
server_Bpp = (server_bpp + 7) / 8;
|
||||
client_bpp = mod->bpp;
|
||||
|
||||
@ -613,7 +618,7 @@ lfreerdp_pat_blt(rdpContext *context, PATBLT_ORDER *patblt)
|
||||
mod = ((struct mod_context *)context)->modi;
|
||||
LLOGLN(10, ("lfreerdp_pat_blt:"));
|
||||
|
||||
server_bpp = mod->inst->settings->color_depth;
|
||||
server_bpp = mod->inst->settings->ColorDepth;
|
||||
client_bpp = mod->bpp;
|
||||
LLOGLN(0, ("lfreerdp_pat_blt: bpp %d %d", server_bpp, client_bpp));
|
||||
|
||||
@ -681,7 +686,7 @@ lfreerdp_opaque_rect(rdpContext *context, OPAQUE_RECT_ORDER *opaque_rect)
|
||||
|
||||
mod = ((struct mod_context *)context)->modi;
|
||||
LLOGLN(10, ("lfreerdp_opaque_rect:"));
|
||||
server_bpp = mod->inst->settings->color_depth;
|
||||
server_bpp = mod->inst->settings->ColorDepth;
|
||||
client_bpp = mod->bpp;
|
||||
fgcolor = convert_color(server_bpp, client_bpp,
|
||||
opaque_rect->color, mod->colormap);
|
||||
@ -746,7 +751,7 @@ lfreerdp_glyph_index(rdpContext *context, GLYPH_INDEX_ORDER *glyph_index)
|
||||
|
||||
mod = ((struct mod_context *)context)->modi;
|
||||
LLOGLN(10, ("lfreerdp_glyph_index:"));
|
||||
server_bpp = mod->inst->settings->color_depth;
|
||||
server_bpp = mod->inst->settings->ColorDepth;
|
||||
client_bpp = mod->bpp;
|
||||
fgcolor = convert_color(server_bpp, client_bpp,
|
||||
glyph_index->foreColor, mod->colormap);
|
||||
@ -777,7 +782,7 @@ lfreerdp_line_to(rdpContext *context, LINE_TO_ORDER *line_to)
|
||||
mod = ((struct mod_context *)context)->modi;
|
||||
LLOGLN(10, ("lfreerdp_line_to:"));
|
||||
mod->server_set_opcode(mod, line_to->bRop2);
|
||||
server_bpp = mod->inst->settings->color_depth;
|
||||
server_bpp = mod->inst->settings->ColorDepth;
|
||||
client_bpp = mod->bpp;
|
||||
fgcolor = convert_color(server_bpp, client_bpp,
|
||||
line_to->penColor, mod->colormap);
|
||||
@ -801,7 +806,7 @@ lfreerdp_cache_bitmap(rdpContext *context, CACHE_BITMAP_ORDER *cache_bitmap_orde
|
||||
/******************************************************************************/
|
||||
/* Turn the bitmap upside down*/
|
||||
static void DEFAULT_CC
|
||||
lfreerdp_upsidedown(uint8 *destination, CACHE_BITMAP_V2_ORDER *cache_bitmap_v2_order, int server_Bpp)
|
||||
lfreerdp_upsidedown(UINT8 *destination, CACHE_BITMAP_V2_ORDER *cache_bitmap_v2_order, int server_Bpp)
|
||||
{
|
||||
tui8 *src;
|
||||
tui8 *dst;
|
||||
@ -872,7 +877,7 @@ lfreerdp_cache_bitmapV2(rdpContext *context,
|
||||
return;
|
||||
}
|
||||
|
||||
server_bpp = mod->inst->settings->color_depth;
|
||||
server_bpp = mod->inst->settings->ColorDepth;
|
||||
server_Bpp = (server_bpp + 7) / 8;
|
||||
client_bpp = mod->bpp;
|
||||
|
||||
@ -926,13 +931,13 @@ lfreerdp_cache_glyph(rdpContext *context, CACHE_GLYPH_ORDER *cache_glyph_order)
|
||||
gd->cx, gd->cy));
|
||||
mod->server_add_char(mod, cache_glyph_order->cacheId, gd->cacheIndex,
|
||||
gd->x, gd->y, gd->cx, gd->cy, (char *)(gd->aj));
|
||||
xfree(gd->aj);
|
||||
free(gd->aj);
|
||||
gd->aj = 0;
|
||||
xfree(gd);
|
||||
free(gd);
|
||||
cache_glyph_order->glyphData[index] = 0;
|
||||
}
|
||||
|
||||
xfree(cache_glyph_order->unicodeCharacters);
|
||||
free(cache_glyph_order->unicodeCharacters);
|
||||
cache_glyph_order->unicodeCharacters = 0;
|
||||
}
|
||||
|
||||
@ -995,7 +1000,7 @@ lfreerdp_cache_brush(rdpContext *context, CACHE_BRUSH_ORDER *cache_brush_order)
|
||||
LLOGLN(10, ("lfreerdp_cache_brush: out bpp %d cx %d cy %d idx %d bytes %d",
|
||||
bpp, cx, cy, idx, bytes));
|
||||
|
||||
xfree(cache_brush_order->data);
|
||||
free(cache_brush_order->data);
|
||||
cache_brush_order->data = 0;
|
||||
|
||||
}
|
||||
@ -1171,9 +1176,9 @@ lfreerdp_pointer_new(rdpContext *context,
|
||||
pointer_new->colorPtrAttr.height));
|
||||
}
|
||||
|
||||
xfree(pointer_new->colorPtrAttr.xorMaskData);
|
||||
free(pointer_new->colorPtrAttr.xorMaskData);
|
||||
pointer_new->colorPtrAttr.xorMaskData = 0;
|
||||
xfree(pointer_new->colorPtrAttr.andMaskData);
|
||||
free(pointer_new->colorPtrAttr.andMaskData);
|
||||
pointer_new->colorPtrAttr.andMaskData = 0;
|
||||
|
||||
}
|
||||
@ -1195,7 +1200,7 @@ lfreerdp_pointer_cached(rdpContext *context,
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
static boolean DEFAULT_CC
|
||||
static BOOL DEFAULT_CC
|
||||
lfreerdp_pre_connect(freerdp *instance)
|
||||
{
|
||||
struct mod *mod;
|
||||
@ -1217,58 +1222,61 @@ lfreerdp_pre_connect(freerdp *instance)
|
||||
num_chans++;
|
||||
LLOGLN(10, ("lfreerdp_pre_connect: got channel [%s], flags [0x%8.8x]",
|
||||
ch_name, ch_flags));
|
||||
dst_ch_name = instance->settings->channels[index].name;
|
||||
dst_ch_name = instance->settings->ChannelDefArray[index].Name;
|
||||
g_memset(dst_ch_name, 0, 8);
|
||||
g_snprintf(dst_ch_name, 8, "%s", ch_name);
|
||||
instance->settings->channels[index].options = ch_flags;
|
||||
instance->settings->ChannelDefArray[index].options = ch_flags;
|
||||
index++;
|
||||
error = mod->server_query_channel(mod, index, ch_name, &ch_flags);
|
||||
}
|
||||
|
||||
instance->settings->num_channels = num_chans;
|
||||
instance->settings->ChannelCount = num_chans;
|
||||
|
||||
instance->settings->offscreen_bitmap_cache = false;
|
||||
// TODO
|
||||
// instance->settings->offscreen_bitmap_cache = false;
|
||||
instance->settings->OffscreenSupportLevel = 0;
|
||||
|
||||
instance->settings->glyph_cache = true;
|
||||
instance->settings->glyphSupportLevel = GLYPH_SUPPORT_FULL;
|
||||
instance->settings->order_support[NEG_GLYPH_INDEX_INDEX] = true;
|
||||
instance->settings->order_support[NEG_FAST_GLYPH_INDEX] = false;
|
||||
instance->settings->order_support[NEG_FAST_INDEX_INDEX] = false;
|
||||
instance->settings->order_support[NEG_SCRBLT_INDEX] = true;
|
||||
instance->settings->order_support[NEG_SAVEBITMAP_INDEX] = false;
|
||||
// TODO
|
||||
//instance->settings->glyph_cache = true;
|
||||
instance->settings->GlyphSupportLevel = GLYPH_SUPPORT_FULL;
|
||||
instance->settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = TRUE;
|
||||
instance->settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = FALSE;
|
||||
instance->settings->OrderSupport[NEG_FAST_INDEX_INDEX] = FALSE;
|
||||
instance->settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE;
|
||||
instance->settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = FALSE;
|
||||
|
||||
instance->settings->bitmap_cache = true;
|
||||
instance->settings->order_support[NEG_MEMBLT_INDEX] = true;
|
||||
instance->settings->order_support[NEG_MEMBLT_V2_INDEX] = true;
|
||||
instance->settings->order_support[NEG_MEM3BLT_INDEX] = false;
|
||||
instance->settings->order_support[NEG_MEM3BLT_V2_INDEX] = false;
|
||||
instance->settings->bitmapCacheV2NumCells = 3; // 5;
|
||||
instance->settings->bitmapCacheV2CellInfo[0].numEntries = 0x78; // 600;
|
||||
instance->settings->bitmapCacheV2CellInfo[0].persistent = false;
|
||||
instance->settings->bitmapCacheV2CellInfo[1].numEntries = 0x78; // 600;
|
||||
instance->settings->bitmapCacheV2CellInfo[1].persistent = false;
|
||||
instance->settings->bitmapCacheV2CellInfo[2].numEntries = 0x150; // 2048;
|
||||
instance->settings->bitmapCacheV2CellInfo[2].persistent = false;
|
||||
instance->settings->bitmapCacheV2CellInfo[3].numEntries = 0; // 4096;
|
||||
instance->settings->bitmapCacheV2CellInfo[3].persistent = false;
|
||||
instance->settings->bitmapCacheV2CellInfo[4].numEntries = 0; // 2048;
|
||||
instance->settings->bitmapCacheV2CellInfo[4].persistent = false;
|
||||
instance->settings->BitmapCacheEnabled = TRUE;
|
||||
instance->settings->OrderSupport[NEG_MEMBLT_INDEX] = TRUE;
|
||||
instance->settings->OrderSupport[NEG_MEMBLT_V2_INDEX] = TRUE;
|
||||
instance->settings->OrderSupport[NEG_MEM3BLT_INDEX] = FALSE;
|
||||
instance->settings->OrderSupport[NEG_MEM3BLT_V2_INDEX] = FALSE;
|
||||
instance->settings->BitmapCacheV2NumCells = 3; // 5;
|
||||
instance->settings->BitmapCacheV2CellInfo[0].numEntries = 0x78; // 600;
|
||||
instance->settings->BitmapCacheV2CellInfo[0].persistent = FALSE;
|
||||
instance->settings->BitmapCacheV2CellInfo[1].numEntries = 0x78; // 600;
|
||||
instance->settings->BitmapCacheV2CellInfo[1].persistent = FALSE;
|
||||
instance->settings->BitmapCacheV2CellInfo[2].numEntries = 0x150; // 2048;
|
||||
instance->settings->BitmapCacheV2CellInfo[2].persistent = FALSE;
|
||||
instance->settings->BitmapCacheV2CellInfo[3].numEntries = 0; // 4096;
|
||||
instance->settings->BitmapCacheV2CellInfo[3].persistent = FALSE;
|
||||
instance->settings->BitmapCacheV2CellInfo[4].numEntries = 0; // 2048;
|
||||
instance->settings->BitmapCacheV2CellInfo[4].persistent = FALSE;
|
||||
|
||||
instance->settings->order_support[NEG_MULTIDSTBLT_INDEX] = false;
|
||||
instance->settings->order_support[NEG_MULTIPATBLT_INDEX] = false;
|
||||
instance->settings->order_support[NEG_MULTISCRBLT_INDEX] = false;
|
||||
instance->settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = false;
|
||||
instance->settings->order_support[NEG_POLYLINE_INDEX] = false;
|
||||
instance->settings->OrderSupport[NEG_MULTIDSTBLT_INDEX] = FALSE;
|
||||
instance->settings->OrderSupport[NEG_MULTIPATBLT_INDEX] = FALSE;
|
||||
instance->settings->OrderSupport[NEG_MULTISCRBLT_INDEX] = FALSE;
|
||||
instance->settings->OrderSupport[NEG_MULTIOPAQUERECT_INDEX] = FALSE;
|
||||
instance->settings->OrderSupport[NEG_POLYLINE_INDEX] = FALSE;
|
||||
|
||||
instance->settings->username = g_strdup(mod->username);
|
||||
instance->settings->password = g_strdup(mod->password);
|
||||
instance->settings->Username = g_strdup(mod->username);
|
||||
instance->settings->Password = g_strdup(mod->password);
|
||||
|
||||
if (mod->client_info.rail_support_level > 0)
|
||||
{
|
||||
instance->settings->remote_app = true;
|
||||
instance->settings->rail_langbar_supported = true;
|
||||
instance->settings->workarea = true;
|
||||
instance->settings->performance_flags = PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG;
|
||||
instance->settings->RemoteApplicationMode = TRUE;
|
||||
instance->settings->RemoteAppLanguageBarSupported = TRUE;
|
||||
instance->settings->Workarea = TRUE;
|
||||
instance->settings->PerformanceFlags = PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG;
|
||||
}
|
||||
|
||||
// here
|
||||
@ -1301,14 +1309,14 @@ lfreerdp_pre_connect(freerdp *instance)
|
||||
if ((mod->username[0] != 0) && (mod->password[0] != 0))
|
||||
{
|
||||
/* since we have username and password, we can try nla */
|
||||
instance->settings->nla_security = 1;
|
||||
instance->settings->NlaSecurity = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
instance->settings->nla_security = 0;
|
||||
instance->settings->NlaSecurity = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -1319,10 +1327,8 @@ lrail_WindowCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo,
|
||||
int index;
|
||||
struct mod *mod;
|
||||
struct rail_window_state_order wso;
|
||||
UNICONV *uniconv;
|
||||
|
||||
LLOGLN(0, ("llrail_WindowCreate:"));
|
||||
uniconv = freerdp_uniconv_new();
|
||||
mod = ((struct mod_context *)context)->modi;
|
||||
memset(&wso, 0, sizeof(wso));
|
||||
/* copy the window state order */
|
||||
@ -1333,8 +1339,7 @@ lrail_WindowCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo,
|
||||
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE)
|
||||
{
|
||||
wso.title_info = freerdp_uniconv_in(uniconv,
|
||||
window_state->titleInfo.string, window_state->titleInfo.length);
|
||||
freerdp_UnicodeToAsciiAlloc(window_state->titleInfo.string, &wso.title_info, window_state->titleInfo.length / 2);
|
||||
}
|
||||
|
||||
LLOGLN(0, ("lrail_WindowCreate: %s", wso.title_info));
|
||||
@ -1387,10 +1392,9 @@ lrail_WindowCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo,
|
||||
mod->server_window_new_update(mod, orderInfo->windowId, &wso,
|
||||
orderInfo->fieldFlags);
|
||||
|
||||
xfree(wso.title_info);
|
||||
free(wso.title_info);
|
||||
g_free(wso.window_rects);
|
||||
g_free(wso.visibility_rects);
|
||||
freerdp_uniconv_free(uniconv);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -1461,11 +1465,8 @@ lrail_NotifyIconCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo,
|
||||
{
|
||||
struct mod *mod;
|
||||
struct rail_notify_state_order rnso;
|
||||
UNICONV *uniconv;
|
||||
|
||||
|
||||
LLOGLN(0, ("lrail_NotifyIconCreate:"));
|
||||
uniconv = freerdp_uniconv_new();
|
||||
|
||||
mod = ((struct mod_context *)context)->modi;
|
||||
|
||||
@ -1474,20 +1475,18 @@ lrail_NotifyIconCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo,
|
||||
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_TIP)
|
||||
{
|
||||
rnso.tool_tip = freerdp_uniconv_in(uniconv,
|
||||
notify_icon_state->toolTip.string, notify_icon_state->toolTip.length);
|
||||
freerdp_UnicodeToAsciiAlloc(notify_icon_state->toolTip.string,
|
||||
&rnso.tool_tip, notify_icon_state->toolTip.length / 2);
|
||||
}
|
||||
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP)
|
||||
{
|
||||
rnso.infotip.timeout = notify_icon_state->infoTip.timeout;
|
||||
rnso.infotip.flags = notify_icon_state->infoTip.flags;
|
||||
rnso.infotip.text = freerdp_uniconv_in(uniconv,
|
||||
notify_icon_state->infoTip.text.string,
|
||||
notify_icon_state->infoTip.text.length);
|
||||
rnso.infotip.title = freerdp_uniconv_in(uniconv,
|
||||
notify_icon_state->infoTip.title.string,
|
||||
notify_icon_state->infoTip.title.length);
|
||||
freerdp_UnicodeToAsciiAlloc(notify_icon_state->infoTip.text.string,
|
||||
&rnso.infotip.text, notify_icon_state->infoTip.text.length / 2);
|
||||
freerdp_UnicodeToAsciiAlloc(notify_icon_state->infoTip.title.string,
|
||||
&rnso.infotip.title, notify_icon_state->infoTip.title.length / 2);
|
||||
}
|
||||
|
||||
rnso.state = notify_icon_state->state;
|
||||
@ -1508,11 +1507,9 @@ lrail_NotifyIconCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo,
|
||||
orderInfo->notifyIconId,
|
||||
&rnso, orderInfo->fieldFlags);
|
||||
|
||||
xfree(rnso.tool_tip);
|
||||
xfree(rnso.infotip.text);
|
||||
xfree(rnso.infotip.title);
|
||||
freerdp_uniconv_free(uniconv);
|
||||
|
||||
free(rnso.tool_tip);
|
||||
free(rnso.infotip.text);
|
||||
free(rnso.infotip.title);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -1582,7 +1579,7 @@ lrail_NonMonitoredDesktop(rdpContext *context, WINDOW_ORDER_INFO *orderInfo)
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
static boolean DEFAULT_CC
|
||||
static BOOL DEFAULT_CC
|
||||
lfreerdp_post_connect(freerdp *instance)
|
||||
{
|
||||
struct mod *mod;
|
||||
@ -1602,7 +1599,7 @@ lfreerdp_post_connect(freerdp *instance)
|
||||
mod->inst->update->window->MonitoredDesktop = lrail_MonitoredDesktop;
|
||||
mod->inst->update->window->NonMonitoredDesktop = lrail_NonMonitoredDesktop;
|
||||
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
@ -1621,7 +1618,7 @@ lfreerdp_context_free(freerdp *instance, rdpContext *context)
|
||||
|
||||
/******************************************************************************/
|
||||
static int DEFAULT_CC
|
||||
lfreerdp_receive_channel_data(freerdp *instance, int channelId, uint8 *data,
|
||||
lfreerdp_receive_channel_data(freerdp *instance, int channelId, UINT8 *data,
|
||||
int size, int flags, int total_size)
|
||||
{
|
||||
struct mod *mod;
|
||||
@ -1632,9 +1629,9 @@ lfreerdp_receive_channel_data(freerdp *instance, int channelId, uint8 *data,
|
||||
mod = ((struct mod_context *)(instance->context))->modi;
|
||||
lchid = -1;
|
||||
|
||||
for (index = 0; index < instance->settings->num_channels; index++)
|
||||
for (index = 0; index < instance->settings->ChannelDefArraySize; index++)
|
||||
{
|
||||
if (instance->settings->channels[index].channel_id == channelId)
|
||||
if (instance->settings->ChannelDefArray[index].ChannelId == channelId)
|
||||
{
|
||||
lchid = index;
|
||||
break;
|
||||
@ -1661,21 +1658,21 @@ lfreerdp_receive_channel_data(freerdp *instance, int channelId, uint8 *data,
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
static boolean DEFAULT_CC
|
||||
static BOOL DEFAULT_CC
|
||||
lfreerdp_authenticate(freerdp *instance, char **username,
|
||||
char **password, char **domain)
|
||||
{
|
||||
LLOGLN(0, ("lfreerdp_authenticate:"));
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
static boolean DEFAULT_CC
|
||||
static BOOL DEFAULT_CC
|
||||
lfreerdp_verify_certificate(freerdp *instance, char *subject, char *issuer,
|
||||
char *fingerprint)
|
||||
{
|
||||
LLOGLN(0, ("lfreerdp_verify_certificate:"));
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <freerdp/rail.h>
|
||||
#include <freerdp/rail/rail.h>
|
||||
#include <freerdp/codec/bitmap.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
//#include <freerdp/utils/memory.h>
|
||||
//#include "/home/jay/git/jsorg71/staging/include/freerdp/freerdp.h"
|
||||
|
||||
struct bitmap_item
|
||||
|
@ -13,7 +13,7 @@ endif
|
||||
|
||||
if XRDP_FREERDP1
|
||||
EXTRA_DEFINES += -DXRDP_FREERDP1
|
||||
EXTRA_LIBS += -lfreerdp-codec -lfreerdp-utils
|
||||
EXTRA_LIBS += $(FREERDP_LIBS)
|
||||
endif
|
||||
|
||||
if XRDP_JPEG
|
||||
|
@ -744,6 +744,7 @@ libxrdp_query_channel(struct xrdp_session *session, int index,
|
||||
|
||||
if (index < 0 || index >= count)
|
||||
{
|
||||
DEBUG(("libxrdp_query_channel - Channel out of range %d", index));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -760,6 +761,7 @@ libxrdp_query_channel(struct xrdp_session *session, int index,
|
||||
if (channel_name != 0)
|
||||
{
|
||||
g_strncpy(channel_name, channel_item->name, 8);
|
||||
DEBUG(("libxrdp_query_channel - Channel %d name %s", index, channel_name));
|
||||
}
|
||||
|
||||
if (channel_flags != 0)
|
||||
|
@ -144,9 +144,9 @@ xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan)
|
||||
/* this is channels getting added from the client */
|
||||
if (appid == MCS_CJRQ)
|
||||
{
|
||||
g_writeln("channel join request received");
|
||||
in_uint16_be(s, userid);
|
||||
in_uint16_be(s, chanid);
|
||||
g_writeln("channel join request received %d:%d", userid, chanid);
|
||||
DEBUG(("xrdp_mcs_recv adding channel %4.4x", chanid));
|
||||
|
||||
if (xrdp_mcs_send_cjcf(self, userid, chanid) != 0)
|
||||
|
@ -2449,6 +2449,7 @@ xrdp_orders_send_create_os_surface(struct xrdp_orders *self, int id,
|
||||
order_flags |= 1 << 2; /* type RDP_ORDER_ALTSEC_CREATE_OFFSCR_BITMAP */
|
||||
out_uint8(self->out_s, order_flags);
|
||||
cache_id = id & 0x7fff;
|
||||
LLOGLN(10, ("xrdp_orders_send_create_os_surface: cache_id %d", cache_id));
|
||||
flags = cache_id;
|
||||
|
||||
if (num_del_list > 0)
|
||||
|
@ -77,12 +77,14 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
|
||||
values = list_create();
|
||||
values->auto_free = 1;
|
||||
g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH);
|
||||
DEBUG(("cfg_file %s", cfg_file));
|
||||
file_by_name_read_section(cfg_file, "globals", items, values);
|
||||
|
||||
for (index = 0; index < items->count; index++)
|
||||
{
|
||||
item = (char *)list_get_item(items, index);
|
||||
value = (char *)list_get_item(values, index);
|
||||
DEBUG(("item %s value %s", item, value));
|
||||
|
||||
if (g_strcasecmp(item, "bitmap_cache") == 0)
|
||||
{
|
||||
@ -193,7 +195,7 @@ xrdp_rdp_detect_cpu(void)
|
||||
|
||||
if (edx & (1 << 26))
|
||||
{
|
||||
DEBUG("SSE2 detected");
|
||||
DEBUG(("SSE2 detected"));
|
||||
cpu_opt |= CPU_SSE2;
|
||||
}
|
||||
|
||||
@ -452,7 +454,7 @@ xrdp_rdp_send_data(struct xrdp_rdp *self, struct stream *s,
|
||||
}
|
||||
else
|
||||
{
|
||||
g_writeln("mppc_encode not ok");
|
||||
g_writeln("mppc_encode not ok: type %d flags %d", mppc_enc->protocol_type, mppc_enc->flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,18 @@
|
||||
EXTRA_DIST = rdp.h
|
||||
EXTRA_DEFINES =
|
||||
|
||||
if XRDP_DEBUG
|
||||
EXTRA_DEFINES += -DXRDP_DEBUG
|
||||
else
|
||||
EXTRA_DEFINES += -DXRDP_NODEBUG
|
||||
endif
|
||||
|
||||
AM_CFLAGS = \
|
||||
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
|
||||
-DXRDP_SBIN_PATH=\"${sbindir}\" \
|
||||
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
|
||||
-DXRDP_PID_PATH=\"${localstatedir}/run\"
|
||||
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
|
||||
$(EXTRA_DEFINES)
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir)/common
|
||||
|
@ -256,7 +256,6 @@ struct _rdpPixmapRec
|
||||
{
|
||||
int status;
|
||||
int rdpindex;
|
||||
int allocBytes;
|
||||
int con_number;
|
||||
int is_dirty;
|
||||
int pad0;
|
||||
@ -338,7 +337,7 @@ draw_item_remove(rdpPixmapRec* priv, struct rdp_draw_item* di);
|
||||
int
|
||||
draw_item_remove_all(rdpPixmapRec* priv);
|
||||
int
|
||||
draw_item_pack(rdpPixmapRec* priv);
|
||||
draw_item_pack(PixmapPtr pix, rdpPixmapRec* priv);
|
||||
int
|
||||
draw_item_add_img_region(rdpPixmapRec* priv, RegionPtr reg, int opcode,
|
||||
int type);
|
||||
@ -359,7 +358,8 @@ rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
||||
unsigned usage_hint);
|
||||
Bool
|
||||
rdpDestroyPixmap(PixmapPtr pPixmap);
|
||||
|
||||
int
|
||||
xrdp_is_os(PixmapPtr pix, rdpPixmapPtr priv);
|
||||
Bool
|
||||
rdpCreateWindow(WindowPtr pWindow);
|
||||
Bool
|
||||
@ -420,7 +420,6 @@ rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||
INT16 xSrc, INT16 ySrc, int nlists, GlyphListPtr lists,
|
||||
GlyphPtr* glyphs);
|
||||
|
||||
|
||||
/* rdpinput.c */
|
||||
int
|
||||
rdpKeybdProc(DeviceIntPtr pDevice, int onoff);
|
||||
|
@ -403,7 +403,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||
pDstPixmap = (PixmapPtr)pDst;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
can_do_screen_blt = pGC->alu == GXcopy;
|
||||
|
||||
@ -423,7 +423,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||
pSrcPixmap = (PixmapPtr)pSrc;
|
||||
pSrcPriv = GETPIXPRIV(pSrcPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pSrcPriv))
|
||||
if (xrdp_is_os(pSrcPixmap, pSrcPriv))
|
||||
{
|
||||
if (pDst->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
@ -442,7 +442,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||
pDstPixmap = (PixmapPtr)pDst;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
if (g_can_do_pix_to_pix)
|
||||
{
|
||||
@ -472,7 +472,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||
pDstPixmap = (PixmapPtr)pDst;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -105,7 +105,7 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
|
||||
pDstPixmap = (PixmapPtr)pDst;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -144,7 +144,7 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -80,7 +80,7 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
|
@ -102,7 +102,7 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -100,7 +100,7 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -100,7 +100,7 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -119,7 +119,7 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -119,7 +119,7 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -99,7 +99,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -102,7 +102,7 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -150,7 +150,7 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -112,7 +112,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -109,7 +109,7 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs)
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -103,7 +103,7 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -103,7 +103,7 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -160,7 +160,7 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -96,7 +96,7 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
|
||||
pDstPixmap = (PixmapPtr)pDst;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -98,7 +98,7 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
|
||||
pDstPixmap = (PixmapPtr)pDst;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -89,7 +89,7 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc,
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -482,7 +482,7 @@ draw_item_remove_all(rdpPixmapRec *priv)
|
||||
|
||||
/******************************************************************************/
|
||||
int
|
||||
draw_item_pack(rdpPixmapRec *priv)
|
||||
draw_item_pack(PixmapPtr pix, rdpPixmapRec *priv)
|
||||
{
|
||||
struct rdp_draw_item *di;
|
||||
struct rdp_draw_item *di_prev;
|
||||
@ -685,20 +685,6 @@ rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
||||
rv = pScreen->CreatePixmap(pScreen, width, height, depth, usage_hint);
|
||||
priv = GETPIXPRIV(rv);
|
||||
priv->rdpindex = -1;
|
||||
|
||||
if ((rv->drawable.depth >= g_rdpScreen.depth) &&
|
||||
(org_width > 1) && (height > 1))
|
||||
{
|
||||
priv->allocBytes = width * height * g_Bpp;
|
||||
priv->rdpindex = rdpup_add_os_bitmap(rv, priv);
|
||||
|
||||
if (priv->rdpindex >= 0)
|
||||
{
|
||||
priv->status = 1;
|
||||
rdpup_create_os_surface(priv->rdpindex, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
pScreen->ModifyPixmapHeader(rv, org_width, 0, 0, 0, 0, 0);
|
||||
pScreen->CreatePixmap = rdpCreatePixmap;
|
||||
return rv;
|
||||
@ -735,6 +721,59 @@ rdpDestroyPixmap(PixmapPtr pPixmap)
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
xrdp_is_os(PixmapPtr pix, rdpPixmapPtr priv)
|
||||
{
|
||||
RegionRec reg1;
|
||||
BoxRec box;
|
||||
int width;
|
||||
int height;
|
||||
struct image_data id;
|
||||
|
||||
if (priv->status == 0)
|
||||
{
|
||||
width = pix->drawable.width;
|
||||
height = pix->drawable.height;
|
||||
if ((pix->drawable.depth >= g_rdpScreen.depth) &&
|
||||
(width > 1) && (height > 1))
|
||||
{
|
||||
width = (width + 3) & ~3;
|
||||
priv->rdpindex = rdpup_add_os_bitmap(pix, priv);
|
||||
if (priv->rdpindex >= 0)
|
||||
{
|
||||
priv->status = 1;
|
||||
rdpup_create_os_surface(priv->rdpindex, width, height);
|
||||
box.x1 = 0;
|
||||
box.y1 = 0;
|
||||
box.x2 = width;
|
||||
box.y2 = height;
|
||||
if (g_do_dirty_os)
|
||||
{
|
||||
draw_item_remove_all(priv);
|
||||
RegionInit(®1, &box, 0);
|
||||
draw_item_add_img_region(priv, ®1, GXcopy, RDI_IMGLL);
|
||||
RegionUninit(®1);
|
||||
priv->is_dirty = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
rdpup_get_pixmap_image_rect(pix, &id);
|
||||
rdpup_switch_os_surface(priv->rdpindex);
|
||||
rdpup_begin_update();
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1,
|
||||
box.y2 - box.y1);
|
||||
rdpup_end_update();
|
||||
rdpup_switch_os_surface(-1);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
Bool
|
||||
rdpCreateWindow(WindowPtr pWindow)
|
||||
@ -831,8 +870,8 @@ rdpRealizeWindow(WindowPtr pWindow)
|
||||
LLOGLN(10, ("rdpRealizeWindow:"));
|
||||
LLOGLN(10, (" pWindow %p id 0x%x pWindow->parent %p id 0x%x x %d "
|
||||
"y %d width %d height %d",
|
||||
pWindow, pWindow->drawable.id,
|
||||
pWindow->parent, pWindow->parent->drawable.id,
|
||||
pWindow, (int)(pWindow->drawable.id),
|
||||
pWindow->parent, (int)(pWindow->parent->drawable.id),
|
||||
pWindow->drawable.x, pWindow->drawable.y,
|
||||
pWindow->drawable.width, pWindow->drawable.height));
|
||||
priv->status = 1;
|
||||
@ -1223,7 +1262,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
||||
pDstPixmap = (PixmapPtr)p;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
if (xrdp_is_os(pDstPixmap, pDstPriv))
|
||||
{
|
||||
post_process = 1;
|
||||
|
||||
|
@ -137,6 +137,7 @@ rdpup_disconnect(void)
|
||||
g_sck_closed = 1;
|
||||
g_pixmap_byte_total = 0;
|
||||
g_pixmap_num_used = 0;
|
||||
g_rdpindex = -1;
|
||||
|
||||
if (g_max_os_bitmaps > 0)
|
||||
{
|
||||
@ -1833,7 +1834,7 @@ rdpup_check_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec *pDirtyPriv)
|
||||
rdpup_switch_os_surface(pDirtyPriv->rdpindex);
|
||||
rdpup_get_pixmap_image_rect(pDirtyPixmap, &id);
|
||||
rdpup_begin_update();
|
||||
draw_item_pack(pDirtyPriv);
|
||||
draw_item_pack(pDirtyPixmap, pDirtyPriv);
|
||||
di = pDirtyPriv->draw_item_head;
|
||||
|
||||
while (di != 0)
|
||||
@ -1958,7 +1959,7 @@ rdpup_check_dirty_screen(rdpPixmapRec *pDirtyPriv)
|
||||
LLOGLN(10, ("-----------------got dirty"));
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
rdpup_begin_update();
|
||||
draw_item_pack(pDirtyPriv);
|
||||
draw_item_pack(0, pDirtyPriv);
|
||||
di = pDirtyPriv->draw_item_head;
|
||||
|
||||
while (di != 0)
|
||||
|
@ -305,6 +305,12 @@ main(int argc, char **argv)
|
||||
|
||||
g_init("xrdp");
|
||||
ssl_init();
|
||||
|
||||
for (test=0;test<argc; test++)
|
||||
{
|
||||
DEBUG(("Argument %i - %s",test,argv[test]));
|
||||
}
|
||||
|
||||
/* check compiled endian with actual endian */
|
||||
test = 1;
|
||||
host_be = !((int)(*(unsigned char *)(&test)));
|
||||
|
@ -102,3 +102,10 @@ port=ask3389
|
||||
username=ask
|
||||
password=ask
|
||||
|
||||
channel.rdpdr=true
|
||||
channel.rdpsnd=true
|
||||
channel.drdynvc=true
|
||||
channel.cliprdr=true
|
||||
channel.rail=true
|
||||
channel.xrdpvr=true
|
||||
|
||||
|
104
xrdp/xrdp_mm.c
104
xrdp/xrdp_mm.c
@ -1932,6 +1932,7 @@ server_reset(struct xrdp_mod *mod, int width, int height, int bpp)
|
||||
xrdp_wm_load_static_pointers(wm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* read the channel section of the ini file into lists
|
||||
* return 1 on success 0 on failure */
|
||||
int read_allowed_channel_names(struct list *names, struct list *values)
|
||||
@ -1960,44 +1961,90 @@ int read_allowed_channel_names(struct list *names, struct list *values)
|
||||
}
|
||||
|
||||
g_file_close(fd);
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define CHANNEL_NAME_PREFIX "channel."
|
||||
/* update the channel lists from connection specific overrides
|
||||
* return 1 on success 0 on failure */
|
||||
int update_allowed_channel_names(struct xrdp_wm *wm, struct list *names, struct list *values)
|
||||
{
|
||||
int ret = 1;
|
||||
int index;
|
||||
int oldindex;
|
||||
char *val;
|
||||
char *name;
|
||||
//wm->mm->login_names,wm->mm->login_values
|
||||
for (index = 0; index < wm->mm->login_names->count; index++)
|
||||
{
|
||||
name = (char *)list_get_item(wm->mm->login_names, index);
|
||||
if ( (name != 0) && (g_strncmp( name, CHANNEL_NAME_PREFIX, g_strlen(CHANNEL_NAME_PREFIX)) == 0 ) )
|
||||
{
|
||||
name += g_strlen(CHANNEL_NAME_PREFIX);
|
||||
// locate and remove from list
|
||||
oldindex = find_name_in_lists(name, names);
|
||||
if (oldindex >= 0)
|
||||
{
|
||||
list_remove_item(names, oldindex);
|
||||
list_remove_item(values, oldindex);
|
||||
}
|
||||
val = (char *)list_get_item(wm->mm->login_values, index);
|
||||
// (re)add to lists
|
||||
list_add_item(names, (tbus)g_strdup(name));
|
||||
list_add_item(values, (tbus)g_strdup(val));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* internal function return -1 if name is not in list
|
||||
* otherwise return the index 0->count-1*/
|
||||
int DEFAULT_CC
|
||||
find_name_in_lists(char *inName, struct list *names)
|
||||
{
|
||||
int reply = -1; /*means not in the list*/
|
||||
int index;
|
||||
char *name;
|
||||
|
||||
for (index = 0; index < names->count; index++)
|
||||
{
|
||||
name = (char *)list_get_item(names, index);
|
||||
if ( (name != 0) && g_strncmp(name, inName, MAX_CHANNEL_NAME))
|
||||
{
|
||||
reply = index;
|
||||
break; /* stop loop - item found*/
|
||||
}
|
||||
}
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
/* internal function return 1 if name is in list of channels
|
||||
* and if the value is allowed */
|
||||
int DEFAULT_CC
|
||||
is_name_in_lists(char *inName, struct list *names, struct list *values)
|
||||
is_channel_enabled(char *inName, struct list *names, struct list *values)
|
||||
{
|
||||
int reply = 0; /*means not in the list*/
|
||||
int index;
|
||||
char *val;
|
||||
char *name;
|
||||
|
||||
for (index = 0; index < names->count; index++)
|
||||
index = find_name_in_lists(inName, names);
|
||||
if ( index >= 0 )
|
||||
{
|
||||
name = (char *)list_get_item(names, index);
|
||||
val = (char *)list_get_item(values, index);
|
||||
|
||||
if (name != 0)
|
||||
if ((g_strcasecmp(val, "yes") == 0) ||
|
||||
(g_strcasecmp(val, "on") == 0) ||
|
||||
(g_strcasecmp(val, "true") == 0) ||
|
||||
(g_atoi(val) != 0))
|
||||
{
|
||||
/* ex rdpdr ;rdpsnd ; drdynvc ; cliprdr */
|
||||
if (!g_strncmp(name, inName, MAX_CHANNEL_NAME))
|
||||
{
|
||||
val = (char *)list_get_item(values, index);
|
||||
|
||||
if ((g_strcasecmp(val, "yes") == 0) ||
|
||||
(g_strcasecmp(val, "on") == 0) ||
|
||||
(g_strcasecmp(val, "true") == 0) ||
|
||||
(g_atoi(val) != 0))
|
||||
{
|
||||
reply = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_writeln("This channel is disabled: %s", name);
|
||||
}
|
||||
|
||||
break; /* stop loop - item found*/
|
||||
}
|
||||
reply = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_writeln("This channel is disabled: %s", name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2026,7 +2073,8 @@ void init_channel_allowed(struct xrdp_wm *wm)
|
||||
names = list_create();
|
||||
values = list_create();
|
||||
|
||||
if (read_allowed_channel_names(names, values))
|
||||
if ( read_allowed_channel_names(names, values)
|
||||
&& update_allowed_channel_names(wm, names, values) )
|
||||
{
|
||||
do
|
||||
{
|
||||
@ -2036,9 +2084,9 @@ void init_channel_allowed(struct xrdp_wm *wm)
|
||||
if (error == 0)
|
||||
{
|
||||
/* examples of channel names: rdpdr ; rdpsnd ; drdynvc ; cliprdr */
|
||||
if (is_name_in_lists(channelname, names, values))
|
||||
if (is_channel_enabled(channelname, names, values))
|
||||
{
|
||||
g_writeln("The following channel is allowed: %s", channelname);
|
||||
g_writeln("The following channel is allowed: %s (%d)", channelname, index);
|
||||
wm->allowedchannels[allowindex] = index;
|
||||
allowindex++;
|
||||
|
||||
@ -2050,7 +2098,7 @@ void init_channel_allowed(struct xrdp_wm *wm)
|
||||
}
|
||||
else
|
||||
{
|
||||
g_writeln("The following channel is not allowed: %s", channelname);
|
||||
g_writeln("The following channel is not allowed: %s (%d)", channelname, index);
|
||||
}
|
||||
|
||||
index++;
|
||||
|
@ -708,6 +708,8 @@ xrdp_painter_copy(struct xrdp_painter *self,
|
||||
int dsty;
|
||||
int w;
|
||||
int h;
|
||||
int index;
|
||||
struct list *del_list;
|
||||
|
||||
if (self == 0 || src == 0 || dst == 0)
|
||||
{
|
||||
@ -781,6 +783,22 @@ xrdp_painter_copy(struct xrdp_painter *self,
|
||||
cache_id = 255; // todo
|
||||
cache_idx = src->item_index; // todo
|
||||
|
||||
if (src->tab_stop == 0)
|
||||
{
|
||||
g_writeln("xrdp_painter_copy: warning src not created");
|
||||
del_list = self->wm->cache->xrdp_os_del_list;
|
||||
index = list_index_of(del_list, cache_idx);
|
||||
list_remove_item(del_list, index);
|
||||
libxrdp_orders_send_create_os_surface(self->session,
|
||||
cache_idx,
|
||||
src->width,
|
||||
src->height,
|
||||
del_list);
|
||||
src->tab_stop = 1;
|
||||
list_clear(del_list);
|
||||
}
|
||||
|
||||
|
||||
k = 0;
|
||||
|
||||
while (xrdp_region_get_rect(region, k, &rect1) == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user