rdpRpc* rpc_new(rdpTransport* transport) { rdpRpc* rpc = (rdpRpc*) xnew(rdpRpc); if (rpc != NULL) { rpc->transport = transport; rpc->settings = transport->settings; rpc->send_seq_num = 0; rpc->ntlm = ntlm_new(); rpc->ntlm_http_in = ntlm_http_new(); rpc->ntlm_http_out = ntlm_http_new(); rpc_ntlm_http_init_channel(rpc, rpc->ntlm_http_in, TSG_CHANNEL_IN); rpc_ntlm_http_init_channel(rpc, rpc->ntlm_http_out, TSG_CHANNEL_OUT); rpc->read_buffer = NULL; rpc->write_buffer = NULL; rpc->read_buffer_len = 0; rpc->write_buffer_len = 0; rpc->ReceiveWindow = 0x00010000; rpc->VirtualConnection = rpc_client_virtual_connection_new(rpc); rpc->call_id = 0; } return rpc; }
rdpRpc* rpc_new(rdpTransport* transport) { rdpRpc* rpc = (rdpRpc*) malloc(sizeof(rdpRpc)); if (rpc != NULL) { ZeroMemory(rpc, sizeof(rdpRpc)); rpc->State = RPC_CLIENT_STATE_INITIAL; rpc->transport = transport; rpc->settings = transport->settings; rpc->SendSeqNum = 0; rpc->ntlm = ntlm_new(); rpc->NtlmHttpIn = ntlm_http_new(); rpc->NtlmHttpOut = ntlm_http_new(); rpc_ntlm_http_init_channel(rpc, rpc->NtlmHttpIn, TSG_CHANNEL_IN); rpc_ntlm_http_init_channel(rpc, rpc->NtlmHttpOut, TSG_CHANNEL_OUT); rpc->PipeCallId = 0; rpc->StubCallId = 0; rpc->StubFragCount = 0; rpc->rpc_vers = 5; rpc->rpc_vers_minor = 0; /* little-endian data representation */ rpc->packed_drep[0] = 0x10; rpc->packed_drep[1] = 0x00; rpc->packed_drep[2] = 0x00; rpc->packed_drep[3] = 0x00; rpc->max_xmit_frag = 0x0FF8; rpc->max_recv_frag = 0x0FF8; rpc->ReceiveWindow = 0x00010000; rpc->ChannelLifetime = 0x40000000; rpc->ChannelLifetimeSet = 0; rpc->KeepAliveInterval = 300000; rpc->CurrentKeepAliveInterval = rpc->KeepAliveInterval; rpc->CurrentKeepAliveTime = 0; rpc->VirtualConnection = rpc_client_virtual_connection_new(rpc); rpc->VirtualConnectionCookieTable = ArrayList_New(TRUE); rpc->CallId = 2; rpc_client_new(rpc); rpc->client->SynchronousSend = TRUE; rpc->client->SynchronousReceive = TRUE; } return rpc; }
rdpRpc* rpc_new(rdpTransport* transport) { rdpRpc* rpc = (rdpRpc*) malloc(sizeof(rdpRpc)); if (rpc != NULL) { ZeroMemory(rpc, sizeof(rdpRpc)); rpc->State = RPC_CLIENT_STATE_INITIAL; rpc->transport = transport; rpc->settings = transport->settings; rpc->send_seq_num = 0; rpc->ntlm = ntlm_new(); rpc->NtlmHttpIn = ntlm_http_new(); rpc->NtlmHttpOut = ntlm_http_new(); rpc_ntlm_http_init_channel(rpc, rpc->NtlmHttpIn, TSG_CHANNEL_IN); rpc_ntlm_http_init_channel(rpc, rpc->NtlmHttpOut, TSG_CHANNEL_OUT); rpc->FragBufferSize = 20; rpc->FragBuffer = (BYTE*) malloc(rpc->FragBufferSize); rpc->StubOffset = 0; rpc->StubBufferSize = 20; rpc->StubLength = 0; rpc->StubFragCount = 0; rpc->StubBuffer = (BYTE*) malloc(rpc->FragBufferSize); rpc->rpc_vers = 5; rpc->rpc_vers_minor = 0; /* little-endian data representation */ rpc->packed_drep[0] = 0x10; rpc->packed_drep[1] = 0x00; rpc->packed_drep[2] = 0x00; rpc->packed_drep[3] = 0x00; rpc->max_xmit_frag = 0x0FF8; rpc->max_recv_frag = 0x0FF8; rpc->pdu = (RPC_PDU*) _aligned_malloc(sizeof(RPC_PDU), MEMORY_ALLOCATION_ALIGNMENT); rpc->SendQueue = (PSLIST_HEADER) _aligned_malloc(sizeof(SLIST_HEADER), MEMORY_ALLOCATION_ALIGNMENT); InitializeSListHead(rpc->SendQueue); rpc->ReceiveQueue = (PSLIST_HEADER) _aligned_malloc(sizeof(SLIST_HEADER), MEMORY_ALLOCATION_ALIGNMENT); InitializeSListHead(rpc->ReceiveQueue); rpc->ReceiveWindow = 0x00010000; rpc->ChannelLifetime = 0x40000000; rpc->ChannelLifetimeSet = 0; rpc->KeepAliveInterval = 300000; rpc->CurrentKeepAliveInterval = rpc->KeepAliveInterval; rpc->CurrentKeepAliveTime = 0; rpc->VirtualConnection = rpc_client_virtual_connection_new(rpc); rpc->VirtualConnectionCookieTable = rpc_virtual_connection_cookie_table_new(rpc); rpc->call_id = 1; rpc_client_new(rpc); rpc->client->SynchronousSend = TRUE; rpc->client->SynchronousReceive = TRUE; } return rpc; }