{
DWORD status;
RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) arg;
- RdpeiClientContext* context = (RdpeiClientContext*) rdpei->iface.pInterface;
- HANDLE hdl[] = {rdpei->event, rdpei->stopEvent};
UINT error = CHANNEL_RC_OK;
+ RdpeiClientContext* context;
+ HANDLE hdl[2];
if (!rdpei)
{
goto out;
}
+ context = (RdpeiClientContext*) rdpei->iface.pInterface;
+ hdl[0] = rdpei->event;
+ hdl[1] = rdpei->stopEvent;
+
if (!context)
{
error = ERROR_INVALID_PARAMETER;
UINT status = CHANNEL_RC_OK;
UINT16* pSurfaceIds = NULL;
rdpGdi* gdi = (rdpGdi*)context->custom;
- xfContext* xfc = (xfContext*) gdi->context;
+ xfContext* xfc;
if (!gdi)
return status;
if (gdi->suppressOutput)
return CHANNEL_RC_OK;
+ xfc = (xfContext*) gdi->context;
EnterCriticalSection(&context->mux);
context->GetSurfaceIds(context, &pSurfaceIds, &count);
rdpGlyph* glyph;
const GLYPH_DATA_V2* glyphData = &fastGlyph->glyphData;
- if (!glyphData)
- return FALSE;
-
glyph = Glyph_Alloc(context, glyphData->x, glyphData->y, glyphData->cx,
glyphData->cy,
glyphData->cb, glyphData->aj);
int i;
GLYPH_CACHE* cache = glyphCache->glyphCache;
- if (cache)
+ for (i = 0; i < 10; i++)
{
- for (i = 0; i < 10; i++)
- {
- UINT32 j;
- rdpGlyph** entries = cache[i].entries;
+ UINT32 j;
+ rdpGlyph** entries = cache[i].entries;
- if (!entries)
- continue;
+ if (!entries)
+ continue;
- for (j = 0; j < cache[i].number; j++)
- {
- rdpGlyph* glyph = entries[j];
+ for (j = 0; j < cache[i].number; j++)
+ {
+ rdpGlyph* glyph = entries[j];
- if (glyph)
- {
- glyph->Free(glyphCache->context, glyph);
- entries[j] = NULL;
- }
+ if (glyph)
+ {
+ glyph->Free(glyphCache->context, glyph);
+ entries[j] = NULL;
}
-
- free(entries);
- cache[i].entries = NULL;
}
+
+ free(entries);
+ cache[i].entries = NULL;
}
if (glyphCache->fragCache.entries)
REGION16 updateRegion;
UINT32 blockLen;
UINT32 blockType;
- RFX_MESSAGE* message = &context->currentMessage;
wStream inStream, *s = &inStream;
BOOL ok = TRUE;
+ RFX_MESSAGE* message;
if (!context || !data || !length)
return FALSE;
+ message = &context->currentMessage;
+
Stream_StaticInit(s, (BYTE*)data, length);
message->freeRects = TRUE;
if (status < 0)
return status;
- if (status > 0)
- Flags |= L1_COMPRESSED;
+ Flags |= L1_COMPRESSED;
}
}
}
if (!pbIn || !pbOut)
goto fail;
- if ((EncryptedSize == 0) || (cbPassStubW > UINT32_MAX))
- goto fail;
-
*((UINT32*) pbIn) = (UINT32)cbPassStubW;
CopyMemory(&pbIn[4], PassStubW, cbPassStubW);
rc4Ctx = winpr_Cipher_New(WINPR_CIPHER_ARC4_128, WINPR_ENCRYPT,
if (!pInitHandle)
return CHANNEL_RC_BAD_INIT_HANDLE;
- if (!pChannel || (channelCount <= 0) || !pChannelInitEventProcEx)
+ if (!pChannel)
+ return CHANNEL_RC_BAD_CHANNEL;
+
+ if ((channelCount <= 0) || !pChannelInitEventProcEx)
return CHANNEL_RC_INITIALIZATION_ERROR;
pChannelInitData = (CHANNEL_INIT_DATA*) pInitHandle;
if ((channels->openDataCount + channelCount) > CHANNEL_MAX_COUNT)
return CHANNEL_RC_TOO_MANY_CHANNELS;
- if (!pChannel)
- return CHANNEL_RC_BAD_CHANNEL;
-
if (channels->connected)
return CHANNEL_RC_ALREADY_CONNECTED;
if (!ppInitHandle || !channels)
return CHANNEL_RC_BAD_INIT_HANDLE;
- if (!pChannel || (channelCount <= 0) || !pChannelInitEventProc)
+ if (!pChannel)
+ return CHANNEL_RC_BAD_CHANNEL;
+
+ if ((channelCount <= 0) || !pChannelInitEventProc)
return CHANNEL_RC_INITIALIZATION_ERROR;
pInterface = g_pInterface;
if (channels->openDataCount + channelCount > CHANNEL_MAX_COUNT)
return CHANNEL_RC_TOO_MANY_CHANNELS;
- if (!pChannel)
- return CHANNEL_RC_BAD_CHANNEL;
-
if (channels->connected)
return CHANNEL_RC_ALREADY_CONNECTED;
return FALSE;
}
- if (!status)
- return FALSE;
-
status = checkChannelErrorEvent(context);
if (!status)
{
SECURITY_STATUS status;
+ if ((!ntlm) || (!ntlm->table))
+ {
+ WLog_ERR(TAG, "ntlm_authenticate: invalid ntlm context");
+ return FALSE;
+ }
+
if (ntlm->outputBuffer[0].pvBuffer)
{
free(ntlm->outputBuffer[0].pvBuffer);
}
}
- if ((!ntlm) || (!ntlm->table))
- {
- WLog_ERR(TAG, "ntlm_authenticate: invalid ntlm context");
- return FALSE;
- }
-
status = ntlm->table->InitializeSecurityContext(&ntlm->credentials,
(ntlm->haveContext) ? &ntlm->context : NULL,
(ntlm->ServicePrincipalName) ? ntlm->ServicePrincipalName : NULL,
info->LogonId = autoReconnectCookie->logonId;
CopyMemory(info->ArcRandomBits, p, 16);
- if ((settings->PrintReconnectCookie) && (autoReconnectCookie->cbLen > 0))
+ if ((settings->PrintReconnectCookie))
{
char* base64;
base64 = crypto_base64_encode((BYTE*) autoReconnectCookie, sizeof(ARC_SC_PRIVATE_PACKET));
/* excludes (!) the length of the mandatory null terminator */
cbDomain = cbDomain >= 2 ? cbDomain - 2 : cbDomain;
- if (!settings->RemoteAssistanceMode)
- {
- cbUserName = ConvertToUnicode(CP_UTF8, 0, settings->Username, -1, &userNameW, 0) * 2;
- }
- else
- {
- /* user name provided by the expert for connecting to the novice computer */
- cbUserName = ConvertToUnicode(CP_UTF8, 0, settings->Username, -1, &userNameW, 0) * 2;
- }
+ /* user name provided by the expert for connecting to the novice computer */
+ cbUserName = ConvertToUnicode(CP_UTF8, 0, settings->Username, -1, &userNameW, 0) * 2;
/* excludes (!) the length of the mandatory null terminator */
cbUserName = cbUserName >= 2 ? cbUserName - 2 : cbUserName;
length += 8;
}
- if ((length < 5) || (length > UINT16_MAX))
+ if (length > UINT16_MAX)
goto fail;
em = Stream_GetPosition(s);
status = BIO_read(bufferedBio, buf, len);
if (status > 0)
+ {
break;
-
- if (status < 0)
+ }
+ else if (status < 0)
{
/* Error? */
if (BIO_should_retry(bufferedBio))
WLog_ERR(TAG, "Failed reading %s reply from SOCKS proxy (Status %d)", reason, status);
return -1;
}
-
- if (status == 0)
+ else // if (status == 0)
{
/* Error? */
WLog_ERR(TAG, "Failed reading %s reply from SOCKS proxy (BIO_read returned zero)", reason);
{
const SSIZE_T tr = (SSIZE_T)bytes - read;
int r = (int)((tr > INT_MAX) ? INT_MAX : tr);
- int status = status = BIO_read(transport->frontBio, data + read, r);
+ int status = BIO_read(transport->frontBio, data + read, r);
if (status <= 0)
{
}
}
- if (length < 1)
- return TRUE;
-
- return FALSE;
+ return TRUE;
}
BOOL certificate_store_init(rdpCertificateStore* certificate_store)
RDPGFX_H264_METABLOCK* meta1;
RDPGFX_AVC420_BITMAP_STREAM* avc2;
RDPGFX_H264_METABLOCK* meta2;
- RECTANGLE_16* regionRects = NULL;
surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId);
if (!surface)
}
fail:
- free(regionRects);
return status;
#else
return ERROR_NOT_SUPPORTED;
const RDPGFX_SURFACE_COMMAND* cmd)
{
UINT status = CHANNEL_RC_OK;
- rdpGdi* gdi = (rdpGdi*) context->custom;
+ rdpGdi* gdi;
if (!context || !cmd)
return ERROR_INVALID_PARAMETER;
+ gdi = (rdpGdi*) context->custom;
+
EnterCriticalSection(&context->mux);
WLog_Print(gdi->log, WLOG_TRACE,
"surfaceId=%"PRIu32", codec=%"PRIu32", contextId=%"PRIu32", format=%s, "
default:
free(surface);
- return ERROR_INTERNAL_ERROR;
+ goto fail;
}
surface->scanline = gfx_align_scanline(surface->width * 4, 16);
Sleep(100); /* 100 ms */
}
-
- CommLog_Print(WLOG_WARN, "_wait_on_mask, unexpected return, WaitEventMask=0x%08"PRIX32"", pComm->WaitEventMask);
- EnterCriticalSection(&pComm->EventsLock);
- pComm->PendingEvents &= ~SERIAL_EV_FREERDP_WAITING;
- LeaveCriticalSection(&pComm->EventsLock);
- assert(FALSE);
- return FALSE;
}
static BOOL _set_break_on(WINPR_COMM *pComm)
}
memcpy(lpBuffer, cwd, length + 1);
+ free(cwd);
return length;
}