static BOOL update_message_BeginPaint(rdpContext* context)
{
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, BeginPaint), NULL, NULL);
-
- return TRUE;
}
static BOOL update_message_EndPaint(rdpContext* context)
{
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, EndPaint), NULL, NULL);
- return TRUE;
}
static BOOL update_message_SetBounds(rdpContext* context, rdpBounds* bounds)
CopyMemory(wParam, bounds, sizeof(rdpBounds));
}
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, SetBounds), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_Synchronize(rdpContext* context)
{
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, Synchronize), NULL, NULL);
- return TRUE;
}
static BOOL update_message_DesktopResize(rdpContext* context)
{
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, DesktopResize), NULL, NULL);
- return TRUE;
}
static BOOL update_message_BitmapUpdate(rdpContext* context, BITMAP_UPDATE* bitmap)
wParam->rectangles[index].bitmapLength);
#endif
}
- MessageQueue_Post(context->update->queue, (void*) context,
- MakeMessageId(Update, BitmapUpdate), (void*) wParam, NULL);
- return TRUE;
+ return MessageQueue_Post(context->update->queue, (void*) context,
+ MakeMessageId(Update, BitmapUpdate), (void*) wParam, NULL);
}
static BOOL update_message_Palette(rdpContext* context, PALETTE_UPDATE* palette)
return FALSE;
CopyMemory(wParam, palette, sizeof(PALETTE_UPDATE));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, Palette), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_PlaySound(rdpContext* context, PLAY_SOUND_UPDATE* playSound)
return FALSE;
CopyMemory(wParam, playSound, sizeof(PLAY_SOUND_UPDATE));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, PlaySound), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_SetKeyboardIndicators(rdpContext* context, UINT16 led_flags)
{
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, SetKeyboardIndicators), (void*)(size_t)led_flags, NULL);
- return TRUE;
}
static BOOL update_message_RefreshRect(rdpContext* context, BYTE count, RECTANGLE_16* areas)
return FALSE;
CopyMemory(lParam, areas, sizeof(RECTANGLE_16) * count);
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, RefreshRect), (void*) (size_t) count, (void*) lParam);
- return TRUE;
}
static BOOL update_message_SuppressOutput(rdpContext* context, BYTE allow, RECTANGLE_16* area)
CopyMemory(lParam, area, sizeof(RECTANGLE_16));
}
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, SuppressOutput), (void*) (size_t) allow, (void*) lParam);
- return TRUE;
}
static BOOL update_message_SurfaceCommand(rdpContext* context, wStream* s)
wParam->pointer = wParam->buffer;
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, SurfaceCommand), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_SurfaceBits(rdpContext* context, SURFACE_BITS_COMMAND* surfaceBitsCommand)
CopyMemory(wParam->bitmapData, surfaceBitsCommand->bitmapData, wParam->bitmapDataLength);
#endif
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, SurfaceBits), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_SurfaceFrameMarker(rdpContext* context, SURFACE_FRAME_MARKER* surfaceFrameMarker)
return FALSE;
CopyMemory(wParam, surfaceFrameMarker, sizeof(SURFACE_FRAME_MARKER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, SurfaceFrameMarker), (void*) wParam, NULL);
-
- return TRUE;
}
static BOOL update_message_SurfaceFrameAcknowledge(rdpContext* context, UINT32 frameId)
{
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(Update, SurfaceFrameAcknowledge), (void*) (size_t) frameId, NULL);
-
- return TRUE;
}
/* Primary Update */
return FALSE;
CopyMemory(wParam, dstBlt, sizeof(DSTBLT_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, DstBlt), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_PatBlt(rdpContext* context, PATBLT_ORDER* patBlt)
wParam->brush.data = (BYTE*) wParam->brush.p8x8;
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, PatBlt), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_ScrBlt(rdpContext* context, SCRBLT_ORDER* scrBlt)
return FALSE;
CopyMemory(wParam, scrBlt, sizeof(SCRBLT_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, ScrBlt), (void*) wParam, NULL);
-
- return TRUE;
}
static BOOL update_message_OpaqueRect(rdpContext* context, OPAQUE_RECT_ORDER* opaqueRect)
return FALSE;
CopyMemory(wParam, opaqueRect, sizeof(OPAQUE_RECT_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, OpaqueRect), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_DrawNineGrid(rdpContext* context, DRAW_NINE_GRID_ORDER* drawNineGrid)
return FALSE;
CopyMemory(wParam, drawNineGrid, sizeof(DRAW_NINE_GRID_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, DrawNineGrid), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_MultiDstBlt(rdpContext* context, MULTI_DSTBLT_ORDER* multiDstBlt)
return FALSE;
CopyMemory(wParam, multiDstBlt, sizeof(MULTI_DSTBLT_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, MultiDstBlt), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_MultiPatBlt(rdpContext* context, MULTI_PATBLT_ORDER* multiPatBlt)
wParam->brush.data = (BYTE*) wParam->brush.p8x8;
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, MultiPatBlt), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_MultiScrBlt(rdpContext* context, MULTI_SCRBLT_ORDER* multiScrBlt)
return FALSE;
CopyMemory(wParam, multiScrBlt, sizeof(MULTI_SCRBLT_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, MultiScrBlt), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_MultiOpaqueRect(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* multiOpaqueRect)
return FALSE;
CopyMemory(wParam, multiOpaqueRect, sizeof(MULTI_OPAQUE_RECT_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, MultiOpaqueRect), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_MultiDrawNineGrid(rdpContext* context, MULTI_DRAW_NINE_GRID_ORDER* multiDrawNineGrid)
/* TODO: complete copy */
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, MultiDrawNineGrid), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_LineTo(rdpContext* context, LINE_TO_ORDER* lineTo)
return FALSE;
CopyMemory(wParam, lineTo, sizeof(LINE_TO_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, LineTo), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_Polyline(rdpContext* context, POLYLINE_ORDER* polyline)
}
CopyMemory(wParam->points, polyline->points, sizeof(DELTA_POINT) * wParam->numDeltaEntries);
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, Polyline), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_MemBlt(rdpContext* context, MEMBLT_ORDER* memBlt)
return FALSE;
CopyMemory(wParam, memBlt, sizeof(MEMBLT_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, MemBlt), (void*) wParam, NULL);
-
- return TRUE;
}
static BOOL update_message_Mem3Blt(rdpContext* context, MEM3BLT_ORDER* mem3Blt)
wParam->brush.data = (BYTE*) wParam->brush.p8x8;
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, Mem3Blt), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_SaveBitmap(rdpContext* context, SAVE_BITMAP_ORDER* saveBitmap)
return FALSE;
CopyMemory(wParam, saveBitmap, sizeof(SAVE_BITMAP_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, SaveBitmap), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_GlyphIndex(rdpContext* context, GLYPH_INDEX_ORDER* glyphIndex)
wParam->brush.data = (BYTE*) wParam->brush.p8x8;
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, GlyphIndex), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_FastIndex(rdpContext* context, FAST_INDEX_ORDER* fastIndex)
return FALSE;
CopyMemory(wParam, fastIndex, sizeof(FAST_INDEX_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, FastIndex), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_FastGlyph(rdpContext* context, FAST_GLYPH_ORDER* fastGlyph)
wParam->glyphData.aj = NULL;
}
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, FastGlyph), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_PolygonSC(rdpContext* context, POLYGON_SC_ORDER* polygonSC)
}
CopyMemory(wParam->points, polygonSC, sizeof(DELTA_POINT) * wParam->numPoints);
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, PolygonSC), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_PolygonCB(rdpContext* context, POLYGON_CB_ORDER* polygonCB)
wParam->brush.data = (BYTE*) wParam->brush.p8x8;
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, PolygonCB), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_EllipseSC(rdpContext* context, ELLIPSE_SC_ORDER* ellipseSC)
return FALSE;
CopyMemory(wParam, ellipseSC, sizeof(ELLIPSE_SC_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, EllipseSC), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_EllipseCB(rdpContext* context, ELLIPSE_CB_ORDER* ellipseCB)
wParam->brush.data = (BYTE*) wParam->brush.p8x8;
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, EllipseCB), (void*) wParam, NULL);
- return TRUE;
}
/* Secondary Update */
}
CopyMemory(wParam->bitmapDataStream, cacheBitmapOrder, wParam->bitmapLength);
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(SecondaryUpdate, CacheBitmap), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_CacheBitmapV2(rdpContext* context, CACHE_BITMAP_V2_ORDER* cacheBitmapV2Order)
}
CopyMemory(wParam->bitmapDataStream, cacheBitmapV2Order->bitmapDataStream, wParam->bitmapLength);
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(SecondaryUpdate, CacheBitmapV2), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_CacheBitmapV3(rdpContext* context, CACHE_BITMAP_V3_ORDER* cacheBitmapV3Order)
}
CopyMemory(wParam->bitmapData.data, cacheBitmapV3Order->bitmapData.data, wParam->bitmapData.length);
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(SecondaryUpdate, CacheBitmapV3), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_CacheColorTable(rdpContext* context, CACHE_COLOR_TABLE_ORDER* cacheColorTableOrder)
return FALSE;
CopyMemory(wParam, cacheColorTableOrder, sizeof(CACHE_COLOR_TABLE_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(SecondaryUpdate, CacheColorTable), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_CacheGlyph(rdpContext* context, CACHE_GLYPH_ORDER* cacheGlyphOrder)
return FALSE;
CopyMemory(wParam, cacheGlyphOrder, sizeof(CACHE_GLYPH_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(SecondaryUpdate, CacheGlyph), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_CacheGlyphV2(rdpContext* context, CACHE_GLYPH_V2_ORDER* cacheGlyphV2Order)
return FALSE;
CopyMemory(wParam, cacheGlyphV2Order, sizeof(CACHE_GLYPH_V2_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(SecondaryUpdate, CacheGlyphV2), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_CacheBrush(rdpContext* context, CACHE_BRUSH_ORDER* cacheBrushOrder)
return FALSE;
CopyMemory(wParam, cacheBrushOrder, sizeof(CACHE_BRUSH_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(SecondaryUpdate, CacheBrush), (void*) wParam, NULL);
- return TRUE;
}
/* Alternate Secondary Update */
}
CopyMemory(wParam->deleteList.indices, createOffscreenBitmap->deleteList.indices, wParam->deleteList.cIndices);
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, CreateOffscreenBitmap), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_SwitchSurface(rdpContext* context, SWITCH_SURFACE_ORDER* switchSurface)
return FALSE;
CopyMemory(wParam, switchSurface, sizeof(SWITCH_SURFACE_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, SwitchSurface), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_CreateNineGridBitmap(rdpContext* context, CREATE_NINE_GRID_BITMAP_ORDER* createNineGridBitmap)
return FALSE;
CopyMemory(wParam, createNineGridBitmap, sizeof(CREATE_NINE_GRID_BITMAP_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, CreateNineGridBitmap), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_FrameMarker(rdpContext* context, FRAME_MARKER_ORDER* frameMarker)
return FALSE;
CopyMemory(wParam, frameMarker, sizeof(FRAME_MARKER_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, FrameMarker), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_StreamBitmapFirst(rdpContext* context, STREAM_BITMAP_FIRST_ORDER* streamBitmapFirst)
/* TODO: complete copy */
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, StreamBitmapFirst), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_StreamBitmapNext(rdpContext* context, STREAM_BITMAP_NEXT_ORDER* streamBitmapNext)
/* TODO: complete copy */
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, StreamBitmapNext), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_DrawGdiPlusFirst(rdpContext* context, DRAW_GDIPLUS_FIRST_ORDER* drawGdiPlusFirst)
/* TODO: complete copy */
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, DrawGdiPlusFirst), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_DrawGdiPlusNext(rdpContext* context, DRAW_GDIPLUS_NEXT_ORDER* drawGdiPlusNext)
/* TODO: complete copy */
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, DrawGdiPlusNext), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_DrawGdiPlusEnd(rdpContext* context, DRAW_GDIPLUS_END_ORDER* drawGdiPlusEnd)
/* TODO: complete copy */
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, DrawGdiPlusEnd), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_DrawGdiPlusCacheFirst(rdpContext* context, DRAW_GDIPLUS_CACHE_FIRST_ORDER* drawGdiPlusCacheFirst)
/* TODO: complete copy */
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, DrawGdiPlusCacheFirst), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_DrawGdiPlusCacheNext(rdpContext* context, DRAW_GDIPLUS_CACHE_NEXT_ORDER* drawGdiPlusCacheNext)
/* TODO: complete copy */
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, DrawGdiPlusCacheNext), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_DrawGdiPlusCacheEnd(rdpContext* context, DRAW_GDIPLUS_CACHE_END_ORDER* drawGdiPlusCacheEnd)
/* TODO: complete copy */
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(AltSecUpdate, DrawGdiPlusCacheEnd), (void*) wParam, NULL);
- return TRUE;
}
/* Window Update */
}
CopyMemory(lParam, windowState, sizeof(WINDOW_STATE_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, WindowCreate), (void*) wParam, (void*) lParam);
- return TRUE;
}
static BOOL update_message_WindowUpdate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* windowState)
}
CopyMemory(lParam, windowState, sizeof(WINDOW_STATE_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, WindowUpdate), (void*) wParam, (void*) lParam);
- return TRUE;
}
static BOOL update_message_WindowIcon(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_ICON_ORDER* windowIcon)
CopyMemory(lParam->iconInfo->colorTable, windowIcon->iconInfo->colorTable, windowIcon->iconInfo->cbColorTable);
}
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, WindowIcon), (void*) wParam, (void*) lParam);
- return TRUE;
out_fail:
free(lParam->iconInfo->bitsColor);
}
CopyMemory(lParam, windowCachedIcon, sizeof(WINDOW_CACHED_ICON_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, WindowCachedIcon), (void*) wParam, (void*) lParam);
- return TRUE;
}
static BOOL update_message_WindowDelete(rdpContext* context, WINDOW_ORDER_INFO* orderInfo)
return FALSE;
CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, WindowDelete), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_NotifyIconCreate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notifyIconState)
}
CopyMemory(lParam, notifyIconState, sizeof(NOTIFY_ICON_STATE_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, NotifyIconCreate), (void*) wParam, (void*) lParam);
- return TRUE;
}
static BOOL update_message_NotifyIconUpdate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notifyIconState)
}
CopyMemory(lParam, notifyIconState, sizeof(NOTIFY_ICON_STATE_ORDER));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, NotifyIconUpdate), (void*) wParam, (void*) lParam);
- return TRUE;
}
static BOOL update_message_NotifyIconDelete(rdpContext* context, WINDOW_ORDER_INFO* orderInfo)
return FALSE;
CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, NotifyIconDelete), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_MonitoredDesktop(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, MONITORED_DESKTOP_ORDER* monitoredDesktop)
CopyMemory(lParam->windowIds, monitoredDesktop->windowIds, lParam->numWindowIds);
}
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, MonitoredDesktop), (void*) wParam, (void*) lParam);
- return TRUE;
}
static BOOL update_message_NonMonitoredDesktop(rdpContext* context, WINDOW_ORDER_INFO* orderInfo)
return FALSE;
CopyMemory(wParam, orderInfo, sizeof(WINDOW_ORDER_INFO));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, NonMonitoredDesktop), (void*) wParam, NULL);
- return TRUE;
}
/* Pointer Update */
return FALSE;
CopyMemory(wParam, pointerPosition, sizeof(POINTER_POSITION_UPDATE));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PointerUpdate, PointerPosition), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_PointerSystem(rdpContext* context, POINTER_SYSTEM_UPDATE* pointerSystem)
return FALSE;
CopyMemory(wParam, pointerSystem, sizeof(POINTER_SYSTEM_UPDATE));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PointerUpdate, PointerSystem), (void*) wParam, NULL);
- return TRUE;
}
static BOOL update_message_PointerColor(rdpContext* context, POINTER_COLOR_UPDATE* pointerColor)
CopyMemory(wParam->xorMaskData, pointerColor->xorMaskData, wParam->lengthXorMask);
}
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PointerUpdate, PointerColor), (void*) wParam, NULL);
- return TRUE;
out_fail:
free(wParam->andMaskData);
CopyMemory(wParam->colorPtrAttr.xorMaskData, pointerNew->colorPtrAttr.xorMaskData, wParam->colorPtrAttr.lengthXorMask);
}
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PointerUpdate, PointerNew), (void*) wParam, NULL);
- return TRUE;
out_fail:
free(wParam->colorPtrAttr.andMaskData);
return FALSE;
CopyMemory(wParam, pointerCached, sizeof(POINTER_CACHED_UPDATE));
- MessageQueue_Post(context->update->queue, (void*) context,
+ return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PointerUpdate, PointerCached), (void*) wParam, NULL);
- return TRUE;
}
/* Message Queue */
{
if (message)
{
- MessageQueue_PostQuit(message->update->queue, 0);
- WaitForSingleObject(message->thread, INFINITE);
+ if (MessageQueue_PostQuit(message->update->queue, 0))
+ WaitForSingleObject(message->thread, INFINITE);
CloseHandle(message->thread);
free(message);
}
static BOOL input_message_SynchronizeEvent(rdpInput* input, UINT32 flags)
{
- MessageQueue_Post(input->queue, (void*) input,
+ return MessageQueue_Post(input->queue, (void*) input,
MakeMessageId(Input, SynchronizeEvent), (void*) (size_t) flags, NULL);
- return TRUE;
}
static BOOL input_message_KeyboardEvent(rdpInput* input, UINT16 flags, UINT16 code)
{
- MessageQueue_Post(input->queue, (void*) input,
+ return MessageQueue_Post(input->queue, (void*) input,
MakeMessageId(Input, KeyboardEvent), (void*) (size_t) flags, (void*) (size_t) code);
- return TRUE;
}
static BOOL input_message_UnicodeKeyboardEvent(rdpInput* input, UINT16 flags, UINT16 code)
{
- MessageQueue_Post(input->queue, (void*) input,
+ return MessageQueue_Post(input->queue, (void*) input,
MakeMessageId(Input, UnicodeKeyboardEvent), (void*) (size_t) flags, (void*) (size_t) code);
- return TRUE;
}
static BOOL input_message_MouseEvent(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
UINT32 pos = (x << 16) | y;
- MessageQueue_Post(input->queue, (void*) input,
+ return MessageQueue_Post(input->queue, (void*) input,
MakeMessageId(Input, MouseEvent), (void*) (size_t) flags, (void*) (size_t) pos);
- return TRUE;
}
static BOOL input_message_ExtendedMouseEvent(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
UINT32 pos = (x << 16) | y;
- MessageQueue_Post(input->queue, (void*) input,
+ return MessageQueue_Post(input->queue, (void*) input,
MakeMessageId(Input, ExtendedMouseEvent), (void*) (size_t) flags, (void*) (size_t) pos);
- return TRUE;
}
static BOOL input_message_FocusInEvent(rdpInput* input, UINT16 toggleStates)
{
- MessageQueue_Post(input->queue, (void*) input,
+ return MessageQueue_Post(input->queue, (void*) input,
MakeMessageId(Input, FocusInEvent), (void*) (size_t) toggleStates, NULL);
- return TRUE;
}
static BOOL input_message_KeyboardPauseEvent(rdpInput* input)
{
- MessageQueue_Post(input->queue, (void*) input,
+ return MessageQueue_Post(input->queue, (void*) input,
MakeMessageId(Input, KeyboardPauseEvent), NULL, NULL);
- return TRUE;
}
/* Event Queue */
return found ? channel : NULL;
}
-static void wts_queue_receive_data(rdpPeerChannel* channel, const BYTE* Buffer, UINT32 Length)
+static BOOL wts_queue_receive_data(rdpPeerChannel* channel, const BYTE* Buffer, UINT32 Length)
{
BYTE* buffer;
wtsChannelMessage* messageCtx;
messageCtx = (wtsChannelMessage*) malloc(sizeof(wtsChannelMessage) + Length);
+ if (!messageCtx)
+ return FALSE;
messageCtx->channelId = channel->channelId;
messageCtx->length = Length;
messageCtx->offset = 0;
buffer = (BYTE*) (messageCtx + 1);
CopyMemory(buffer, Buffer, Length);
- MessageQueue_Post(channel->queue, messageCtx, 0, NULL, NULL);
+ return MessageQueue_Post(channel->queue, messageCtx, 0, NULL, NULL);
}
-static void wts_queue_send_item(rdpPeerChannel* channel, BYTE* Buffer, UINT32 Length)
+static BOOL wts_queue_send_item(rdpPeerChannel* channel, BYTE* Buffer, UINT32 Length)
{
BYTE* buffer;
UINT32 length;
length = Length;
channelId = channel->channelId;
- MessageQueue_Post(channel->vcm->queue, (void*) (UINT_PTR) channelId, 0, (void*) buffer, (void*) (UINT_PTR) length);
+ return MessageQueue_Post(channel->vcm->queue, (void*) (UINT_PTR) channelId, 0, (void*) buffer, (void*) (UINT_PTR) length);
}
static int wts_read_variable_uint(wStream* s, int cbLen, UINT32* val)
}
}
-static void wts_read_drdynvc_capabilities_response(rdpPeerChannel* channel, UINT32 length)
+static BOOL wts_read_drdynvc_capabilities_response(rdpPeerChannel* channel, UINT32 length)
{
UINT16 Version;
if (length < 3)
- return;
+ return FALSE;
Stream_Seek_UINT8(channel->receiveData); /* Pad (1 byte) */
Stream_Read_UINT16(channel->receiveData, Version);
DEBUG_DVC("Version: %d", Version);
channel->vcm->drdynvc_state = DRDYNVC_STATE_READY;
+ return TRUE;
}
-static void wts_read_drdynvc_create_response(rdpPeerChannel* channel, wStream* s, UINT32 length)
+static BOOL wts_read_drdynvc_create_response(rdpPeerChannel* channel, wStream* s, UINT32 length)
{
UINT32 CreationStatus;
if (length < 4)
- return;
+ return FALSE;
Stream_Read_UINT32(s, CreationStatus);
DEBUG_DVC("ChannelId %d creation succeeded", channel->channelId);
channel->dvc_open_state = DVC_OPEN_STATE_SUCCEEDED;
}
+ return TRUE;
}
-static void wts_read_drdynvc_data_first(rdpPeerChannel* channel, wStream* s, int cbLen, UINT32 length)
+static BOOL wts_read_drdynvc_data_first(rdpPeerChannel* channel, wStream* s, int cbLen, UINT32 length)
{
int value;
value = wts_read_variable_uint(s, cbLen, &channel->dvc_total_length);
if (value == 0)
- return;
+ return FALSE;
length -= value;
if (length > channel->dvc_total_length)
- return;
+ return FALSE;
Stream_SetPosition(channel->receiveData, 0);
- Stream_EnsureRemainingCapacity(channel->receiveData, (int) channel->dvc_total_length);
+ if (!Stream_EnsureRemainingCapacity(channel->receiveData, (int) channel->dvc_total_length))
+ return FALSE;
Stream_Write(channel->receiveData, Stream_Pointer(s), length);
+ return TRUE;
}
-static void wts_read_drdynvc_data(rdpPeerChannel* channel, wStream* s, UINT32 length)
+static BOOL wts_read_drdynvc_data(rdpPeerChannel* channel, wStream* s, UINT32 length)
{
+ BOOL ret;
if (channel->dvc_total_length > 0)
{
if (Stream_GetPosition(channel->receiveData) + length > channel->dvc_total_length)
{
channel->dvc_total_length = 0;
- WLog_ERR(TAG, "incorrect fragment data, discarded.");
- return;
+ WLog_ERR(TAG, "incorrect fragment data, discarded.");
+ return FALSE;
}
Stream_Write(channel->receiveData, Stream_Pointer(s), length);
if (Stream_GetPosition(channel->receiveData) >= (int) channel->dvc_total_length)
{
- wts_queue_receive_data(channel, Stream_Buffer(channel->receiveData), channel->dvc_total_length);
+ ret = wts_queue_receive_data(channel, Stream_Buffer(channel->receiveData), channel->dvc_total_length);
channel->dvc_total_length = 0;
}
}
else
{
- wts_queue_receive_data(channel, Stream_Pointer(s), length);
+ ret = wts_queue_receive_data(channel, Stream_Pointer(s), length);
}
+ return ret;
}
static void wts_read_drdynvc_close_response(rdpPeerChannel* channel)
channel->dvc_open_state = DVC_OPEN_STATE_CLOSED;
}
-static void wts_read_drdynvc_pdu(rdpPeerChannel* channel)
+static BOOL wts_read_drdynvc_pdu(rdpPeerChannel* channel)
{
UINT32 length;
int value;
length = Stream_GetPosition(channel->receiveData);
if (length < 1)
- return;
+ return FALSE;
Stream_SetPosition(channel->receiveData, 0);
Stream_Read_UINT8(channel->receiveData, value);
if (Cmd == CAPABILITY_REQUEST_PDU)
{
- wts_read_drdynvc_capabilities_response(channel, length);
+ return wts_read_drdynvc_capabilities_response(channel, length);
}
else if (channel->vcm->drdynvc_state == DRDYNVC_STATE_READY)
{
value = wts_read_variable_uint(channel->receiveData, cbChId, &ChannelId);
if (value == 0)
- return;
+ return FALSE;
length -= value;
switch (Cmd)
{
case CREATE_REQUEST_PDU:
- wts_read_drdynvc_create_response(dvc, channel->receiveData, length);
- break;
+ return wts_read_drdynvc_create_response(dvc, channel->receiveData, length);
case DATA_FIRST_PDU:
- wts_read_drdynvc_data_first(dvc, channel->receiveData, Sp, length);
- break;
+ return wts_read_drdynvc_data_first(dvc, channel->receiveData, Sp, length);
case DATA_PDU:
- wts_read_drdynvc_data(dvc, channel->receiveData, length);
- break;
+ return wts_read_drdynvc_data(dvc, channel->receiveData, length);
case CLOSE_REQUEST_PDU:
wts_read_drdynvc_close_response(dvc);
{
WLog_ERR(TAG, "received Cmd %d but channel is not ready.", Cmd);
}
+ return TRUE;
}
static int wts_write_variable_uint(wStream* s, UINT32 val)
return TRUE;
}
-static void WTSProcessChannelData(rdpPeerChannel* channel, UINT16 channelId, BYTE* data, int size, int flags, int totalSize)
+static BOOL WTSProcessChannelData(rdpPeerChannel* channel, UINT16 channelId, BYTE* data, int size, int flags, int totalSize)
{
+ BOOL ret = TRUE;
+
if (flags & CHANNEL_FLAG_FIRST)
{
Stream_SetPosition(channel->receiveData, 0);
}
- Stream_EnsureRemainingCapacity(channel->receiveData, size);
+ if (!Stream_EnsureRemainingCapacity(channel->receiveData, size))
+ return FALSE;
Stream_Write(channel->receiveData, data, size);
if (flags & CHANNEL_FLAG_LAST)
{
if (Stream_GetPosition(channel->receiveData) != totalSize)
{
- WLog_ERR(TAG, "read error");
+ WLog_ERR(TAG, "read error");
}
if (channel == channel->vcm->drdynvc_channel)
{
- wts_read_drdynvc_pdu(channel);
+ ret = wts_read_drdynvc_pdu(channel);
}
else
{
- wts_queue_receive_data(channel, Stream_Buffer(channel->receiveData), Stream_GetPosition(channel->receiveData));
+ ret = wts_queue_receive_data(channel, Stream_Buffer(channel->receiveData), Stream_GetPosition(channel->receiveData));
}
Stream_SetPosition(channel->receiveData, 0);
}
+
+ return ret;
}
static int WTSReceiveChannelData(freerdp_peer* client, UINT16 channelId, BYTE* data, int size, int flags, int totalSize)
UINT32 length;
UINT32 written;
rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle;
+ BOOL ret = TRUE;
if (!channel)
return FALSE;
if (channel->channelType == RDP_PEER_CHANNEL_TYPE_SVC)
{
length = Length;
- buffer = (BYTE*) malloc(length);
+ buffer = (BYTE *)malloc(length);
+ if (!buffer)
+ return FALSE;
CopyMemory(buffer, Buffer, length);
- wts_queue_send_item(channel, buffer, length);
+ ret = wts_queue_send_item(channel, buffer, length);
}
else if (!channel->vcm->drdynvc_channel || (channel->vcm->drdynvc_state != DRDYNVC_STATE_READY))
{
WLog_ERR(TAG, "Stream_New failed!");
return FALSE;
}
+
buffer = Stream_Buffer(s);
Stream_Seek_UINT8(s);
Length -= written;
Buffer += written;
- wts_queue_send_item(channel->vcm->drdynvc_channel, buffer, length);
+ ret = wts_queue_send_item(channel->vcm->drdynvc_channel, buffer, length);
}
}
if (pBytesWritten)
*pBytesWritten = Length;
- return TRUE;
+ return ret;
}
BOOL WINAPI FreeRDP_WTSVirtualChannelPurgeInput(HANDLE hChannelHandle)