mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
@@ -319,7 +319,9 @@ static IWTSVirtualChannelManager* dvcman_new(drdynvcPlugin* plugin)
|
||||
if (!dvcman->channelsById)
|
||||
goto fail;
|
||||
|
||||
HashTable_SetHashFunction(dvcman->channelsById, channelIdHash);
|
||||
if (!HashTable_SetHashFunction(dvcman->channelsById, channelIdHash))
|
||||
goto fail;
|
||||
|
||||
obj = HashTable_KeyObject(dvcman->channelsById);
|
||||
WINPR_ASSERT(obj);
|
||||
obj->fnObjectEquals = channelIdMatch;
|
||||
@@ -335,7 +337,9 @@ static IWTSVirtualChannelManager* dvcman_new(drdynvcPlugin* plugin)
|
||||
dvcman->listeners = HashTable_New(TRUE);
|
||||
if (!dvcman->listeners)
|
||||
goto fail;
|
||||
HashTable_SetHashFunction(dvcman->listeners, HashTable_StringHash);
|
||||
|
||||
if (!HashTable_SetHashFunction(dvcman->listeners, HashTable_StringHash))
|
||||
goto fail;
|
||||
|
||||
obj = HashTable_KeyObject(dvcman->listeners);
|
||||
obj->fnObjectEquals = HashTable_StringCompare;
|
||||
|
||||
@@ -346,31 +346,43 @@ static const IWTSVirtualChannelCallback geometry_callbacks = { geometry_on_data_
|
||||
nullptr, /* Open */
|
||||
geometry_on_close, nullptr };
|
||||
|
||||
static void geometry_plugin_free(GeometryClientContext* context)
|
||||
{
|
||||
if (!context)
|
||||
return;
|
||||
HashTable_Free(context->geometries);
|
||||
free(context);
|
||||
}
|
||||
static void terminate_plugin_cb(GENERIC_DYNVC_PLUGIN* base)
|
||||
{
|
||||
GEOMETRY_PLUGIN* geometry = (GEOMETRY_PLUGIN*)base;
|
||||
|
||||
if (!geometry)
|
||||
return;
|
||||
|
||||
geometry_plugin_free(geometry->context);
|
||||
}
|
||||
|
||||
static UINT init_plugin_cb(GENERIC_DYNVC_PLUGIN* base, WINPR_ATTR_UNUSED rdpContext* rcontext,
|
||||
rdpSettings* settings)
|
||||
{
|
||||
GeometryClientContext* context = nullptr;
|
||||
GEOMETRY_PLUGIN* geometry = (GEOMETRY_PLUGIN*)base;
|
||||
|
||||
WINPR_ASSERT(base);
|
||||
WINPR_UNUSED(settings);
|
||||
|
||||
context = (GeometryClientContext*)calloc(1, sizeof(GeometryClientContext));
|
||||
GeometryClientContext* context =
|
||||
(GeometryClientContext*)calloc(1, sizeof(GeometryClientContext));
|
||||
if (!context)
|
||||
{
|
||||
WLog_Print(base->log, WLOG_ERROR, "calloc failed!");
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
}
|
||||
goto fail;
|
||||
|
||||
context->geometries = HashTable_New(FALSE);
|
||||
if (!context->geometries)
|
||||
{
|
||||
WLog_Print(base->log, WLOG_ERROR, "unable to allocate geometries");
|
||||
free(context);
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
}
|
||||
goto fail;
|
||||
|
||||
if (!HashTable_SetHashFunction(context->geometries, mappedGeometryHash))
|
||||
goto fail;
|
||||
|
||||
HashTable_SetHashFunction(context->geometries, mappedGeometryHash);
|
||||
{
|
||||
wObject* obj = HashTable_KeyObject(context->geometries);
|
||||
obj->fnObjectEquals = mappedGeometryKeyCompare;
|
||||
@@ -385,15 +397,10 @@ static UINT init_plugin_cb(GENERIC_DYNVC_PLUGIN* base, WINPR_ATTR_UNUSED rdpCont
|
||||
geometry->base.iface.pInterface = (void*)context;
|
||||
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static void terminate_plugin_cb(GENERIC_DYNVC_PLUGIN* base)
|
||||
{
|
||||
GEOMETRY_PLUGIN* geometry = (GEOMETRY_PLUGIN*)base;
|
||||
|
||||
if (geometry->context)
|
||||
HashTable_Free(geometry->context->geometries);
|
||||
free(geometry->context);
|
||||
fail:
|
||||
geometry_plugin_free(context);
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3707,7 +3707,8 @@ static RdpdrServerPrivate* rdpdr_server_private_new(void)
|
||||
if (!priv->devicelist)
|
||||
goto fail;
|
||||
|
||||
HashTable_SetHashFunction(priv->devicelist, rdpdr_deviceid_hash);
|
||||
if (!HashTable_SetHashFunction(priv->devicelist, rdpdr_deviceid_hash))
|
||||
goto fail;
|
||||
|
||||
{
|
||||
wObject* obj = HashTable_ValueObject(priv->devicelist);
|
||||
|
||||
@@ -89,7 +89,8 @@ int main(int argc, char* argv[])
|
||||
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi());
|
||||
if (!WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi()))
|
||||
return -1;
|
||||
|
||||
if (!(instance = freerdp_listener_new()))
|
||||
return 1;
|
||||
|
||||
@@ -1480,7 +1480,9 @@ int main(int argc, char* argv[])
|
||||
return usage(app, arg);
|
||||
}
|
||||
|
||||
WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi());
|
||||
if (!WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi()))
|
||||
return -1;
|
||||
|
||||
if (!winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT))
|
||||
return -1;
|
||||
|
||||
|
||||
@@ -171,21 +171,22 @@ BOOL wfreerdp_server_stop(wfServer* server)
|
||||
|
||||
wfServer* wfreerdp_server_new()
|
||||
{
|
||||
WSADATA wsaData;
|
||||
WSADATA wsaData = WINPR_C_ARRAY_INIT;
|
||||
wfServer* server;
|
||||
|
||||
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
|
||||
return nullptr;
|
||||
|
||||
server = (wfServer*)calloc(1, sizeof(wfServer));
|
||||
if (!WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi()))
|
||||
return nullptr;
|
||||
|
||||
wfServer* server = (wfServer*)calloc(1, sizeof(wfServer));
|
||||
|
||||
if (server)
|
||||
{
|
||||
server->port = 3389;
|
||||
}
|
||||
|
||||
WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi());
|
||||
|
||||
cbEvent = nullptr;
|
||||
|
||||
return server;
|
||||
|
||||
@@ -812,7 +812,9 @@ BOOL pf_server_start(proxyServer* server)
|
||||
|
||||
WINPR_ASSERT(server);
|
||||
|
||||
WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi());
|
||||
if (!WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi()))
|
||||
goto error;
|
||||
|
||||
if (!winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT))
|
||||
goto error;
|
||||
|
||||
@@ -853,7 +855,9 @@ BOOL pf_server_start_from_socket(proxyServer* server, int socket)
|
||||
|
||||
WINPR_ASSERT(server);
|
||||
|
||||
WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi());
|
||||
if (!WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi()))
|
||||
goto error;
|
||||
|
||||
if (!winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT))
|
||||
goto error;
|
||||
|
||||
|
||||
@@ -153,9 +153,7 @@ BOOL winpr_RC4_Update(WINPR_RC4_CTX* ctx, size_t length, const void* input, void
|
||||
return FALSE;
|
||||
|
||||
WINPR_ASSERT(ctx);
|
||||
if (EVP_CipherUpdate(ctx->ctx, output, &outputLength, input, (int)length) != 1)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
return EVP_CipherUpdate(ctx->ctx, output, &outputLength, input, (int)length) == 1;
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user