BITMAP_DATA* bitmap;
rdpCodecs* codecs = context->codecs;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
for (index = 0; index < bitmapUpdate->number; index++)
{
XFree(image);
- gdi_InvalidateRegion(xfc->hdc, nXDst, nYDst, nWidth, nHeight);
+ ret = gdi_InvalidateRegion(xfc->hdc, nXDst, nYDst, nWidth, nHeight);
xf_unlock_x11(xfc, FALSE);
}
- return TRUE;
+ return ret;
}
static BOOL xf_gdi_palette_update(rdpContext* context, PALETTE_UPDATE* palette)
static BOOL xf_gdi_dstblt(rdpContext* context, DSTBLT_ORDER* dstblt)
{
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
dstblt->nWidth, dstblt->nHeight);
if (xfc->drawing == xfc->primary)
- {
- gdi_InvalidateRegion(xfc->hdc, dstblt->nLeftRect, dstblt->nTopRect, dstblt->nWidth, dstblt->nHeight);
- }
+ ret = gdi_InvalidateRegion(xfc->hdc, dstblt->nLeftRect, dstblt->nTopRect, dstblt->nWidth, dstblt->nHeight);
XSetFunction(xfc->display, xfc->gc, GXcopy);
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
UINT32 foreColor;
UINT32 backColor;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
}
if (xfc->drawing == xfc->primary)
- {
- gdi_InvalidateRegion(xfc->hdc, patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight);
- }
+ ret = gdi_InvalidateRegion(xfc->hdc, patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight);
XSetFunction(xfc->display, xfc->gc, GXcopy);
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
static BOOL xf_gdi_scrblt(rdpContext* context, SCRBLT_ORDER* scrblt)
{
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
scrblt->nWidth, scrblt->nHeight, scrblt->nLeftRect, scrblt->nTopRect);
if (xfc->drawing == xfc->primary)
- {
- gdi_InvalidateRegion(xfc->hdc, scrblt->nLeftRect, scrblt->nTopRect, scrblt->nWidth, scrblt->nHeight);
- }
+ ret = gdi_InvalidateRegion(xfc->hdc, scrblt->nLeftRect, scrblt->nTopRect, scrblt->nWidth, scrblt->nHeight);
XSetFunction(xfc->display, xfc->gc, GXcopy);
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
BOOL xf_gdi_opaque_rect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect)
{
UINT32 color;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
opaque_rect->nWidth, opaque_rect->nHeight);
if (xfc->drawing == xfc->primary)
- {
- gdi_InvalidateRegion(xfc->hdc, opaque_rect->nLeftRect, opaque_rect->nTopRect,
+ ret = gdi_InvalidateRegion(xfc->hdc, opaque_rect->nLeftRect, opaque_rect->nTopRect,
opaque_rect->nWidth, opaque_rect->nHeight);
- }
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
BOOL xf_gdi_multi_opaque_rect(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect)
UINT32 color;
DELTA_RECT* rectangle;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
rectangle->width, rectangle->height);
if (xfc->drawing == xfc->primary)
- {
- gdi_InvalidateRegion(xfc->hdc, rectangle->left, rectangle->top, rectangle->width, rectangle->height);
- }
+ ret = gdi_InvalidateRegion(xfc->hdc, rectangle->left, rectangle->top, rectangle->width, rectangle->height);
}
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
void xf_gdi_draw_nine_grid(rdpContext* context, DRAW_NINE_GRID_ORDER* draw_nine_grid)
{
UINT32 color;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
w = abs(line_to->nXEnd - line_to->nXStart) + 1;
h = abs(line_to->nYEnd - line_to->nYStart) + 1;
- gdi_InvalidateRegion(xfc->hdc, x, y, w, h);
+ ret = gdi_InvalidateRegion(xfc->hdc, x, y, w, h);
}
XSetFunction(xfc->display, xfc->gc, GXcopy);
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
-static void xf_gdi_invalidate_poly_region(xfContext* xfc, XPoint* points, int npoints, BOOL autoclose)
+static BOOL xf_gdi_invalidate_poly_region(xfContext* xfc, XPoint* points, int npoints, BOOL autoclose)
{
int i, x, y, x1, y1, x2, y2, w, h;
+ BOOL ret = TRUE;
x1 = points[0].x;
y1 = points[0].y;
x1 = x2;
y1 = y2;
- gdi_InvalidateRegion(xfc->hdc, x, y, w, h);
+ ret = gdi_InvalidateRegion(xfc->hdc, x, y, w, h);
}
+ return ret;
}
BOOL xf_gdi_polyline(rdpContext* context, POLYLINE_ORDER* polyline)
UINT32 color;
XPoint* points;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
if (xfc->drawing == xfc->primary)
{
- xf_gdi_invalidate_poly_region(xfc, points, npoints, FALSE);
+ if (!xf_gdi_invalidate_poly_region(xfc, points, npoints, FALSE))
+ ret = FALSE;
}
XSetFunction(xfc->display, xfc->gc, GXcopy);
free(points);
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
BOOL xf_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
{
xfBitmap* bitmap;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
memblt->nLeftRect, memblt->nTopRect);
if (xfc->drawing == xfc->primary)
- {
- gdi_InvalidateRegion(xfc->hdc, memblt->nLeftRect, memblt->nTopRect, memblt->nWidth, memblt->nHeight);
- }
+ ret = gdi_InvalidateRegion(xfc->hdc, memblt->nLeftRect, memblt->nTopRect, memblt->nWidth, memblt->nHeight);
XSetFunction(xfc->display, xfc->gc, GXcopy);
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
BOOL xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
UINT32 backColor;
Pixmap pattern = 0;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
mem3blt->nLeftRect, mem3blt->nTopRect);
if (xfc->drawing == xfc->primary)
- {
- gdi_InvalidateRegion(xfc->hdc, mem3blt->nLeftRect, mem3blt->nTopRect, mem3blt->nWidth, mem3blt->nHeight);
- }
+ ret = gdi_InvalidateRegion(xfc->hdc, mem3blt->nLeftRect, mem3blt->nTopRect, mem3blt->nWidth, mem3blt->nHeight);
XSetFillStyle(xfc->display, xfc->gc, FillSolid);
XSetTSOrigin(xfc->display, xfc->gc, 0, 0);
XSetFunction(xfc->display, xfc->gc, GXcopy);
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
BOOL xf_gdi_polygon_sc(rdpContext* context, POLYGON_SC_ORDER* polygon_sc)
XPoint* points;
UINT32 brush_color;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
if (xfc->drawing == xfc->primary)
{
- xf_gdi_invalidate_poly_region(xfc, points, npoints, TRUE);
+ if (!xf_gdi_invalidate_poly_region(xfc, points, npoints, TRUE))
+ ret = FALSE;
}
XSetFunction(xfc->display, xfc->gc, GXcopy);
free(points);
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
BOOL xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
UINT32 foreColor;
UINT32 backColor;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
if (xfc->drawing == xfc->primary)
{
- xf_gdi_invalidate_poly_region(xfc, points, npoints, TRUE);
+ if (!xf_gdi_invalidate_poly_region(xfc, points, npoints, TRUE))
+ ret = FALSE;
}
}
else
free(points);
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
BOOL xf_gdi_ellipse_sc(rdpContext* context, ELLIPSE_SC_ORDER* ellipse_sc)
{
rdpSettings* settings;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
settings = xfc->instance->settings;
+
xf_lock_x11(xfc, FALSE);
switch (surface_frame_marker->frameAction)
case SURFACECMD_FRAMEACTION_END:
xfc->frame_begin = FALSE;
if ((xfc->frame_x2 > xfc->frame_x1) && (xfc->frame_y2 > xfc->frame_y1))
- {
- gdi_InvalidateRegion(xfc->hdc, xfc->frame_x1, xfc->frame_y1,
+ ret = gdi_InvalidateRegion(xfc->hdc, xfc->frame_x1, xfc->frame_y1,
xfc->frame_x2 - xfc->frame_x1, xfc->frame_y2 - xfc->frame_y1);
- }
if (settings->FrameAcknowledge > 0)
{
IFCALL(xfc->instance->update->SurfaceFrameAcknowledge, context, surface_frame_marker->frameId);
}
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
-static void xf_gdi_surface_update_frame(xfContext* xfc, UINT16 tx, UINT16 ty, UINT16 width, UINT16 height)
+static BOOL xf_gdi_surface_update_frame(xfContext* xfc, UINT16 tx, UINT16 ty, UINT16 width, UINT16 height)
{
+ BOOL ret = TRUE;
if (!xfc->remote_app)
{
if (xfc->frame_begin)
}
else
{
- gdi_InvalidateRegion(xfc->hdc, tx, ty, width, height);
+ ret = gdi_InvalidateRegion(xfc->hdc, tx, ty, width, height);
}
}
else
{
- gdi_InvalidateRegion(xfc->hdc, tx, ty, width, height);
+ ret = gdi_InvalidateRegion(xfc->hdc, tx, ty, width, height);
}
+ return ret;
}
BOOL xf_gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* cmd)
BYTE* pDstData;
RFX_MESSAGE* message;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
tx = message->rects[i].x + cmd->destLeft;
ty = message->rects[i].y + cmd->destTop;
- xf_gdi_surface_update_frame(xfc, tx, ty, message->rects[i].width, message->rects[i].height);
+ if (!xf_gdi_surface_update_frame(xfc, tx, ty, message->rects[i].width, message->rects[i].height))
+ {
+ ret = FALSE;
+ break;
+ }
}
XSetClipMask(xfc->display, xfc->gc, None);
XFree(image);
- xf_gdi_surface_update_frame(xfc, cmd->destLeft, cmd->destTop, cmd->width, cmd->height);
+ ret = xf_gdi_surface_update_frame(xfc, cmd->destLeft, cmd->destTop, cmd->width, cmd->height);
XSetClipMask(xfc->display, xfc->gc, None);
}
cmd->width, cmd->height);
XFree(image);
- xf_gdi_surface_update_frame(xfc, cmd->destLeft, cmd->destTop, cmd->width, cmd->height);
+ ret = xf_gdi_surface_update_frame(xfc, cmd->destLeft, cmd->destTop, cmd->width, cmd->height);
XSetClipMask(xfc->display, xfc->gc, None);
}
}
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
void xf_gdi_register_update_callbacks(rdpUpdate* update)
XImage* image;
int width, height;
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
width = bitmap->right - bitmap->left + 1;
height = bitmap->bottom - bitmap->top + 1;
XFree(image);
- gdi_InvalidateRegion(xfc->hdc, bitmap->left, bitmap->top, width, height);
+ ret = gdi_InvalidateRegion(xfc->hdc, bitmap->left, bitmap->top, width, height);
xf_unlock_x11(xfc, FALSE);
return TRUE;
BOOL xf_Glyph_EndDraw(rdpContext* context, int x, int y, int width, int height, UINT32 bgcolor, UINT32 fgcolor)
{
xfContext* xfc = (xfContext*) context;
+ BOOL ret = TRUE;
xf_lock_x11(xfc, FALSE);
if (xfc->drawing == xfc->primary)
- {
- gdi_InvalidateRegion(xfc->hdc, x, y, width, height);
- }
+ ret = gdi_InvalidateRegion(xfc->hdc, x, y, width, height);
xf_unlock_x11(xfc, FALSE);
- return TRUE;
+ return ret;
}
/* Graphics Module */
}
#endif /* WITH_XRENDER defined */
#endif /* pinch/zoom/pan simulation */
- return TRUE;
+ return FALSE;
}
BOOL xf_keyboard_set_indicators(rdpContext* context, UINT16 led_flags)
#define IFCALL(_cb, ...) do { if (_cb != NULL) { _cb( __VA_ARGS__ ); } } while (0)
#define IFCALLRET(_cb, _ret, ...) do { if (_cb != NULL) { _ret = _cb( __VA_ARGS__ ); } } while (0)
-#define IFCALLRETURN(_default_return, _cb, ...) do { if (_cb != NULL) { return _cb( __VA_ARGS__ ); } else { return _default_return;} } while (0)
+#define IFCALLRESULT(_default_return, _cb, ...) (_cb != NULL) ? _cb( __VA_ARGS__ ) : (_default_return)
#endif /* FREERDP_API */
FREERDP_API int gdi_EqualRgn(HGDI_RGN hSrcRgn1, HGDI_RGN hSrcRgn2);
FREERDP_API int gdi_CopyRect(HGDI_RECT dst, HGDI_RECT src);
FREERDP_API int gdi_PtInRect(HGDI_RECT rc, int x, int y);
-FREERDP_API int gdi_InvalidateRegion(HGDI_DC hdc, int x, int y, int w, int h);
+FREERDP_API BOOL gdi_InvalidateRegion(HGDI_DC hdc, int x, int y, int w, int h);
#ifdef __cplusplus
}
return TRUE;
memblt->bitmap = bitmap;
- IFCALLRETURN(TRUE, cache->bitmap->MemBlt, context, memblt);
+ return IFCALLRESULT(TRUE, cache->bitmap->MemBlt, context, memblt);
}
BOOL update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
BOOL update_gdi_polygon_sc(rdpContext* context, POLYGON_SC_ORDER* polygon_sc)
{
rdpCache* cache = context->cache;
- IFCALLRETURN(TRUE, cache->brush->PolygonSC, context, polygon_sc);
+ return IFCALLRESULT(TRUE, cache->brush->PolygonSC, context, polygon_sc);
}
BOOL update_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
BOOL update_gdi_draw_nine_grid(rdpContext* context, DRAW_NINE_GRID_ORDER* draw_nine_grid)
{
rdpCache* cache = context->cache;
- IFCALLRETURN(TRUE, cache->nine_grid->DrawNineGrid, context, draw_nine_grid);
+ return IFCALLRESULT(TRUE, cache->nine_grid->DrawNineGrid, context, draw_nine_grid);
}
BOOL update_gdi_multi_draw_nine_grid(rdpContext* context, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid)
{
rdpCache* cache = context->cache;
- IFCALLRETURN(TRUE, cache->nine_grid->MultiDrawNineGrid, context, multi_draw_nine_grid);
+ return IFCALLRESULT(TRUE, cache->nine_grid->MultiDrawNineGrid, context, multi_draw_nine_grid);
}
void nine_grid_cache_register_callbacks(rdpUpdate* update)
rdp = fastpath->rdp;
s = transport_send_stream_init(rdp->transport, 256);
+ if (!s)
+ return NULL;
Stream_Seek(s, 3); /* fpInputHeader, length1 and length2 */
rdp = fastpath->rdp;
s = fastpath_input_pdu_init_header(fastpath);
+ if (!s)
+ return NULL;
Stream_Write_UINT8(s, eventFlags | (eventCode << 5)); /* eventHeader (1 byte) */
return s;
BOOL Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y)
{
- IFCALLRETURN(TRUE, context->graphics->Pointer_Prototype->SetPosition, context, x, y);
+ return IFCALLRESULT(TRUE, context->graphics->Pointer_Prototype->SetPosition, context, x, y);
}
void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer)
Stream_Seek(s, 2); /* pad2Octets (2 bytes) */
Stream_Read_UINT32(s, toggleFlags); /* toggleFlags (4 bytes) */
- IFCALLRETURN(TRUE, input->SynchronizeEvent, input, toggleFlags);
+ return IFCALLRESULT(TRUE, input->SynchronizeEvent, input, toggleFlags);
}
static BOOL input_recv_keyboard_event(rdpInput* input, wStream* s)
else
keyboardFlags |= KBD_FLAGS_DOWN;
- IFCALLRETURN(TRUE, input->KeyboardEvent, input, keyboardFlags, keyCode);
+ return IFCALLRESULT(TRUE, input->KeyboardEvent, input, keyboardFlags, keyCode);
}
static BOOL input_recv_unicode_keyboard_event(rdpInput* input, wStream* s)
else
keyboardFlags |= KBD_FLAGS_DOWN;
- IFCALLRETURN(TRUE, input->UnicodeKeyboardEvent, input, keyboardFlags, unicodeCode);
+ return IFCALLRESULT(TRUE, input->UnicodeKeyboardEvent, input, keyboardFlags, unicodeCode);
}
static BOOL input_recv_mouse_event(rdpInput* input, wStream* s)
Stream_Read_UINT16(s, xPos); /* xPos (2 bytes) */
Stream_Read_UINT16(s, yPos); /* yPos (2 bytes) */
- IFCALLRETURN(TRUE, input->MouseEvent, input, pointerFlags, xPos, yPos);
+ return IFCALLRESULT(TRUE, input->MouseEvent, input, pointerFlags, xPos, yPos);
}
static BOOL input_recv_extended_mouse_event(rdpInput* input, wStream* s)
Stream_Read_UINT16(s, xPos); /* xPos (2 bytes) */
Stream_Read_UINT16(s, yPos); /* yPos (2 bytes) */
- IFCALLRETURN(TRUE, input->ExtendedMouseEvent, input, pointerFlags, xPos, yPos);
+ return IFCALLRESULT(TRUE, input->ExtendedMouseEvent, input, pointerFlags, xPos, yPos);
}
static BOOL input_recv_event(rdpInput* input, wStream* s)
BOOL freerdp_input_send_synchronize_event(rdpInput* input, UINT32 flags)
{
- IFCALLRETURN(TRUE, input->SynchronizeEvent, input, flags);
+ return IFCALLRESULT(TRUE, input->SynchronizeEvent, input, flags);
}
BOOL freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
- IFCALLRETURN(TRUE, input->KeyboardEvent, input, flags, code);
+ return IFCALLRESULT(TRUE, input->KeyboardEvent, input, flags, code);
}
BOOL freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, UINT32 rdp_scancode)
BOOL freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
- IFCALLRETURN(TRUE, input->UnicodeKeyboardEvent, input, flags, code);
+ return IFCALLRESULT(TRUE, input->UnicodeKeyboardEvent, input, flags, code);
}
BOOL freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
- IFCALLRETURN(TRUE, input->MouseEvent, input, flags, x, y);
+ return IFCALLRESULT(TRUE, input->MouseEvent, input, flags, x, y);
}
BOOL freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
- IFCALLRETURN(TRUE, input->ExtendedMouseEvent, input, flags, x, y);
+ return IFCALLRESULT(TRUE, input->ExtendedMouseEvent, input, flags, x, y);
}
BOOL freerdp_input_send_focus_in_event(rdpInput* input, UINT16 toggleStates)
{
- IFCALLRETURN(TRUE, input->FocusInEvent, input, toggleStates);
+ return IFCALLRESULT(TRUE, input->FocusInEvent, input, toggleStates);
}
BOOL freerdp_input_send_keyboard_pause_event(rdpInput* input)
{
- IFCALLRETURN(TRUE, input->KeyboardPauseEvent, input);
+ return IFCALLRESULT(TRUE, input->KeyboardPauseEvent, input);
}
int input_process_events(rdpInput* input)
s = fastpath_update_pdu_init(rdp->fastpath);
if (!s)
return FALSE;
+
if (!Stream_EnsureRemainingCapacity(s, SURFCMD_SURFACE_BITS_HEADER_LENGTH + (int) cmd->bitmapDataLength + 16))
goto out_fail;
if (last)
{
if (!update_write_surfcmd_frame_marker(s, SURFACECMD_FRAMEACTION_END, frameId))
- return FALSE;
+ goto out_fail;
}
ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, s, cmd->skipCompression);
if (!s)
return FALSE;
- if (!update_write_pointer_color(s, pointer_color))
+ if (!update_write_pointer_color(s, pointer_color))
goto out_fail;
ret = fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_COLOR, s, FALSE);
}
}
- gdi_InvalidateRegion(hdc, nXDest, nYDest, nWidth, nHeight);
- return 0;
+ if (!gdi_InvalidateRegion(hdc, nXDest, nYDest, nWidth, nHeight))
+ return 0;
+ return 1;
}
static int BitBlt_BLACKNESS_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
memset(dstp, 0, nWidth * hdcDest->bytesPerPixel);
}
- return 0;
+ return 1;
}
static int BitBlt_WHITENESS_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
memset(dstp, 0xFF, nWidth * hdcDest->bytesPerPixel);
}
- return 0;
+ return 1;
}
static int BitBlt_SRCCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc) == 0)
memcpy(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
}
- return 0;
+ return 1;
}
if (nYSrc < nYDest)
}
}
- return 0;
+ return 1;
}
static int BitBlt_NOTSRCCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_DSTINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCERASE_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_NOTSRCERASE_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCAND_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
HGDI_BITMAP hSrcBmp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
/* D = (S & P) | (~S & D) */
/* DSPDxax, used to draw glyphs */
}
}
- return 0;
+ return 1;
}
static int BitBlt_PSDPxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16 color16;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
/* D = (S & D) | (~S & P) */
}
}
- return 0;
+ return 1;
}
static int BitBlt_SPna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16* patp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_DPa_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_PDxn_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_DSna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
UINT16* patp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_MERGEPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_PATCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_PATINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_PATPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT16* patp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
int BitBlt_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, int rop)
return 0;
}
- gdi_InvalidateRegion(hdcDest, nXDest, nYDest, nWidth, nHeight);
-
- if (!hdcDest)
- return 1;
+ if (!gdi_InvalidateRegion(hdcDest, nXDest, nYDest, nWidth, nHeight))
+ return 0;
switch (rop)
{
if (gdi_ClipCoords(hdc, &nXLeft, &nYLeft, &nWidth, &nHeight, NULL, NULL) == 0)
return 0;
- gdi_InvalidateRegion(hdc, nXLeft, nYLeft, nWidth, nHeight);
+ if (!gdi_InvalidateRegion(hdc, nXLeft, nYLeft, nWidth, nHeight))
+ return 0;
switch (rop)
{
}
}
- gdi_InvalidateRegion(hdc, nXDest, nYDest, nWidth, nHeight);
- return 0;
+ if (!gdi_InvalidateRegion(hdc, nXDest, nYDest, nWidth, nHeight))
+ return 0;
+ return 1;
}
static int BitBlt_BLACKNESS_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_WHITENESS_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
memset(dstp, 0xFF, nWidth * hdcDest->bytesPerPixel);
}
- return 0;
+ return 1;
}
static int BitBlt_SRCCOPY_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc) == 0)
memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
}
- return 0;
+ return 1;
}
if (nYSrc < nYDest)
}
}
- return 0;
+ return 1;
}
static int BitBlt_NOTSRCCOPY_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* dstp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_DSTINVERT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCERASE_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* dstp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_NOTSRCERASE_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* dstp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCINVERT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* dstp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCAND_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* dstp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCPAINT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* dstp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_DSPDxax_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
HGDI_BITMAP hSrcBmp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
/* D = (S & P) | (~S & D) */
}
}
- return 0;
+ return 1;
}
static int BitBlt_PSDPxax_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32 color32;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
/* D = (S & D) | (~S & P) */
}
}
- return 0;
+ return 1;
}
static int BitBlt_SPDSxax_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32 color32;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
/* D = S ^ (P & (D ^ S)) */
}
}
- return 0;
+ return 1;
}
static int BitBlt_SPna_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* patp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_DSna_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* dstp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_DPa_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_PDxn_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_MERGECOPY_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* patp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_MERGEPAINT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* dstp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_PATCOPY_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_PATINVERT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_PATPAINT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
UINT32* patp;
if (!hdcDest || !hdcSrc)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
int BitBlt_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, int rop)
return 0;
}
- gdi_InvalidateRegion(hdcDest, nXDest, nYDest, nWidth, nHeight);
-
- if (!hdcDest)
- return 1;
+ if (!gdi_InvalidateRegion(hdcDest, nXDest, nYDest, nWidth, nHeight))
+ return 0;
switch (rop)
{
if (gdi_ClipCoords(hdc, &nXLeft, &nYLeft, &nWidth, &nHeight, NULL, NULL) == 0)
return 0;
- gdi_InvalidateRegion(hdc, nXLeft, nYLeft, nWidth, nHeight);
+ if (!gdi_InvalidateRegion(hdc, nXLeft, nYLeft, nWidth, nHeight))
+ return 0;
switch (rop)
{
BYTE gdi_get_color_8bpp(HGDI_DC hdc, GDI_COLOR color)
{
/* TODO: Implement 8bpp gdi_get_color_8bpp() */
- return 0;
+ return 1;
}
int FillRect_8bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr)
{
/* TODO: Implement 8bpp FillRect() */
- return 0;
+ return 1;
}
static int BitBlt_BLACKNESS_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
memset(dstp, 0, nWidth * hdcDest->bytesPerPixel);
}
- return 0;
+ return 1;
}
static int BitBlt_WHITENESS_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
memset(dstp, 0xFF, nWidth * hdcDest->bytesPerPixel);
}
- return 0;
+ return 1;
}
static int BitBlt_SRCCOPY_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc) == 0)
memcpy(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
}
- return 0;
+ return 1;
}
if (nYSrc < nYDest)
}
}
- return 0;
+ return 1;
}
static int BitBlt_NOTSRCCOPY_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_DSTINVERT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCERASE_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_NOTSRCERASE_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCINVERT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCAND_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_SRCPAINT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_DSPDxax_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
/* TODO: Implement 8bpp DSPDxax BitBlt */
- return 0;
+ return 1;
}
static int BitBlt_PSDPxax_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE color8;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
/* D = (S & D) | (~S & P) */
}
}
- return 0;
+ return 1;
}
static int BitBlt_SPna_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* patp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_DPa_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_PDxn_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_DSna_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_MERGECOPY_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* patp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_MERGEPAINT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* dstp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
static int BitBlt_PATCOPY_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_PATINVERT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
}
}
- return 0;
+ return 1;
}
static int BitBlt_PATPAINT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
BYTE* patp;
if (!hdcSrc || !hdcDest)
- return 1;
+ return 0;
for (y = 0; y < nHeight; y++)
{
}
}
- return 0;
+ return 1;
}
int BitBlt_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, int rop)
{
+ if (!hdcDest)
+ return 0;
+
if (hdcSrc != NULL)
{
if (gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, &nXSrc, &nYSrc) == 0)
return 0;
}
- gdi_InvalidateRegion(hdcDest, nXDest, nYDest, nWidth, nHeight);
-
- if (!hdcDest)
- return 1;
+ if (!gdi_InvalidateRegion(hdcDest, nXDest, nYDest, nWidth, nHeight))
+ return 0;
switch (rop)
{
if (gdi_ClipCoords(hdc, &nXLeft, &nYLeft, &nWidth, &nHeight, NULL, NULL) == 0)
return 0;
- gdi_InvalidateRegion(hdc, nXLeft, nYLeft, nWidth, nHeight);
+ if (!gdi_InvalidateRegion(hdc, nXLeft, nYLeft, nWidth, nHeight))
+ return 0;
switch (rop)
{
{
HGDI_BITMAP hBmp = (HGDI_BITMAP) hdc->selectedObject;
*((GDI_COLOR*)&(hBmp->data[(Y * hBmp->width * hdc->bytesPerPixel) + X * hdc->bytesPerPixel])) = crColor;
- return 0;
+ return crColor;
}
INLINE void gdi_SetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y, BYTE pixel)
* @param nXSrc source x1
* @param nYSrc source y1
* @param rop raster operation code
- * @return 1 if successful, 0 otherwise
+ * @return 0 on failure, non-zero otherwise
*/
int gdi_BitBlt(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, int rop)
status = freerdp_image_copy(pDstData, gdi->format, nDstStep, nXDst, nYDst,
nWidth, nHeight, pSrcData, gdi->format, nSrcStep, nXSrc, nYSrc, gdi->palette);
- gdi_InvalidateRegion(gdi->primary->hdc, nXDst, nYDst, nWidth, nHeight);
+ return gdi_InvalidateRegion(gdi->primary->hdc, nXDst, nYDst, nWidth, nHeight);
}
return TRUE;
}
rdpGdi* gdi = context->gdi;
if (gdi_BitBlt(gdi->drawing->hdc, dstblt->nLeftRect, dstblt->nTopRect,
- dstblt->nWidth, dstblt->nHeight, NULL, 0, 0, gdi_rop3_code(dstblt->bRop)) != 1)
+ dstblt->nWidth, dstblt->nHeight, NULL, 0, 0, gdi_rop3_code(dstblt->bRop)) == 0)
return FALSE;
return TRUE;
}
}
if (gdi_PatBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect,
- patblt->nWidth, patblt->nHeight, gdi_rop3_code(patblt->bRop)) != 1)
+ patblt->nWidth, patblt->nHeight, gdi_rop3_code(patblt->bRop)) == 0)
ret = FALSE;
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
}
if (gdi_PatBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect,
- patblt->nWidth, patblt->nHeight, gdi_rop3_code(patblt->bRop)) != 1)
+ patblt->nWidth, patblt->nHeight, gdi_rop3_code(patblt->bRop)) == 0)
ret = FALSE;
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
}
if (gdi_PatBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect,
- patblt->nWidth, patblt->nHeight, gdi_rop3_code(patblt->bRop)) != 1)
+ patblt->nWidth, patblt->nHeight, gdi_rop3_code(patblt->bRop)) == 0)
ret = FALSE;
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
if (gdi_BitBlt(gdi->drawing->hdc, scrblt->nLeftRect, scrblt->nTopRect,
scrblt->nWidth, scrblt->nHeight, gdi->primary->hdc,
- scrblt->nXSrc, scrblt->nYSrc, gdi_rop3_code(scrblt->bRop)) != 1)
+ scrblt->nXSrc, scrblt->nYSrc, gdi_rop3_code(scrblt->bRop)) == 0)
return FALSE;
return TRUE;
}
bitmap = (gdiBitmap*) memblt->bitmap;
- gdi_BitBlt(gdi->drawing->hdc, memblt->nLeftRect, memblt->nTopRect,
+ if (gdi_BitBlt(gdi->drawing->hdc, memblt->nLeftRect, memblt->nTopRect,
memblt->nWidth, memblt->nHeight, bitmap->hdc,
- memblt->nXSrc, memblt->nYSrc, gdi_rop3_code(memblt->bRop));
+ memblt->nXSrc, memblt->nYSrc, gdi_rop3_code(memblt->bRop)) == 0)
+ return FALSE;
return TRUE;
}
height = bitmap->bottom - bitmap->top + 1;
if (gdi_BitBlt(context->gdi->primary->hdc, bitmap->left, bitmap->top,
- width, height, gdi_bitmap->hdc, 0, 0, GDI_SRCCOPY) != 0)
+ width, height, gdi_bitmap->hdc, 0, 0, GDI_SRCCOPY) == 0)
return FALSE;
return TRUE;
}
gdi_glyph = (gdiGlyph*) glyph;
if (gdi_BitBlt(gdi->drawing->hdc, x, y, gdi_glyph->bitmap->width,
- gdi_glyph->bitmap->height, gdi_glyph->hdc, 0, 0, GDI_DSPDxax) != 0)
+ gdi_glyph->bitmap->height, gdi_glyph->hdc, 0, 0, GDI_DSPDxax) == 0)
return FALSE;
return TRUE;
}
GDI_RECT rect;
HGDI_BRUSH brush;
rdpGdi* gdi = context->gdi;
- int ret = 1;
+ int ret = 0;
/* TODO: handle fOpRedundant! See xf_Glyph_BeginDraw() */
brush = gdi_CreateSolidBrush(fgcolor);
if (!brush)
- {
goto out_fail;
- return FALSE;
- }
gdi_CRgnToRect(x, y, width, height, &rect);
ret = gdi_FillRect(gdi->drawing->hdc, &rect, brush);
out_fail:
gdi->textColor = gdi_SetTextColor(gdi->drawing->hdc, bgcolor);
- if (ret != 0)
+ if (ret == 0)
return FALSE;
return TRUE;
}
bx2 = MIN(bx2, bmp->width - 1);
by2 = MIN(by2, bmp->height - 1);
- gdi_InvalidateRegion(hdc, bx1, by1, bx2 - bx1 + 1, by2 - by1 + 1);
+ if (!gdi_InvalidateRegion(hdc, bx1, by1, bx2 - bx1 + 1, by2 - by1 + 1))
+ return 0;
pen = GDI_GET_PEN_COLOR(hdc->pen);
HGDI_RECT gdi_CreateRect(int xLeft, int yTop, int xRight, int yBottom)
{
HGDI_RECT hRect = (HGDI_RECT) malloc(sizeof(GDI_RECT));
+ if (!hRect)
+ return NULL;
hRect->objectType = GDIOBJECT_RECT;
hRect->left = xLeft;
hRect->top = yTop;
* @param y y1
* @param w width
* @param h height
- * @return
+ * @return FALSE on error
*/
-INLINE int gdi_InvalidateRegion(HGDI_DC hdc, int x, int y, int w, int h)
+INLINE BOOL gdi_InvalidateRegion(HGDI_DC hdc, int x, int y, int w, int h)
{
GDI_RECT inv;
GDI_RECT rgn;
HGDI_RGN cinvalid;
if (!hdc->hwnd)
- return 0;
+ return TRUE;
if (!hdc->hwnd->invalid)
- return 0;
+ return TRUE;
if (w == 0 || h == 0)
- return 0;
+ return TRUE;
cinvalid = hdc->hwnd->cinvalid;
new_cnt = hdc->hwnd->count * 2;
new_rgn = (HGDI_RGN) realloc(cinvalid, sizeof(GDI_RGN) * new_cnt);
if (!new_rgn)
- return -1;
+ return FALSE;
hdc->hwnd->count = new_cnt;
cinvalid = new_rgn;
}
invalid->w = w;
invalid->h = h;
invalid->null = 0;
- return 0;
+ return TRUE;
}
gdi_CRgnToRect(x, y, w, h, &rgn);
gdi_RectToRgn(&inv, invalid);
- return 0;
+ return TRUE;
}
int y2 = 256;
HGDI_RECT hRect = gdi_CreateRect(x1, y1, x2, y2);
+ if (!hRect)
+ return -1;
if (hRect->objectType != GDIOBJECT_RECT)
return -1;