mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
Merge pull request #11258 from akallabeth/unused-fixes
[warnings] fix -Wunused-macro
This commit is contained in:
commit
dcebd0cb2b
@ -71,10 +71,6 @@ static BOOL wlf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
|
||||
wlfContext* wlf = (wlfContext*)context;
|
||||
wlfPointer* ptr = (wlfPointer*)pointer;
|
||||
void* data = NULL;
|
||||
UINT32 w = 0;
|
||||
UINT32 h = 0;
|
||||
UINT32 x = 0;
|
||||
UINT32 y = 0;
|
||||
size_t size = 0;
|
||||
UwacReturnCode rc = UWAC_ERROR_INTERNAL;
|
||||
BOOL res = FALSE;
|
||||
@ -83,10 +79,10 @@ static BOOL wlf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
|
||||
if (!wlf || !wlf->seat)
|
||||
return FALSE;
|
||||
|
||||
x = pointer->xPos;
|
||||
y = pointer->yPos;
|
||||
w = pointer->width;
|
||||
h = pointer->height;
|
||||
UINT32 x = pointer->xPos;
|
||||
UINT32 y = pointer->yPos;
|
||||
UINT32 w = pointer->width;
|
||||
UINT32 h = pointer->height;
|
||||
|
||||
if (!wlf_scale_coordinates(context, &x, &y, FALSE) ||
|
||||
!wlf_scale_coordinates(context, &w, &h, FALSE))
|
||||
@ -148,7 +144,7 @@ static BOOL wlf_Pointer_SetPosition(WINPR_ATTR_UNUSED rdpContext* context,
|
||||
WINPR_ATTR_UNUSED UINT32 x, WINPR_ATTR_UNUSED UINT32 y)
|
||||
{
|
||||
// TODO
|
||||
WLog_ERR("TODO", "TODO: implement");
|
||||
WLog_ERR(TAG, "TODO: implement");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -77,15 +77,15 @@
|
||||
// #define VGIDS_SE_ALGOID_CT_RSA_4096 0x09
|
||||
|
||||
#define VGIDS_SE_ALGOID_DST_PAD_PKCS1 0x40
|
||||
#define VGIDS_SE_ALGOID_DST_RSA_1024 0x06
|
||||
#define VGIDS_SE_ALGOID_DST_RSA_2048 0x07
|
||||
#define VGIDS_SE_ALGOID_DST_RSA_3072 0x08
|
||||
#define VGIDS_SE_ALGOID_DST_RSA_4096 0x09
|
||||
#define VGIDS_SE_ALGOID_DST_ECDSA_P192 0x0A
|
||||
#define VGIDS_SE_ALGOID_DST_ECDSA_P224 0x0B
|
||||
#define VGIDS_SE_ALGOID_DST_ECDSA_P256 0x0C
|
||||
#define VGIDS_SE_ALGOID_DST_ECDSA_P384 0x0D
|
||||
#define VGIDS_SE_ALGOID_DST_ECDSA_P512 0x0E
|
||||
// #define VGIDS_SE_ALGOID_DST_RSA_1024 0x06
|
||||
// #define VGIDS_SE_ALGOID_DST_RSA_2048 0x07
|
||||
// #define VGIDS_SE_ALGOID_DST_RSA_3072 0x08
|
||||
// #define VGIDS_SE_ALGOID_DST_RSA_4096 0x09
|
||||
// #define VGIDS_SE_ALGOID_DST_ECDSA_P192 0x0A
|
||||
// #define VGIDS_SE_ALGOID_DST_ECDSA_P224 0x0B
|
||||
// #define VGIDS_SE_ALGOID_DST_ECDSA_P256 0x0C
|
||||
// #define VGIDS_SE_ALGOID_DST_ECDSA_P384 0x0D
|
||||
// #define VGIDS_SE_ALGOID_DST_ECDSA_P512 0x0E
|
||||
|
||||
#define VGIDS_DEFAULT_KEY_REF 0x81
|
||||
|
||||
|
@ -33,12 +33,6 @@
|
||||
|
||||
static primitives_t* generic = NULL;
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define GNU_INLINE __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
#else
|
||||
#define GNU_INLINE
|
||||
#endif
|
||||
|
||||
#define CACHE_LINE_BYTES 64
|
||||
|
||||
/* 1.403 << 14 */
|
||||
@ -85,19 +79,23 @@ static inline __m128i mm_between_epi16_int(__m128i val, __m128i min, __m128i max
|
||||
|
||||
#define mm_between_epi16(_val, _min, _max) (_val) = mm_between_epi16_int((_val), (_min), (_max))
|
||||
|
||||
#ifdef DO_PREFETCH
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static inline void GNU_INLINE _mm_prefetch_buffer(char* WINPR_RESTRICT buffer, int num_bytes)
|
||||
static inline void mm_prefetch_buffer(const void* WINPR_RESTRICT buffer, size_t width,
|
||||
size_t stride, size_t height)
|
||||
{
|
||||
__m128i* buf = (__m128i*)buffer;
|
||||
const size_t srcbump = stride / sizeof(__m128i);
|
||||
const __m128i* buf = (const __m128i*)buffer;
|
||||
|
||||
for (unsigned int i = 0; i < (num_bytes / sizeof(__m128i));
|
||||
i += (CACHE_LINE_BYTES / sizeof(__m128i)))
|
||||
for (size_t y = 0; y < height; y++)
|
||||
{
|
||||
_mm_prefetch((char*)(&buf[i]), _MM_HINT_NTA);
|
||||
const __m128i* line = &buf[y * srcbump];
|
||||
for (size_t x = 0; x < width * sizeof(INT16) / sizeof(__m128i);
|
||||
x += (CACHE_LINE_BYTES / sizeof(__m128i)))
|
||||
{
|
||||
const char* ptr = (const char*)&line[x];
|
||||
_mm_prefetch(ptr, _MM_HINT_NTA);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* DO_PREFETCH */
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static pstatus_t
|
||||
@ -133,28 +131,11 @@ sse2_yCbCrToRGB_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], int srcStep,
|
||||
__m128i c4096 = _mm_set1_epi16(4096);
|
||||
const size_t srcbump = WINPR_ASSERTING_INT_CAST(size_t, srcStep) / sizeof(__m128i);
|
||||
const size_t dstbump = WINPR_ASSERTING_INT_CAST(size_t, dstStep) / sizeof(__m128i);
|
||||
#ifdef DO_PREFETCH
|
||||
|
||||
/* Prefetch Y's, Cb's, and Cr's. */
|
||||
for (UINT32 yp = 0; yp < roi->height; yp++)
|
||||
{
|
||||
for (int i = 0; i < roi->width * sizeof(INT16) / sizeof(__m128i);
|
||||
i += (CACHE_LINE_BYTES / sizeof(__m128i)))
|
||||
{
|
||||
_mm_prefetch((char*)(&y_buf[i]), _MM_HINT_NTA);
|
||||
_mm_prefetch((char*)(&cb_buf[i]), _MM_HINT_NTA);
|
||||
_mm_prefetch((char*)(&cr_buf[i]), _MM_HINT_NTA);
|
||||
}
|
||||
mm_prefetch_buffer(y_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
mm_prefetch_buffer(cb_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
mm_prefetch_buffer(cr_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
|
||||
y_buf += srcbump;
|
||||
cb_buf += srcbump;
|
||||
cr_buf += srcbump;
|
||||
}
|
||||
|
||||
y_buf = (__m128i*)(pSrc[0]);
|
||||
cb_buf = (__m128i*)(pSrc[1]);
|
||||
cr_buf = (__m128i*)(pSrc[2]);
|
||||
#endif /* DO_PREFETCH */
|
||||
const size_t imax = roi->width * sizeof(INT16) / sizeof(__m128i);
|
||||
|
||||
for (UINT32 yp = 0; yp < roi->height; ++yp)
|
||||
@ -246,27 +227,10 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* WINPR_RESTRICT pSrc[3],
|
||||
const size_t imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
|
||||
BYTE* d_buf = pDst;
|
||||
const size_t dstPad = (dstStep - roi->width * 4);
|
||||
#ifdef DO_PREFETCH
|
||||
|
||||
/* Prefetch Y's, Cb's, and Cr's. */
|
||||
for (UINT32 yp = 0; yp < roi->height; yp++)
|
||||
{
|
||||
for (size_t i = 0; i < imax; i += (CACHE_LINE_BYTES / sizeof(__m128i)))
|
||||
{
|
||||
_mm_prefetch((char*)(&((__m128i*)y_buf)[i]), _MM_HINT_NTA);
|
||||
_mm_prefetch((char*)(&((__m128i*)cb_buf)[i]), _MM_HINT_NTA);
|
||||
_mm_prefetch((char*)(&((__m128i*)cr_buf)[i]), _MM_HINT_NTA);
|
||||
}
|
||||
|
||||
y_buf += srcStep / sizeof(INT16);
|
||||
cb_buf += srcStep / sizeof(INT16);
|
||||
cr_buf += srcStep / sizeof(INT16);
|
||||
}
|
||||
|
||||
y_buf = (INT16*)pSrc[0];
|
||||
cb_buf = (INT16*)pSrc[1];
|
||||
cr_buf = (INT16*)pSrc[2];
|
||||
#endif /* DO_PREFETCH */
|
||||
mm_prefetch_buffer(y_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
mm_prefetch_buffer(cr_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
mm_prefetch_buffer(cb_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
|
||||
for (UINT32 yp = 0; yp < roi->height; ++yp)
|
||||
{
|
||||
@ -432,27 +396,10 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* WINPR_RESTRICT pSrc[3],
|
||||
const size_t imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
|
||||
BYTE* d_buf = pDst;
|
||||
const size_t dstPad = (dstStep - roi->width * 4);
|
||||
#ifdef DO_PREFETCH
|
||||
|
||||
/* Prefetch Y's, Cb's, and Cr's. */
|
||||
for (UINT32 yp = 0; yp < roi->height; yp++)
|
||||
{
|
||||
for (size_t i = 0; i < imax; i += (CACHE_LINE_BYTES / sizeof(__m128i)))
|
||||
{
|
||||
_mm_prefetch((char*)(&((__m128i*)y_buf)[i]), _MM_HINT_NTA);
|
||||
_mm_prefetch((char*)(&((__m128i*)cb_buf)[i]), _MM_HINT_NTA);
|
||||
_mm_prefetch((char*)(&((__m128i*)cr_buf)[i]), _MM_HINT_NTA);
|
||||
}
|
||||
|
||||
y_buf += srcStep / sizeof(INT16);
|
||||
cb_buf += srcStep / sizeof(INT16);
|
||||
cr_buf += srcStep / sizeof(INT16);
|
||||
}
|
||||
|
||||
y_buf = (INT16*)(pSrc[0]);
|
||||
cb_buf = (INT16*)(pSrc[1]);
|
||||
cr_buf = (INT16*)(pSrc[2]);
|
||||
#endif /* DO_PREFETCH */
|
||||
mm_prefetch_buffer(y_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
mm_prefetch_buffer(cb_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
mm_prefetch_buffer(cr_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
|
||||
for (UINT32 yp = 0; yp < roi->height; ++yp)
|
||||
{
|
||||
@ -657,28 +604,11 @@ sse2_RGBToYCbCr_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], int srcStep,
|
||||
__m128i cr_b = _mm_set1_epi16(-2663); /* -0.081282 << 15 */
|
||||
const size_t srcbump = WINPR_ASSERTING_INT_CAST(size_t, srcStep) / sizeof(__m128i);
|
||||
const size_t dstbump = WINPR_ASSERTING_INT_CAST(size_t, dstStep) / sizeof(__m128i);
|
||||
#ifdef DO_PREFETCH
|
||||
|
||||
/* Prefetch RGB's. */
|
||||
for (UINT32 yp = 0; yp < roi->height; yp++)
|
||||
{
|
||||
for (int i = 0; i < roi->width * sizeof(INT16) / sizeof(__m128i);
|
||||
i += (CACHE_LINE_BYTES / sizeof(__m128i)))
|
||||
{
|
||||
_mm_prefetch((char*)(&r_buf[i]), _MM_HINT_NTA);
|
||||
_mm_prefetch((char*)(&g_buf[i]), _MM_HINT_NTA);
|
||||
_mm_prefetch((char*)(&b_buf[i]), _MM_HINT_NTA);
|
||||
}
|
||||
mm_prefetch_buffer(r_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
mm_prefetch_buffer(g_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
mm_prefetch_buffer(b_buf, roi->width, (size_t)srcStep, roi->height);
|
||||
|
||||
r_buf += srcbump;
|
||||
g_buf += srcbump;
|
||||
b_buf += srcbump;
|
||||
}
|
||||
|
||||
r_buf = (__m128i*)(pSrc[0]);
|
||||
g_buf = (__m128i*)(pSrc[1]);
|
||||
b_buf = (__m128i*)(pSrc[2]);
|
||||
#endif /* DO_PREFETCH */
|
||||
const size_t imax = roi->width * sizeof(INT16) / sizeof(__m128i);
|
||||
|
||||
for (UINT32 yp = 0; yp < roi->height; ++yp)
|
||||
|
@ -29,8 +29,6 @@
|
||||
#include <freerdp/codec/color.h>
|
||||
|
||||
#if defined(SSE_AVX_INTRINSICS_ENABLED)
|
||||
#define TAG FREERDP_TAG("primitives.copy")
|
||||
|
||||
#include <emmintrin.h>
|
||||
#include <immintrin.h>
|
||||
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <freerdp/codec/color.h>
|
||||
|
||||
#if defined(SSE_AVX_INTRINSICS_ENABLED)
|
||||
#define TAG FREERDP_TAG("primitives.copy")
|
||||
|
||||
#include <emmintrin.h>
|
||||
#include <immintrin.h>
|
||||
|
||||
|
@ -43,6 +43,7 @@
|
||||
#cmakedefine WITH_DEBUG_EVENTS
|
||||
#cmakedefine WITH_DEBUG_MUTEX
|
||||
|
||||
#cmakedefine WINPR_UTILS_IMAGE_DIBv5 /** @since version 3.13.0 */
|
||||
#cmakedefine WINPR_UTILS_IMAGE_WEBP /** @since version 3.3.0 */
|
||||
#cmakedefine WINPR_UTILS_IMAGE_PNG /** @since version 3.3.0 */
|
||||
#cmakedefine WINPR_UTILS_IMAGE_JPEG /** @since version 3.3.0 */
|
||||
|
@ -27,6 +27,9 @@
|
||||
#include "../utils/image.h"
|
||||
#include "clipboard.h"
|
||||
|
||||
#include "../log.h"
|
||||
#define TAG WINPR_TAG("clipboard.synthetic")
|
||||
|
||||
static const char* mime_bitmap[] = { "image/bmp", "image/x-bmp", "image/x-MS-bmp",
|
||||
"image/x-win-bitmap" };
|
||||
|
||||
@ -233,10 +236,15 @@ static void* clipboard_synthesize_cf_dib(wClipboard* clipboard, UINT32 formatId,
|
||||
BYTE* pDstData = NULL;
|
||||
SrcSize = *pSize;
|
||||
|
||||
#if defined(WINPR_UTILS_IMAGE_DIBv5)
|
||||
if (formatId == CF_DIBV5)
|
||||
{
|
||||
WLog_WARN(TAG, "[DIB] Unsupported destination format %s",
|
||||
ClipboardGetFormatName(clipboard, formatId));
|
||||
}
|
||||
else if (is_format_bitmap(clipboard, formatId))
|
||||
else
|
||||
#endif
|
||||
if (is_format_bitmap(clipboard, formatId))
|
||||
{
|
||||
WINPR_BITMAP_FILE_HEADER pFileHeader = { 0 };
|
||||
wStream sbuffer = { 0 };
|
||||
@ -255,6 +263,11 @@ static void* clipboard_synthesize_cf_dib(wClipboard* clipboard, UINT32 formatId,
|
||||
*pSize = DstSize;
|
||||
return pDstData;
|
||||
}
|
||||
else
|
||||
{
|
||||
WLog_WARN(TAG, "[DIB] Unsupported destination format %s",
|
||||
ClipboardGetFormatName(clipboard, formatId));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -264,20 +277,50 @@ static void* clipboard_synthesize_cf_dib(wClipboard* clipboard, UINT32 formatId,
|
||||
*
|
||||
* BITMAPV5HEADER structure followed by the bitmap color space information and the bitmap bits.
|
||||
*/
|
||||
|
||||
#if defined(WINPR_UTILS_IMAGE_DIBv5)
|
||||
static void* clipboard_synthesize_cf_dibv5(wClipboard* clipboard, UINT32 formatId,
|
||||
WINPR_ATTR_UNUSED const void* data,
|
||||
WINPR_ATTR_UNUSED UINT32* pSize)
|
||||
{
|
||||
if (formatId == CF_DIB)
|
||||
{
|
||||
WLog_WARN(TAG, "[DIBv5] Unsupported destination format %s",
|
||||
ClipboardGetFormatName(clipboard, formatId));
|
||||
}
|
||||
else if (is_format_bitmap(clipboard, formatId))
|
||||
{
|
||||
WLog_WARN(TAG, "[DIBv5] Unsupported destination format %s",
|
||||
ClipboardGetFormatName(clipboard, formatId));
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOL handled = FALSE;
|
||||
#if defined(WINPR_UTILS_IMAGE_PNG)
|
||||
{
|
||||
const UINT32 altFormatId = ClipboardRegisterFormat(clipboard, mime_png);
|
||||
if (formatId == altFormatId)
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(WINPR_UTILS_IMAGE_JPEG)
|
||||
{
|
||||
const UINT32 altFormatId = ClipboardRegisterFormat(clipboard, mime_jpeg);
|
||||
if (formatId == altFormatId)
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!handled)
|
||||
{
|
||||
WLog_WARN(TAG, "[DIBv5] Unsupported destination format %s",
|
||||
ClipboardGetFormatName(clipboard, formatId));
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void* clipboard_prepend_bmp_header(const WINPR_BITMAP_INFO_HEADER* pInfoHeader,
|
||||
const void* data, size_t size, UINT32* pSize)
|
||||
@ -347,8 +390,17 @@ static void* clipboard_synthesize_image_bmp(WINPR_ATTR_UNUSED wClipboard* clipbo
|
||||
|
||||
return clipboard_prepend_bmp_header(&header, data, SrcSize, pSize);
|
||||
}
|
||||
#if defined(WINPR_UTILS_IMAGE_DIBv5)
|
||||
else if (formatId == CF_DIBV5)
|
||||
{
|
||||
WLog_WARN(TAG, "[BMP] Unsupported destination format %s",
|
||||
ClipboardGetFormatName(clipboard, formatId));
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
WLog_WARN(TAG, "[BMP] Unsupported destination format %s",
|
||||
ClipboardGetFormatName(clipboard, formatId));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -726,7 +778,9 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard)
|
||||
* CF_DIB
|
||||
*/
|
||||
{
|
||||
#if defined(WINPR_UTILS_IMAGE_DIBv5)
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIB, CF_DIBV5, clipboard_synthesize_cf_dibv5);
|
||||
#endif
|
||||
for (size_t x = 0; x < ARRAYSIZE(mime_bitmap); x++)
|
||||
{
|
||||
const char* mime = mime_bitmap[x];
|
||||
@ -741,8 +795,7 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard)
|
||||
/**
|
||||
* CF_DIBV5
|
||||
*/
|
||||
|
||||
if (0)
|
||||
#if defined(WINPR_UTILS_IMAGE_DIBv5)
|
||||
{
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIBV5, CF_DIB, clipboard_synthesize_cf_dib);
|
||||
|
||||
@ -756,6 +809,7 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard)
|
||||
clipboard_synthesize_image_bmp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* image/bmp
|
||||
@ -767,8 +821,10 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard)
|
||||
if (altFormatId == 0)
|
||||
continue;
|
||||
ClipboardRegisterSynthesizer(clipboard, altFormatId, CF_DIB, clipboard_synthesize_cf_dib);
|
||||
#if defined(WINPR_UTILS_IMAGE_DIBv5)
|
||||
ClipboardRegisterSynthesizer(clipboard, altFormatId, CF_DIBV5,
|
||||
clipboard_synthesize_cf_dibv5);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -779,12 +835,14 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard)
|
||||
const UINT32 altFormatId = ClipboardRegisterFormat(clipboard, mime_png);
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIB, altFormatId,
|
||||
clipboard_synthesize_image_bmp_to_png);
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIBV5, altFormatId,
|
||||
clipboard_synthesize_image_bmp_to_png);
|
||||
ClipboardRegisterSynthesizer(clipboard, altFormatId, CF_DIB,
|
||||
clipboard_synthesize_image_png_to_bmp);
|
||||
#if defined(WINPR_UTILS_IMAGE_DIBv5)
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIBV5, altFormatId,
|
||||
clipboard_synthesize_image_bmp_to_png);
|
||||
ClipboardRegisterSynthesizer(clipboard, altFormatId, CF_DIBV5,
|
||||
clipboard_synthesize_image_png_to_bmp);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -796,12 +854,14 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard)
|
||||
const UINT32 altFormatId = ClipboardRegisterFormat(clipboard, mime_webp);
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIB, altFormatId,
|
||||
clipboard_synthesize_image_bmp_to_webp);
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIBV5, altFormatId,
|
||||
clipboard_synthesize_image_webp_to_bmp);
|
||||
ClipboardRegisterSynthesizer(clipboard, altFormatId, CF_DIB,
|
||||
clipboard_synthesize_image_webp_to_bmp);
|
||||
#if defined(WINPR_UTILS_IMAGE_DIBv5)
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIBV5, altFormatId,
|
||||
clipboard_synthesize_image_bmp_to_webp);
|
||||
ClipboardRegisterSynthesizer(clipboard, altFormatId, CF_DIBV5,
|
||||
clipboard_synthesize_image_webp_to_bmp);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -813,12 +873,14 @@ BOOL ClipboardInitSynthesizers(wClipboard* clipboard)
|
||||
const UINT32 altFormatId = ClipboardRegisterFormat(clipboard, mime_jpeg);
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIB, altFormatId,
|
||||
clipboard_synthesize_image_bmp_to_jpeg);
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIBV5, altFormatId,
|
||||
clipboard_synthesize_image_jpeg_to_bmp);
|
||||
ClipboardRegisterSynthesizer(clipboard, altFormatId, CF_DIB,
|
||||
clipboard_synthesize_image_bmp_to_jpeg);
|
||||
clipboard_synthesize_image_jpeg_to_bmp);
|
||||
#if defined(WINPR_UTILS_IMAGE_DIBv5)
|
||||
ClipboardRegisterSynthesizer(clipboard, altFormatId, CF_DIBV5,
|
||||
clipboard_synthesize_image_jpeg_to_bmp);
|
||||
ClipboardRegisterSynthesizer(clipboard, CF_DIBV5, altFormatId,
|
||||
clipboard_synthesize_image_bmp_to_jpeg);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -38,10 +38,6 @@
|
||||
#include "../log.h"
|
||||
#define TAG WINPR_TAG("crt")
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#if defined(WITH_URIPARSER)
|
||||
char* winpr_str_url_decode(const char* str, size_t len)
|
||||
{
|
||||
|
@ -29,17 +29,10 @@
|
||||
#include <winpr/error.h>
|
||||
#include <winpr/print.h>
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) (a) < (b) ? (a) : (b)
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
#include "unicode.h"
|
||||
|
||||
#include "../log.h"
|
||||
#define TAG WINPR_TAG("unicode")
|
||||
|
||||
/**
|
||||
* Notes on cross-platform Unicode portability:
|
||||
*
|
||||
|
@ -29,10 +29,6 @@
|
||||
#include <winpr/error.h>
|
||||
#include <winpr/print.h>
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) (a) < (b) ? (a) : (b)
|
||||
#endif
|
||||
|
||||
#include <unicode/ucnv.h>
|
||||
#include <unicode/ustring.h>
|
||||
|
||||
|
@ -535,35 +535,33 @@ BOOL winpr_Digest_Init_Allow_FIPS(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md)
|
||||
switch (md)
|
||||
{
|
||||
case WINPR_MD_MD5:
|
||||
{
|
||||
#if defined(WITH_INTERNAL_MD5)
|
||||
winpr_MD5_Init(&ctx->md5);
|
||||
return TRUE;
|
||||
#else
|
||||
break;
|
||||
#elif defined(WITH_OPENSSL)
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
#if !defined(WITH_INTERNAL_MD5)
|
||||
if (md == WINPR_MD_MD5)
|
||||
{
|
||||
EVP_MD* md5 = EVP_MD_fetch(NULL, "MD5", "fips=no");
|
||||
BOOL rc = winpr_Digest_Init_Internal(ctx, md5);
|
||||
EVP_MD_free(md5);
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
const EVP_MD* evp = winpr_openssl_get_evp_md(md);
|
||||
EVP_MD_CTX_set_flags(ctx->mdctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
|
||||
return winpr_Digest_Init_Internal(ctx, evp);
|
||||
#elif defined(WITH_MBEDTLS)
|
||||
return winpr_Digest_Init_Internal(ctx, md);
|
||||
#endif
|
||||
}
|
||||
default:
|
||||
WLog_ERR(TAG, "Invalid FIPS digest %s requested", winpr_md_type_to_string(md));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if defined(WITH_OPENSSL)
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
#if !defined(WITH_INTERNAL_MD5)
|
||||
if (md == WINPR_MD_MD5)
|
||||
{
|
||||
EVP_MD* md5 = EVP_MD_fetch(NULL, "MD5", "fips=no");
|
||||
BOOL rc = winpr_Digest_Init_Internal(ctx, md5);
|
||||
EVP_MD_free(md5);
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
const EVP_MD* evp = winpr_openssl_get_evp_md(md);
|
||||
EVP_MD_CTX_set_flags(ctx->mdctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
|
||||
return winpr_Digest_Init_Internal(ctx, evp);
|
||||
#elif defined(WITH_MBEDTLS)
|
||||
return winpr_Digest_Init_Internal(ctx, md);
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOL winpr_Digest_Init(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md)
|
||||
|
@ -24,17 +24,12 @@
|
||||
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/library.h>
|
||||
#include <winpr/wlog.h>
|
||||
#include <winpr/nt.h>
|
||||
#include <winpr/endian.h>
|
||||
|
||||
#include "../log.h"
|
||||
#define TAG WINPR_TAG("nt")
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
#include <pthread.h>
|
||||
#include <winpr/crt.h>
|
||||
|
||||
#include "../handle/handle.h"
|
||||
|
||||
|
@ -27,7 +27,9 @@
|
||||
#include <winpr/path.h>
|
||||
#include <winpr/file.h>
|
||||
|
||||
#if defined(WITH_RESOURCE_VERSIONING)
|
||||
#define STR(x) #x
|
||||
#endif
|
||||
|
||||
#define PATH_SLASH_CHR '/'
|
||||
#define PATH_SLASH_STR "/"
|
||||
@ -59,18 +61,6 @@
|
||||
#define PATH_SEPARATOR_STR_W PATH_SLASH_STR_W
|
||||
#endif
|
||||
|
||||
#define SHARED_LIBRARY_EXT_DLL "dll"
|
||||
#define SHARED_LIBRARY_EXT_SO "so"
|
||||
#define SHARED_LIBRARY_EXT_DYLIB "dylib"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_DLL
|
||||
#elif defined(__APPLE__)
|
||||
#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_DYLIB
|
||||
#else
|
||||
#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_SO
|
||||
#endif
|
||||
|
||||
#include "../log.h"
|
||||
#define TAG WINPR_TAG("path")
|
||||
|
||||
|
@ -34,8 +34,10 @@
|
||||
|
||||
#include "ntlm_av_pairs.h"
|
||||
|
||||
#if defined(WITH_DEBUG_NTLM)
|
||||
#include "../../log.h"
|
||||
#define TAG WINPR_TAG("sspi.NTLM")
|
||||
#endif
|
||||
|
||||
static BOOL ntlm_av_pair_get_next_offset(const NTLM_AV_PAIR* pAvPair, size_t size, size_t* pOffset);
|
||||
|
||||
|
@ -26,9 +26,11 @@
|
||||
#define SSPI_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#include <winpr/winpr.h>
|
||||
#if defined(SSPI_DLL)
|
||||
#define SEC_ENTRY
|
||||
#define SSPI_EXPORT WINPR_API
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef long LONG;
|
||||
|
@ -84,9 +84,6 @@ static const SecurityFunctionTableW_NAME SecurityFunctionTableW_NAME_LIST[] = {
|
||||
{ BUFFER_NAME_LIST_W[4], &SCHANNEL_SecurityFunctionTableW }
|
||||
};
|
||||
|
||||
#define SecHandle_LOWER_MAX 0xFFFFFFFF
|
||||
#define SecHandle_UPPER_MAX 0xFFFFFFFE
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void* contextBuffer;
|
||||
|
@ -670,10 +670,10 @@ UINT64 winpr_GetUnixTimeNS(void)
|
||||
#define D_BIT_SSE (1 << 25)
|
||||
#define D_BIT_SSE2 (1 << 26)
|
||||
#define D_BIT_3DN (1 << 30)
|
||||
#define C_BIT_SSE3 (1 << 0)
|
||||
// #define C_BIT_SSE3 (1 << 0)
|
||||
#define C_BIT_PCLMULQDQ (1 << 1)
|
||||
#define C81_BIT_LZCNT (1 << 5)
|
||||
#define C_BIT_3DNP (1 << 8)
|
||||
// #define C_BIT_3DNP (1 << 8)
|
||||
#define C_BIT_3DNP (1 << 8)
|
||||
#define C_BIT_SSSE3 (1 << 9)
|
||||
#define C_BIT_SSE41 (1 << 19)
|
||||
|
@ -32,10 +32,6 @@
|
||||
|
||||
#define TAG WINPR_TAG("timezone")
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#include "TimeZoneNameMap.h"
|
||||
#include "TimeZoneIanaAbbrevMap.h"
|
||||
|
||||
|
@ -36,6 +36,7 @@ if(WITH_LODEPNG)
|
||||
winpr_library_add_private(${lodepng_LIBRARIES})
|
||||
endif()
|
||||
|
||||
option(WINPR_UTILS_IMAGE_DIBv5 "[experimental] Add DIBv5 <--> BMP conversion support to clipboard" OFF)
|
||||
option(WINPR_UTILS_IMAGE_PNG "Add PNG <--> BMP conversion support to clipboard" OFF)
|
||||
if(WINPR_UTILS_IMAGE_PNG)
|
||||
find_package(PNG REQUIRED)
|
||||
|
@ -56,41 +56,7 @@ WINPR_PRAGMA_DIAG_POP
|
||||
#include <winpr/wlog.h>
|
||||
#include <winpr/debug.h>
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) (a) < (b) ? (a) : (b)
|
||||
#endif
|
||||
|
||||
#define TAG "com.winpr.utils.debug"
|
||||
#define LOGT(...) \
|
||||
do \
|
||||
{ \
|
||||
WLog_Print(WLog_Get(TAG), WLOG_TRACE, __VA_ARGS__); \
|
||||
} while (0)
|
||||
#define LOGD(...) \
|
||||
do \
|
||||
{ \
|
||||
WLog_Print(WLog_Get(TAG), WLOG_DEBUG, __VA_ARGS__); \
|
||||
} while (0)
|
||||
#define LOGI(...) \
|
||||
do \
|
||||
{ \
|
||||
WLog_Print(WLog_Get(TAG), WLOG_INFO, __VA_ARGS__); \
|
||||
} while (0)
|
||||
#define LOGW(...) \
|
||||
do \
|
||||
{ \
|
||||
WLog_Print(WLog_Get(TAG), WLOG_WARN, __VA_ARGS__); \
|
||||
} while (0)
|
||||
#define LOGE(...) \
|
||||
do \
|
||||
{ \
|
||||
WLog_Print(WLog_Get(TAG), WLOG_ERROR, __VA_ARGS__); \
|
||||
} while (0)
|
||||
#define LOGF(...) \
|
||||
do \
|
||||
{ \
|
||||
WLog_Print(WLog_Get(TAG), WLOG_FATAL, __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
static const char* support_msg = "Invalid stacktrace buffer! check if platform is supported!";
|
||||
|
||||
@ -109,7 +75,7 @@ void winpr_backtrace_free(void* buffer)
|
||||
winpr_win_backtrace_free(buffer);
|
||||
#else
|
||||
free(buffer);
|
||||
LOGF(support_msg);
|
||||
WLog_FATAL(TAG, "%s", support_msg);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -124,7 +90,7 @@ void* winpr_backtrace(DWORD size)
|
||||
#elif (defined(_WIN32) || defined(_WIN64)) && !defined(_UWP)
|
||||
return winpr_win_backtrace(size);
|
||||
#else
|
||||
LOGF(support_msg);
|
||||
WLog_FATAL(TAG, "%s", support_msg);
|
||||
/* return a non NULL buffer to allow the backtrace function family to succeed without failing
|
||||
*/
|
||||
return _strdup(support_msg);
|
||||
@ -138,7 +104,7 @@ char** winpr_backtrace_symbols(void* buffer, size_t* used)
|
||||
|
||||
if (!buffer)
|
||||
{
|
||||
LOGF(support_msg);
|
||||
WLog_FATAL(TAG, "%s", support_msg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -151,7 +117,7 @@ char** winpr_backtrace_symbols(void* buffer, size_t* used)
|
||||
#elif (defined(_WIN32) || defined(_WIN64)) && !defined(_UWP)
|
||||
return winpr_win_backtrace_symbols(buffer, used);
|
||||
#else
|
||||
LOGF(support_msg);
|
||||
WLog_FATAL(TAG, "%s", support_msg);
|
||||
|
||||
/* We return a char** on heap that is compatible with free:
|
||||
*
|
||||
@ -177,7 +143,7 @@ void winpr_backtrace_symbols_fd(void* buffer, int fd)
|
||||
{
|
||||
if (!buffer)
|
||||
{
|
||||
LOGF(support_msg);
|
||||
WLog_FATAL(TAG, "%s", support_msg);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -196,7 +162,7 @@ void winpr_backtrace_symbols_fd(void* buffer, int fd)
|
||||
free((void*)lines);
|
||||
}
|
||||
#else
|
||||
LOGF(support_msg);
|
||||
WLog_FATAL(TAG, "%s", support_msg);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,6 @@
|
||||
|
||||
#include <winpr/file.h>
|
||||
|
||||
#include "../../log.h"
|
||||
#define TAG WINPR_TAG("utils.wlog")
|
||||
|
||||
BOOL WLog_DataMessage_Write(const char* filename, const void* data, size_t length)
|
||||
{
|
||||
FILE* fp = NULL;
|
||||
@ -36,10 +33,7 @@ BOOL WLog_DataMessage_Write(const char* filename, const void* data, size_t lengt
|
||||
fp = winpr_fopen(filename, "w+b");
|
||||
|
||||
if (!fp)
|
||||
{
|
||||
// WLog_ERR(TAG, "failed to open file %s", filename);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (fwrite(data, length, 1, fp) != 1)
|
||||
ret = FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user