Merge pull request #10531 from akallabeth/warning-fixes-cast
Warning fixes cast
This commit is contained in:
commit
b91c768867
@ -350,7 +350,7 @@ static UINT audin_alsa_parse_addin_args(AudinALSADevice* device, const ADDIN_ARG
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
DWORD flags = 0;
|
DWORD flags = 0;
|
||||||
const COMMAND_LINE_ARGUMENT_A* arg = NULL;
|
const COMMAND_LINE_ARGUMENT_A* arg = NULL;
|
||||||
AudinALSADevice* alsa = (AudinALSADevice*)device;
|
AudinALSADevice* alsa = device;
|
||||||
COMMAND_LINE_ARGUMENT_A audin_alsa_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>",
|
COMMAND_LINE_ARGUMENT_A audin_alsa_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>",
|
||||||
NULL, NULL, -1, NULL, "audio device name" },
|
NULL, NULL, -1, NULL, "audio device name" },
|
||||||
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } };
|
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } };
|
||||||
|
@ -386,7 +386,7 @@ static UINT audin_oss_parse_addin_args(AudinOSSDevice* device, const ADDIN_ARGV*
|
|||||||
char* eptr = NULL;
|
char* eptr = NULL;
|
||||||
DWORD flags = 0;
|
DWORD flags = 0;
|
||||||
const COMMAND_LINE_ARGUMENT_A* arg = NULL;
|
const COMMAND_LINE_ARGUMENT_A* arg = NULL;
|
||||||
AudinOSSDevice* oss = (AudinOSSDevice*)device;
|
AudinOSSDevice* oss = device;
|
||||||
COMMAND_LINE_ARGUMENT_A audin_oss_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>",
|
COMMAND_LINE_ARGUMENT_A audin_oss_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>",
|
||||||
NULL, NULL, -1, NULL, "audio device name" },
|
NULL, NULL, -1, NULL, "audio device name" },
|
||||||
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } };
|
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } };
|
||||||
|
@ -455,7 +455,7 @@ static UINT audin_pulse_parse_addin_args(AudinPulseDevice* device, const ADDIN_A
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
DWORD flags = 0;
|
DWORD flags = 0;
|
||||||
const COMMAND_LINE_ARGUMENT_A* arg = NULL;
|
const COMMAND_LINE_ARGUMENT_A* arg = NULL;
|
||||||
AudinPulseDevice* pulse = (AudinPulseDevice*)device;
|
AudinPulseDevice* pulse = device;
|
||||||
COMMAND_LINE_ARGUMENT_A audin_pulse_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>",
|
COMMAND_LINE_ARGUMENT_A audin_pulse_args[] = { { "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>",
|
||||||
NULL, NULL, -1, NULL, "audio device name" },
|
NULL, NULL, -1, NULL, "audio device name" },
|
||||||
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } };
|
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } };
|
||||||
|
@ -48,7 +48,7 @@ static void* freerdp_channels_find_static_entry_in_table(const STATIC_ENTRY_TABL
|
|||||||
const char* identifier)
|
const char* identifier)
|
||||||
{
|
{
|
||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
const STATIC_ENTRY* pEntry = (const STATIC_ENTRY*)&table->table[index++];
|
const STATIC_ENTRY* pEntry = &table->table[index++];
|
||||||
|
|
||||||
while (pEntry->entry != NULL)
|
while (pEntry->entry != NULL)
|
||||||
{
|
{
|
||||||
@ -57,7 +57,7 @@ static void* freerdp_channels_find_static_entry_in_table(const STATIC_ENTRY_TABL
|
|||||||
return (void*)pEntry->entry;
|
return (void*)pEntry->entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
pEntry = (const STATIC_ENTRY*)&table->table[index++];
|
pEntry = &table->table[index++];
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -412,8 +412,8 @@ static UINT disp_server_open(DispServerContext* context)
|
|||||||
|
|
||||||
priv->SessionId = (DWORD)*pSessionId;
|
priv->SessionId = (DWORD)*pSessionId;
|
||||||
WTSFreeMemory(pSessionId);
|
WTSFreeMemory(pSessionId);
|
||||||
priv->disp_channel = (HANDLE)WTSVirtualChannelOpenEx(priv->SessionId, DISP_DVC_CHANNEL_NAME,
|
priv->disp_channel =
|
||||||
WTS_CHANNEL_OPTION_DYNAMIC);
|
WTSVirtualChannelOpenEx(priv->SessionId, DISP_DVC_CHANNEL_NAME, WTS_CHANNEL_OPTION_DYNAMIC);
|
||||||
|
|
||||||
if (!priv->disp_channel)
|
if (!priv->disp_channel)
|
||||||
{
|
{
|
||||||
|
@ -1371,7 +1371,7 @@ static UINT drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cb
|
|||||||
"process_close_request: Sp=%d cbChId=%d, ChannelId=%" PRIu32 "", Sp, cbChId,
|
"process_close_request: Sp=%d cbChId=%d, ChannelId=%" PRIu32 "", Sp, cbChId,
|
||||||
ChannelId);
|
ChannelId);
|
||||||
|
|
||||||
channel = (DVCMAN_CHANNEL*)dvcman_get_channel_by_id(drdynvc->channel_mgr, ChannelId, TRUE);
|
channel = dvcman_get_channel_by_id(drdynvc->channel_mgr, ChannelId, TRUE);
|
||||||
if (!channel)
|
if (!channel)
|
||||||
{
|
{
|
||||||
WLog_Print(drdynvc->log, WLOG_ERROR, "dvcman_close_request channel %" PRIu32 " not present",
|
WLog_Print(drdynvc->log, WLOG_ERROR, "dvcman_close_request channel %" PRIu32 " not present",
|
||||||
|
@ -1469,7 +1469,7 @@ out_close:
|
|||||||
|
|
||||||
static BOOL rail_server_stop(RailServerContext* context)
|
static BOOL rail_server_stop(RailServerContext* context)
|
||||||
{
|
{
|
||||||
RailServerPrivate* priv = (RailServerPrivate*)context->priv;
|
RailServerPrivate* priv = context->priv;
|
||||||
|
|
||||||
if (priv->thread)
|
if (priv->thread)
|
||||||
{
|
{
|
||||||
|
@ -1249,7 +1249,7 @@ static UINT rdpdr_send_client_announce_reply(rdpdrPlugin* rdpdr)
|
|||||||
Stream_Write_UINT16(s, PAKID_CORE_CLIENTID_CONFIRM); /* PacketId (2 bytes) */
|
Stream_Write_UINT16(s, PAKID_CORE_CLIENTID_CONFIRM); /* PacketId (2 bytes) */
|
||||||
Stream_Write_UINT16(s, rdpdr->clientVersionMajor);
|
Stream_Write_UINT16(s, rdpdr->clientVersionMajor);
|
||||||
Stream_Write_UINT16(s, rdpdr->clientVersionMinor);
|
Stream_Write_UINT16(s, rdpdr->clientVersionMinor);
|
||||||
Stream_Write_UINT32(s, (UINT32)rdpdr->clientID);
|
Stream_Write_UINT32(s, rdpdr->clientID);
|
||||||
return rdpdr_send(rdpdr, s);
|
return rdpdr_send(rdpdr, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1296,7 +1296,7 @@ static UINT rdpdr_send_client_name_request(rdpdrPlugin* rdpdr)
|
|||||||
Stream_Write_UINT32(s, 0); /* codePage, must be set to zero */
|
Stream_Write_UINT32(s, 0); /* codePage, must be set to zero */
|
||||||
Stream_Write_UINT32(s,
|
Stream_Write_UINT32(s,
|
||||||
(UINT32)computerNameLenW); /* computerNameLen, including null terminator */
|
(UINT32)computerNameLenW); /* computerNameLen, including null terminator */
|
||||||
Stream_Write(s, computerNameW, (size_t)computerNameLenW);
|
Stream_Write(s, computerNameW, computerNameLenW);
|
||||||
free(computerNameW);
|
free(computerNameW);
|
||||||
return rdpdr_send(rdpdr, s);
|
return rdpdr_send(rdpdr, s);
|
||||||
}
|
}
|
||||||
@ -1859,7 +1859,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s)
|
|||||||
UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s)
|
UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s)
|
||||||
{
|
{
|
||||||
UINT status = 0;
|
UINT status = 0;
|
||||||
rdpdrPlugin* plugin = (rdpdrPlugin*)rdpdr;
|
rdpdrPlugin* plugin = rdpdr;
|
||||||
|
|
||||||
if (!s)
|
if (!s)
|
||||||
{
|
{
|
||||||
|
@ -80,7 +80,7 @@ static void evict_cache_slots(RdpgfxClientContext* context, UINT16 MaxCacheSlots
|
|||||||
if (CacheSlots[index])
|
if (CacheSlots[index])
|
||||||
{
|
{
|
||||||
RDPGFX_EVICT_CACHE_ENTRY_PDU pdu = { 0 };
|
RDPGFX_EVICT_CACHE_ENTRY_PDU pdu = { 0 };
|
||||||
pdu.cacheSlot = (UINT16)index + 1;
|
pdu.cacheSlot = index + 1;
|
||||||
|
|
||||||
if (context && context->EvictCacheEntry)
|
if (context && context->EvictCacheEntry)
|
||||||
{
|
{
|
||||||
@ -743,7 +743,7 @@ static UINT rdpgfx_save_persistent_cache(RDPGFX_PLUGIN* gfx)
|
|||||||
{
|
{
|
||||||
if (gfx->CacheSlots[idx])
|
if (gfx->CacheSlots[idx])
|
||||||
{
|
{
|
||||||
UINT16 cacheSlot = (UINT16)idx;
|
UINT16 cacheSlot = idx;
|
||||||
|
|
||||||
if (context->ExportCacheEntry(context, cacheSlot, &cacheEntry) != CHANNEL_RC_OK)
|
if (context->ExportCacheEntry(context, cacheSlot, &cacheEntry) != CHANNEL_RC_OK)
|
||||||
continue;
|
continue;
|
||||||
|
@ -1526,7 +1526,7 @@ static DWORD WINAPI rdpgfx_server_thread_func(LPVOID arg)
|
|||||||
static BOOL rdpgfx_server_open(RdpgfxServerContext* context)
|
static BOOL rdpgfx_server_open(RdpgfxServerContext* context)
|
||||||
{
|
{
|
||||||
WINPR_ASSERT(context);
|
WINPR_ASSERT(context);
|
||||||
RdpgfxServerPrivate* priv = (RdpgfxServerPrivate*)context->priv;
|
RdpgfxServerPrivate* priv = context->priv;
|
||||||
void* buffer = NULL;
|
void* buffer = NULL;
|
||||||
|
|
||||||
WINPR_ASSERT(priv);
|
WINPR_ASSERT(priv);
|
||||||
@ -1625,7 +1625,7 @@ BOOL rdpgfx_server_close(RdpgfxServerContext* context)
|
|||||||
{
|
{
|
||||||
WINPR_ASSERT(context);
|
WINPR_ASSERT(context);
|
||||||
|
|
||||||
RdpgfxServerPrivate* priv = (RdpgfxServerPrivate*)context->priv;
|
RdpgfxServerPrivate* priv = context->priv;
|
||||||
WINPR_ASSERT(priv);
|
WINPR_ASSERT(priv);
|
||||||
|
|
||||||
if (priv->ownThread && priv->thread)
|
if (priv->ownThread && priv->thread)
|
||||||
|
@ -862,8 +862,8 @@ static UINT rdpsnd_server_start(RdpsndServerContext* context)
|
|||||||
{
|
{
|
||||||
priv->SessionId = (DWORD)*pSessionId;
|
priv->SessionId = (DWORD)*pSessionId;
|
||||||
WTSFreeMemory(pSessionId);
|
WTSFreeMemory(pSessionId);
|
||||||
priv->ChannelHandle = (HANDLE)WTSVirtualChannelOpenEx(
|
priv->ChannelHandle = WTSVirtualChannelOpenEx(priv->SessionId, RDPSND_DVC_CHANNEL_NAME,
|
||||||
priv->SessionId, RDPSND_DVC_CHANNEL_NAME, WTS_CHANNEL_OPTION_DYNAMIC);
|
WTS_CHANNEL_OPTION_DYNAMIC);
|
||||||
if (!priv->ChannelHandle)
|
if (!priv->ChannelHandle)
|
||||||
{
|
{
|
||||||
WLog_ERR(TAG, "Open audio dynamic virtual channel (%s) failed!",
|
WLog_ERR(TAG, "Open audio dynamic virtual channel (%s) failed!",
|
||||||
|
@ -583,10 +583,9 @@ static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample)
|
|||||||
|
|
||||||
if (temp_stream->major_type == TSMF_MAJOR_TYPE_AUDIO)
|
if (temp_stream->major_type == TSMF_MAJOR_TYPE_AUDIO)
|
||||||
{
|
{
|
||||||
UINT64 video_time =
|
UINT64 video_time = stream->decoder->GetRunningTime(stream->decoder);
|
||||||
(UINT64)stream->decoder->GetRunningTime(stream->decoder);
|
|
||||||
UINT64 audio_time =
|
UINT64 audio_time =
|
||||||
(UINT64)temp_stream->decoder->GetRunningTime(temp_stream->decoder);
|
temp_stream->decoder->GetRunningTime(temp_stream->decoder);
|
||||||
UINT64 max_adjust = VIDEO_ADJUST_MAX;
|
UINT64 max_adjust = VIDEO_ADJUST_MAX;
|
||||||
|
|
||||||
if (video_time < audio_time)
|
if (video_time < audio_time)
|
||||||
|
@ -1446,7 +1446,7 @@ static int libusb_udev_cancel_transfer_request(IUDEVICE* idev, UINT32 RequestId)
|
|||||||
|
|
||||||
if (transfer)
|
if (transfer)
|
||||||
{
|
{
|
||||||
URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*)pdev->urbdrc;
|
URBDRC_PLUGIN* urbdrc = pdev->urbdrc;
|
||||||
|
|
||||||
rc = func_cancel_xact_request(urbdrc, transfer);
|
rc = func_cancel_xact_request(urbdrc, transfer);
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ static size_t udevman_register_udevice(IUDEVMAN* idevman, BYTE bus_number, BYTE
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
urbdrc = (URBDRC_PLUGIN*)idevman->plugin;
|
urbdrc = (URBDRC_PLUGIN*)idevman->plugin;
|
||||||
pdev = (IUDEVICE*)udevman_get_udevice_by_addr(idevman, bus_number, dev_number);
|
pdev = udevman_get_udevice_by_addr(idevman, bus_number, dev_number);
|
||||||
|
|
||||||
if (pdev != NULL)
|
if (pdev != NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -577,7 +577,7 @@ static UINT urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback
|
|||||||
if (urbdrc->udevman == NULL)
|
if (urbdrc->udevman == NULL)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
udevman = (IUDEVMAN*)urbdrc->udevman;
|
udevman = urbdrc->udevman;
|
||||||
|
|
||||||
if (!Stream_CheckAndLogRequiredLength(TAG, data, 12))
|
if (!Stream_CheckAndLogRequiredLength(TAG, data, 12))
|
||||||
return ERROR_INVALID_DATA;
|
return ERROR_INVALID_DATA;
|
||||||
|
@ -2239,7 +2239,7 @@ xf_cliprdr_server_format_data_response(CliprdrClientContext* context,
|
|||||||
DEBUG_CLIPRDR("requested format 0x%08" PRIx32 " [%s] {local 0x%08" PRIx32 "} [%s]",
|
DEBUG_CLIPRDR("requested format 0x%08" PRIx32 " [%s] {local 0x%08" PRIx32 "} [%s]",
|
||||||
format->formatToRequest, ClipboardGetFormatIdString(format->formatToRequest),
|
format->formatToRequest, ClipboardGetFormatIdString(format->formatToRequest),
|
||||||
format->localFormat, format->formatName);
|
format->localFormat, format->formatName);
|
||||||
SrcSize = (UINT32)size;
|
SrcSize = size;
|
||||||
|
|
||||||
DEBUG_CLIPRDR("srcFormatId: %u, dstFormatId: %u", srcFormatId, dstFormatId);
|
DEBUG_CLIPRDR("srcFormatId: %u, dstFormatId: %u", srcFormatId, dstFormatId);
|
||||||
|
|
||||||
|
@ -956,8 +956,8 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, const XPropertyEvent* event,
|
|||||||
* when the window has been minimized, maximized, restored locally
|
* when the window has been minimized, maximized, restored locally
|
||||||
* ie. not using the buttons on the rail window itself
|
* ie. not using the buttons on the rail window itself
|
||||||
*/
|
*/
|
||||||
if ((((Atom)event->atom == xfc->_NET_WM_STATE) && (event->state != PropertyDelete)) ||
|
if (((event->atom == xfc->_NET_WM_STATE) && (event->state != PropertyDelete)) ||
|
||||||
(((Atom)event->atom == xfc->WM_STATE) && (event->state != PropertyDelete)))
|
((event->atom == xfc->WM_STATE) && (event->state != PropertyDelete)))
|
||||||
{
|
{
|
||||||
BOOL status = FALSE;
|
BOOL status = FALSE;
|
||||||
BOOL minimized = FALSE;
|
BOOL minimized = FALSE;
|
||||||
@ -975,7 +975,7 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, const XPropertyEvent* event,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Atom)event->atom == xfc->_NET_WM_STATE)
|
if (event->atom == xfc->_NET_WM_STATE)
|
||||||
{
|
{
|
||||||
status = xf_GetWindowProperty(xfc, event->window, xfc->_NET_WM_STATE, 12, &nitems,
|
status = xf_GetWindowProperty(xfc, event->window, xfc->_NET_WM_STATE, 12, &nitems,
|
||||||
&bytes, &prop);
|
&bytes, &prop);
|
||||||
@ -1010,7 +1010,7 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, const XPropertyEvent* event,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Atom)event->atom == xfc->WM_STATE)
|
if (event->atom == xfc->WM_STATE)
|
||||||
{
|
{
|
||||||
status =
|
status =
|
||||||
xf_GetWindowProperty(xfc, event->window, xfc->WM_STATE, 1, &nitems, &bytes, &prop);
|
xf_GetWindowProperty(xfc, event->window, xfc->WM_STATE, 1, &nitems, &bytes, &prop);
|
||||||
|
@ -391,7 +391,7 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight)
|
|||||||
{
|
{
|
||||||
MONITOR_ATTRIBUTES* attrs = NULL;
|
MONITOR_ATTRIBUTES* attrs = NULL;
|
||||||
|
|
||||||
if (!xf_is_monitor_id_active(xfc, (UINT32)i))
|
if (!xf_is_monitor_id_active(xfc, i))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!vscreen->monitors)
|
if (!vscreen->monitors)
|
||||||
@ -437,7 +437,7 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((UINT32)i == nr)
|
if (i == nr)
|
||||||
{
|
{
|
||||||
monitor->is_primary = TRUE;
|
monitor->is_primary = TRUE;
|
||||||
if (!freerdp_settings_set_uint32(settings, FreeRDP_MonitorLocalShiftX, monitor->x))
|
if (!freerdp_settings_set_uint32(settings, FreeRDP_MonitorLocalShiftX, monitor->x))
|
||||||
|
@ -862,7 +862,7 @@ BOOL freerdp_client_add_static_channel(rdpSettings* settings, size_t count, cons
|
|||||||
if (freerdp_static_channel_collection_find(settings, params[0]))
|
if (freerdp_static_channel_collection_find(settings, params[0]))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
_args = freerdp_addin_argv_new(count, (const char**)params);
|
_args = freerdp_addin_argv_new(count, params);
|
||||||
|
|
||||||
if (!_args)
|
if (!_args)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1371,7 +1371,7 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
buffer = (char*)calloc((size_t)(size + 1), sizeof(char));
|
buffer = (char*)calloc((size_t)(size + 1), sizeof(char));
|
||||||
|
|
||||||
if (freerdp_client_write_rdp_file_buffer(file, buffer, (size_t)size + 1) != size)
|
if (freerdp_client_write_rdp_file_buffer(file, buffer, size + 1) != size)
|
||||||
{
|
{
|
||||||
WLog_ERR(TAG, "freerdp_client_write_rdp_file: error writing to output buffer");
|
WLog_ERR(TAG, "freerdp_client_write_rdp_file: error writing to output buffer");
|
||||||
free(buffer);
|
free(buffer);
|
||||||
@ -1408,7 +1408,7 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fwrite(buffer, 1, (size_t)size, fp) != (size_t)size)
|
if (fwrite(buffer, 1, size, fp) != size)
|
||||||
{
|
{
|
||||||
free(buffer);
|
free(buffer);
|
||||||
(void)fclose(fp);
|
(void)fclose(fp);
|
||||||
|
11
libfreerdp/cache/glyph.c
vendored
11
libfreerdp/cache/glyph.c
vendored
@ -644,9 +644,6 @@ const void* glyph_cache_fragment_get(rdpGlyphCache* glyphCache, UINT32 index, UI
|
|||||||
BOOL glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, UINT32 size,
|
BOOL glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, UINT32 size,
|
||||||
const void* fragment)
|
const void* fragment)
|
||||||
{
|
{
|
||||||
void* prevFragment = NULL;
|
|
||||||
void* copy = NULL;
|
|
||||||
|
|
||||||
WINPR_ASSERT(glyphCache);
|
WINPR_ASSERT(glyphCache);
|
||||||
WINPR_ASSERT(glyphCache->fragCache.entries);
|
WINPR_ASSERT(glyphCache->fragCache.entries);
|
||||||
|
|
||||||
@ -656,7 +653,10 @@ BOOL glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, UINT32 si
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
copy = malloc(size);
|
if (size == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
void* copy = malloc(size);
|
||||||
|
|
||||||
if (!copy)
|
if (!copy)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -664,7 +664,8 @@ BOOL glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, UINT32 si
|
|||||||
WLog_Print(glyphCache->log, WLOG_DEBUG,
|
WLog_Print(glyphCache->log, WLOG_DEBUG,
|
||||||
"GlyphCacheFragmentPut: index: %" PRIu32 " size: %" PRIu32 "", index, size);
|
"GlyphCacheFragmentPut: index: %" PRIu32 " size: %" PRIu32 "", index, size);
|
||||||
CopyMemory(copy, fragment, size);
|
CopyMemory(copy, fragment, size);
|
||||||
prevFragment = glyphCache->fragCache.entries[index].fragment;
|
|
||||||
|
void* prevFragment = glyphCache->fragCache.entries[index].fragment;
|
||||||
glyphCache->fragCache.entries[index].fragment = copy;
|
glyphCache->fragCache.entries[index].fragment = copy;
|
||||||
glyphCache->fragCache.entries[index].size = size;
|
glyphCache->fragCache.entries[index].size = size;
|
||||||
free(prevFragment);
|
free(prevFragment);
|
||||||
|
@ -150,17 +150,14 @@ static BOOL freerdp_dsp_channel_mix(FREERDP_DSP_CONTEXT* WINPR_RESTRICT context,
|
|||||||
const AUDIO_FORMAT* WINPR_RESTRICT srcFormat,
|
const AUDIO_FORMAT* WINPR_RESTRICT srcFormat,
|
||||||
const BYTE** WINPR_RESTRICT data, size_t* WINPR_RESTRICT length)
|
const BYTE** WINPR_RESTRICT data, size_t* WINPR_RESTRICT length)
|
||||||
{
|
{
|
||||||
UINT32 bpp;
|
|
||||||
size_t samples;
|
|
||||||
|
|
||||||
if (!context || !data || !length)
|
if (!context || !data || !length)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (srcFormat->wFormatTag != WAVE_FORMAT_PCM)
|
if (srcFormat->wFormatTag != WAVE_FORMAT_PCM)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
bpp = srcFormat->wBitsPerSample > 8 ? 2 : 1;
|
const UINT32 bpp = srcFormat->wBitsPerSample > 8 ? 2 : 1;
|
||||||
samples = size / bpp / srcFormat->nChannels;
|
const size_t samples = size / bpp / srcFormat->nChannels;
|
||||||
|
|
||||||
if (context->common.format.nChannels == srcFormat->nChannels)
|
if (context->common.format.nChannels == srcFormat->nChannels)
|
||||||
{
|
{
|
||||||
@ -324,10 +321,8 @@ static const INT16 ima_step_size_table[] = {
|
|||||||
static UINT16 dsp_decode_ima_adpcm_sample(ADPCM* WINPR_RESTRICT adpcm, unsigned int channel,
|
static UINT16 dsp_decode_ima_adpcm_sample(ADPCM* WINPR_RESTRICT adpcm, unsigned int channel,
|
||||||
BYTE sample)
|
BYTE sample)
|
||||||
{
|
{
|
||||||
INT32 ss;
|
const INT32 ss = ima_step_size_table[adpcm->ima.last_step[channel]];
|
||||||
INT32 d;
|
INT32 d = (ss >> 3);
|
||||||
ss = ima_step_size_table[adpcm->ima.last_step[channel]];
|
|
||||||
d = (ss >> 3);
|
|
||||||
|
|
||||||
if (sample & 1)
|
if (sample & 1)
|
||||||
d += (ss >> 2);
|
d += (ss >> 2);
|
||||||
@ -363,10 +358,7 @@ static BOOL freerdp_dsp_decode_ima_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT con
|
|||||||
const BYTE* WINPR_RESTRICT src, size_t size,
|
const BYTE* WINPR_RESTRICT src, size_t size,
|
||||||
wStream* WINPR_RESTRICT out)
|
wStream* WINPR_RESTRICT out)
|
||||||
{
|
{
|
||||||
BYTE sample;
|
|
||||||
UINT16 decoded;
|
|
||||||
size_t out_size = size * 4;
|
size_t out_size = size * 4;
|
||||||
UINT32 channel;
|
|
||||||
const UINT32 block_size = context->common.format.nBlockAlign;
|
const UINT32 block_size = context->common.format.nBlockAlign;
|
||||||
const UINT32 channels = context->common.format.nChannels;
|
const UINT32 channels = context->common.format.nChannels;
|
||||||
|
|
||||||
@ -401,15 +393,21 @@ static BOOL freerdp_dsp_decode_ima_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT con
|
|||||||
{
|
{
|
||||||
BYTE* dst = Stream_Pointer(out);
|
BYTE* dst = Stream_Pointer(out);
|
||||||
|
|
||||||
channel = (i < 4 ? 0 : 1);
|
const int channel = (i < 4 ? 0 : 1);
|
||||||
sample = ((*src) & 0x0f);
|
{
|
||||||
decoded = dsp_decode_ima_adpcm_sample(&context->adpcm, channel, sample);
|
const BYTE sample = ((*src) & 0x0f);
|
||||||
dst[((i & 3) << 3) + (channel << 1)] = (decoded & 0xFF);
|
const UINT16 decoded =
|
||||||
dst[((i & 3) << 3) + (channel << 1) + 1] = (decoded >> 8);
|
dsp_decode_ima_adpcm_sample(&context->adpcm, channel, sample);
|
||||||
sample = ((*src) >> 4);
|
dst[((i & 3) << 3) + (channel << 1)] = (decoded & 0xFF);
|
||||||
decoded = dsp_decode_ima_adpcm_sample(&context->adpcm, channel, sample);
|
dst[((i & 3) << 3) + (channel << 1) + 1] = (decoded >> 8);
|
||||||
dst[((i & 3) << 3) + (channel << 1) + 4] = (decoded & 0xFF);
|
}
|
||||||
dst[((i & 3) << 3) + (channel << 1) + 5] = (decoded >> 8);
|
{
|
||||||
|
const BYTE sample = ((*src) >> 4);
|
||||||
|
const UINT16 decoded =
|
||||||
|
dsp_decode_ima_adpcm_sample(&context->adpcm, channel, sample);
|
||||||
|
dst[((i & 3) << 3) + (channel << 1) + 4] = (decoded & 0xFF);
|
||||||
|
dst[((i & 3) << 3) + (channel << 1) + 5] = (decoded >> 8);
|
||||||
|
}
|
||||||
src++;
|
src++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -423,14 +421,18 @@ static BOOL freerdp_dsp_decode_ima_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT con
|
|||||||
if (!Stream_SafeSeek(out, 4))
|
if (!Stream_SafeSeek(out, 4))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
sample = ((*src) & 0x0f);
|
{
|
||||||
decoded = dsp_decode_ima_adpcm_sample(&context->adpcm, 0, sample);
|
const BYTE sample = ((*src) & 0x0f);
|
||||||
*dst++ = (decoded & 0xFF);
|
const UINT16 decoded = dsp_decode_ima_adpcm_sample(&context->adpcm, 0, sample);
|
||||||
*dst++ = (decoded >> 8);
|
*dst++ = (decoded & 0xFF);
|
||||||
sample = ((*src) >> 4);
|
*dst++ = (decoded >> 8);
|
||||||
decoded = dsp_decode_ima_adpcm_sample(&context->adpcm, 0, sample);
|
}
|
||||||
*dst++ = (decoded & 0xFF);
|
{
|
||||||
*dst++ = (decoded >> 8);
|
const BYTE sample = ((*src) >> 4);
|
||||||
|
const UINT16 decoded = dsp_decode_ima_adpcm_sample(&context->adpcm, 0, sample);
|
||||||
|
*dst++ = (decoded & 0xFF);
|
||||||
|
*dst++ = (decoded >> 8);
|
||||||
|
}
|
||||||
src++;
|
src++;
|
||||||
size--;
|
size--;
|
||||||
}
|
}
|
||||||
@ -744,15 +746,11 @@ static const struct
|
|||||||
|
|
||||||
static BYTE dsp_encode_ima_adpcm_sample(ADPCM* WINPR_RESTRICT adpcm, int channel, INT16 sample)
|
static BYTE dsp_encode_ima_adpcm_sample(ADPCM* WINPR_RESTRICT adpcm, int channel, INT16 sample)
|
||||||
{
|
{
|
||||||
INT32 e;
|
INT32 ss = ima_step_size_table[adpcm->ima.last_step[channel]];
|
||||||
INT32 d;
|
INT32 e = sample - adpcm->ima.last_sample[channel];
|
||||||
INT32 ss;
|
INT32 d = e;
|
||||||
BYTE enc;
|
INT32 diff = ss >> 3;
|
||||||
INT32 diff;
|
BYTE enc = 0;
|
||||||
ss = ima_step_size_table[adpcm->ima.last_step[channel]];
|
|
||||||
d = e = sample - adpcm->ima.last_sample[channel];
|
|
||||||
diff = ss >> 3;
|
|
||||||
enc = 0;
|
|
||||||
|
|
||||||
if (e < 0)
|
if (e < 0)
|
||||||
{
|
{
|
||||||
@ -809,16 +807,12 @@ static BOOL freerdp_dsp_encode_ima_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT con
|
|||||||
const BYTE* WINPR_RESTRICT src, size_t size,
|
const BYTE* WINPR_RESTRICT src, size_t size,
|
||||||
wStream* WINPR_RESTRICT out)
|
wStream* WINPR_RESTRICT out)
|
||||||
{
|
{
|
||||||
INT16 sample;
|
|
||||||
BYTE encoded;
|
|
||||||
size_t align;
|
|
||||||
|
|
||||||
if (!Stream_EnsureRemainingCapacity(out, size))
|
if (!Stream_EnsureRemainingCapacity(out, size))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!Stream_EnsureRemainingCapacity(context->common.buffer, size + 64))
|
if (!Stream_EnsureRemainingCapacity(context->common.buffer, size + 64))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
align = (context->common.format.nChannels > 1) ? 32 : 4;
|
const size_t align = (context->common.format.nChannels > 1) ? 32 : 4;
|
||||||
|
|
||||||
while (size >= align)
|
while (size >= align)
|
||||||
{
|
{
|
||||||
@ -848,9 +842,9 @@ static BOOL freerdp_dsp_encode_ima_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT con
|
|||||||
|
|
||||||
for (size_t i = 0; i < 16; i++)
|
for (size_t i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
sample = (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
|
const INT16 sample = (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
|
||||||
src += 2;
|
src += 2;
|
||||||
encoded = dsp_encode_ima_adpcm_sample(&context->adpcm, i % 2, sample);
|
const BYTE encoded = dsp_encode_ima_adpcm_sample(&context->adpcm, i % 2, sample);
|
||||||
dst[ima_stereo_encode_map[i].byte_num] |= encoded
|
dst[ima_stereo_encode_map[i].byte_num] |= encoded
|
||||||
<< ima_stereo_encode_map[i].byte_shift;
|
<< ima_stereo_encode_map[i].byte_shift;
|
||||||
}
|
}
|
||||||
@ -861,9 +855,9 @@ static BOOL freerdp_dsp_encode_ima_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT con
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sample = (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
|
INT16 sample = (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
|
||||||
src += 2;
|
src += 2;
|
||||||
encoded = dsp_encode_ima_adpcm_sample(&context->adpcm, 0, sample);
|
BYTE encoded = dsp_encode_ima_adpcm_sample(&context->adpcm, 0, sample);
|
||||||
sample = (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
|
sample = (INT16)(((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
|
||||||
src += 2;
|
src += 2;
|
||||||
encoded |= dsp_encode_ima_adpcm_sample(&context->adpcm, 0, sample) << 4;
|
encoded |= dsp_encode_ima_adpcm_sample(&context->adpcm, 0, sample) << 4;
|
||||||
@ -898,12 +892,11 @@ static const INT32 ms_adpcm_coeffs2[7] = { 0, -256, 0, 64, 0, -208, -232 };
|
|||||||
static INLINE INT16 freerdp_dsp_decode_ms_adpcm_sample(ADPCM* WINPR_RESTRICT adpcm, BYTE sample,
|
static INLINE INT16 freerdp_dsp_decode_ms_adpcm_sample(ADPCM* WINPR_RESTRICT adpcm, BYTE sample,
|
||||||
int channel)
|
int channel)
|
||||||
{
|
{
|
||||||
INT8 nibble;
|
const INT8 nibble = (sample & 0x08 ? (INT8)sample - 16 : (INT8)sample);
|
||||||
INT32 presample;
|
INT32 presample =
|
||||||
nibble = (sample & 0x08 ? (INT8)sample - 16 : (INT8)sample);
|
((adpcm->ms.sample1[channel] * ms_adpcm_coeffs1[adpcm->ms.predictor[channel]]) +
|
||||||
presample = ((adpcm->ms.sample1[channel] * ms_adpcm_coeffs1[adpcm->ms.predictor[channel]]) +
|
(adpcm->ms.sample2[channel] * ms_adpcm_coeffs2[adpcm->ms.predictor[channel]])) /
|
||||||
(adpcm->ms.sample2[channel] * ms_adpcm_coeffs2[adpcm->ms.predictor[channel]])) /
|
256;
|
||||||
256;
|
|
||||||
presample += nibble * adpcm->ms.delta[channel];
|
presample += nibble * adpcm->ms.delta[channel];
|
||||||
|
|
||||||
if (presample > 32767)
|
if (presample > 32767)
|
||||||
@ -925,7 +918,6 @@ static BOOL freerdp_dsp_decode_ms_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT cont
|
|||||||
const BYTE* WINPR_RESTRICT src, size_t size,
|
const BYTE* WINPR_RESTRICT src, size_t size,
|
||||||
wStream* WINPR_RESTRICT out)
|
wStream* WINPR_RESTRICT out)
|
||||||
{
|
{
|
||||||
BYTE sample;
|
|
||||||
const size_t out_size = size * 4;
|
const size_t out_size = size * 4;
|
||||||
const UINT32 channels = context->common.format.nChannels;
|
const UINT32 channels = context->common.format.nChannels;
|
||||||
const UINT32 block_size = context->common.format.nBlockAlign;
|
const UINT32 block_size = context->common.format.nBlockAlign;
|
||||||
@ -976,22 +968,26 @@ static BOOL freerdp_dsp_decode_ms_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT cont
|
|||||||
|
|
||||||
if (channels > 1)
|
if (channels > 1)
|
||||||
{
|
{
|
||||||
sample = *src++;
|
{
|
||||||
size--;
|
const BYTE sample = *src++;
|
||||||
Stream_Write_INT16(out,
|
size--;
|
||||||
freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0));
|
Stream_Write_INT16(
|
||||||
Stream_Write_INT16(
|
out, freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0));
|
||||||
out, freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample & 0x0F, 1));
|
Stream_Write_INT16(
|
||||||
sample = *src++;
|
out, freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample & 0x0F, 1));
|
||||||
size--;
|
}
|
||||||
Stream_Write_INT16(out,
|
{
|
||||||
freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0));
|
const BYTE sample = *src++;
|
||||||
Stream_Write_INT16(
|
size--;
|
||||||
out, freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample & 0x0F, 1));
|
Stream_Write_INT16(
|
||||||
|
out, freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0));
|
||||||
|
Stream_Write_INT16(
|
||||||
|
out, freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample & 0x0F, 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sample = *src++;
|
const BYTE sample = *src++;
|
||||||
size--;
|
size--;
|
||||||
Stream_Write_INT16(out,
|
Stream_Write_INT16(out,
|
||||||
freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0));
|
freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0));
|
||||||
@ -1006,12 +1002,11 @@ static BOOL freerdp_dsp_decode_ms_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT cont
|
|||||||
static BYTE freerdp_dsp_encode_ms_adpcm_sample(ADPCM* WINPR_RESTRICT adpcm, INT32 sample,
|
static BYTE freerdp_dsp_encode_ms_adpcm_sample(ADPCM* WINPR_RESTRICT adpcm, INT32 sample,
|
||||||
int channel)
|
int channel)
|
||||||
{
|
{
|
||||||
INT32 presample;
|
INT32 presample =
|
||||||
INT32 errordelta;
|
((adpcm->ms.sample1[channel] * ms_adpcm_coeffs1[adpcm->ms.predictor[channel]]) +
|
||||||
presample = ((adpcm->ms.sample1[channel] * ms_adpcm_coeffs1[adpcm->ms.predictor[channel]]) +
|
(adpcm->ms.sample2[channel] * ms_adpcm_coeffs2[adpcm->ms.predictor[channel]])) /
|
||||||
(adpcm->ms.sample2[channel] * ms_adpcm_coeffs2[adpcm->ms.predictor[channel]])) /
|
256;
|
||||||
256;
|
INT32 errordelta = (sample - presample) / adpcm->ms.delta[channel];
|
||||||
errordelta = (sample - presample) / adpcm->ms.delta[channel];
|
|
||||||
|
|
||||||
if ((sample - presample) % adpcm->ms.delta[channel] > adpcm->ms.delta[channel] / 2)
|
if ((sample - presample) % adpcm->ms.delta[channel] > adpcm->ms.delta[channel] / 2)
|
||||||
errordelta++;
|
errordelta++;
|
||||||
@ -1043,14 +1038,12 @@ static BOOL freerdp_dsp_encode_ms_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT cont
|
|||||||
const BYTE* WINPR_RESTRICT src, size_t size,
|
const BYTE* WINPR_RESTRICT src, size_t size,
|
||||||
wStream* WINPR_RESTRICT out)
|
wStream* WINPR_RESTRICT out)
|
||||||
{
|
{
|
||||||
size_t start;
|
|
||||||
INT32 sample;
|
|
||||||
const size_t step = 8 + ((context->common.format.nChannels > 1) ? 4 : 0);
|
const size_t step = 8 + ((context->common.format.nChannels > 1) ? 4 : 0);
|
||||||
|
|
||||||
if (!Stream_EnsureRemainingCapacity(out, size))
|
if (!Stream_EnsureRemainingCapacity(out, size))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
start = Stream_GetPosition(out);
|
const size_t start = Stream_GetPosition(out);
|
||||||
|
|
||||||
if (context->adpcm.ms.delta[0] < 16)
|
if (context->adpcm.ms.delta[0] < 16)
|
||||||
context->adpcm.ms.delta[0] = 16;
|
context->adpcm.ms.delta[0] = 16;
|
||||||
@ -1060,7 +1053,6 @@ static BOOL freerdp_dsp_encode_ms_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT cont
|
|||||||
|
|
||||||
while (size >= step)
|
while (size >= step)
|
||||||
{
|
{
|
||||||
BYTE val;
|
|
||||||
if ((Stream_GetPosition(out) - start) % context->common.format.nBlockAlign == 0)
|
if ((Stream_GetPosition(out) - start) % context->common.format.nBlockAlign == 0)
|
||||||
{
|
{
|
||||||
if (context->common.format.nChannels > 1)
|
if (context->common.format.nChannels > 1)
|
||||||
@ -1101,17 +1093,22 @@ static BOOL freerdp_dsp_encode_ms_adpcm(FREERDP_DSP_CONTEXT* WINPR_RESTRICT cont
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sample = read_int16(src);
|
{
|
||||||
src += 2;
|
const INT16 sample = read_int16(src);
|
||||||
Stream_Write_UINT8(
|
src += 2;
|
||||||
out, (freerdp_dsp_encode_ms_adpcm_sample(&context->adpcm, sample, 0) << 4) & 0xFF);
|
Stream_Write_UINT8(
|
||||||
sample = read_int16(src);
|
out, (freerdp_dsp_encode_ms_adpcm_sample(&context->adpcm, sample, 0) << 4) & 0xFF);
|
||||||
src += 2;
|
}
|
||||||
|
{
|
||||||
|
const INT16 sample = read_int16(src);
|
||||||
|
src += 2;
|
||||||
|
|
||||||
Stream_Read_UINT8(out, val);
|
BYTE val = 0;
|
||||||
val += freerdp_dsp_encode_ms_adpcm_sample(&context->adpcm, sample,
|
Stream_Read_UINT8(out, val);
|
||||||
context->common.format.nChannels > 1 ? 1 : 0);
|
val += freerdp_dsp_encode_ms_adpcm_sample(&context->adpcm, sample,
|
||||||
Stream_Write_UINT8(out, val);
|
context->common.format.nChannels > 1 ? 1 : 0);
|
||||||
|
Stream_Write_UINT8(out, val);
|
||||||
|
}
|
||||||
size -= 4;
|
size -= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1252,14 +1249,12 @@ BOOL freerdp_dsp_encode(FREERDP_DSP_CONTEXT* WINPR_RESTRICT context,
|
|||||||
#if defined(WITH_DSP_FFMPEG)
|
#if defined(WITH_DSP_FFMPEG)
|
||||||
return freerdp_dsp_ffmpeg_encode(context, srcFormat, data, length, out);
|
return freerdp_dsp_ffmpeg_encode(context, srcFormat, data, length, out);
|
||||||
#else
|
#else
|
||||||
const BYTE* resampleData;
|
|
||||||
size_t resampleLength;
|
|
||||||
AUDIO_FORMAT format;
|
|
||||||
|
|
||||||
if (!context || !context->common.encoder || !srcFormat || !data || !out)
|
if (!context || !context->common.encoder || !srcFormat || !data || !out)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
format = *srcFormat;
|
AUDIO_FORMAT format = *srcFormat;
|
||||||
|
const BYTE* resampleData = NULL;
|
||||||
|
size_t resampleLength = 0;
|
||||||
|
|
||||||
if (!freerdp_dsp_channel_mix(context, data, length, srcFormat, &resampleData, &resampleLength))
|
if (!freerdp_dsp_channel_mix(context, data, length, srcFormat, &resampleData, &resampleLength))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -2942,7 +2942,7 @@ static int ncrush_generate_tables(NCRUSH_CONTEXT* context)
|
|||||||
for (int j = 0; j < 1 << LOMBitsLUT[i]; j++)
|
for (int j = 0; j < 1 << LOMBitsLUT[i]; j++)
|
||||||
{
|
{
|
||||||
size_t l = (cnt++) + 2ull;
|
size_t l = (cnt++) + 2ull;
|
||||||
context->HuffTableLOM[l] = (int)i;
|
context->HuffTableLOM[l] = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,7 +388,7 @@ static INLINE INT32 planar_decompress_plane_rle(const BYTE* WINPR_RESTRICT pSrcD
|
|||||||
|
|
||||||
for (INT32 y = beg; y != end; y += inc)
|
for (INT32 y = beg; y != end; y += inc)
|
||||||
{
|
{
|
||||||
BYTE* dstp = &pDstData[((nYDst + y) * (INT32)nDstStep) + (nXDst * 4) + nChannel];
|
BYTE* dstp = &pDstData[((nYDst + y) * nDstStep) + (nXDst * 4) + nChannel];
|
||||||
pixel = 0;
|
pixel = 0;
|
||||||
currentScanline = dstp;
|
currentScanline = dstp;
|
||||||
|
|
||||||
@ -515,7 +515,7 @@ static INLINE INT32 planar_set_plane(BYTE bValue, BYTE* pDstData, INT32 nDstStep
|
|||||||
|
|
||||||
for (INT32 y = beg; y != end; y += inc)
|
for (INT32 y = beg; y != end; y += inc)
|
||||||
{
|
{
|
||||||
BYTE* dstp = &pDstData[((nYDst + y) * (INT32)nDstStep) + (nXDst * 4) + nChannel];
|
BYTE* dstp = &pDstData[((nYDst + y) * nDstStep) + (nXDst * 4) + nChannel];
|
||||||
|
|
||||||
for (INT32 x = 0; x < (INT32)nWidth; ++x)
|
for (INT32 x = 0; x < (INT32)nWidth; ++x)
|
||||||
{
|
{
|
||||||
@ -1130,7 +1130,7 @@ static INLINE BOOL freerdp_split_color_planes(BITMAP_PLANAR_CONTEXT* WINPR_RESTR
|
|||||||
UINT32 k = 0;
|
UINT32 k = 0;
|
||||||
for (UINT32 i = 0; i < height; i++)
|
for (UINT32 i = 0; i < height; i++)
|
||||||
{
|
{
|
||||||
const BYTE* pixel = &data[1ULL * scanline * (UINT32)i];
|
const BYTE* pixel = &data[1ULL * scanline * i];
|
||||||
|
|
||||||
for (UINT32 j = 0; j < width; j++)
|
for (UINT32 j = 0; j < width; j++)
|
||||||
{
|
{
|
||||||
@ -1222,7 +1222,7 @@ static INLINE UINT32 freerdp_bitmap_planar_write_rle_bytes(const BYTE* WINPR_RES
|
|||||||
outBufferSize--;
|
outBufferSize--;
|
||||||
*pOutput = controlByte;
|
*pOutput = controlByte;
|
||||||
pOutput++;
|
pOutput++;
|
||||||
nBytesToWrite = (int)(controlByte >> 4);
|
nBytesToWrite = (controlByte >> 4);
|
||||||
|
|
||||||
if (nBytesToWrite)
|
if (nBytesToWrite)
|
||||||
{
|
{
|
||||||
|
@ -1022,18 +1022,18 @@ progressive_decompress_tile_first(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressiv
|
|||||||
progressive_rfx_quant_add(quantCr, quantProgCr, &shiftCr);
|
progressive_rfx_quant_add(quantCr, quantProgCr, &shiftCr);
|
||||||
progressive_rfx_quant_lsub(&shiftCr, 1); /* -6 + 5 = -1 */
|
progressive_rfx_quant_lsub(&shiftCr, 1); /* -6 + 5 = -1 */
|
||||||
|
|
||||||
pSign[0] = (INT16*)((BYTE*)(&tile->sign[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
pSign[0] = (INT16*)((&tile->sign[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
||||||
pSign[1] = (INT16*)((BYTE*)(&tile->sign[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
pSign[1] = (INT16*)((&tile->sign[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
||||||
pSign[2] = (INT16*)((BYTE*)(&tile->sign[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
pSign[2] = (INT16*)((&tile->sign[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
||||||
|
|
||||||
pCurrent[0] = (INT16*)((BYTE*)(&tile->current[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
pCurrent[0] = (INT16*)((&tile->current[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
||||||
pCurrent[1] = (INT16*)((BYTE*)(&tile->current[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
pCurrent[1] = (INT16*)((&tile->current[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
||||||
pCurrent[2] = (INT16*)((BYTE*)(&tile->current[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
pCurrent[2] = (INT16*)((&tile->current[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
||||||
|
|
||||||
pBuffer = (BYTE*)BufferPool_Take(progressive->bufferPool, -1);
|
pBuffer = (BYTE*)BufferPool_Take(progressive->bufferPool, -1);
|
||||||
pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
pSrcDst[0] = (INT16*)((&pBuffer[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
||||||
pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
pSrcDst[1] = (INT16*)((&pBuffer[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
||||||
pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
pSrcDst[2] = (INT16*)((&pBuffer[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
||||||
|
|
||||||
rc = progressive_rfx_decode_component(progressive, &shiftY, tile->yData, tile->yLen, pSrcDst[0],
|
rc = progressive_rfx_decode_component(progressive, &shiftY, tile->yData, tile->yLen, pSrcDst[0],
|
||||||
pCurrent[0], pSign[0], diff, sub, extrapolate); /* Y */
|
pCurrent[0], pSign[0], diff, sub, extrapolate); /* Y */
|
||||||
@ -1457,18 +1457,18 @@ progressive_decompress_tile_upgrade(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progress
|
|||||||
tile->cbProgQuant = *quantProgCb;
|
tile->cbProgQuant = *quantProgCb;
|
||||||
tile->crProgQuant = *quantProgCr;
|
tile->crProgQuant = *quantProgCr;
|
||||||
|
|
||||||
pSign[0] = (INT16*)((BYTE*)(&tile->sign[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
pSign[0] = (INT16*)((&tile->sign[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
||||||
pSign[1] = (INT16*)((BYTE*)(&tile->sign[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
pSign[1] = (INT16*)((&tile->sign[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
||||||
pSign[2] = (INT16*)((BYTE*)(&tile->sign[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
pSign[2] = (INT16*)((&tile->sign[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
||||||
|
|
||||||
pCurrent[0] = (INT16*)((BYTE*)(&tile->current[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
pCurrent[0] = (INT16*)((&tile->current[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
||||||
pCurrent[1] = (INT16*)((BYTE*)(&tile->current[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
pCurrent[1] = (INT16*)((&tile->current[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
||||||
pCurrent[2] = (INT16*)((BYTE*)(&tile->current[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
pCurrent[2] = (INT16*)((&tile->current[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
||||||
|
|
||||||
pBuffer = (BYTE*)BufferPool_Take(progressive->bufferPool, -1);
|
pBuffer = (BYTE*)BufferPool_Take(progressive->bufferPool, -1);
|
||||||
pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
pSrcDst[0] = (INT16*)((&pBuffer[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
||||||
pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
pSrcDst[1] = (INT16*)((&pBuffer[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
||||||
pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
pSrcDst[2] = (INT16*)((&pBuffer[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
||||||
|
|
||||||
status = progressive_rfx_upgrade_component(progressive, &shiftY, quantProgY, &yNumBits,
|
status = progressive_rfx_upgrade_component(progressive, &shiftY, quantProgY, &yNumBits,
|
||||||
pSrcDst[0], pCurrent[0], pSign[0], tile->ySrlData,
|
pSrcDst[0], pCurrent[0], pSign[0], tile->ySrlData,
|
||||||
|
@ -1638,8 +1638,8 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* WINPR_RESTRICT context,
|
|||||||
const RFX_RECT* WINPR_RESTRICT rects, size_t numRects,
|
const RFX_RECT* WINPR_RESTRICT rects, size_t numRects,
|
||||||
const BYTE* WINPR_RESTRICT data, UINT32 w, UINT32 h, size_t s)
|
const BYTE* WINPR_RESTRICT data, UINT32 w, UINT32 h, size_t s)
|
||||||
{
|
{
|
||||||
const UINT32 width = (UINT32)w;
|
const UINT32 width = w;
|
||||||
const UINT32 height = (UINT32)h;
|
const UINT32 height = h;
|
||||||
const UINT32 scanline = (UINT32)s;
|
const UINT32 scanline = (UINT32)s;
|
||||||
RFX_MESSAGE* message = NULL;
|
RFX_MESSAGE* message = NULL;
|
||||||
PTP_WORK* workObject = NULL;
|
PTP_WORK* workObject = NULL;
|
||||||
@ -1791,9 +1791,9 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* WINPR_RESTRICT context,
|
|||||||
if (!(tile->YCbCrData = (BYTE*)BufferPool_Take(context->priv->BufferPool, -1)))
|
if (!(tile->YCbCrData = (BYTE*)BufferPool_Take(context->priv->BufferPool, -1)))
|
||||||
goto skip_encoding_loop;
|
goto skip_encoding_loop;
|
||||||
|
|
||||||
tile->YData = (BYTE*)&(tile->YCbCrData[((8192 + 32) * 0) + 16]);
|
tile->YData = &(tile->YCbCrData[((8192 + 32) * 0) + 16]);
|
||||||
tile->CbData = (BYTE*)&(tile->YCbCrData[((8192 + 32) * 1) + 16]);
|
tile->CbData = &(tile->YCbCrData[((8192 + 32) * 1) + 16]);
|
||||||
tile->CrData = (BYTE*)&(tile->YCbCrData[((8192 + 32) * 2) + 16]);
|
tile->CrData = &(tile->YCbCrData[((8192 + 32) * 2) + 16]);
|
||||||
|
|
||||||
if (!rfx_ensure_tiles(message, 1))
|
if (!rfx_ensure_tiles(message, 1))
|
||||||
goto skip_encoding_loop;
|
goto skip_encoding_loop;
|
||||||
|
@ -83,9 +83,9 @@ BOOL rfx_decode_rgb(RFX_CONTEXT* WINPR_RESTRICT context, const RFX_TILE* WINPR_R
|
|||||||
cb_quants = context->quants + (10ULL * tile->quantIdxCb);
|
cb_quants = context->quants + (10ULL * tile->quantIdxCb);
|
||||||
cr_quants = context->quants + (10ULL * tile->quantIdxCr);
|
cr_quants = context->quants + (10ULL * tile->quantIdxCr);
|
||||||
pBuffer = (BYTE*)BufferPool_Take(context->priv->BufferPool, -1);
|
pBuffer = (BYTE*)BufferPool_Take(context->priv->BufferPool, -1);
|
||||||
pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192ULL + 32ULL) * 0ULL) + 16ULL])); /* y_r_buffer */
|
pSrcDst[0] = (INT16*)((&pBuffer[((8192ULL + 32ULL) * 0ULL) + 16ULL])); /* y_r_buffer */
|
||||||
pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192ULL + 32ULL) * 1ULL) + 16ULL])); /* cb_g_buffer */
|
pSrcDst[1] = (INT16*)((&pBuffer[((8192ULL + 32ULL) * 1ULL) + 16ULL])); /* cb_g_buffer */
|
||||||
pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192ULL + 32ULL) * 2ULL) + 16ULL])); /* cr_b_buffer */
|
pSrcDst[2] = (INT16*)((&pBuffer[((8192ULL + 32ULL) * 2ULL) + 16ULL])); /* cr_b_buffer */
|
||||||
rfx_decode_component(context, y_quants, tile->YData, tile->YLen, pSrcDst[0]); /* YData */
|
rfx_decode_component(context, y_quants, tile->YData, tile->YLen, pSrcDst[0]); /* YData */
|
||||||
rfx_decode_component(context, cb_quants, tile->CbData, tile->CbLen, pSrcDst[1]); /* CbData */
|
rfx_decode_component(context, cb_quants, tile->CbData, tile->CbLen, pSrcDst[1]); /* CbData */
|
||||||
rfx_decode_component(context, cr_quants, tile->CrData, tile->CrLen, pSrcDst[2]); /* CrData */
|
rfx_decode_component(context, cr_quants, tile->CrData, tile->CrLen, pSrcDst[2]); /* CrData */
|
||||||
|
@ -283,9 +283,9 @@ void rfx_encode_rgb(RFX_CONTEXT* WINPR_RESTRICT context, RFX_TILE* WINPR_RESTRIC
|
|||||||
YQuant = context->quants + (10ULL * tile->quantIdxY);
|
YQuant = context->quants + (10ULL * tile->quantIdxY);
|
||||||
CbQuant = context->quants + (10ULL * tile->quantIdxCb);
|
CbQuant = context->quants + (10ULL * tile->quantIdxCb);
|
||||||
CrQuant = context->quants + (10ULL * tile->quantIdxCr);
|
CrQuant = context->quants + (10ULL * tile->quantIdxCr);
|
||||||
pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192ULL + 32ULL) * 0ULL) + 16ULL])); /* y_r_buffer */
|
pSrcDst[0] = (INT16*)((&pBuffer[((8192ULL + 32ULL) * 0ULL) + 16ULL])); /* y_r_buffer */
|
||||||
pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192ULL + 32ULL) * 1ULL) + 16ULL])); /* cb_g_buffer */
|
pSrcDst[1] = (INT16*)((&pBuffer[((8192ULL + 32ULL) * 1ULL) + 16ULL])); /* cb_g_buffer */
|
||||||
pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192ULL + 32ULL) * 2ULL) + 16ULL])); /* cr_b_buffer */
|
pSrcDst[2] = (INT16*)((&pBuffer[((8192ULL + 32ULL) * 2ULL) + 16ULL])); /* cr_b_buffer */
|
||||||
PROFILER_ENTER(context->priv->prof_rfx_encode_rgb)
|
PROFILER_ENTER(context->priv->prof_rfx_encode_rgb)
|
||||||
PROFILER_ENTER(context->priv->prof_rfx_encode_format_rgb)
|
PROFILER_ENTER(context->priv->prof_rfx_encode_format_rgb)
|
||||||
rfx_encode_format_rgb(tile->data, tile->width, tile->height, tile->scanline,
|
rfx_encode_format_rgb(tile->data, tile->width, tile->height, tile->scanline,
|
||||||
|
@ -225,8 +225,7 @@ PVIRTUALCHANNELENTRY freerdp_load_dynamic_addin(LPCSTR pszFileName, LPCSTR pszPa
|
|||||||
|
|
||||||
CopyMemory(pszFilePath, pszAddinInstallPath, cchAddinInstallPath);
|
CopyMemory(pszFilePath, pszAddinInstallPath, cchAddinInstallPath);
|
||||||
pszFilePath[cchAddinInstallPath] = '\0';
|
pszFilePath[cchAddinInstallPath] = '\0';
|
||||||
const HRESULT hr =
|
const HRESULT hr = NativePathCchAppendA(pszFilePath, cchFilePath + 1, pszRelativeFilePath);
|
||||||
NativePathCchAppendA((LPSTR)pszFilePath, cchFilePath + 1, pszRelativeFilePath);
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ struct rdp_assistance_file
|
|||||||
static const char* strrstr(const char* haystack, size_t len, const char* needle)
|
static const char* strrstr(const char* haystack, size_t len, const char* needle)
|
||||||
{
|
{
|
||||||
if (*needle == '\0')
|
if (*needle == '\0')
|
||||||
return (const char*)haystack;
|
return haystack;
|
||||||
|
|
||||||
char* result = NULL;
|
char* result = NULL;
|
||||||
for (;;)
|
for (;;)
|
||||||
@ -960,8 +960,8 @@ static BOOL freerdp_assistance_decrypt2(rdpAssistanceFile* file)
|
|||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
cbOut = cbFinal = 0;
|
cbOut = cbFinal = 0;
|
||||||
cbIn = (size_t)file->EncryptedLHTicketLength;
|
cbIn = file->EncryptedLHTicketLength;
|
||||||
pbIn = (BYTE*)file->EncryptedLHTicket;
|
pbIn = file->EncryptedLHTicket;
|
||||||
pbOut = (BYTE*)calloc(1, cbIn + WINPR_AES_BLOCK_SIZE + 2);
|
pbOut = (BYTE*)calloc(1, cbIn + WINPR_AES_BLOCK_SIZE + 2);
|
||||||
|
|
||||||
if (!pbOut)
|
if (!pbOut)
|
||||||
|
@ -272,7 +272,7 @@ RDPDR_DEVICE* freerdp_device_collection_find(rdpSettings* settings, const char*
|
|||||||
WINPR_ASSERT(name);
|
WINPR_ASSERT(name);
|
||||||
for (UINT32 index = 0; index < settings->DeviceCount; index++)
|
for (UINT32 index = 0; index < settings->DeviceCount; index++)
|
||||||
{
|
{
|
||||||
device = (RDPDR_DEVICE*)settings->DeviceArray[index];
|
device = settings->DeviceArray[index];
|
||||||
|
|
||||||
if (!device->Name)
|
if (!device->Name)
|
||||||
continue;
|
continue;
|
||||||
@ -291,7 +291,7 @@ RDPDR_DEVICE* freerdp_device_collection_find_type(rdpSettings* settings, UINT32
|
|||||||
|
|
||||||
for (UINT32 index = 0; index < settings->DeviceCount; index++)
|
for (UINT32 index = 0; index < settings->DeviceCount; index++)
|
||||||
{
|
{
|
||||||
device = (RDPDR_DEVICE*)settings->DeviceArray[index];
|
device = settings->DeviceArray[index];
|
||||||
|
|
||||||
if (device->Type == type)
|
if (device->Type == type)
|
||||||
return device;
|
return device;
|
||||||
|
@ -531,7 +531,7 @@ static BOOL rdg_send_tunnel_request(rdpRdg* rdg)
|
|||||||
if (PAACookie)
|
if (PAACookie)
|
||||||
{
|
{
|
||||||
Stream_Write_UINT16(s, (UINT16)PAACookieLen * sizeof(WCHAR)); /* PAA cookie string length */
|
Stream_Write_UINT16(s, (UINT16)PAACookieLen * sizeof(WCHAR)); /* PAA cookie string length */
|
||||||
Stream_Write_UTF16_String(s, PAACookie, (size_t)PAACookieLen);
|
Stream_Write_UTF16_String(s, PAACookie, PAACookieLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream_SealLength(s);
|
Stream_SealLength(s);
|
||||||
@ -578,7 +578,7 @@ static BOOL rdg_send_tunnel_authorization(rdpRdg* rdg)
|
|||||||
Stream_Write_UINT32(s, packetSize); /* PacketLength (4 bytes) */
|
Stream_Write_UINT32(s, packetSize); /* PacketLength (4 bytes) */
|
||||||
Stream_Write_UINT16(s, 0); /* FieldsPresent (2 bytes) */
|
Stream_Write_UINT16(s, 0); /* FieldsPresent (2 bytes) */
|
||||||
Stream_Write_UINT16(s, (UINT16)clientNameLen * sizeof(WCHAR)); /* Client name string length */
|
Stream_Write_UINT16(s, (UINT16)clientNameLen * sizeof(WCHAR)); /* Client name string length */
|
||||||
Stream_Write_UTF16_String(s, clientName, (size_t)clientNameLen);
|
Stream_Write_UTF16_String(s, clientName, clientNameLen);
|
||||||
Stream_SealLength(s);
|
Stream_SealLength(s);
|
||||||
status = rdg_write_packet(rdg, s);
|
status = rdg_write_packet(rdg, s);
|
||||||
Stream_Free(s, TRUE);
|
Stream_Free(s, TRUE);
|
||||||
@ -622,7 +622,7 @@ static BOOL rdg_send_channel_create(rdpRdg* rdg)
|
|||||||
(UINT16)rdg->context->settings->ServerPort); /* Resource port (2 bytes) */
|
(UINT16)rdg->context->settings->ServerPort); /* Resource port (2 bytes) */
|
||||||
Stream_Write_UINT16(s, 3); /* Protocol number (2 bytes) */
|
Stream_Write_UINT16(s, 3); /* Protocol number (2 bytes) */
|
||||||
Stream_Write_UINT16(s, (UINT16)serverNameLen * sizeof(WCHAR));
|
Stream_Write_UINT16(s, (UINT16)serverNameLen * sizeof(WCHAR));
|
||||||
Stream_Write_UTF16_String(s, serverName, (size_t)serverNameLen);
|
Stream_Write_UTF16_String(s, serverName, serverNameLen);
|
||||||
Stream_SealLength(s);
|
Stream_SealLength(s);
|
||||||
status = rdg_write_packet(rdg, s);
|
status = rdg_write_packet(rdg, s);
|
||||||
fail:
|
fail:
|
||||||
@ -1678,7 +1678,7 @@ static int rdg_write_websocket_data_packet(rdpRdg* rdg, const BYTE* buf, int isi
|
|||||||
/* mask as much as possible with 32bit access */
|
/* mask as much as possible with 32bit access */
|
||||||
for (streamPos = 0; streamPos + 4 <= isize; streamPos += 4)
|
for (streamPos = 0; streamPos + 4 <= isize; streamPos += 4)
|
||||||
{
|
{
|
||||||
uint32_t masked = *((const uint32_t*)((const BYTE*)buf + streamPos)) ^ maskingKey;
|
uint32_t masked = *((const uint32_t*)(buf + streamPos)) ^ maskingKey;
|
||||||
Stream_Write_UINT32(sWS, masked);
|
Stream_Write_UINT32(sWS, masked);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1686,7 +1686,7 @@ static int rdg_write_websocket_data_packet(rdpRdg* rdg, const BYTE* buf, int isi
|
|||||||
for (; streamPos < isize; streamPos++)
|
for (; streamPos < isize; streamPos++)
|
||||||
{
|
{
|
||||||
BYTE* partialMask = (BYTE*)(&maskingKey) + streamPos % 4;
|
BYTE* partialMask = (BYTE*)(&maskingKey) + streamPos % 4;
|
||||||
BYTE masked = *((const BYTE*)((const BYTE*)buf + streamPos)) ^ *partialMask;
|
BYTE masked = *((buf + streamPos)) ^ *partialMask;
|
||||||
Stream_Write_UINT8(sWS, masked);
|
Stream_Write_UINT8(sWS, masked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,8 +478,7 @@ static int rpc_client_recv_fragment(rdpRpc* rpc, wStream* fragment)
|
|||||||
if (Stream_Length(fragment) < StubOffset + StubLength)
|
if (Stream_Length(fragment) < StubOffset + StubLength)
|
||||||
goto fail;
|
goto fail;
|
||||||
Stream_SetPosition(fragment, StubOffset);
|
Stream_SetPosition(fragment, StubOffset);
|
||||||
rpc_client_receive_pipe_write(rpc->client, Stream_ConstPointer(fragment),
|
rpc_client_receive_pipe_write(rpc->client, Stream_ConstPointer(fragment), StubLength);
|
||||||
(size_t)StubLength);
|
|
||||||
rpc->StubFragCount++;
|
rpc->StubFragCount++;
|
||||||
|
|
||||||
if (response->alloc_hint == StubLength)
|
if (response->alloc_hint == StubLength)
|
||||||
|
@ -184,7 +184,7 @@ int websocket_write(BIO* bio, const BYTE* buf, int isize, WEBSOCKET_OPCODE opcod
|
|||||||
/* mask as much as possible with 32bit access */
|
/* mask as much as possible with 32bit access */
|
||||||
for (streamPos = 0; streamPos + 4 <= isize; streamPos += 4)
|
for (streamPos = 0; streamPos + 4 <= isize; streamPos += 4)
|
||||||
{
|
{
|
||||||
uint32_t masked = *((const uint32_t*)((const BYTE*)buf + streamPos)) ^ maskingKey;
|
uint32_t masked = *((const uint32_t*)(buf + streamPos)) ^ maskingKey;
|
||||||
Stream_Write_UINT32(sWS, masked);
|
Stream_Write_UINT32(sWS, masked);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ int websocket_write(BIO* bio, const BYTE* buf, int isize, WEBSOCKET_OPCODE opcod
|
|||||||
for (; streamPos < isize; streamPos++)
|
for (; streamPos < isize; streamPos++)
|
||||||
{
|
{
|
||||||
BYTE* partialMask = (BYTE*)(&maskingKey) + streamPos % 4;
|
BYTE* partialMask = (BYTE*)(&maskingKey) + streamPos % 4;
|
||||||
BYTE masked = *((const BYTE*)((const BYTE*)buf + streamPos)) ^ *partialMask;
|
BYTE masked = *((buf + streamPos)) ^ *partialMask;
|
||||||
Stream_Write_UINT8(sWS, masked);
|
Stream_Write_UINT8(sWS, masked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ static BOOL input_send_fastpath_keyboard_event(rdpInput* input, UINT16 flags, UI
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
WINPR_ASSERT(code <= UINT8_MAX);
|
WINPR_ASSERT(code <= UINT8_MAX);
|
||||||
Stream_Write_UINT8(s, (UINT8)code); /* keyCode (1 byte) */
|
Stream_Write_UINT8(s, code); /* keyCode (1 byte) */
|
||||||
return fastpath_send_input_pdu(rdp->fastpath, s);
|
return fastpath_send_input_pdu(rdp->fastpath, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,8 +440,8 @@ static BOOL WTSProcessChannelData(rdpPeerChannel* channel, UINT16 channelId, con
|
|||||||
size_t s, UINT32 flags, size_t t)
|
size_t s, UINT32 flags, size_t t)
|
||||||
{
|
{
|
||||||
BOOL ret = TRUE;
|
BOOL ret = TRUE;
|
||||||
const size_t size = (size_t)s;
|
const size_t size = s;
|
||||||
const size_t totalSize = (size_t)t;
|
const size_t totalSize = t;
|
||||||
|
|
||||||
WINPR_ASSERT(channel);
|
WINPR_ASSERT(channel);
|
||||||
WINPR_ASSERT(channel->vcm);
|
WINPR_ASSERT(channel->vcm);
|
||||||
|
@ -333,7 +333,7 @@ static BOOL print_negative(char* buffer, size_t size, INT64 value, INT64 min)
|
|||||||
(void)_snprintf(buffer, size, "%" PRId32, (INT32)value);
|
(void)_snprintf(buffer, size, "%" PRId32, (INT32)value);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case INT64_MIN:
|
case INT64_MIN:
|
||||||
(void)_snprintf(buffer, size, "%" PRId64, (INT64)value);
|
(void)_snprintf(buffer, size, "%" PRId64, value);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
default:
|
default:
|
||||||
(void)_snprintf(buffer, size, "too small a number");
|
(void)_snprintf(buffer, size, "too small a number");
|
||||||
@ -358,7 +358,7 @@ static BOOL print_xpositive(char* buffer, size_t size, INT64 value, INT64 max)
|
|||||||
(void)_snprintf(buffer, size, "%" PRIx32, (INT32)value);
|
(void)_snprintf(buffer, size, "%" PRIx32, (INT32)value);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case INT64_MAX:
|
case INT64_MAX:
|
||||||
(void)_snprintf(buffer, size, "%" PRIx64, (INT64)value);
|
(void)_snprintf(buffer, size, "%" PRIx64, value);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
default:
|
default:
|
||||||
(void)_snprintf(buffer, size, "too small a number");
|
(void)_snprintf(buffer, size, "too small a number");
|
||||||
|
@ -55,15 +55,15 @@ static SSIZE_T crypto_rsa_common(const BYTE* input, size_t length, UINT32 key_le
|
|||||||
if (!input || !modulus || !exponent || !output)
|
if (!input || !modulus || !exponent || !output)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if ((size_t)exponent_size > INT_MAX / 2)
|
if (exponent_size > INT_MAX / 2)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (key_length >= INT_MAX / 2 - exponent_size)
|
if (key_length >= INT_MAX / 2 - exponent_size)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
bufferSize = 2ULL * key_length + exponent_size;
|
bufferSize = 2ULL * key_length + exponent_size;
|
||||||
if ((size_t)length > bufferSize)
|
if (length > bufferSize)
|
||||||
bufferSize = (size_t)length;
|
bufferSize = length;
|
||||||
|
|
||||||
input_reverse = (BYTE*)calloc(bufferSize, 1);
|
input_reverse = (BYTE*)calloc(bufferSize, 1);
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ char* crypto_read_pem(const char* WINPR_RESTRICT filename, size_t* WINPR_RESTRIC
|
|||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (plength)
|
if (plength)
|
||||||
*plength = (size_t)strnlen(pem, size);
|
*plength = strnlen(pem, size);
|
||||||
(void)fclose(fp);
|
(void)fclose(fp);
|
||||||
return pem;
|
return pem;
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ static char* object_string(ASN1_TYPE* object)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = (char*)_strdup((char*)utf8String);
|
result = _strdup((char*)utf8String);
|
||||||
OPENSSL_free(utf8String);
|
OPENSSL_free(utf8String);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -624,7 +624,7 @@ static UINT gdi_SurfaceCommand_AVC420(rdpGdi* gdi, RdpgfxClientContext* context,
|
|||||||
for (UINT32 i = 0; i < meta->numRegionRects; i++)
|
for (UINT32 i = 0; i < meta->numRegionRects; i++)
|
||||||
{
|
{
|
||||||
region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion),
|
region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion),
|
||||||
(RECTANGLE_16*)&(meta->regionRects[i]));
|
&(meta->regionRects[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId,
|
status = IFCALLRESULT(CHANNEL_RC_OK, context->UpdateSurfaceArea, context, surface->surfaceId,
|
||||||
|
@ -102,8 +102,8 @@ static pstatus_t general_copy_8u(const BYTE* pSrc, BYTE* pDst, INT32 len)
|
|||||||
static pstatus_t general_copy_8u_AC4r(const BYTE* pSrc, INT32 srcStep, BYTE* pDst, INT32 dstStep,
|
static pstatus_t general_copy_8u_AC4r(const BYTE* pSrc, INT32 srcStep, BYTE* pDst, INT32 dstStep,
|
||||||
INT32 width, INT32 height)
|
INT32 width, INT32 height)
|
||||||
{
|
{
|
||||||
const BYTE* src = (const BYTE*)pSrc;
|
const BYTE* src = pSrc;
|
||||||
BYTE* dst = (BYTE*)pDst;
|
BYTE* dst = pDst;
|
||||||
int rowbytes = width * sizeof(UINT32);
|
int rowbytes = width * sizeof(UINT32);
|
||||||
|
|
||||||
if ((width == 0) || (height == 0))
|
if ((width == 0) || (height == 0))
|
||||||
|
@ -41,7 +41,7 @@ static pstatus_t general_zero(void* pDst, size_t len)
|
|||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
static pstatus_t general_set_32s(INT32 val, INT32* pDst, UINT32 len)
|
static pstatus_t general_set_32s(INT32 val, INT32* pDst, UINT32 len)
|
||||||
{
|
{
|
||||||
INT32* dptr = (INT32*)pDst;
|
INT32* dptr = pDst;
|
||||||
size_t span = 0;
|
size_t span = 0;
|
||||||
size_t remaining = 0;
|
size_t remaining = 0;
|
||||||
primitives_t* prims = NULL;
|
primitives_t* prims = NULL;
|
||||||
@ -78,7 +78,7 @@ static pstatus_t general_set_32s(INT32 val, INT32* pDst, UINT32 len)
|
|||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
static pstatus_t general_set_32u(UINT32 val, UINT32* pDst, UINT32 len)
|
static pstatus_t general_set_32u(UINT32 val, UINT32* pDst, UINT32 len)
|
||||||
{
|
{
|
||||||
UINT32* dptr = (UINT32*)pDst;
|
UINT32* dptr = pDst;
|
||||||
size_t span = 0;
|
size_t span = 0;
|
||||||
size_t remaining = 0;
|
size_t remaining = 0;
|
||||||
primitives_t* prims = NULL;
|
primitives_t* prims = NULL;
|
||||||
|
@ -78,7 +78,7 @@ static INLINE pstatus_t general_lShiftC_16u(const UINT16* pSrc, UINT32 val, UINT
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
while (len--)
|
while (len--)
|
||||||
*pDst++ = (INT16)((UINT16)*pSrc++ << val);
|
*pDst++ = (INT16)(*pSrc++ << val);
|
||||||
|
|
||||||
return PRIMITIVES_SUCCESS;
|
return PRIMITIVES_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert(const BYTE* WINPR_RESTRICT pSr
|
|||||||
UINT8 shift, BOOL withAlpha)
|
UINT8 shift, BOOL withAlpha)
|
||||||
{
|
{
|
||||||
const BYTE* sptr = pSrc;
|
const BYTE* sptr = pSrc;
|
||||||
BYTE* dptr = (BYTE*)pDst;
|
BYTE* dptr = pDst;
|
||||||
int sRowBump = srcStep - width * sizeof(UINT32);
|
int sRowBump = srcStep - width * sizeof(UINT32);
|
||||||
int dRowBump = dstStep - width * sizeof(UINT32);
|
int dRowBump = dstStep - width * sizeof(UINT32);
|
||||||
/* Shift left by "shift" and divide by two is the same as shift
|
/* Shift left by "shift" and divide by two is the same as shift
|
||||||
@ -227,7 +227,7 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert(const BYTE* WINPR_RESTRICT
|
|||||||
UINT32 height, UINT8 shift, BOOL withAlpha)
|
UINT32 height, UINT8 shift, BOOL withAlpha)
|
||||||
{
|
{
|
||||||
const BYTE* sptr = pSrc;
|
const BYTE* sptr = pSrc;
|
||||||
BYTE* dptr = (BYTE*)pDst;
|
BYTE* dptr = pDst;
|
||||||
int sRowBump = srcStep - width * sizeof(UINT32);
|
int sRowBump = srcStep - width * sizeof(UINT32);
|
||||||
int dRowBump = dstStep - width * sizeof(UINT32);
|
int dRowBump = dstStep - width * sizeof(UINT32);
|
||||||
/* Shift left by "shift" and divide by two is the same as shift
|
/* Shift left by "shift" and divide by two is the same as shift
|
||||||
|
@ -39,15 +39,13 @@ static pstatus_t sse3_add_16s_inplace(INT16* WINPR_RESTRICT pSrcDst1,
|
|||||||
INT16* WINPR_RESTRICT pSrcDst2, UINT32 len)
|
INT16* WINPR_RESTRICT pSrcDst2, UINT32 len)
|
||||||
{
|
{
|
||||||
const int shifts = 2;
|
const int shifts = 2;
|
||||||
UINT32 offBeatMask;
|
|
||||||
INT16* dptr1 = pSrcDst1;
|
INT16* dptr1 = pSrcDst1;
|
||||||
INT16* dptr2 = pSrcDst2;
|
INT16* dptr2 = pSrcDst2;
|
||||||
|
|
||||||
size_t count;
|
|
||||||
if (len < 16) /* pointless if too small */
|
if (len < 16) /* pointless if too small */
|
||||||
return generic->add_16s_inplace(pSrcDst1, pSrcDst2, len);
|
return generic->add_16s_inplace(pSrcDst1, pSrcDst2, len);
|
||||||
|
|
||||||
offBeatMask = (1 << (shifts - 1)) - 1;
|
UINT32 offBeatMask = (1 << (shifts - 1)) - 1;
|
||||||
if ((ULONG_PTR)pSrcDst1 & offBeatMask)
|
if ((ULONG_PTR)pSrcDst1 & offBeatMask)
|
||||||
{
|
{
|
||||||
/* Incrementing the pointer skips over 16-byte boundary. */
|
/* Incrementing the pointer skips over 16-byte boundary. */
|
||||||
@ -65,7 +63,7 @@ static pstatus_t sse3_add_16s_inplace(INT16* WINPR_RESTRICT pSrcDst1,
|
|||||||
dptr2 += add;
|
dptr2 += add;
|
||||||
}
|
}
|
||||||
/* Use 4 128-bit SSE registers. */
|
/* Use 4 128-bit SSE registers. */
|
||||||
count = len >> (7 - shifts);
|
size_t count = len >> (7 - shifts);
|
||||||
len -= count << (7 - shifts);
|
len -= count << (7 - shifts);
|
||||||
if (((const ULONG_PTR)dptr1 & 0x0f) || ((const ULONG_PTR)dptr2 & 0x0f))
|
if (((const ULONG_PTR)dptr1 & 0x0f) || ((const ULONG_PTR)dptr2 & 0x0f))
|
||||||
{
|
{
|
||||||
|
@ -214,9 +214,9 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* const WINPR_RESTRICT pSrc[3], UIN
|
|||||||
const __m128i g_cr = _mm_set1_epi16(-11698); /* -0.714 << 14 */
|
const __m128i g_cr = _mm_set1_epi16(-11698); /* -0.714 << 14 */
|
||||||
const __m128i b_cb = _mm_set1_epi16(28999); /* 1.770 << 14 */
|
const __m128i b_cb = _mm_set1_epi16(28999); /* 1.770 << 14 */
|
||||||
const __m128i c4096 = _mm_set1_epi16(4096);
|
const __m128i c4096 = _mm_set1_epi16(4096);
|
||||||
const INT16* y_buf = (const INT16*)pSrc[0];
|
const INT16* y_buf = pSrc[0];
|
||||||
const INT16* cb_buf = (const INT16*)pSrc[1];
|
const INT16* cb_buf = pSrc[1];
|
||||||
const INT16* cr_buf = (const INT16*)pSrc[2];
|
const INT16* cr_buf = pSrc[2];
|
||||||
const UINT32 pad = roi->width % 16;
|
const UINT32 pad = roi->width % 16;
|
||||||
const UINT32 step = sizeof(__m128i) / sizeof(INT16);
|
const UINT32 step = sizeof(__m128i) / sizeof(INT16);
|
||||||
const UINT32 imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
|
const UINT32 imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
|
||||||
@ -412,9 +412,9 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* const WINPR_RESTRICT pSrc[3], UIN
|
|||||||
const __m128i g_cr = _mm_set1_epi16(-11698); /* -0.714 << 14 */
|
const __m128i g_cr = _mm_set1_epi16(-11698); /* -0.714 << 14 */
|
||||||
const __m128i b_cb = _mm_set1_epi16(28999); /* 1.770 << 14 */
|
const __m128i b_cb = _mm_set1_epi16(28999); /* 1.770 << 14 */
|
||||||
const __m128i c4096 = _mm_set1_epi16(4096);
|
const __m128i c4096 = _mm_set1_epi16(4096);
|
||||||
const INT16* y_buf = (const INT16*)pSrc[0];
|
const INT16* y_buf = pSrc[0];
|
||||||
const INT16* cb_buf = (const INT16*)pSrc[1];
|
const INT16* cb_buf = pSrc[1];
|
||||||
const INT16* cr_buf = (const INT16*)pSrc[2];
|
const INT16* cr_buf = pSrc[2];
|
||||||
const UINT32 pad = roi->width % 16;
|
const UINT32 pad = roi->width % 16;
|
||||||
const UINT32 step = sizeof(__m128i) / sizeof(INT16);
|
const UINT32 step = sizeof(__m128i) / sizeof(INT16);
|
||||||
const UINT32 imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
|
const UINT32 imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
|
||||||
@ -779,7 +779,7 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX(
|
|||||||
BYTE* out = NULL;
|
BYTE* out = NULL;
|
||||||
UINT32 srcbump = 0;
|
UINT32 srcbump = 0;
|
||||||
UINT32 dstbump = 0;
|
UINT32 dstbump = 0;
|
||||||
out = (BYTE*)pDst;
|
out = pDst;
|
||||||
srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16);
|
srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16);
|
||||||
dstbump = (dstStep - (roi->width * sizeof(UINT32)));
|
dstbump = (dstStep - (roi->width * sizeof(UINT32)));
|
||||||
|
|
||||||
@ -890,7 +890,7 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX(
|
|||||||
BYTE* out = NULL;
|
BYTE* out = NULL;
|
||||||
UINT32 srcbump = 0;
|
UINT32 srcbump = 0;
|
||||||
UINT32 dstbump = 0;
|
UINT32 dstbump = 0;
|
||||||
out = (BYTE*)pDst;
|
out = pDst;
|
||||||
srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16);
|
srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16);
|
||||||
dstbump = (dstStep - (roi->width * sizeof(UINT32)));
|
dstbump = (dstStep - (roi->width * sizeof(UINT32)));
|
||||||
|
|
||||||
@ -1001,7 +1001,7 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR(
|
|||||||
BYTE* out = NULL;
|
BYTE* out = NULL;
|
||||||
UINT32 srcbump = 0;
|
UINT32 srcbump = 0;
|
||||||
UINT32 dstbump = 0;
|
UINT32 dstbump = 0;
|
||||||
out = (BYTE*)pDst;
|
out = pDst;
|
||||||
srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16);
|
srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16);
|
||||||
dstbump = (dstStep - (roi->width * sizeof(UINT32)));
|
dstbump = (dstStep - (roi->width * sizeof(UINT32)));
|
||||||
|
|
||||||
@ -1112,7 +1112,7 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB(
|
|||||||
BYTE* out = NULL;
|
BYTE* out = NULL;
|
||||||
UINT32 srcbump = 0;
|
UINT32 srcbump = 0;
|
||||||
UINT32 dstbump = 0;
|
UINT32 dstbump = 0;
|
||||||
out = (BYTE*)pDst;
|
out = pDst;
|
||||||
srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16);
|
srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16);
|
||||||
dstbump = (dstStep - (roi->width * sizeof(UINT32)));
|
dstbump = (dstStep - (roi->width * sizeof(UINT32)));
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ static pstatus_t sse2_set_8u(BYTE val, BYTE* WINPR_RESTRICT pDst, UINT32 len)
|
|||||||
return generic->set_8u(val, pDst, len);
|
return generic->set_8u(val, pDst, len);
|
||||||
|
|
||||||
byte = val;
|
byte = val;
|
||||||
dptr = (BYTE*)pDst;
|
dptr = pDst;
|
||||||
|
|
||||||
/* Seek 16-byte alignment. */
|
/* Seek 16-byte alignment. */
|
||||||
while ((ULONG_PTR)dptr & 0x0f)
|
while ((ULONG_PTR)dptr & 0x0f)
|
||||||
@ -116,7 +116,7 @@ static pstatus_t sse2_set_8u(BYTE val, BYTE* WINPR_RESTRICT pDst, UINT32 len)
|
|||||||
static pstatus_t sse2_set_32u(UINT32 val, UINT32* WINPR_RESTRICT pDst, UINT32 len)
|
static pstatus_t sse2_set_32u(UINT32 val, UINT32* WINPR_RESTRICT pDst, UINT32 len)
|
||||||
{
|
{
|
||||||
const primitives_t* prim = primitives_get_generic();
|
const primitives_t* prim = primitives_get_generic();
|
||||||
UINT32* dptr = (UINT32*)pDst;
|
UINT32* dptr = pDst;
|
||||||
__m128i xmm0;
|
__m128i xmm0;
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ SSE3_SCD_ROUTINE(sse2_rShiftC_16u, UINT16, generic->rShiftC_16u, _mm_srli_epi16,
|
|||||||
static pstatus_t sse2_lShiftC_16s_inplace(INT16* WINPR_RESTRICT pSrcDst, UINT32 val, UINT32 len)
|
static pstatus_t sse2_lShiftC_16s_inplace(INT16* WINPR_RESTRICT pSrcDst, UINT32 val, UINT32 len)
|
||||||
{
|
{
|
||||||
const INT32 shifts = 2;
|
const INT32 shifts = 2;
|
||||||
int count;
|
|
||||||
if (val == 0)
|
if (val == 0)
|
||||||
return PRIMITIVES_SUCCESS;
|
return PRIMITIVES_SUCCESS;
|
||||||
if (val >= 16)
|
if (val >= 16)
|
||||||
@ -73,7 +72,7 @@ static pstatus_t sse2_lShiftC_16s_inplace(INT16* WINPR_RESTRICT pSrcDst, UINT32
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Use 8 128-bit SSE registers. */
|
/* Use 8 128-bit SSE registers. */
|
||||||
count = len >> (8 - shifts);
|
int count = len >> (8 - shifts);
|
||||||
len -= count << (8 - shifts);
|
len -= count << (8 - shifts);
|
||||||
|
|
||||||
while (count--)
|
while (count--)
|
||||||
|
@ -33,8 +33,8 @@ static primitives_t* generic = NULL;
|
|||||||
static pstatus_t ssse3_sign_16s(const INT16* WINPR_RESTRICT pSrc, INT16* WINPR_RESTRICT pDst,
|
static pstatus_t ssse3_sign_16s(const INT16* WINPR_RESTRICT pSrc, INT16* WINPR_RESTRICT pDst,
|
||||||
UINT32 len)
|
UINT32 len)
|
||||||
{
|
{
|
||||||
const INT16* sptr = (const INT16*)pSrc;
|
const INT16* sptr = pSrc;
|
||||||
INT16* dptr = (INT16*)pDst;
|
INT16* dptr = pDst;
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
|
|
||||||
if (len < 16)
|
if (len < 16)
|
||||||
|
@ -1492,7 +1492,7 @@ static LONG smartcard_LocateCardsByATRA_Call(scard_call_context* smartcard, wStr
|
|||||||
|
|
||||||
for (UINT32 i = 0; i < call->cReaders; i++)
|
for (UINT32 i = 0; i < call->cReaders; i++)
|
||||||
{
|
{
|
||||||
states[i].szReader = (LPSTR)call->rgReaderStates[i].szReader;
|
states[i].szReader = call->rgReaderStates[i].szReader;
|
||||||
states[i].dwCurrentState = call->rgReaderStates[i].dwCurrentState;
|
states[i].dwCurrentState = call->rgReaderStates[i].dwCurrentState;
|
||||||
states[i].dwEventState = call->rgReaderStates[i].dwEventState;
|
states[i].dwEventState = call->rgReaderStates[i].dwEventState;
|
||||||
states[i].cbAtr = call->rgReaderStates[i].cbAtr;
|
states[i].cbAtr = call->rgReaderStates[i].cbAtr;
|
||||||
|
@ -104,7 +104,7 @@ static void test_peer_context_free(freerdp_peer* client, rdpContext* ctx)
|
|||||||
rdpsnd_server_context_free(context->rdpsnd);
|
rdpsnd_server_context_free(context->rdpsnd);
|
||||||
encomsp_server_context_free(context->encomsp);
|
encomsp_server_context_free(context->encomsp);
|
||||||
|
|
||||||
WTSCloseServer((HANDLE)context->vcm);
|
WTSCloseServer(context->vcm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ void client_to_proxy_context_free(freerdp_peer* client, rdpContext* ctx)
|
|||||||
HashTable_Free(context->channelsByBackId);
|
HashTable_Free(context->channelsByBackId);
|
||||||
|
|
||||||
if (context->vcm && (context->vcm != INVALID_HANDLE_VALUE))
|
if (context->vcm && (context->vcm != INVALID_HANDLE_VALUE))
|
||||||
WTSCloseServer((HANDLE)context->vcm);
|
WTSCloseServer(context->vcm);
|
||||||
context->vcm = NULL;
|
context->vcm = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ static void shadow_client_context_free(freerdp_peer* peer, rdpContext* context)
|
|||||||
|
|
||||||
/* Clear queued messages and free resource */
|
/* Clear queued messages and free resource */
|
||||||
MessageQueue_Free(client->MsgQueue);
|
MessageQueue_Free(client->MsgQueue);
|
||||||
WTSCloseServer((HANDLE)client->vcm);
|
WTSCloseServer(client->vcm);
|
||||||
region16_uninit(&(client->invalidRegion));
|
region16_uninit(&(client->invalidRegion));
|
||||||
DeleteCriticalSection(&(client->lock));
|
DeleteCriticalSection(&(client->lock));
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ BOOL ClipboardEmpty(wClipboard* clipboard)
|
|||||||
|
|
||||||
if (clipboard->data)
|
if (clipboard->data)
|
||||||
{
|
{
|
||||||
free((void*)clipboard->data);
|
free(clipboard->data);
|
||||||
clipboard->data = NULL;
|
clipboard->data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,7 +449,7 @@ void* ClipboardGetData(wClipboard* clipboard, UINT32 formatId, UINT32* pSize)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
SrcSize = clipboard->size;
|
SrcSize = clipboard->size;
|
||||||
pSrcData = (void*)clipboard->data;
|
pSrcData = clipboard->data;
|
||||||
|
|
||||||
if (formatId == format->formatId)
|
if (formatId == format->formatId)
|
||||||
{
|
{
|
||||||
@ -490,7 +490,7 @@ BOOL ClipboardSetData(wClipboard* clipboard, UINT32 formatId, const void* data,
|
|||||||
if (!format)
|
if (!format)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
free((void*)clipboard->data);
|
free(clipboard->data);
|
||||||
clipboard->data = malloc(size);
|
clipboard->data = malloc(size);
|
||||||
|
|
||||||
if (!clipboard->data)
|
if (!clipboard->data)
|
||||||
@ -587,7 +587,7 @@ void ClipboardDestroy(wClipboard* clipboard)
|
|||||||
|
|
||||||
ClipboardUninitFormats(clipboard);
|
ClipboardUninitFormats(clipboard);
|
||||||
|
|
||||||
free((void*)clipboard->data);
|
free(clipboard->data);
|
||||||
clipboard->data = NULL;
|
clipboard->data = NULL;
|
||||||
clipboard->size = 0;
|
clipboard->size = 0;
|
||||||
clipboard->numFormats = 0;
|
clipboard->numFormats = 0;
|
||||||
@ -675,7 +675,7 @@ char* parse_uri_to_local_file(const char* uri, size_t uri_len)
|
|||||||
if (is_dos_drive(&uri[prefixLen + 1], uri_len - prefixLen - 1))
|
if (is_dos_drive(&uri[prefixLen + 1], uri_len - prefixLen - 1))
|
||||||
{
|
{
|
||||||
// Dos and Windows file URI
|
// Dos and Windows file URI
|
||||||
localName = (const char*)(uri + prefixLen + 1);
|
localName = (uri + prefixLen + 1);
|
||||||
localLen = uri_len - prefixLen - 1;
|
localLen = uri_len - prefixLen - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -309,7 +309,7 @@ int _wcsncmp(const WCHAR* string1, const WCHAR* string2, size_t count)
|
|||||||
|
|
||||||
size_t _wcslen(const WCHAR* str)
|
size_t _wcslen(const WCHAR* str)
|
||||||
{
|
{
|
||||||
const WCHAR* p = (const WCHAR*)str;
|
const WCHAR* p = str;
|
||||||
|
|
||||||
WINPR_ASSERT(p);
|
WINPR_ASSERT(p);
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ WCHAR* _wcschr(const WCHAR* str, WCHAR value)
|
|||||||
const WCHAR* cc;
|
const WCHAR* cc;
|
||||||
WCHAR* c;
|
WCHAR* c;
|
||||||
} cnv;
|
} cnv;
|
||||||
const WCHAR* p = (const WCHAR*)str;
|
const WCHAR* p = str;
|
||||||
|
|
||||||
while (*p && (*p != value))
|
while (*p && (*p != value))
|
||||||
p++;
|
p++;
|
||||||
|
@ -405,8 +405,8 @@ SSIZE_T ConvertWCharNToUtf8(const WCHAR* wstr, size_t wlen, char* str, size_t le
|
|||||||
isNullTerminated = TRUE;
|
isNullTerminated = TRUE;
|
||||||
iwlen++;
|
iwlen++;
|
||||||
}
|
}
|
||||||
const int rc = WideCharToMultiByte(CP_UTF8, 0, wstr, (int)iwlen, str, (int)MIN(INT32_MAX, len),
|
const int rc =
|
||||||
NULL, NULL);
|
WideCharToMultiByte(CP_UTF8, 0, wstr, (int)iwlen, str, MIN(INT32_MAX, len), NULL, NULL);
|
||||||
if ((rc <= 0) || ((len > 0) && ((size_t)rc > len)))
|
if ((rc <= 0) || ((len > 0) && ((size_t)rc > len)))
|
||||||
return -1;
|
return -1;
|
||||||
else if (!isNullTerminated)
|
else if (!isNullTerminated)
|
||||||
@ -437,7 +437,7 @@ SSIZE_T ConvertMszWCharNToUtf8(const WCHAR* wstr, size_t wlen, char* str, size_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int iwlen = MIN(INT32_MAX, len);
|
const int iwlen = MIN(INT32_MAX, len);
|
||||||
const int rc = WideCharToMultiByte(CP_UTF8, 0, wstr, (int)wlen, str, (int)iwlen, NULL, NULL);
|
const int rc = WideCharToMultiByte(CP_UTF8, 0, wstr, (int)wlen, str, iwlen, NULL, NULL);
|
||||||
if ((rc <= 0) || ((len > 0) && (rc > iwlen)))
|
if ((rc <= 0) || ((len > 0) && (rc > iwlen)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -478,7 +478,7 @@ SSIZE_T ConvertUtf8NToWChar(const char* str, size_t len, WCHAR* wstr, size_t wle
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int iwlen = MIN(INT32_MAX, wlen);
|
const int iwlen = MIN(INT32_MAX, wlen);
|
||||||
const int rc = MultiByteToWideChar(CP_UTF8, 0, str, (int)ilen, wstr, (int)iwlen);
|
const int rc = MultiByteToWideChar(CP_UTF8, 0, str, (int)ilen, wstr, iwlen);
|
||||||
if ((rc <= 0) || ((wlen > 0) && (rc > iwlen)))
|
if ((rc <= 0) || ((wlen > 0) && (rc > iwlen)))
|
||||||
return -1;
|
return -1;
|
||||||
if (!isNullTerminated)
|
if (!isNullTerminated)
|
||||||
@ -509,7 +509,7 @@ SSIZE_T ConvertMszUtf8NToWChar(const char* str, size_t len, WCHAR* wstr, size_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int iwlen = MIN(INT32_MAX, wlen);
|
const int iwlen = MIN(INT32_MAX, wlen);
|
||||||
const int rc = MultiByteToWideChar(CP_UTF8, 0, str, (int)len, wstr, (int)iwlen);
|
const int rc = MultiByteToWideChar(CP_UTF8, 0, str, (int)len, wstr, iwlen);
|
||||||
if ((rc <= 0) || ((wlen > 0) && (rc > iwlen)))
|
if ((rc <= 0) || ((wlen > 0) && (rc > iwlen)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -627,7 +627,7 @@ int winpr_Cipher_BytesToKey(int cipher, WINPR_MD_TYPE md, const void* salt, cons
|
|||||||
#if defined(WITH_OPENSSL)
|
#if defined(WITH_OPENSSL)
|
||||||
const EVP_MD* evp_md = NULL;
|
const EVP_MD* evp_md = NULL;
|
||||||
const EVP_CIPHER* evp_cipher = NULL;
|
const EVP_CIPHER* evp_cipher = NULL;
|
||||||
evp_md = winpr_openssl_get_evp_md((WINPR_MD_TYPE)md);
|
evp_md = winpr_openssl_get_evp_md(md);
|
||||||
evp_cipher = winpr_openssl_get_evp_cipher(cipher);
|
evp_cipher = winpr_openssl_get_evp_cipher(cipher);
|
||||||
return EVP_BytesToKey(evp_cipher, evp_md, salt, data, datal, count, key, iv);
|
return EVP_BytesToKey(evp_cipher, evp_md, salt, data, datal, count, key, iv);
|
||||||
#elif defined(WITH_MBEDTLS)
|
#elif defined(WITH_MBEDTLS)
|
||||||
|
@ -371,13 +371,13 @@ static BOOL FileGetFileInformationByHandle(HANDLE hFile,
|
|||||||
#else
|
#else
|
||||||
ft = STAT_TIME_TO_FILETIME(st.st_ctime);
|
ft = STAT_TIME_TO_FILETIME(st.st_ctime);
|
||||||
#endif
|
#endif
|
||||||
lpFileInformation->ftCreationTime.dwHighDateTime = ((UINT64)ft) >> 32ULL;
|
lpFileInformation->ftCreationTime.dwHighDateTime = (ft) >> 32ULL;
|
||||||
lpFileInformation->ftCreationTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
lpFileInformation->ftCreationTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
||||||
ft = STAT_TIME_TO_FILETIME(st.st_mtime);
|
ft = STAT_TIME_TO_FILETIME(st.st_mtime);
|
||||||
lpFileInformation->ftLastWriteTime.dwHighDateTime = ((UINT64)ft) >> 32ULL;
|
lpFileInformation->ftLastWriteTime.dwHighDateTime = (ft) >> 32ULL;
|
||||||
lpFileInformation->ftLastWriteTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
lpFileInformation->ftLastWriteTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
||||||
ft = STAT_TIME_TO_FILETIME(st.st_atime);
|
ft = STAT_TIME_TO_FILETIME(st.st_atime);
|
||||||
lpFileInformation->ftLastAccessTime.dwHighDateTime = ((UINT64)ft) >> 32ULL;
|
lpFileInformation->ftLastAccessTime.dwHighDateTime = (ft) >> 32ULL;
|
||||||
lpFileInformation->ftLastAccessTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
lpFileInformation->ftLastAccessTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
||||||
lpFileInformation->nFileSizeHigh = ((UINT64)st.st_size) >> 32ULL;
|
lpFileInformation->nFileSizeHigh = ((UINT64)st.st_size) >> 32ULL;
|
||||||
lpFileInformation->nFileSizeLow = st.st_size & 0xFFFFFFFF;
|
lpFileInformation->nFileSizeLow = st.st_size & 0xFFFFFFFF;
|
||||||
|
@ -978,13 +978,13 @@ static BOOL FindDataFromStat(const char* path, const struct stat* fileStat,
|
|||||||
#else
|
#else
|
||||||
ft = STAT_TIME_TO_FILETIME(fileStat->st_ctime);
|
ft = STAT_TIME_TO_FILETIME(fileStat->st_ctime);
|
||||||
#endif
|
#endif
|
||||||
lpFindFileData->ftCreationTime.dwHighDateTime = ((UINT64)ft) >> 32ULL;
|
lpFindFileData->ftCreationTime.dwHighDateTime = (ft) >> 32ULL;
|
||||||
lpFindFileData->ftCreationTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
lpFindFileData->ftCreationTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
||||||
ft = STAT_TIME_TO_FILETIME(fileStat->st_mtime);
|
ft = STAT_TIME_TO_FILETIME(fileStat->st_mtime);
|
||||||
lpFindFileData->ftLastWriteTime.dwHighDateTime = ((UINT64)ft) >> 32ULL;
|
lpFindFileData->ftLastWriteTime.dwHighDateTime = (ft) >> 32ULL;
|
||||||
lpFindFileData->ftLastWriteTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
lpFindFileData->ftLastWriteTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
||||||
ft = STAT_TIME_TO_FILETIME(fileStat->st_atime);
|
ft = STAT_TIME_TO_FILETIME(fileStat->st_atime);
|
||||||
lpFindFileData->ftLastAccessTime.dwHighDateTime = ((UINT64)ft) >> 32ULL;
|
lpFindFileData->ftLastAccessTime.dwHighDateTime = (ft) >> 32ULL;
|
||||||
lpFindFileData->ftLastAccessTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
lpFindFileData->ftLastAccessTime.dwLowDateTime = ft & 0xFFFFFFFF;
|
||||||
lpFindFileData->nFileSizeHigh = ((UINT64)fileStat->st_size) >> 32ULL;
|
lpFindFileData->nFileSizeHigh = ((UINT64)fileStat->st_size) >> 32ULL;
|
||||||
lpFindFileData->nFileSizeLow = fileStat->st_size & 0xFFFFFFFF;
|
lpFindFileData->nFileSizeLow = fileStat->st_size & 0xFFFFFFFF;
|
||||||
|
@ -204,9 +204,9 @@ static HANDLE NamedPipeClientCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAcces
|
|||||||
if (status != 0)
|
if (status != 0)
|
||||||
{
|
{
|
||||||
close(pNamedPipe->clientfd);
|
close(pNamedPipe->clientfd);
|
||||||
free((char*)pNamedPipe->name);
|
free(pNamedPipe->name);
|
||||||
free((char*)pNamedPipe->lpFileName);
|
free(pNamedPipe->lpFileName);
|
||||||
free((char*)pNamedPipe->lpFilePath);
|
free(pNamedPipe->lpFilePath);
|
||||||
free(pNamedPipe);
|
free(pNamedPipe);
|
||||||
return INVALID_HANDLE_VALUE;
|
return INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ char* GetNamedPipeUnixDomainSocketFilePathA(LPCSTR lpName)
|
|||||||
char* lpFilePath = NULL;
|
char* lpFilePath = NULL;
|
||||||
lpPipePath = GetNamedPipeUnixDomainSocketBaseFilePathA();
|
lpPipePath = GetNamedPipeUnixDomainSocketBaseFilePathA();
|
||||||
lpFileName = GetNamedPipeNameWithoutPrefixA(lpName);
|
lpFileName = GetNamedPipeNameWithoutPrefixA(lpName);
|
||||||
lpFilePath = GetCombinedPath(lpPipePath, (char*)lpFileName);
|
lpFilePath = GetCombinedPath(lpPipePath, lpFileName);
|
||||||
free(lpPipePath);
|
free(lpPipePath);
|
||||||
free(lpFileName);
|
free(lpFileName);
|
||||||
return lpFilePath;
|
return lpFilePath;
|
||||||
|
@ -109,7 +109,7 @@ static char* GetDeviceFileUnixDomainSocketFilePathA(LPCSTR lpName)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
lpFilePath = GetCombinedPath(lpPipePath, (char*)lpFileName);
|
lpFilePath = GetCombinedPath(lpPipePath, lpFileName);
|
||||||
free(lpPipePath);
|
free(lpPipePath);
|
||||||
free(lpFileName);
|
free(lpFileName);
|
||||||
return lpFilePath;
|
return lpFilePath;
|
||||||
|
@ -240,7 +240,7 @@ SECURITY_STATUS NCryptGetProperty(NCRYPT_HANDLE hObject, LPCWSTR pszProperty, PB
|
|||||||
SECURITY_STATUS NCryptFreeObject(NCRYPT_HANDLE hObject)
|
SECURITY_STATUS NCryptFreeObject(NCRYPT_HANDLE hObject)
|
||||||
{
|
{
|
||||||
NCryptBaseHandle* base = NULL;
|
NCryptBaseHandle* base = NULL;
|
||||||
SECURITY_STATUS ret = checkNCryptHandle((NCRYPT_HANDLE)hObject, WINPR_NCRYPT_INVALID);
|
SECURITY_STATUS ret = checkNCryptHandle(hObject, WINPR_NCRYPT_INVALID);
|
||||||
if (ret != ERROR_SUCCESS)
|
if (ret != ERROR_SUCCESS)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -2104,10 +2104,10 @@ static LONG WINAPI PCSC_SCardState(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD
|
|||||||
if (mszReaderNames)
|
if (mszReaderNames)
|
||||||
PCSC_SCardFreeMemory_Internal(hContext, mszReaderNames);
|
PCSC_SCardFreeMemory_Internal(hContext, mszReaderNames);
|
||||||
|
|
||||||
*pdwState = (DWORD)pcsc_dwState;
|
*pdwState = pcsc_dwState;
|
||||||
*pdwProtocol = PCSC_ConvertProtocolsToWinSCard((DWORD)pcsc_dwProtocol);
|
*pdwProtocol = PCSC_ConvertProtocolsToWinSCard(pcsc_dwProtocol);
|
||||||
if (pcbAtrLen)
|
if (pcbAtrLen)
|
||||||
*pcbAtrLen = (DWORD)pcsc_cbAtrLen;
|
*pcbAtrLen = pcsc_cbAtrLen;
|
||||||
return PCSC_MapErrorCodeToWinSCard(status);
|
return PCSC_MapErrorCodeToWinSCard(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1087,7 +1087,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULON
|
|||||||
{
|
{
|
||||||
Data_Write_UINT32(&value, SeqNo);
|
Data_Write_UINT32(&value, SeqNo);
|
||||||
winpr_HMAC_Update(hmac, (void*)&value, 4);
|
winpr_HMAC_Update(hmac, (void*)&value, 4);
|
||||||
winpr_HMAC_Update(hmac, (void*)data, length);
|
winpr_HMAC_Update(hmac, data, length);
|
||||||
winpr_HMAC_Final(hmac, digest, WINPR_MD5_DIGEST_LENGTH);
|
winpr_HMAC_Final(hmac, digest, WINPR_MD5_DIGEST_LENGTH);
|
||||||
winpr_HMAC_Free(hmac);
|
winpr_HMAC_Free(hmac);
|
||||||
}
|
}
|
||||||
@ -1186,7 +1186,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSec
|
|||||||
{
|
{
|
||||||
Data_Write_UINT32(&value, SeqNo);
|
Data_Write_UINT32(&value, SeqNo);
|
||||||
winpr_HMAC_Update(hmac, (void*)&value, 4);
|
winpr_HMAC_Update(hmac, (void*)&value, 4);
|
||||||
winpr_HMAC_Update(hmac, (void*)data_buffer->pvBuffer, data_buffer->cbBuffer);
|
winpr_HMAC_Update(hmac, data_buffer->pvBuffer, data_buffer->cbBuffer);
|
||||||
winpr_HMAC_Final(hmac, digest, WINPR_MD5_DIGEST_LENGTH);
|
winpr_HMAC_Final(hmac, digest, WINPR_MD5_DIGEST_LENGTH);
|
||||||
winpr_HMAC_Free(hmac);
|
winpr_HMAC_Free(hmac);
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,7 @@ static BOOL ntlm_fetch_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash)
|
|||||||
NTOWFv2FromHashW(entry->NtHash, (LPWSTR)credentials->identity.User,
|
NTOWFv2FromHashW(entry->NtHash, (LPWSTR)credentials->identity.User,
|
||||||
credentials->identity.UserLength * sizeof(WCHAR),
|
credentials->identity.UserLength * sizeof(WCHAR),
|
||||||
(LPWSTR)credentials->identity.Domain,
|
(LPWSTR)credentials->identity.Domain,
|
||||||
credentials->identity.DomainLength * sizeof(WCHAR), (BYTE*)hash);
|
credentials->identity.DomainLength * sizeof(WCHAR), hash);
|
||||||
|
|
||||||
rc = TRUE;
|
rc = TRUE;
|
||||||
|
|
||||||
@ -450,7 +450,7 @@ static BOOL ntlm_compute_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash)
|
|||||||
{
|
{
|
||||||
NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User,
|
NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User,
|
||||||
credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain,
|
credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain,
|
||||||
credentials->identity.DomainLength * 2, (BYTE*)hash);
|
credentials->identity.DomainLength * 2, hash);
|
||||||
}
|
}
|
||||||
else if (credentials->identity.PasswordLength > SSPI_CREDENTIALS_HASH_LENGTH_OFFSET)
|
else if (credentials->identity.PasswordLength > SSPI_CREDENTIALS_HASH_LENGTH_OFFSET)
|
||||||
{
|
{
|
||||||
@ -460,14 +460,14 @@ static BOOL ntlm_compute_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash)
|
|||||||
|
|
||||||
NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User,
|
NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User,
|
||||||
credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain,
|
credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain,
|
||||||
credentials->identity.DomainLength * 2, (BYTE*)hash);
|
credentials->identity.DomainLength * 2, hash);
|
||||||
}
|
}
|
||||||
else if (credentials->identity.Password)
|
else if (credentials->identity.Password)
|
||||||
{
|
{
|
||||||
NTOWFv2W((LPWSTR)credentials->identity.Password, credentials->identity.PasswordLength * 2,
|
NTOWFv2W((LPWSTR)credentials->identity.Password, credentials->identity.PasswordLength * 2,
|
||||||
(LPWSTR)credentials->identity.User, credentials->identity.UserLength * 2,
|
(LPWSTR)credentials->identity.User, credentials->identity.UserLength * 2,
|
||||||
(LPWSTR)credentials->identity.Domain, credentials->identity.DomainLength * 2,
|
(LPWSTR)credentials->identity.Domain, credentials->identity.DomainLength * 2,
|
||||||
(BYTE*)hash);
|
hash);
|
||||||
}
|
}
|
||||||
else if (context->HashCallback)
|
else if (context->HashCallback)
|
||||||
{
|
{
|
||||||
@ -531,7 +531,7 @@ BOOL ntlm_compute_lm_v2_response(NTLM_CONTEXT* context)
|
|||||||
response = (BYTE*)context->LmChallengeResponse.pvBuffer;
|
response = (BYTE*)context->LmChallengeResponse.pvBuffer;
|
||||||
/* Compute the HMAC-MD5 hash of the resulting value using the NTLMv2 hash as the key */
|
/* Compute the HMAC-MD5 hash of the resulting value using the NTLMv2 hash as the key */
|
||||||
winpr_HMAC(WINPR_MD_MD5, (void*)context->NtlmV2Hash, WINPR_MD5_DIGEST_LENGTH, (BYTE*)value,
|
winpr_HMAC(WINPR_MD_MD5, (void*)context->NtlmV2Hash, WINPR_MD5_DIGEST_LENGTH, (BYTE*)value,
|
||||||
WINPR_MD5_DIGEST_LENGTH, (BYTE*)response, WINPR_MD5_DIGEST_LENGTH);
|
WINPR_MD5_DIGEST_LENGTH, response, WINPR_MD5_DIGEST_LENGTH);
|
||||||
/* Concatenate the resulting HMAC-MD5 hash and the client challenge, giving us the LMv2 response
|
/* Concatenate the resulting HMAC-MD5 hash and the client challenge, giving us the LMv2 response
|
||||||
* (24 bytes) */
|
* (24 bytes) */
|
||||||
CopyMemory(&response[16], context->ClientChallenge, 8);
|
CopyMemory(&response[16], context->ClientChallenge, 8);
|
||||||
|
@ -993,8 +993,7 @@ static const SecurityFunctionTableA* sspi_GetSecurityFunctionTableAByNameA(const
|
|||||||
{
|
{
|
||||||
if (strcmp(Name, SecurityFunctionTableA_NAME_LIST[index].Name) == 0)
|
if (strcmp(Name, SecurityFunctionTableA_NAME_LIST[index].Name) == 0)
|
||||||
{
|
{
|
||||||
return (const SecurityFunctionTableA*)SecurityFunctionTableA_NAME_LIST[index]
|
return SecurityFunctionTableA_NAME_LIST[index].SecurityFunctionTable;
|
||||||
.SecurityFunctionTable;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1009,8 +1008,7 @@ static const SecurityFunctionTableW* sspi_GetSecurityFunctionTableWByNameW(const
|
|||||||
{
|
{
|
||||||
if (_wcscmp(Name, SecurityFunctionTableW_NAME_LIST[index].Name) == 0)
|
if (_wcscmp(Name, SecurityFunctionTableW_NAME_LIST[index].Name) == 0)
|
||||||
{
|
{
|
||||||
return (const SecurityFunctionTableW*)SecurityFunctionTableW_NAME_LIST[index]
|
return SecurityFunctionTableW_NAME_LIST[index].SecurityFunctionTable;
|
||||||
.SecurityFunctionTable;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ static BOOL test_default(void)
|
|||||||
if (!DynamicTest)
|
if (!DynamicTest)
|
||||||
{
|
{
|
||||||
pSecBuffer->cbBuffer = sizeof(TEST_NTLM_NEGOTIATE) - 1;
|
pSecBuffer->cbBuffer = sizeof(TEST_NTLM_NEGOTIATE) - 1;
|
||||||
pSecBuffer->pvBuffer = (void*)malloc(pSecBuffer->cbBuffer);
|
pSecBuffer->pvBuffer = malloc(pSecBuffer->cbBuffer);
|
||||||
|
|
||||||
if (!pSecBuffer->pvBuffer)
|
if (!pSecBuffer->pvBuffer)
|
||||||
{
|
{
|
||||||
@ -604,7 +604,7 @@ static BOOL test_default(void)
|
|||||||
{
|
{
|
||||||
SecPkgContext_AuthNtlmMessage AuthNtlmMessage = { 0 };
|
SecPkgContext_AuthNtlmMessage AuthNtlmMessage = { 0 };
|
||||||
pSecBuffer->cbBuffer = sizeof(TEST_NTLM_CHALLENGE) - 1;
|
pSecBuffer->cbBuffer = sizeof(TEST_NTLM_CHALLENGE) - 1;
|
||||||
pSecBuffer->pvBuffer = (void*)malloc(pSecBuffer->cbBuffer);
|
pSecBuffer->pvBuffer = malloc(pSecBuffer->cbBuffer);
|
||||||
|
|
||||||
if (!pSecBuffer->pvBuffer)
|
if (!pSecBuffer->pvBuffer)
|
||||||
{
|
{
|
||||||
@ -644,7 +644,7 @@ static BOOL test_default(void)
|
|||||||
if (!DynamicTest)
|
if (!DynamicTest)
|
||||||
{
|
{
|
||||||
pSecBuffer->cbBuffer = sizeof(TEST_NTLM_AUTHENTICATE) - 1;
|
pSecBuffer->cbBuffer = sizeof(TEST_NTLM_AUTHENTICATE) - 1;
|
||||||
pSecBuffer->pvBuffer = (void*)malloc(pSecBuffer->cbBuffer);
|
pSecBuffer->pvBuffer = malloc(pSecBuffer->cbBuffer);
|
||||||
|
|
||||||
if (!pSecBuffer->pvBuffer)
|
if (!pSecBuffer->pvBuffer)
|
||||||
{
|
{
|
||||||
|
@ -193,7 +193,7 @@ static DWORD WINAPI TestSynchCritical_Main(LPVOID arg)
|
|||||||
critical.RecursionCount, i);
|
critical.RecursionCount, i);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (critical.OwningThread != (HANDLE)(i ? hMainThread : NULL))
|
if (critical.OwningThread != (i ? hMainThread : NULL))
|
||||||
{
|
{
|
||||||
printf("CriticalSection failure: Could not verify section ownership (loop index=%d).\n",
|
printf("CriticalSection failure: Could not verify section ownership (loop index=%d).\n",
|
||||||
i);
|
i);
|
||||||
|
@ -201,7 +201,7 @@ LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pArgs = (LPSTR*)buffer;
|
pArgs = (LPSTR*)buffer;
|
||||||
pOutput = (char*)&buffer[maxNumArgs * (sizeof(char*))];
|
pOutput = &buffer[maxNumArgs * (sizeof(char*))];
|
||||||
p = (const char*)lpCmdLine;
|
p = (const char*)lpCmdLine;
|
||||||
|
|
||||||
while (p < lpCmdLine + cmdLineLength)
|
while (p < lpCmdLine + cmdLineLength)
|
||||||
|
@ -1099,8 +1099,7 @@ size_t WinPrAsn1DecReadOID(WinPrAsn1Decoder* dec, WinPrAsn1_OID* target, BOOL al
|
|||||||
size_t WinPrAsn1DecReadOctetString(WinPrAsn1Decoder* dec, WinPrAsn1_OctetString* target,
|
size_t WinPrAsn1DecReadOctetString(WinPrAsn1Decoder* dec, WinPrAsn1_OctetString* target,
|
||||||
BOOL allocate)
|
BOOL allocate)
|
||||||
{
|
{
|
||||||
return WinPrAsn1DecReadMemoryChunkLike(dec, ER_TAG_OCTET_STRING, (WinPrAsn1_OctetString*)target,
|
return WinPrAsn1DecReadMemoryChunkLike(dec, ER_TAG_OCTET_STRING, target, allocate);
|
||||||
allocate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t WinPrAsn1DecReadIA5String(WinPrAsn1Decoder* dec, WinPrAsn1_IA5STRING* target)
|
size_t WinPrAsn1DecReadIA5String(WinPrAsn1Decoder* dec, WinPrAsn1_IA5STRING* target)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
int TestArrayList(int argc, char* argv[])
|
int TestArrayList(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int rc = 0;
|
SSIZE_T rc = 0;
|
||||||
size_t val = 0;
|
size_t val = 0;
|
||||||
wArrayList* arrayList = NULL;
|
wArrayList* arrayList = NULL;
|
||||||
const size_t elemsToInsert = 10;
|
const size_t elemsToInsert = 10;
|
||||||
@ -65,7 +65,7 @@ int TestArrayList(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = ArrayList_IndexOf(arrayList, (void*)(size_t)elemsToInsert, -1, -1);
|
rc = ArrayList_IndexOf(arrayList, (void*)elemsToInsert, -1, -1);
|
||||||
printf("ArrayList index: %d\n", rc);
|
printf("ArrayList index: %d\n", rc);
|
||||||
if (rc != -1)
|
if (rc != -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -18,7 +18,7 @@ int TestQueue(int argc, char* argv[])
|
|||||||
|
|
||||||
for (size_t index = 1; index <= 10; index++)
|
for (size_t index = 1; index <= 10; index++)
|
||||||
{
|
{
|
||||||
Queue_Enqueue(queue, (void*)(size_t)index);
|
Queue_Enqueue(queue, (void*)index);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = Queue_Count(queue);
|
count = Queue_Count(queue);
|
||||||
|
@ -104,7 +104,7 @@ static _Unwind_Reason_Code unwind_backtrace_callback(struct _Unwind_Context* con
|
|||||||
{
|
{
|
||||||
unwind_info_t* info = &ctx->info[ctx->pos++];
|
unwind_info_t* info = &ctx->info[ctx->pos++];
|
||||||
info->pc = _Unwind_GetIP(context);
|
info->pc = _Unwind_GetIP(context);
|
||||||
info->langSpecificData = (void*)_Unwind_GetLanguageSpecificData(context);
|
info->langSpecificData = _Unwind_GetLanguageSpecificData(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _URC_NO_REASON;
|
return _URC_NO_REASON;
|
||||||
|
@ -123,7 +123,7 @@ static wLogAppender* WLog_Appender_New(wLog* log, DWORD logAppenderType)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case WLOG_APPENDER_UDP:
|
case WLOG_APPENDER_UDP:
|
||||||
appender = (wLogAppender*)WLog_UdpAppender_New(log);
|
appender = WLog_UdpAppender_New(log);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
(void)fprintf(stderr, "%s: unknown handler type %" PRIu32 "\n", __func__,
|
(void)fprintf(stderr, "%s: unknown handler type %" PRIu32 "\n", __func__,
|
||||||
@ -133,7 +133,7 @@ static wLogAppender* WLog_Appender_New(wLog* log, DWORD logAppenderType)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!appender)
|
if (!appender)
|
||||||
appender = (wLogAppender*)WLog_ConsoleAppender_New(log);
|
appender = WLog_ConsoleAppender_New(log);
|
||||||
|
|
||||||
if (!appender)
|
if (!appender)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -247,7 +247,7 @@ BOOL WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me
|
|||||||
&recurse }, /* function */
|
&recurse }, /* function */
|
||||||
{ ENTRY("%hr"), ENTRY("%02u"), NULL, (void*)(size_t)localTime.wHour, NULL,
|
{ ENTRY("%hr"), ENTRY("%02u"), NULL, (void*)(size_t)localTime.wHour, NULL,
|
||||||
&recurse }, /* hours */
|
&recurse }, /* hours */
|
||||||
{ ENTRY("%ln"), ENTRY("%" PRIuz), NULL, (void*)(size_t)message->LineNumber, NULL,
|
{ ENTRY("%ln"), ENTRY("%" PRIuz), NULL, (void*)message->LineNumber, NULL,
|
||||||
&recurse }, /* line number */
|
&recurse }, /* line number */
|
||||||
{ ENTRY("%lv"), ENTRY("%s"), NULL, (void*)WLOG_LEVELS[message->Level], NULL,
|
{ ENTRY("%lv"), ENTRY("%s"), NULL, (void*)WLOG_LEVELS[message->Level], NULL,
|
||||||
&recurse }, /* log level */
|
&recurse }, /* log level */
|
||||||
|
@ -1007,7 +1007,7 @@ SOCKET _accept(SOCKET s, struct sockaddr* addr, int* addrlen)
|
|||||||
int fd = (int)s;
|
int fd = (int)s;
|
||||||
socklen_t s_addrlen = (socklen_t)*addrlen;
|
socklen_t s_addrlen = (socklen_t)*addrlen;
|
||||||
status = accept(fd, addr, &s_addrlen);
|
status = accept(fd, addr, &s_addrlen);
|
||||||
*addrlen = (socklen_t)s_addrlen;
|
*addrlen = (int)s_addrlen;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1094,7 +1094,7 @@ int _getsockopt(SOCKET s, int level, int optname, char* optval, int* optlen)
|
|||||||
int fd = (int)s;
|
int fd = (int)s;
|
||||||
socklen_t s_optlen = (socklen_t)*optlen;
|
socklen_t s_optlen = (socklen_t)*optlen;
|
||||||
status = getsockopt(fd, level, optname, (void*)optval, &s_optlen);
|
status = getsockopt(fd, level, optname, (void*)optval, &s_optlen);
|
||||||
*optlen = (socklen_t)s_optlen;
|
*optlen = (int)s_optlen;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ static char* makecert_read_str(BIO* bio, size_t* pOffset)
|
|||||||
if (status <= 0)
|
if (status <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
offset += (size_t)readBytes;
|
offset += readBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user