示例#1
0
void update_pointer_color(rdpContext* context, POINTER_COLOR_UPDATE* pointer_color)
{
	rdpPointer* pointer;
	rdpCache* cache = context->cache;

	pointer = Pointer_Alloc(context);

	if (pointer != NULL)
	{
		pointer->xorBpp = 24;
		pointer->xPos = pointer_color->xPos;
		pointer->yPos = pointer_color->yPos;
		pointer->width = pointer_color->width;
		pointer->height = pointer_color->height;
		pointer->lengthAndMask = pointer_color->lengthAndMask;
		pointer->lengthXorMask = pointer_color->lengthXorMask;

		if (pointer->lengthAndMask && pointer_color->xorMaskData)
		{
			pointer->andMaskData = (BYTE*) malloc(pointer->lengthAndMask);
			CopyMemory(pointer->andMaskData, pointer_color->andMaskData, pointer->lengthAndMask);
		}

		if (pointer->lengthXorMask && pointer_color->xorMaskData)
		{
			pointer->xorMaskData = (BYTE*) malloc(pointer->lengthXorMask);
			CopyMemory(pointer->xorMaskData, pointer_color->xorMaskData, pointer->lengthXorMask);
		}
		pointer->New(context, pointer);
		pointer_cache_put(cache->pointer, pointer_color->cacheIndex, pointer);
		Pointer_Set(context, pointer);
	}
}
示例#2
0
static BOOL update_pointer_new(rdpContext* context,
                               const POINTER_NEW_UPDATE* pointer_new)
{
	rdpPointer* pointer;
	rdpCache* cache;

	if (!context || !pointer_new)
		return FALSE;

	cache = context->cache;
	pointer = Pointer_Alloc(context);

	if (!pointer)
		return FALSE;

	pointer->xorBpp = pointer_new->xorBpp;
	pointer->xPos = pointer_new->colorPtrAttr.xPos;
	pointer->yPos = pointer_new->colorPtrAttr.yPos;
	pointer->width = pointer_new->colorPtrAttr.width;
	pointer->height = pointer_new->colorPtrAttr.height;
	pointer->lengthAndMask = pointer_new->colorPtrAttr.lengthAndMask;
	pointer->lengthXorMask = pointer_new->colorPtrAttr.lengthXorMask;

	if (pointer->lengthAndMask)
	{
		pointer->andMaskData = (BYTE*) malloc(pointer->lengthAndMask);

		if (!pointer->andMaskData)
			goto out_fail;

		CopyMemory(pointer->andMaskData, pointer_new->colorPtrAttr.andMaskData,
		           pointer->lengthAndMask);
	}

	if (pointer->lengthXorMask)
	{
		pointer->xorMaskData = (BYTE*) malloc(pointer->lengthXorMask);

		if (!pointer->xorMaskData)
			goto out_fail;

		CopyMemory(pointer->xorMaskData, pointer_new->colorPtrAttr.xorMaskData,
		           pointer->lengthXorMask);
	}

	if (!pointer->New(context, pointer))
		goto out_fail;

	if (!pointer_cache_put(cache->pointer, pointer_new->colorPtrAttr.cacheIndex,
	                       pointer))
		goto out_fail;

	return pointer->Set(context, pointer);
out_fail:
	pointer_free(context, pointer);
	return FALSE;
}
示例#3
0
static BOOL update_pointer_color(rdpContext* context,
                                 const POINTER_COLOR_UPDATE* pointer_color)
{
	rdpPointer* pointer;
	rdpCache* cache = context->cache;
	pointer = Pointer_Alloc(context);

	if (pointer != NULL)
	{
		pointer->xorBpp = 24;
		pointer->xPos = pointer_color->xPos;
		pointer->yPos = pointer_color->yPos;
		pointer->width = pointer_color->width;
		pointer->height = pointer_color->height;
		pointer->lengthAndMask = pointer_color->lengthAndMask;
		pointer->lengthXorMask = pointer_color->lengthXorMask;

		if (pointer->lengthAndMask && pointer_color->xorMaskData)
		{
			pointer->andMaskData = (BYTE*) malloc(pointer->lengthAndMask);

			if (!pointer->andMaskData)
				goto out_fail;

			CopyMemory(pointer->andMaskData, pointer_color->andMaskData,
			           pointer->lengthAndMask);
		}

		if (pointer->lengthXorMask && pointer_color->xorMaskData)
		{
			pointer->xorMaskData = (BYTE*) malloc(pointer->lengthXorMask);

			if (!pointer->xorMaskData)
				goto out_fail;

			CopyMemory(pointer->xorMaskData, pointer_color->xorMaskData,
			           pointer->lengthXorMask);
		}

		if (!pointer->New(context, pointer))
			goto out_fail;

		if (!pointer_cache_put(cache->pointer, pointer_color->cacheIndex, pointer))
			goto out_fail;

		return pointer->Set(context, pointer);
	}

	return FALSE;
out_fail:
	pointer_free(context, pointer);
	return FALSE;
}
示例#4
0
文件: pointer.c 项目: C4rt/FreeRDP
BOOL update_pointer_new(rdpContext* context, POINTER_NEW_UPDATE* pointer_new)
{
	rdpPointer* pointer;
	rdpCache* cache = context->cache;

	pointer = Pointer_Alloc(context);

	if (pointer != NULL)
	{
		pointer->xorBpp = pointer_new->xorBpp;
		pointer->xPos = pointer_new->colorPtrAttr.xPos;
		pointer->yPos = pointer_new->colorPtrAttr.yPos;
		pointer->width = pointer_new->colorPtrAttr.width;
		pointer->height = pointer_new->colorPtrAttr.height;
		pointer->lengthAndMask = pointer_new->colorPtrAttr.lengthAndMask;
		pointer->lengthXorMask = pointer_new->colorPtrAttr.lengthXorMask;

		pointer->andMaskData = pointer->xorMaskData = NULL;

		if (pointer->lengthAndMask)
		{
			pointer->andMaskData = (BYTE*) malloc(pointer->lengthAndMask);
			if (!pointer->andMaskData)
				goto out_fail;
			CopyMemory(pointer->andMaskData, pointer_new->colorPtrAttr.andMaskData, pointer->lengthAndMask);
		}

		if (pointer->lengthXorMask)
		{
			pointer->xorMaskData = (BYTE*) malloc(pointer->lengthXorMask);
			CopyMemory(pointer->xorMaskData, pointer_new->colorPtrAttr.xorMaskData, pointer->lengthXorMask);
		}

		pointer->New(context, pointer);
		pointer_cache_put(cache->pointer, pointer_new->colorPtrAttr.cacheIndex, pointer);
		Pointer_Set(context, pointer);
		return TRUE;
	}
	return FALSE;

out_fail:
	free(pointer->andMaskData);
	free(pointer->xorMaskData);
	free(pointer);
	return FALSE;
}
示例#5
0
void update_pointer_new(rdpContext* context, POINTER_NEW_UPDATE* pointer_new)
{
	rdpPointer* pointer;
	rdpCache* cache = context->cache;

	pointer = Pointer_Alloc(context);

	if (pointer != NULL)
	{
		pointer->xorBpp = pointer_new->xorBpp;
		pointer->xPos = pointer_new->colorPtrAttr.xPos;
		pointer->yPos = pointer_new->colorPtrAttr.yPos;
		pointer->width = pointer_new->colorPtrAttr.width;
		pointer->height = pointer_new->colorPtrAttr.height;
		pointer->lengthAndMask = pointer_new->colorPtrAttr.lengthAndMask;
		pointer->lengthXorMask = pointer_new->colorPtrAttr.lengthXorMask;
		pointer->xorMaskData = pointer_new->colorPtrAttr.xorMaskData;
		pointer->andMaskData = pointer_new->colorPtrAttr.andMaskData;

		pointer->New(context, pointer);
		pointer_cache_put(cache->pointer, pointer_new->colorPtrAttr.cacheIndex, pointer);
		Pointer_Set(context, pointer);
	}
}