Ejemplo n.º 1
0
void bulk_free(rdpBulk* bulk)
{
    if (!bulk)
        return;

    mppc_context_free(bulk->mppcSend);
    mppc_context_free(bulk->mppcRecv);
    ncrush_context_free(bulk->ncrushRecv);
    ncrush_context_free(bulk->ncrushSend);
    xcrush_context_free(bulk->xcrushRecv);
    xcrush_context_free(bulk->xcrushSend);
    free(bulk);
}
Ejemplo n.º 2
0
int test_XCrushCompressBells()
{
	int status;
	UINT32 Flags;
	UINT32 SrcSize;
	BYTE* pSrcData;
	UINT32 DstSize;
	BYTE* pDstData;
	UINT32 expectedSize;
	BYTE OutputBuffer[65536];
	XCRUSH_CONTEXT* xcrush;

	xcrush = xcrush_context_new(TRUE);

	SrcSize = sizeof(TEST_BELLS_DATA) - 1;
	pSrcData = (BYTE*) TEST_BELLS_DATA;
	expectedSize = sizeof(TEST_BELLS_DATA_XCRUSH) - 1;

	pDstData = OutputBuffer;
	DstSize = sizeof(OutputBuffer);
	ZeroMemory(OutputBuffer, sizeof(OutputBuffer));

	status = xcrush_compress(xcrush, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);

	printf("status: %d Flags: 0x%04X DstSize: %d\n", status, Flags, DstSize);

	if (DstSize != expectedSize)
	{
		printf("XCrushCompressBells: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize);

		printf("Actual\n");
		BitDump(pDstData, DstSize * 8, 0);

		printf("Expected\n");
		BitDump(TEST_BELLS_DATA_XCRUSH, expectedSize * 8, 0);

		return -1;
	}

	if (memcmp(pDstData, TEST_BELLS_DATA_XCRUSH, DstSize) != 0)
	{
		printf("XCrushCompressBells: output mismatch\n");

		printf("Actual\n");
		BitDump(pDstData, DstSize * 8, 0);

		printf("Expected\n");
		BitDump(TEST_BELLS_DATA_XCRUSH, expectedSize * 8, 0);

		return -1;
	}

	xcrush_context_free(xcrush);

	return 1;
}