27 #define WIN32_NO_STATUS 29 #define NONAMELESSUNION 57 #define DEFAULT_NCACN_HTTP_TIMEOUT (60 * 1000) 172 TRACE(
"retrying busy server\n");
175 TRACE(
"connection failed, error=%x\n",
err);
180 WARN(
"connection failed, error=%x\n",
err);
196 static const char prefix[] =
"\\\\.\\pipe\\lrpc\\";
227 char generated_endpoint[22];
231 static LONG lrpc_nameless_id;
234 snprintf(generated_endpoint,
sizeof(generated_endpoint),
235 "LRPC%08x.%08x", process_id,
id);
262 static const char prefix[] =
"\\\\";
263 static const char local[] =
".";
266 static const char prefix[] =
"\\\\.";
282 strcpy(pipe_name, prefix);
317 char generated_endpoint[26];
321 static LONG np_nameless_id;
324 snprintf(generated_endpoint,
sizeof(generated_endpoint),
325 "\\\\pipe\\\\%08x.%03x", process_id,
id);
372 ERR(
"Failed to retrieve the computer name, error %u\n",
GetLastError());
424 ERR(
"Failed to retrieve the computer name, error %u\n",
GetLastError());
492 if (connection->
pipe)
496 connection->
pipe = 0;
536 const char *networkaddr,
542 size_t networkaddr_size;
543 size_t endpoint_size;
547 networkaddr_size = networkaddr ?
strlen(networkaddr) + 1 : 1;
549 size =
sizeof(*smb_floor) + endpoint_size +
sizeof(*nb_floor) + networkaddr_size;
556 tower_data +=
sizeof(*smb_floor);
566 tower_data += endpoint_size;
570 tower_data +=
sizeof(*nb_floor);
577 memcpy(tower_data, networkaddr, networkaddr_size);
592 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
594 if (tower_size <
sizeof(*smb_floor))
597 tower_data +=
sizeof(*smb_floor);
598 tower_size -=
sizeof(*smb_floor);
603 (tower_data[smb_floor->
count_rhs - 1] !=
'\0'))
616 if (tower_size <
sizeof(*nb_floor))
621 tower_data +=
sizeof(*nb_floor);
622 tower_size -=
sizeof(*nb_floor);
627 (tower_data[nb_floor->
count_rhs - 1] !=
'\0'))
653 TRACE(
"(%p)\n", conn);
662 WARN(
"ImpersonateNamedPipeClient failed with error %u\n",
error);
676 TRACE(
"(%p)\n", conn);
712 HANDLE *objs = prev_array;
760 ERR(
"couldn't allocate objs\n");
784 HANDLE *objs = wait_array;
829 ERR(
"failed to locate connection for handle %p\n", b_handle);
838 const char *networkaddr,
843 size_t endpoint_size;
848 size =
sizeof(*pipe_floor) + endpoint_size;
855 tower_data +=
sizeof(*pipe_floor);
873 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
875 if (tower_size <
sizeof(*pipe_floor))
878 tower_data +=
sizeof(*pipe_floor);
879 tower_size -=
sizeof(*pipe_floor);
884 (tower_data[pipe_floor->
count_rhs - 1] !=
'\0'))
921 unsigned char *stub_data,
unsigned int stub_data_size,
923 unsigned char *auth_value,
unsigned int auth_value_size)
934 TRACE(
"(%p, %p, %p, %p, %p, %p, 0x%x)\n", conn, privs,
935 server_princ_name, authn_level, authn_svc, authz_svc,
flags);
939 FIXME(
"privs not implemented\n");
942 if (server_princ_name)
944 FIXME(
"server_princ_name not implemented\n");
945 *server_princ_name =
NULL;
951 FIXME(
"authorization service not implemented\n");
963 const char *networkaddr,
964 unsigned char tcp_protid,
972 size_t size =
sizeof(*tcp_floor) +
sizeof(*ipv4_floor);
980 tower_data +=
sizeof(*tcp_floor);
985 tcp_floor->
protid = tcp_protid;
988 ipv4_floor->count_lhs =
sizeof(ipv4_floor->protid);
990 ipv4_floor->count_rhs =
sizeof(ipv4_floor->ipv4addr);
997 hints.ai_addrlen = 0;
1016 tcp_floor->
port =
sin->sin_port;
1017 ipv4_floor->ipv4addr =
sin->sin_addr.s_addr;
1034 unsigned char tcp_protid,
1041 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
1043 if (tower_size <
sizeof(*tcp_floor))
1046 tower_data +=
sizeof(*tcp_floor);
1047 tower_size -=
sizeof(*tcp_floor);
1049 if (tower_size <
sizeof(*ipv4_floor))
1055 (tcp_floor->
protid != tcp_protid) ||
1087 *networkaddr =
NULL;
1110 static BOOL wsa_inited;
1123 ERR(
"event creation failed\n");
1149 ERR(
"WaitForMultipleObjects() failed with error %d\n",
GetLastError());
1168 ERR(
"WaitForMultipleObjects() failed with error %d\n",
GetLastError());
1199 if (tcpc->
sock != -1)
1206 hints.ai_addrlen = 0;
1214 ERR(
"getaddrinfo for %s:%s failed: %s\n", Connection->
NetworkAddr,
1219 for (ai_cur = ai; ai_cur; ai_cur = ai_cur->
ai_next)
1226 TRACE(
"skipping non-IP/IPv6 address family\n");
1235 host,
sizeof(
host), service,
sizeof(service),
1263 TRACE(
"connected\n");
1287 hints.ai_addrlen = 0;
1295 ERR(
"getaddrinfo for port %s failed: %s\n",
endpoint,
1302 for (ai_cur = ai; ai_cur; ai_cur = ai_cur->
ai_next)
1313 TRACE(
"skipping non-IP/IPv6 address family\n");
1321 host,
sizeof(
host), service,
sizeof(service),
1346 sa_len =
sizeof(
sa);
1356 NULL, 0, service,
sizeof(service),
1393 WARN(
"couldn't make socket non-blocking, error %d\n",
ret);
1401 tcpc->common.
protseq = protseq;
1430 ERR(
"Failed to accept a TCP connection: error %d\n",
ret);
1442 ERR(
"Failed to retrieve the IP address, error %d\n",
ret);
1446 TRACE(
"Accepted a new TCP connection from %s\n",
client->common.NetworkAddr);
1455 while (bytes_read !=
count)
1483 int bytes_written = 0;
1484 while (bytes_written !=
count)
1500 return bytes_written;
1509 if (connection->
sock != -1)
1511 connection->
sock = -1;
1527 TRACE(
"%p\n", connection);
1542 TRACE(
"%p\n", Connection);
1550 const char *networkaddr,
1568 static BOOL wsa_inited;
1590 HANDLE *objs = prev_array;
1600 if (conn->
sock != -1)
1611 ERR(
"couldn't allocate objs\n");
1620 if (conn->
sock != -1)
1644 HANDLE *objs = wait_array;
1684 ERR(
"failed to locate connection for handle %p\n", b_handle);
1705 #define HTTP_IDLE_TIME 60000 1729 TRACE(
"destroying async data %p\n",
data);
1732 data->cs.DebugInfo->Spare[0] = 0;
1763 TRACE(
"Cancelled\n");
1768 ERR(
"Async request failed with error %d\n", async_data->
async_result);
1812 if (!httpc)
return NULL;
1844 DWORD bytes_written;
1853 DWORD cached_last_sent_time = *last_sent_time;
1883 DWORD dwInternetStatus,
1884 LPVOID lpvStatusInformation,
1885 DWORD dwStatusInformationLength)
1889 switch (dwInternetStatus)
1892 TRACE(
"INTERNET_STATUS_REQUEST_COMPLETED\n");
1941 static const WCHAR wszUserAgent[] = {
'M',
'S',
'R',
'P',
'C',0};
1979 static const WCHAR wszRpcProxy[] = {
'R',
'p',
'c',
'P',
'r',
'o',
'x',
'y',
'=',0};
1980 static const WCHAR wszHttpProxy[] = {
'H',
't',
't',
'p',
'P',
'r',
'o',
'x',
'y',
'=',0};
1985 const WCHAR *value_end;
1990 value_end = value_start +
lstrlenW(value_start);
1991 for (
p = value_start;
p < value_end;
p++)
1998 TRACE(
"RpcProxy value is %s\n",
debugstr_wn(value_start, value_end-value_start));
2004 const WCHAR *value_end;
2008 value_end = value_start +
lstrlenW(value_start);
2009 TRACE(
"HttpProxy value is %s\n",
debugstr_wn(value_start, value_end-value_start));
2071 unsigned int bytes_left =
count;
2085 TRACE(
"call cancelled\n");
2111 TRACE(
"sending echo request to server\n");
2129 static const WCHAR fmtW[] =
2130 {
'C',
'o',
'n',
't',
'e',
'n',
't',
'-',
'L',
'e',
'n',
'g',
't',
'h',
':',
' ',
'%',
'u',
'\r',
'\n',0};
2140 const UUID *connection_uuid,
const UUID *in_pipe_uuid,
2141 const UUID *association_uuid,
BOOL authorized)
2147 DWORD bytes_written;
2155 memset(&buffers_in, 0,
sizeof(buffers_in));
2167 TRACE(
"sending HTTP connect header to server\n");
2184 unsigned short data_len;
2191 ERR(
"wrong packet type received %d or wrong frag_len %d\n",
2192 hdr->common.ptype,
hdr->common.frag_len);
2196 size =
sizeof(
hdr->http) -
sizeof(
hdr->common);
2200 data_len =
hdr->common.frag_len -
sizeof(
hdr->http);
2217 ERR(
"invalid http packet\n");
2227 HANDLE cancel_event,
const UUID *connection_uuid,
2228 const UUID *out_pipe_uuid,
ULONG *flow_control_increment,
2234 BYTE *data_from_server;
2236 ULONG field1, field3;
2258 TRACE(
"sending HTTP connect header to server\n");
2269 &pkt_from_server, &data_from_server);
2275 TRACE(
"received (%d) from first prepare header\n", field1);
2280 &pkt_from_server, &data_from_server);
2282 if (pkt_from_server.
http.
flags != 0x0001)
break;
2284 TRACE(
"http idle packet, waiting for real packet\n");
2288 ERR(
"HTTP idle packet should have no data items instead of %d\n",
2294 &field1, flow_control_increment,
2298 TRACE(
"received (0x%08x 0x%08x %d) from second prepare header\n", field1, *flow_control_increment, field3);
2305 static const char enc[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
2311 base64[
i++] = enc[(
bin[0] & 0xfc) >> 2];
2312 x = (
bin[0] & 3) << 4;
2317 base64[
i++] = enc[
x];
2322 base64[
i++] = enc[
x | ((
bin[1] & 0xf0) >> 4)];
2323 x = (
bin[1] & 0x0f) << 2;
2328 base64[
i++] = enc[
x];
2332 base64[
i++] = enc[
x | ((
bin[2] & 0xc0) >> 6)];
2335 base64[
i++] = enc[
bin[2] & 0x3f];
2345 if (
c >=
'A' &&
c <=
'Z')
return c -
'A';
2346 if (
c >=
'a' &&
c <=
'z')
return c -
'a' + 26;
2347 if (
c >=
'0' &&
c <=
'9')
return c -
'0' + 52;
2348 if (
c ==
'+')
return 62;
2349 if (
c ==
'/')
return 63;
2356 char c0, c1, c2, c3;
2368 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2369 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2370 buf[
i + 2] = (c2 << 6) | c3;
2381 if (
buf)
buf[
i] = (c0 << 2) | (c1 >> 4);
2384 else if (
p[3] ==
'=')
2392 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2393 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2406 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2407 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2408 buf[
i + 2] = (c2 << 6) | c3;
2506 info->data_len = userlen + passlen + 1;
2513 info->data[userlen] =
':';
2525 static SEC_WCHAR ntlmW[] = {
'N',
'T',
'L',
'M',0},
negotiateW[] = {
'N',
'e',
'g',
'o',
't',
'i',
'a',
't',
'e',0};
2533 WCHAR auth_value[2048];
2561 ERR(
"authentication scheme changed\n");
2571 in_desc.pBuffers = &
in;
2573 p = auth_value + scheme_len;
2582 out.cbBuffer =
info->max_token;
2590 out_desc.pBuffers = &
out;
2594 in.pvBuffer ? &in_desc :
NULL, 0, &
info->ctx, &out_desc,
2601 info->data_len =
out.cbBuffer;
2603 TRACE(
"sending last auth packet\n");
2610 info->data_len =
out.cbBuffer;
2611 TRACE(
"sending next auth packet\n");
2616 ERR(
"InitializeSecurityContextW failed with error 0x%08x\n",
ret);
2640 static const WCHAR authW[] = {
'A',
'u',
't',
'h',
'o',
'r',
'i',
'z',
'a',
't',
'i',
'o',
'n',
':',
' '};
2641 static const WCHAR basicW[] = {
'B',
'a',
's',
'i',
'c',
' '};
2642 static const WCHAR negotiateW[] = {
'N',
'e',
'g',
'o',
't',
'i',
'a',
't',
'e',
' '};
2643 static const WCHAR ntlmW[] = {
'N',
'T',
'L',
'M',
' '};
2645 const WCHAR *scheme_str;
2701 static const WCHAR authW[] = {
'A',
'u',
't',
'h',
'o',
'r',
'i',
'z',
'a',
't',
'i',
'o',
'n',
':',
'\r',
'\n',0};
2744 if (!
id || !
id->User || !
id->Password)
return FALSE;
2759 static WCHAR httpsW[] = {
'h',
't',
't',
'p',
's',0};
2804 static const WCHAR wszVerbIn[] = {
'R',
'P',
'C',
'_',
'I',
'N',
'_',
'D',
'A',
'T',
'A',0};
2805 static const WCHAR wszVerbOut[] = {
'R',
'P',
'C',
'_',
'O',
'U',
'T',
'_',
'D',
'A',
'T',
'A',0};
2806 static const WCHAR wszRpcProxyPrefix[] = {
'/',
'r',
'p',
'c',
'/',
'r',
'p',
'c',
'p',
'r',
'o',
'x',
'y',
'.',
'd',
'l',
'l',
'?',0};
2807 static const WCHAR wszColon[] = {
':',0};
2808 static const WCHAR wszAcceptType[] = {
'a',
'p',
'p',
'l',
'i',
'c',
'a',
't',
'i',
'o',
'n',
'/',
'r',
'p',
'c',0};
2809 LPCWSTR wszAcceptTypes[] = { wszAcceptType,
NULL };
2821 ERR(
"ncacn_http servers not supported yet\n");
2841 memcpy(
url, wszRpcProxyPrefix,
sizeof(wszRpcProxyPrefix));
2905 &Connection->
assoc->http_uuid, credentials);
2960 TRACE(
"(%p, %p, %p)\n", Connection,
Header, Payload);
2965 if (dwRead !=
sizeof(common_hdr)) {
2966 WARN(
"Short read of header, %d bytes\n", dwRead);
2970 if (!
memcmp(&common_hdr,
"HTTP/1.1",
sizeof(
"HTTP/1.1")) ||
2971 !
memcmp(&common_hdr,
"HTTP/1.0",
sizeof(
"HTTP/1.0")))
2982 if (hdr_length == 0) {
2983 WARN(
"header length == 0\n");
2998 if (dwRead != hdr_length -
sizeof(common_hdr)) {
2999 WARN(
"bad header length, %d bytes, hdr_length %d\n", dwRead, hdr_length);
3004 if (common_hdr.frag_len - hdr_length)
3014 if (dwRead != common_hdr.frag_len - hdr_length)
3016 WARN(
"bad data length, %d/%d\n", dwRead, common_hdr.frag_len - hdr_length);
3024 if ((*Header)->common.ptype ==
PKT_HTTP)
3028 ERR(
"invalid http packet of length %d bytes\n", (*Header)->common.frag_len);
3032 if ((*Header)->http.flags == 0x0001)
3034 TRACE(
"http idle packet, waiting for real packet\n");
3035 if ((*Header)->http.num_data_items != 0)
3037 ERR(
"HTTP idle packet should have no data items instead of %d\n", (*Header)->http.num_data_items);
3042 else if ((*Header)->http.flags == 0x0002)
3044 ULONG bytes_transmitted;
3045 ULONG flow_control_increment;
3050 &flow_control_increment,
3054 TRACE(
"received http flow control header (0x%x, 0x%x, %s)\n",
3055 bytes_transmitted, flow_control_increment,
debugstr_guid(&pipe_uuid));
3060 FIXME(
"unrecognised http packet with flags 0x%04x\n", (*Header)->http.flags);
3086 DWORD bytes_written;
3110 DWORD bytes_written;
3117 return ret ? bytes_written : -1;
3180 const char *networkaddr,
3342 TRACE(
"(Connection == ^%p)\n", Connection);
3345 return Connection->
ops->open_connection_client(Connection);
3350 TRACE(
"(Connection == ^%p)\n", Connection);
3371 FIXME(
"not supported for protseq %s\n", Protseq);
3375 NewConnection = ops->
alloc();
3376 NewConnection->
ref = 1;
3378 NewConnection->
ops = ops;
3388 NewConnection->
AuthInfo = AuthInfo;
3391 NewConnection->
QOS =
QOS;
3396 TRACE(
"connection: %p\n", NewConnection);
3397 *Connection = NewConnection;
3428 if (connection->
ref > 1)
3443 TRACE(
"%p ref=%u\n", connection,
ref);
3468 TRACE(
"%p ref=%u\n", connection,
ref);
3497 FIXME(
"not supported for protseq %s\n", protseq);
3506 const char *protseq,
3507 const char *networkaddr,
3520 *tower_size =
sizeof(*protocol_floor);
3530 tower_data +=
sizeof(*protocol_floor);
3536 *tower_size +=
sizeof(*protocol_floor);
3553 if (tower_size <
sizeof(*protocol_floor))
3557 tower_data +=
sizeof(*protocol_floor);
3558 tower_size -=
sizeof(*protocol_floor);
3560 (protocol_floor->
count_rhs > tower_size))
3562 tower_data += protocol_floor->
count_rhs;
3563 tower_size -= protocol_floor->
count_rhs;
3566 if ((tower_size <
sizeof(*floor4)) ||
3639 for (
i = 0;
i < (*protseqs)->Count;
i++)
3657 for (
i = 0;
i < (*protseqs)->Count;
i++)
static RPC_STATUS rpcrt4_ncacn_http_parse_top_of_tower(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint)
#define HTTP_QUERY_CONTENT_LENGTH
static RPC_STATUS rpcrt4_ncacn_np_is_server_listening(const char *endpoint)
BOOL WINAPI SHIM_OBJ_NAME() GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
USHORT MaxTransmissionSize
static const WCHAR basicW[]
union _RPC_SECURITY_QOS_V2_W::@3107 u
namespace GUID const ADDRINFOEXW * hints
static void rpcrt4_conn_np_cancel_call(RpcConnection *conn)
static void drain_content(HINTERNET request, RpcHttpAsyncData *async_data, HANDLE cancel_event)
static size_t rpcrt4_ncacn_http_get_top_of_tower(unsigned char *tower_data, const char *networkaddr, const char *endpoint)
struct list protseq_entry
#define INTERNET_FLAG_NO_CACHE_WRITE
static RPC_STATUS send_echo_request(HINTERNET req, RpcHttpAsyncData *async_data, HANDLE cancel_event)
static RPC_STATUS rpcrt4_ncacn_http_is_server_listening(const char *endpoint)
#define PIPE_UNLIMITED_INSTANCES
RPC_STATUS WINAPI RpcNetworkInqProtseqsW(RPC_PROTSEQ_VECTORW **protseqs)
static int rpcrt4_ncacn_http_write(RpcConnection *Connection, const void *buffer, unsigned int count)
static size_t rpcrt4_ncalrpc_get_top_of_tower(unsigned char *tower_data, const char *networkaddr, const char *endpoint)
#define RPC_C_AUTHN_WINNT
#define ERROR_FILE_EXISTS
static int rpcrt4_protseq_sock_wait_for_new_connection(RpcServerProtseq *protseq, unsigned int count, void *wait_array)
static struct authinfo * alloc_authinfo(void)
static int rpcrt4_http_async_read(HINTERNET req, RpcHttpAsyncData *async_data, HANDLE cancel_event, void *buffer, unsigned int count)
static int rpcrt4_conn_close(RpcConnection *Connection)
BOOL WINAPI ImpersonateNamedPipeClient(HANDLE hNamedPipe)
static struct list protseqs
static RPC_STATUS rpcrt4_ip_tcp_parse_top_of_tower(const unsigned char *tower_data, size_t tower_size, char **networkaddr, unsigned char tcp_protid, char **endpoint)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
static RPC_STATUS rpcrt4_conn_tcp_handoff(RpcConnection *old_conn, RpcConnection *new_conn)
static VOID WINAPI rpcrt4_http_internet_callback(HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength)
static void rpcrt4_protseq_np_signal_state_changed(RpcServerProtseq *protseq)
#define HTTP_QUERY_STATUS_TEXT
static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq *protseq, const char *endpoint)
#define SECPKG_CRED_OUTBOUND
static const char * rpcrt4_conn_get_name(const RpcConnection *Connection)
static RPC_STATUS rpcrt4_ncalrpc_parse_top_of_tower(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint)
static RPC_STATUS rpcrt4_ncalrpc_authorize(RpcConnection *conn, BOOL first_time, unsigned char *in_buffer, unsigned int in_size, unsigned char *out_buffer, unsigned int *out_size)
void RpcAssoc_ConnectionReleased(RpcAssoc *assoc)
unsigned char * Protseq[1]
static int rpcrt4_conn_np_close(RpcConnection *conn)
static rfbScreenInfoPtr server
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
SEC_WINNT_AUTH_IDENTITY_W * TransportCredentials
static RPC_STATUS rpcrt4_ncacn_http_handoff(RpcConnection *old_conn, RpcConnection *new_conn)
ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo)
static HANDLE get_np_event(RpcConnection_np *connection)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static struct object_header ** handles
static RPC_STATUS rpcrt4_conn_np_impersonate_client(RpcConnection *conn)
static DWORD auth_scheme_from_header(const WCHAR *header)
#define WideCharToMultiByte
SECURITY_STATUS WINAPI AcquireCredentialsHandleW(SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
char * strcat(char *DstString, const char *SrcString)
RPC_STATUS RPCRT4_default_revert_to_self(RpcConnection *conn)
void WINAPI I_RpcFree(void *Object)
static int rpcrt4_conn_tcp_close(RpcConnection *conn)
#define PIPE_TYPE_MESSAGE
static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection *Connection)
#define RPC_C_HTTP_AUTHN_TARGET_SERVER
static RPC_STATUS rpcrt4_http_prepare_out_pipe(HINTERNET out_request, RpcHttpAsyncData *async_data, HANDLE cancel_event, const UUID *connection_uuid, const UUID *out_pipe_uuid, ULONG *flow_control_increment, BOOL authorized)
RPC_STATUS RPCRT4_ParseHttpPrepareHeader1(RpcPktHdr *header, unsigned char *data, ULONG *field1)
#define RPC_S_NO_CONTEXT_AVAILABLE
ACPI_SIZE strlen(const char *String)
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
GLenum GLuint GLenum GLsizei const GLchar * buf
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
unsigned short * Password
BOOL WINAPI RevertToSelf(VOID)
#define SECURITY_IDENTIFICATION
GLdouble GLdouble GLdouble r
static int rpcrt4_conn_np_read(RpcConnection *conn, void *buffer, unsigned int count)
struct _RpcServerProtseq_np RpcServerProtseq_np
RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data, size_t tower_size, char **protseq, char **networkaddr, char **endpoint)
GLuint GLuint GLsizei count
HANDLE WINAPI CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
#define SecIsValidHandle(x)
static RPC_STATUS is_pipe_listening(const char *pipe_name)
#define INTERNET_FLAG_SECURE
VOID RPCRT4_FreeHeader(RpcPktHdr *Header)
static ULONG RpcHttpAsyncData_Release(RpcHttpAsyncData *data)
static int rpcrt4_conn_np_write(RpcConnection *conn, const void *buffer, unsigned int count)
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
static HANDLE PIO_APC_ROUTINE void PIO_STATUS_BLOCK io_status
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
DWORD WINAPI GetTickCount(VOID)
static RPC_STATUS rpcrt4_ncalrpc_np_is_server_listening(const char *endpoint)
void RPCRT4_new_client(RpcConnection *conn)
static RPC_STATUS rpcrt4_ncacn_http_receive_fragment(RpcConnection *Connection, RpcPktHdr **Header, void **Payload)
#define RPC_C_HTTP_AUTHN_SCHEME_BASIC
#define INTERNET_OPEN_TYPE_PROXY
RPC_STATUS RPCRT4_IsServerListening(const char *protseq, const char *endpoint)
#define INVALID_HANDLE_VALUE
void RPCRT4_ReleaseConnection(RpcConnection *connection)
#define RPC_S_SERVER_UNAVAILABLE
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
DWORD WINAPI GetLastError(VOID)
static RPC_STATUS wait_async_request(RpcHttpAsyncData *async_data, BOOL call_ret, HANDLE cancel_event)
GLint GLint GLint GLint GLint x
RPC_STATUS RPCRT4_CloseConnection(RpcConnection *Connection)
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
SECURITY_STATUS WINAPI FreeCredentialsHandle(PCredHandle phCredential)
#define RPC_C_IMP_LEVEL_ANONYMOUS
NTSYSCALLAPI NTSTATUS NTAPI NtFsControlFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG FsControlCode, PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength)
struct _RpcServerProtseq_sock RpcServerProtseq_sock
static RpcConnection * rpcrt4_conn_tcp_alloc(void)
RPC_HTTP_TRANSPORT_CREDENTIALS_W * HttpCredentials
#define RPC_C_IMP_LEVEL_IDENTIFY
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define NMPWAIT_USE_DEFAULT_WAIT
unsigned short * RPC_WSTR
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define RPC_C_IMP_LEVEL_IMPERSONATE
INTERNET_BUFFERSW inet_buffers
#define HTTP_QUERY_WWW_AUTHENTICATE
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
static const struct connection_ops * rpcrt4_get_conn_protseq_ops(const char *protseq)
INT WSAAPI connect(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
#define ERROR_CANNOT_IMPERSONATE
#define EPM_PROTOCOL_NETBIOS
#define EPM_PROTOCOL_NCACN
const struct connection_ops * ops
RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection *Connection)
GLbitfield GLuint64 timeout
DWORD RPCRT4_GetHeaderSize(const RpcPktHdr *Header)
static BOOL rpcrt4_sock_wait_init(RpcConnection_tcp *tcpc)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID out_buffer
#define RPC_S_INVALID_ENDPOINT_FORMAT
#define INTERNET_DEFAULT_HTTP_PORT
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
static RPC_STATUS rpcrt4_ncalrpc_handoff(RpcConnection *old_conn, RpcConnection *new_conn)
static int rpcrt4_conn_tcp_write(RpcConnection *Connection, const void *buffer, unsigned int count)
struct list conn_pool_entry
static const WCHAR negotiateW[]
#define HTTP_ADDREQ_FLAG_REPLACE
#define RPC_S_ACCESS_DENIED
ULONG AuthenticationTarget
BOOL WINAPI WaitNamedPipeA(LPCSTR lpNamedPipeName, DWORD nTimeOut)
static int rpcrt4_conn_np_wait_for_incoming_data(RpcConnection *conn)
#define EPM_PROTOCOL_PIPE
static void rpcrt4_ncacn_http_cancel_call(RpcConnection *Connection)
struct status_code status_code
#define sprintf(buf, format,...)
static unsigned char * in_buffer
#define SecInvalidateHandle(x)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
static const struct protseq_ops protseq_list[]
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
ULONG RpcQualityOfService_Release(RpcQualityOfService *qos)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
ULONG flow_control_increment
static void rpcrt4_ncacn_http_close_read(RpcConnection *conn)
void rpcrt4_conn_release_and_wait(RpcConnection *connection)
static size_t rpcrt4_ncacn_np_get_top_of_tower(unsigned char *tower_data, const char *networkaddr, const char *endpoint)
void RPCRT4_strfree(LPSTR src)
#define ERROR_ACCESS_DENIED
#define RPC_S_OUT_OF_MEMORY
struct _RpcConnection_tcp RpcConnection_tcp
#define SECURITY_DELEGATION
IO_STATUS_BLOCK io_status
ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo)
static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protseq, const char *endpoint)