if (delta)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, lsi8);
*coord += lsi8;
}
else
{
- if(stream_get_left(s) < 2)
+ if (stream_get_left(s) < 2)
return FALSE;
stream_read_UINT16(s, lsi16);
*coord = lsi16;
{
BYTE byte;
- if(stream_get_left(s) < 3)
+ if (stream_get_left(s) < 3)
return FALSE;
stream_read_BYTE(s, byte);
*color = byte;
{
BYTE byte;
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
if (byte & 0x80)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
*value = (byte & 0x7F) << 8;
BYTE byte;
BOOL negative;
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
if (byte & 0x80)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
*value = (*value << 8) | byte;
BYTE byte;
BYTE count;
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
count = (byte & 0xC0) >> 6;
- if(stream_get_left(s) < count)
+ if (stream_get_left(s) < count)
return FALSE;
switch (count)
{
BYTE byte;
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
if (byte & 0x80)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
*value = (*value << 8) | byte;
{
if (fieldFlags & ORDER_FIELD_01)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, brush->x);
}
if (fieldFlags & ORDER_FIELD_02)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, brush->y);
}
if (fieldFlags & ORDER_FIELD_03)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, brush->style);
}
if (fieldFlags & ORDER_FIELD_04)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, brush->hatch);
}
if (fieldFlags & ORDER_FIELD_05)
{
- if(stream_get_left(s) < 7)
+ if (stream_get_left(s) < 7)
return FALSE;
brush->data = (BYTE*) brush->p8x8;
stream_read_BYTE(s, brush->data[7]);
zeroBitsSize = ((number + 1) / 2);
- if(stream_get_left(s) < zeroBitsSize)
+ if (stream_get_left(s) < zeroBitsSize)
return FALSE;
stream_get_mark(s, zeroBits);
stream_seek(s, zeroBitsSize);
if (~flags & 0x20)
{
- if(!update_read_delta(s, &rectangles[i].width))
+ if (!update_read_delta(s, &rectangles[i].width))
return FALSE;
}
else
if (~flags & 0x10)
{
- if(!update_read_delta(s, &rectangles[i].height))
+ if (!update_read_delta(s, &rectangles[i].height))
return FALSE;
}
else
zeroBitsSize = ((number + 3) / 4);
- if(stream_get_left(s) < zeroBitsSize)
+ if (stream_get_left(s) < zeroBitsSize)
return FALSE;
stream_get_mark(s, zeroBits);
stream_seek(s, zeroBitsSize);
do {\
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
- if(stream_get_left(s) < 1) \
+ if (stream_get_left(s) < 1) \
return FALSE; \
stream_read_BYTE(s, TARGET); \
} \
do {\
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
- if(stream_get_left(s) < 2) \
+ if (stream_get_left(s) < 2) \
return FALSE; \
stream_read_BYTE(s, TARGET1); \
stream_read_BYTE(s, TARGET2); \
do {\
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
- if(stream_get_left(s) < 2) \
+ if (stream_get_left(s) < 2) \
return FALSE; \
stream_read_UINT16(s, TARGET); \
} \
do {\
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
- if(stream_get_left(s) < 4) \
+ if (stream_get_left(s) < 4) \
return FALSE; \
stream_read_UINT32(s, TARGET); \
} \
return FALSE
#define FIELD_SKIP_BUFFER16(s, TARGET_LEN) \
- if(stream_get_left(s) < 2) \
+ if (stream_get_left(s) < 2) \
return FALSE; \
stream_read_UINT16(s, TARGET_LEN); \
- if(!stream_skip(s, TARGET_LEN)) \
+ if (!stream_skip(s, TARGET_LEN)) \
return FALSE
if (orderInfo->fieldFlags & ORDER_FIELD_05)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
opaque_rect->color = (opaque_rect->color & 0xFFFFFF00) | byte;
}
if (orderInfo->fieldFlags & ORDER_FIELD_06) {
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
opaque_rect->color = (opaque_rect->color & 0xFFFF00FF) | (byte << 8);
}
if (orderInfo->fieldFlags & ORDER_FIELD_07) {
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
opaque_rect->color = (opaque_rect->color & 0xFF00FFFF) | (byte << 16);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
- if(stream_get_left(s) < 2)
+ if (stream_get_left(s) < 2)
return FALSE;
stream_read_UINT16(s, multi_dstblt->cbData);
return update_read_delta_rects(s, multi_dstblt->rectangles, multi_dstblt->numRectangles);
ORDER_FIELD_COLOR(6, multi_patblt->backColor);
ORDER_FIELD_COLOR(7, multi_patblt->foreColor);
- if(!update_read_brush(s, &multi_patblt->brush, orderInfo->fieldFlags >> 7))
+ if (!update_read_brush(s, &multi_patblt->brush, orderInfo->fieldFlags >> 7))
return FALSE;
ORDER_FIELD_BYTE(13, multi_patblt->numRectangles);
if (orderInfo->fieldFlags & ORDER_FIELD_14)
{
- if(stream_get_left(s) < 2)
+ if (stream_get_left(s) < 2)
return FALSE;
stream_read_UINT16(s, multi_patblt->cbData);
- if(!update_read_delta_rects(s, multi_patblt->rectangles, multi_patblt->numRectangles))
+ if (!update_read_delta_rects(s, multi_patblt->rectangles, multi_patblt->numRectangles))
return FALSE;
}
return TRUE;
if (orderInfo->fieldFlags & ORDER_FIELD_09)
{
- if(stream_get_left(s) < 2)
+ if (stream_get_left(s) < 2)
return FALSE;
stream_read_UINT16(s, multi_scrblt->cbData);
return update_read_delta_rects(s, multi_scrblt->rectangles, multi_scrblt->numRectangles);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
multi_opaque_rect->color = (multi_opaque_rect->color & 0xFFFFFF00) | byte;
if (orderInfo->fieldFlags & ORDER_FIELD_06)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
multi_opaque_rect->color = (multi_opaque_rect->color & 0xFFFF00FF) | (byte << 8);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, byte);
multi_opaque_rect->color = (multi_opaque_rect->color & 0xFF00FFFF) | (byte << 16);
if (orderInfo->fieldFlags & ORDER_FIELD_09)
{
- if(stream_get_left(s) < 2)
+ if (stream_get_left(s) < 2)
return FALSE;
stream_read_UINT16(s, multi_opaque_rect->cbData);
return update_read_delta_rects(s, multi_opaque_rect->rectangles, multi_opaque_rect->numRectangles);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, polyline->cbData);
ORDER_FIELD_COLOR(9, mem3blt->backColor);
ORDER_FIELD_COLOR(10, mem3blt->foreColor);
- if(!update_read_brush(s, &mem3blt->brush, orderInfo->fieldFlags >> 10))
+ if (!update_read_brush(s, &mem3blt->brush, orderInfo->fieldFlags >> 10))
return FALSE;
ORDER_FIELD_UINT16(16, mem3blt->cacheIndex);
ORDER_FIELD_UINT16(13, glyph_index->opRight);
ORDER_FIELD_UINT16(14, glyph_index->opBottom);
- if(!update_read_brush(s, &glyph_index->brush, orderInfo->fieldFlags >> 14))
+ if (!update_read_brush(s, &glyph_index->brush, orderInfo->fieldFlags >> 14))
return FALSE;
ORDER_FIELD_UINT16(20, glyph_index->x);
if (orderInfo->fieldFlags & ORDER_FIELD_22)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, glyph_index->cbData);
- if(stream_get_left(s) < glyph_index->cbData)
+ if (stream_get_left(s) < glyph_index->cbData)
return FALSE;
memcpy(glyph_index->data, s->p, glyph_index->cbData);
stream_seek(s, glyph_index->cbData);
if (orderInfo->fieldFlags & ORDER_FIELD_15)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, fast_index->cbData);
- if(stream_get_left(s) < fast_index->cbData)
+ if (stream_get_left(s) < fast_index->cbData)
return FALSE;
memcpy(fast_index->data, s->p, fast_index->cbData);
stream_seek(s, fast_index->cbData);
if (orderInfo->fieldFlags & ORDER_FIELD_15)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, fast_glyph->cbData);
- if(stream_get_left(s) < fast_glyph->cbData)
+ if (stream_get_left(s) < fast_glyph->cbData)
return FALSE;
memcpy(fast_glyph->data, s->p, fast_glyph->cbData);
phold = s->p;
/* parse optional glyph data */
glyph = (GLYPH_DATA_V2*) malloc(sizeof(GLYPH_DATA_V2));
glyph->cacheIndex = fast_glyph->data[0];
- if(!update_read_2byte_signed(s, &glyph->x) ||
+ if (!update_read_2byte_signed(s, &glyph->x) ||
!update_read_2byte_signed(s, &glyph->y) ||
!update_read_2byte_unsigned(s, &glyph->cx) ||
!update_read_2byte_unsigned(s, &glyph->cy))
return FALSE;
glyph->cb = ((glyph->cx + 7) / 8) * glyph->cy;
glyph->cb += ((glyph->cb % 4) > 0) ? 4 - (glyph->cb % 4) : 0;
- if(stream_get_left(s) < glyph->cb)
+ if (stream_get_left(s) < glyph->cb)
return FALSE;
glyph->aj = (BYTE*) malloc(glyph->cb);
stream_read(s, glyph->aj, glyph->cb);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, polygon_sc->cbData);
ORDER_FIELD_COLOR(5, polygon_cb->backColor);
ORDER_FIELD_COLOR(6, polygon_cb->foreColor);
- if(!update_read_brush(s, &polygon_cb->brush, orderInfo->fieldFlags >> 6))
+ if (!update_read_brush(s, &polygon_cb->brush, orderInfo->fieldFlags >> 6))
return FALSE;
ORDER_FIELD_BYTE(12, polygon_cb->numPoints);
if (orderInfo->fieldFlags & ORDER_FIELD_13)
{
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, polygon_cb->cbData);
else
polygon_cb->points = (DELTA_POINT*) realloc(polygon_cb->points, sizeof(DELTA_POINT) * polygon_cb->numPoints);
- if(!update_read_delta_points(s, polygon_cb->points, polygon_cb->numPoints, polygon_cb->xStart, polygon_cb->yStart))
+ if (!update_read_delta_points(s, polygon_cb->points, polygon_cb->numPoints, polygon_cb->xStart, polygon_cb->yStart))
return FALSE;
}
BOOL update_read_cache_bitmap_order(STREAM* s, CACHE_BITMAP_ORDER* cache_bitmap_order, BOOL compressed, UINT16 flags)
{
- if(stream_get_left(s) < 9)
+ if (stream_get_left(s) < 9)
return FALSE;
stream_read_BYTE(s, cache_bitmap_order->cacheId); /* cacheId (1 byte) */
stream_seek_BYTE(s); /* pad1Octet (1 byte) */
if ((flags & NO_BITMAP_COMPRESSION_HDR) == 0)
{
BYTE* bitmapComprHdr = (BYTE*) &(cache_bitmap_order->bitmapComprHdr);
- if(stream_get_left(s) < 8)
+ if (stream_get_left(s) < 8)
return FALSE;
stream_read(s, bitmapComprHdr, 8); /* bitmapComprHdr (8 bytes) */
cache_bitmap_order->bitmapLength -= 8;
}
- if(stream_get_left(s) < cache_bitmap_order->bitmapLength)
+ if (stream_get_left(s) < cache_bitmap_order->bitmapLength)
return FALSE;
stream_get_mark(s, cache_bitmap_order->bitmapDataStream);
}
else
{
- if(stream_get_left(s) < cache_bitmap_order->bitmapLength)
+ if (stream_get_left(s) < cache_bitmap_order->bitmapLength)
return FALSE;
stream_get_mark(s, cache_bitmap_order->bitmapDataStream);
if (cache_bitmap_v2_order->flags & CBR2_PERSISTENT_KEY_PRESENT)
{
- if(stream_get_left(s) < 8)
+ if (stream_get_left(s) < 8)
return FALSE;
stream_read_UINT32(s, cache_bitmap_v2_order->key1); /* key1 (4 bytes) */
stream_read_UINT32(s, cache_bitmap_v2_order->key2); /* key2 (4 bytes) */
if (cache_bitmap_v2_order->flags & CBR2_HEIGHT_SAME_AS_WIDTH)
{
- if(!update_read_2byte_unsigned(s, &cache_bitmap_v2_order->bitmapWidth)) /* bitmapWidth */
+ if (!update_read_2byte_unsigned(s, &cache_bitmap_v2_order->bitmapWidth)) /* bitmapWidth */
return FALSE;
cache_bitmap_v2_order->bitmapHeight = cache_bitmap_v2_order->bitmapWidth;
}
else
{
- if(!update_read_2byte_unsigned(s, &cache_bitmap_v2_order->bitmapWidth) || /* bitmapWidth */
+ if (!update_read_2byte_unsigned(s, &cache_bitmap_v2_order->bitmapWidth) || /* bitmapWidth */
!update_read_2byte_unsigned(s, &cache_bitmap_v2_order->bitmapHeight)) /* bitmapHeight */
return FALSE;
}
- if(!update_read_4byte_unsigned(s, &cache_bitmap_v2_order->bitmapLength) || /* bitmapLength */
+ if (!update_read_4byte_unsigned(s, &cache_bitmap_v2_order->bitmapLength) || /* bitmapLength */
!update_read_2byte_unsigned(s, &cache_bitmap_v2_order->cacheIndex)) /* cacheIndex */
return FALSE;
{
if (!(cache_bitmap_v2_order->flags & CBR2_NO_BITMAP_COMPRESSION_HDR))
{
- if(stream_get_left(s) < 8)
+ if (stream_get_left(s) < 8)
return FALSE;
stream_read_UINT16(s, cache_bitmap_v2_order->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */
cache_bitmap_v2_order->bitmapLength = cache_bitmap_v2_order->cbCompMainBodySize;
}
- if(stream_get_left(s) < cache_bitmap_v2_order->bitmapLength)
+ if (stream_get_left(s) < cache_bitmap_v2_order->bitmapLength)
return FALSE;
stream_get_mark(s, cache_bitmap_v2_order->bitmapDataStream);
stream_seek(s, cache_bitmap_v2_order->bitmapLength);
}
else
{
- if(stream_get_left(s) < cache_bitmap_v2_order->bitmapLength)
+ if (stream_get_left(s) < cache_bitmap_v2_order->bitmapLength)
return FALSE;
stream_get_mark(s, cache_bitmap_v2_order->bitmapDataStream);
stream_seek(s, cache_bitmap_v2_order->bitmapLength);
bitsPerPixelId = (flags & 0x00000078) >> 3;
cache_bitmap_v3_order->bpp = CBR23_BPP[bitsPerPixelId];
- if(stream_get_left(s) < 21)
+ if (stream_get_left(s) < 21)
return FALSE;
stream_read_UINT16(s, cache_bitmap_v3_order->cacheIndex); /* cacheIndex (2 bytes) */
stream_read_UINT32(s, cache_bitmap_v3_order->key1); /* key1 (4 bytes) */
stream_read_UINT16(s, bitmapData->height); /* height (2 bytes) */
stream_read_UINT32(s, bitmapData->length); /* length (4 bytes) */
- if(stream_get_left(s) < bitmapData->length)
+ if (stream_get_left(s) < bitmapData->length)
return FALSE;
if (bitmapData->data == NULL)
bitmapData->data = (BYTE*) malloc(bitmapData->length);
int i;
UINT32* colorTable;
- if(stream_get_left(s) < 3)
+ if (stream_get_left(s) < 3)
return FALSE;
stream_read_BYTE(s, cache_color_table_order->cacheIndex); /* cacheIndex (1 byte) */
stream_read_UINT16(s, cache_color_table_order->numberColors); /* numberColors (2 bytes) */
- if(stream_get_left(s) < cache_color_table_order->numberColors * 4)
+ if (stream_get_left(s) < cache_color_table_order->numberColors * 4)
return FALSE;
colorTable = cache_color_table_order->colorTable;
INT16 lsi16;
GLYPH_DATA* glyph;
- if(stream_get_left(s) < 2)
+ if (stream_get_left(s) < 2)
return FALSE;
stream_read_BYTE(s, cache_glyph_order->cacheId); /* cacheId (1 byte) */
stream_read_BYTE(s, cache_glyph_order->cGlyphs); /* cGlyphs (1 byte) */
}
glyph = cache_glyph_order->glyphData[i];
- if(stream_get_left(s) < 10)
+ if (stream_get_left(s) < 10)
return FALSE;
stream_read_UINT16(s, glyph->cacheIndex);
stream_read_UINT16(s, lsi16);
glyph->cb = ((glyph->cx + 7) / 8) * glyph->cy;
glyph->cb += ((glyph->cb % 4) > 0) ? 4 - (glyph->cb % 4) : 0;
- if(stream_get_left(s) < glyph->cb)
+ if (stream_get_left(s) < glyph->cb)
return FALSE;
glyph->aj = (BYTE*) malloc(glyph->cb);
stream_read(s, glyph->aj, glyph->cb);
}
glyph = cache_glyph_v2_order->glyphData[i];
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, glyph->cacheIndex);
- if(!update_read_2byte_signed(s, &glyph->x) ||
+ if (!update_read_2byte_signed(s, &glyph->x) ||
!update_read_2byte_signed(s, &glyph->y) ||
!update_read_2byte_unsigned(s, &glyph->cx) ||
!update_read_2byte_unsigned(s, &glyph->cy))
glyph->cb = ((glyph->cx + 7) / 8) * glyph->cy;
glyph->cb += ((glyph->cb % 4) > 0) ? 4 - (glyph->cb % 4) : 0;
- if(stream_get_left(s) < glyph->cb)
+ if (stream_get_left(s) < glyph->cb)
return FALSE;
glyph->aj = (BYTE*) malloc(glyph->cb);
stream_read(s, glyph->aj, glyph->cb);
palette = s->p + 16;
bytesPerPixel = ((bpp + 1) / 8);
- if(stream_get_left(s) < 16) // 64 / 4
+ if (stream_get_left(s) < 16) // 64 / 4
return FALSE;
for (y = 7; y >= 0; y--)
BYTE iBitmapFormat;
BOOL compressed = FALSE;
- if(stream_get_left(s) < 6)
+ if (stream_get_left(s) < 6)
return FALSE;
stream_read_BYTE(s, cache_brush_order->index); /* cacheEntry (1 byte) */
}
/* rows are encoded in reverse order */
- if(stream_get_left(s) < 8)
+ if (stream_get_left(s) < 8)
return FALSE;
for (i = 7; i >= 0; i--)
if (compressed != FALSE)
{
/* compressed brush */
- if(!update_decompress_brush(s, cache_brush_order->data, cache_brush_order->bpp))
+ if (!update_decompress_brush(s, cache_brush_order->data, cache_brush_order->bpp))
return FALSE;
}
else
{
/* uncompressed brush */
int scanline = (cache_brush_order->bpp / 8) * 8;
- if(stream_get_left(s) < scanline * 8)
+ if (stream_get_left(s) < scanline * 8)
return FALSE;
for (i = 7; i >= 0; i--)
BOOL deleteListPresent;
OFFSCREEN_DELETE_LIST* deleteList;
- if(stream_get_left(s) < 6)
+ if (stream_get_left(s) < 6)
return FALSE;
stream_read_UINT16(s, flags); /* flags (2 bytes) */
create_offscreen_bitmap->id = flags & 0x7FFF;
if (deleteListPresent)
{
int i;
- if(stream_get_left(s) < 2)
+ if (stream_get_left(s) < 2)
return FALSE;
stream_read_UINT16(s, deleteList->cIndices);
deleteList->indices = realloc(deleteList->indices, deleteList->sIndices * 2);
}
- if(stream_get_left(s) < 2 * deleteList->cIndices)
+ if (stream_get_left(s) < 2 * deleteList->cIndices)
return FALSE;
for (i = 0; i < (int) deleteList->cIndices; i++)
BOOL update_read_switch_surface_order(STREAM* s, SWITCH_SURFACE_ORDER* switch_surface)
{
- if(stream_get_left(s) < 2)
+ if (stream_get_left(s) < 2)
return FALSE;
stream_read_UINT16(s, switch_surface->bitmapId); /* bitmapId (2 bytes) */
return TRUE;
{
NINE_GRID_BITMAP_INFO* nineGridInfo;
- if(stream_get_left(s) < 19)
+ if (stream_get_left(s) < 19)
return FALSE;
stream_read_BYTE(s, create_nine_grid_bitmap->bitmapBpp); /* bitmapBpp (1 byte) */
stream_read_UINT16(s, create_nine_grid_bitmap->bitmapId); /* bitmapId (2 bytes) */
BOOL update_read_frame_marker_order(STREAM* s, FRAME_MARKER_ORDER* frame_marker)
{
- if(stream_get_left(s) < 4)
+ if (stream_get_left(s) < 4)
return FALSE;
stream_read_UINT32(s, frame_marker->action); /* action (4 bytes) */
return TRUE;
BOOL update_read_stream_bitmap_first_order(STREAM* s, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first)
{
- if(stream_get_left(s) < 10) // 8 + 2 at least
+ if (stream_get_left(s) < 10) // 8 + 2 at least
return FALSE;
stream_read_BYTE(s, stream_bitmap_first->bitmapFlags); /* bitmapFlags (1 byte) */
stream_read_BYTE(s, stream_bitmap_first->bitmapBpp); /* bitmapBpp (1 byte) */
stream_read_UINT16(s, stream_bitmap_first->bitmapHeight); /* bitmapHeigth (2 bytes) */
if (stream_bitmap_first->bitmapFlags & STREAM_BITMAP_V2) {
- if(stream_get_left(s) < 4)
+ if (stream_get_left(s) < 4)
return FALSE;
stream_read_UINT32(s, stream_bitmap_first->bitmapSize); /* bitmapSize (4 bytes) */
} else {
- if(stream_get_left(s) < 2)
+ if (stream_get_left(s) < 2)
return FALSE;
stream_read_UINT16(s, stream_bitmap_first->bitmapSize); /* bitmapSize (2 bytes) */
}
BOOL update_read_stream_bitmap_next_order(STREAM* s, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_next)
{
- if(stream_get_left(s) < 5)
+ if (stream_get_left(s) < 5)
return FALSE;
stream_read_BYTE(s, stream_bitmap_next->bitmapFlags); /* bitmapFlags (1 byte) */
stream_read_UINT16(s, stream_bitmap_next->bitmapType); /* bitmapType (2 bytes) */
BOOL update_read_draw_gdiplus_first_order(STREAM* s, DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first)
{
- if(stream_get_left(s) < 11)
+ if (stream_get_left(s) < 11)
return FALSE;
stream_seek_BYTE(s); /* pad1Octet (1 byte) */
stream_read_UINT16(s, draw_gdiplus_first->cbSize); /* cbSize (2 bytes) */
BOOL update_read_draw_gdiplus_next_order(STREAM* s, DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next)
{
- if(stream_get_left(s) < 3)
+ if (stream_get_left(s) < 3)
return FALSE;
stream_seek_BYTE(s); /* pad1Octet (1 byte) */
FIELD_SKIP_BUFFER16(s, draw_gdiplus_next->cbSize); /* cbSize(2 bytes) + emfRecords */
BOOL update_read_draw_gdiplus_end_order(STREAM* s, DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end)
{
- if(stream_get_left(s) < 11)
+ if (stream_get_left(s) < 11)
return FALSE;
stream_seek_BYTE(s); /* pad1Octet (1 byte) */
stream_read_UINT16(s, draw_gdiplus_end->cbSize); /* cbSize (2 bytes) */
BOOL update_read_draw_gdiplus_cache_first_order(STREAM* s, DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first)
{
- if(stream_get_left(s) < 11)
+ if (stream_get_left(s) < 11)
return FALSE;
stream_read_BYTE(s, draw_gdiplus_cache_first->flags); /* flags (1 byte) */
stream_read_UINT16(s, draw_gdiplus_cache_first->cacheType); /* cacheType (2 bytes) */
BOOL update_read_draw_gdiplus_cache_next_order(STREAM* s, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next)
{
- if(stream_get_left(s) < 7)
+ if (stream_get_left(s) < 7)
return FALSE;
stream_read_BYTE(s, draw_gdiplus_cache_next->flags); /* flags (1 byte) */
stream_read_UINT16(s, draw_gdiplus_cache_next->cacheType); /* cacheType (2 bytes) */
BOOL update_read_draw_gdiplus_cache_end_order(STREAM* s, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end)
{
- if(stream_get_left(s) < 11)
+ if (stream_get_left(s) < 11)
return FALSE;
stream_read_BYTE(s, draw_gdiplus_cache_end->flags); /* flags (1 byte) */
stream_read_UINT16(s, draw_gdiplus_cache_end->cacheType); /* cacheType (2 bytes) */
fieldBytes = 0;
}
- if(stream_get_left(s) < fieldBytes)
+ if (stream_get_left(s) < fieldBytes)
return FALSE;
*fieldFlags = 0;
{
BYTE flags;
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
stream_read_BYTE(s, flags); /* field flags */
}
else if (flags & BOUND_DELTA_TOP)
{
- if(!update_read_coord(s, &bounds->top, TRUE))
+ if (!update_read_coord(s, &bounds->top, TRUE))
return FALSE;
}
if (flags & BOUND_RIGHT)
{
- if(!update_read_coord(s, &bounds->right, FALSE))
+ if (!update_read_coord(s, &bounds->right, FALSE))
return FALSE;
}
else if (flags & BOUND_DELTA_RIGHT)
{
- if(!update_read_coord(s, &bounds->right, TRUE))
+ if (!update_read_coord(s, &bounds->right, TRUE))
return FALSE;
}
if (flags & BOUND_BOTTOM)
{
- if(!update_read_coord(s, &bounds->bottom, FALSE))
+ if (!update_read_coord(s, &bounds->bottom, FALSE))
return FALSE;
}
else if (flags & BOUND_DELTA_BOTTOM)
{
- if(!update_read_coord(s, &bounds->bottom, TRUE))
+ if (!update_read_coord(s, &bounds->bottom, TRUE))
return FALSE;
}
return TRUE;
rdpContext* context = update->context;
rdpSecondaryUpdate* secondary = update->secondary;
- if(stream_get_left(s) < 5)
+ if (stream_get_left(s) < 5)
return FALSE;
stream_read_UINT16(s, orderLength); /* orderLength (2 bytes) */
stream_read_UINT16(s, extraFlags); /* extraFlags (2 bytes) */
case ORDER_TYPE_CACHE_GLYPH:
if (secondary->glyph_v2)
{
- if(!update_read_cache_glyph_v2_order(s, &(secondary->cache_glyph_v2_order), extraFlags))
+ if (!update_read_cache_glyph_v2_order(s, &(secondary->cache_glyph_v2_order), extraFlags))
return FALSE;
IFCALL(secondary->CacheGlyphV2, context, &(secondary->cache_glyph_v2_order));
}
else
{
- if(!update_read_cache_glyph_order(s, &(secondary->cache_glyph_order), extraFlags))
+ if (!update_read_cache_glyph_order(s, &(secondary->cache_glyph_order), extraFlags))
return FALSE;
IFCALL(secondary->CacheGlyph, context, &(secondary->cache_glyph_order));
}
break;
case ORDER_TYPE_CACHE_BRUSH:
- if(!update_read_cache_brush_order(s, &(secondary->cache_brush_order), extraFlags))
+ if (!update_read_cache_brush_order(s, &(secondary->cache_brush_order), extraFlags))
return FALSE;
IFCALL(secondary->CacheBrush, context, &(secondary->cache_brush_order));
break;
switch (orderType)
{
case ORDER_TYPE_CREATE_OFFSCREEN_BITMAP:
- if(!update_read_create_offscreen_bitmap_order(s, &(altsec->create_offscreen_bitmap)))
+ if (!update_read_create_offscreen_bitmap_order(s, &(altsec->create_offscreen_bitmap)))
return FALSE;
IFCALL(altsec->CreateOffscreenBitmap, context, &(altsec->create_offscreen_bitmap));
break;
case ORDER_TYPE_SWITCH_SURFACE:
- if(!update_read_switch_surface_order(s, &(altsec->switch_surface)))
+ if (!update_read_switch_surface_order(s, &(altsec->switch_surface)))
return FALSE;
IFCALL(altsec->SwitchSurface, context, &(altsec->switch_surface));
break;
case ORDER_TYPE_CREATE_NINE_GRID_BITMAP:
- if(!update_read_create_nine_grid_bitmap_order(s, &(altsec->create_nine_grid_bitmap)))
+ if (!update_read_create_nine_grid_bitmap_order(s, &(altsec->create_nine_grid_bitmap)))
return FALSE;
IFCALL(altsec->CreateNineGridBitmap, context, &(altsec->create_nine_grid_bitmap));
break;
case ORDER_TYPE_FRAME_MARKER:
- if(!update_read_frame_marker_order(s, &(altsec->frame_marker)))
+ if (!update_read_frame_marker_order(s, &(altsec->frame_marker)))
return FALSE;
IFCALL(altsec->FrameMarker, context, &(altsec->frame_marker));
break;
case ORDER_TYPE_STREAM_BITMAP_FIRST:
- if(!update_read_stream_bitmap_first_order(s, &(altsec->stream_bitmap_first)))
+ if (!update_read_stream_bitmap_first_order(s, &(altsec->stream_bitmap_first)))
return FALSE;
IFCALL(altsec->StreamBitmapFirst, context, &(altsec->stream_bitmap_first));
break;
case ORDER_TYPE_STREAM_BITMAP_NEXT:
- if(!update_read_stream_bitmap_next_order(s, &(altsec->stream_bitmap_next)))
+ if (!update_read_stream_bitmap_next_order(s, &(altsec->stream_bitmap_next)))
return FALSE;
IFCALL(altsec->StreamBitmapNext, context, &(altsec->stream_bitmap_next));
break;
case ORDER_TYPE_GDIPLUS_FIRST:
- if(!update_read_draw_gdiplus_first_order(s, &(altsec->draw_gdiplus_first)))
+ if (!update_read_draw_gdiplus_first_order(s, &(altsec->draw_gdiplus_first)))
return FALSE;
IFCALL(altsec->DrawGdiPlusFirst, context, &(altsec->draw_gdiplus_first));
break;
case ORDER_TYPE_GDIPLUS_NEXT:
- if(!update_read_draw_gdiplus_next_order(s, &(altsec->draw_gdiplus_next)))
+ if (!update_read_draw_gdiplus_next_order(s, &(altsec->draw_gdiplus_next)))
return FALSE;
IFCALL(altsec->DrawGdiPlusNext, context, &(altsec->draw_gdiplus_next));
break;
case ORDER_TYPE_GDIPLUS_END:
- if(update_read_draw_gdiplus_end_order(s, &(altsec->draw_gdiplus_end)))
+ if (update_read_draw_gdiplus_end_order(s, &(altsec->draw_gdiplus_end)))
return FALSE;
IFCALL(altsec->DrawGdiPlusEnd, context, &(altsec->draw_gdiplus_end));
break;
case ORDER_TYPE_GDIPLUS_CACHE_FIRST:
- if(!update_read_draw_gdiplus_cache_first_order(s, &(altsec->draw_gdiplus_cache_first)))
+ if (!update_read_draw_gdiplus_cache_first_order(s, &(altsec->draw_gdiplus_cache_first)))
return FALSE;
IFCALL(altsec->DrawGdiPlusCacheFirst, context, &(altsec->draw_gdiplus_cache_first));
break;
case ORDER_TYPE_GDIPLUS_CACHE_NEXT:
- if(!update_read_draw_gdiplus_cache_next_order(s, &(altsec->draw_gdiplus_cache_next)))
+ if (!update_read_draw_gdiplus_cache_next_order(s, &(altsec->draw_gdiplus_cache_next)))
return FALSE;
IFCALL(altsec->DrawGdiPlusCacheNext, context, &(altsec->draw_gdiplus_cache_next));
break;
case ORDER_TYPE_GDIPLUS_CACHE_END:
- if(!update_read_draw_gdiplus_cache_end_order(s, &(altsec->draw_gdiplus_cache_end)))
+ if (!update_read_draw_gdiplus_cache_end_order(s, &(altsec->draw_gdiplus_cache_end)))
return FALSE;
IFCALL(altsec->DrawGdiPlusCacheEnd, context, &(altsec->draw_gdiplus_cache_end));
break;
{
BYTE controlFlags;
- if(stream_get_left(s) < 1)
+ if (stream_get_left(s) < 1)
return FALSE;
+
stream_read_BYTE(s, controlFlags); /* controlFlags (1 byte) */
if (!(controlFlags & ORDER_STANDARD))