27#define WIN32_NO_STATUS
29#define NONAMELESSUNION
43#include "wine/winternl.h"
57#define DEFAULT_NCACN_HTTP_TIMEOUT (60 * 1000)
74#define CancelIoEx CancelIoEx_
145 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate Everyone SID (error code %d)\n",
GetLastError());
155 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate Anonymous SID (error code %d)\n",
GetLastError());
167 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate Admins SID (error code %d)\n",
GetLastError());
175 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate absolute SD!\n");
182 ERR(
"rpcrt4_create_pipe_security(): Failed to create absolute SD (error code %d)\n",
GetLastError());
196 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate DACL!\n");
203 ERR(
"rpcrt4_create_pipe_security(): Failed to create DACL (error code %d)\n",
GetLastError());
213 ERR(
"rpcrt4_create_pipe_security(): Failed to set up ACE for Everyone SID (error code %d)\n",
GetLastError());
223 ERR(
"rpcrt4_create_pipe_security(): Failed to set up ACE for Anonymous SID (error code %d)\n",
GetLastError());
233 ERR(
"rpcrt4_create_pipe_security(): Failed to set up ACE for Admins SID (error code %d)\n",
GetLastError());
240 ERR(
"rpcrt4_create_pipe_security(): Failed to set DACL to absolute SD (error code %d)\n",
GetLastError());
247 ERR(
"rpcrt4_create_pipe_security(): Failed to set SD owner (error code %d)\n",
GetLastError());
254 ERR(
"rpcrt4_create_pipe_security(): Failed to set SD group (error code %d)\n",
GetLastError());
261 ERR(
"rpcrt4_create_pipe_security(): Unexpected error code (error code %d -- must be ERROR_INSUFFICIENT_BUFFER)\n",
GetLastError());
269 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate relative SD!\n");
276 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate relative SD, buffer too smal (expected size %lu)\n", RelSDSize);
281 TRACE(
"rpcrt4_create_pipe_security(): Success!\n");
294 if (EveryoneSid !=
NULL)
299 if (AnonymousSid !=
NULL)
304 if (AdminsSid !=
NULL)
335 ErrCode = rpcrt4_create_pipe_security(&PipeSecDesc);
338 ERR(
"rpcrt4_conn_create_pipe(): Pipe security descriptor creation failed!\n");
413 TRACE(
"retrying busy server\n");
416 TRACE(
"connection failed, error=%x\n",
err);
420 TRACE(
"connection failed, error=%x\n",
err);
426 WARN(
"connection failed, error=%x\n",
err);
442 static const char prefix[] =
"\\\\.\\pipe\\lrpc\\";
473 char generated_endpoint[22];
477 static LONG lrpc_nameless_id;
480 snprintf(generated_endpoint,
sizeof(generated_endpoint),
481 "LRPC%08x.%08x", process_id,
id);
508 static const char prefix[] =
"\\\\";
509 static const char local[] =
".";
513 static const char prefix[] =
"\\\\.";
576 char generated_endpoint[26];
580 static LONG np_nameless_id;
583 snprintf(generated_endpoint,
sizeof(generated_endpoint),
584 "\\\\pipe\\\\%08x.%03x", process_id,
id);
631 ERR(
"Failed to retrieve the computer name, error %u\n",
GetLastError());
683 ERR(
"Failed to retrieve the computer name, error %u\n",
GetLastError());
751 if (connection->
pipe)
755 connection->
pipe = 0;
795 const char *networkaddr,
801 size_t networkaddr_size;
802 size_t endpoint_size;
806 networkaddr_size = networkaddr ?
strlen(networkaddr) + 1 : 1;
808 size =
sizeof(*smb_floor) + endpoint_size +
sizeof(*nb_floor) + networkaddr_size;
815 tower_data +=
sizeof(*smb_floor);
825 tower_data += endpoint_size;
829 tower_data +=
sizeof(*nb_floor);
836 memcpy(tower_data, networkaddr, networkaddr_size);
851 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
853 if (tower_size <
sizeof(*smb_floor))
856 tower_data +=
sizeof(*smb_floor);
857 tower_size -=
sizeof(*smb_floor);
862 (tower_data[smb_floor->
count_rhs - 1] !=
'\0'))
875 if (tower_size <
sizeof(*nb_floor))
880 tower_data +=
sizeof(*nb_floor);
881 tower_size -=
sizeof(*nb_floor);
886 (tower_data[nb_floor->
count_rhs - 1] !=
'\0'))
912 TRACE(
"(%p)\n", conn);
921 WARN(
"ImpersonateNamedPipeClient failed with error %u\n",
error);
935 TRACE(
"(%p)\n", conn);
971 HANDLE *objs = prev_array;
1019 ERR(
"couldn't allocate objs\n");
1043 HANDLE *objs = wait_array;
1088 ERR(
"failed to locate connection for handle %p\n", b_handle);
1097 const char *networkaddr,
1102 size_t endpoint_size;
1107 size =
sizeof(*pipe_floor) + endpoint_size;
1114 tower_data +=
sizeof(*pipe_floor);
1132 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
1134 if (tower_size <
sizeof(*pipe_floor))
1137 tower_data +=
sizeof(*pipe_floor);
1138 tower_size -=
sizeof(*pipe_floor);
1143 (tower_data[pipe_floor->
count_rhs - 1] !=
'\0'))
1147 *networkaddr =
NULL;
1180 unsigned char *stub_data,
unsigned int stub_data_size,
1182 unsigned char *auth_value,
unsigned int auth_value_size)
1193 TRACE(
"(%p, %p, %p, %p, %p, %p, 0x%x)\n", conn, privs,
1194 server_princ_name, authn_level, authn_svc, authz_svc,
flags);
1198 FIXME(
"privs not implemented\n");
1201 if (server_princ_name)
1203 FIXME(
"server_princ_name not implemented\n");
1204 *server_princ_name =
NULL;
1210 FIXME(
"authorization service not implemented\n");
1214 FIXME(
"flags 0x%x not implemented\n",
flags);
1222 const char *networkaddr,
1223 unsigned char tcp_protid,
1231 size_t size =
sizeof(*tcp_floor) +
sizeof(*ipv4_floor);
1239 tower_data +=
sizeof(*tcp_floor);
1244 tcp_floor->
protid = tcp_protid;
1256 hints.ai_addrlen = 0;
1262 static BOOL wsa_inited;
1279 ERR(
"getaddrinfo failed: %s\n", gai_strerror(
ret));
1287 tcp_floor->
port =
sin->sin_port;
1305 unsigned char tcp_protid,
1312 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
1314 if (tower_size <
sizeof(*tcp_floor))
1317 tower_data +=
sizeof(*tcp_floor);
1318 tower_size -=
sizeof(*tcp_floor);
1320 if (tower_size <
sizeof(*ipv4_floor))
1326 (tcp_floor->
protid != tcp_protid) ||
1358 *networkaddr =
NULL;
1381 static BOOL wsa_inited;
1394 ERR(
"event creation failed\n");
1420 ERR(
"WaitForMultipleObjects() failed with error %d\n",
GetLastError());
1439 ERR(
"WaitForMultipleObjects() failed with error %d\n",
GetLastError());
1470 if (tcpc->
sock != -1)
1477 hints.ai_addrlen = 0;
1485 ERR(
"getaddrinfo for %s:%s failed: %s\n", Connection->
NetworkAddr,
1490 for (ai_cur = ai; ai_cur; ai_cur = ai_cur->
ai_next)
1497 TRACE(
"skipping non-IP/IPv6 address family\n");
1506 host,
sizeof(
host), service,
sizeof(service),
1534 TRACE(
"connected\n");
1558 hints.ai_addrlen = 0;
1566 ERR(
"getaddrinfo for port %s failed: %s\n",
endpoint,
1573 for (ai_cur = ai; ai_cur; ai_cur = ai_cur->
ai_next)
1584 TRACE(
"skipping non-IP/IPv6 address family\n");
1592 host,
sizeof(
host), service,
sizeof(service),
1617 sa_len =
sizeof(
sa);
1627 NULL, 0, service,
sizeof(service),
1631 WARN(
"getnameinfo failed: %s\n", gai_strerror(
ret));
1664 WARN(
"couldn't make socket non-blocking, error %d\n",
ret);
1701 ERR(
"Failed to accept a TCP connection: error %d\n",
ret);
1713 ERR(
"Failed to retrieve the IP address, error %d\n",
ret);
1717 TRACE(
"Accepted a new TCP connection from %s\n",
client->common.NetworkAddr);
1726 while (bytes_read !=
count)
1754 int bytes_written = 0;
1755 while (bytes_written !=
count)
1771 return bytes_written;
1780 if (connection->
sock != -1)
1782 connection->
sock = -1;
1798 TRACE(
"%p\n", connection);
1813 TRACE(
"%p\n", Connection);
1821 const char *networkaddr,
1839 static BOOL wsa_inited;
1861 HANDLE *objs = prev_array;
1871 if (conn->
sock != -1)
1882 ERR(
"couldn't allocate objs\n");
1891 if (conn->
sock != -1)
1915 HANDLE *objs = wait_array;
1955 ERR(
"failed to locate connection for handle %p\n", b_handle);
1976#define HTTP_IDLE_TIME 60000
2000 TRACE(
"destroying async data %p\n",
data);
2003 data->cs.DebugInfo->Spare[0] = 0;
2034 TRACE(
"Cancelled\n");
2039 ERR(
"Async request failed with error %d\n", async_data->
async_result);
2083 if (!httpc)
return NULL;
2115 DWORD bytes_written;
2124 DWORD cached_last_sent_time = *last_sent_time;
2154 DWORD dwInternetStatus,
2155 LPVOID lpvStatusInformation,
2156 DWORD dwStatusInformationLength)
2160 switch (dwInternetStatus)
2163 TRACE(
"INTERNET_STATUS_REQUEST_COMPLETED\n");
2212 static const WCHAR wszUserAgent[] = {
'M',
'S',
'R',
'P',
'C',0};
2250 static const WCHAR wszRpcProxy[] = {
'R',
'p',
'c',
'P',
'r',
'o',
'x',
'y',
'=',0};
2251 static const WCHAR wszHttpProxy[] = {
'H',
't',
't',
'p',
'P',
'r',
'o',
'x',
'y',
'=',0};
2256 const WCHAR *value_end;
2261 value_end = value_start +
lstrlenW(value_start);
2262 for (
p = value_start;
p < value_end;
p++)
2269 TRACE(
"RpcProxy value is %s\n",
debugstr_wn(value_start, value_end-value_start));
2275 const WCHAR *value_end;
2279 value_end = value_start +
lstrlenW(value_start);
2280 TRACE(
"HttpProxy value is %s\n",
debugstr_wn(value_start, value_end-value_start));
2342 unsigned int bytes_left =
count;
2356 TRACE(
"call cancelled\n");
2382 TRACE(
"sending echo request to server\n");
2400 static const WCHAR fmtW[] =
2401 {
'C',
'o',
'n',
't',
'e',
'n',
't',
'-',
'L',
'e',
'n',
'g',
't',
'h',
':',
' ',
'%',
'u',
'\r',
'\n',0};
2411 const UUID *connection_uuid,
const UUID *in_pipe_uuid,
2412 const UUID *association_uuid,
BOOL authorized)
2418 DWORD bytes_written;
2426 memset(&buffers_in, 0,
sizeof(buffers_in));
2438 TRACE(
"sending HTTP connect header to server\n");
2455 unsigned short data_len;
2462 ERR(
"wrong packet type received %d or wrong frag_len %d\n",
2463 hdr->common.ptype,
hdr->common.frag_len);
2467 size =
sizeof(
hdr->http) -
sizeof(
hdr->common);
2471 data_len =
hdr->common.frag_len -
sizeof(
hdr->http);
2488 ERR(
"invalid http packet\n");
2498 HANDLE cancel_event,
const UUID *connection_uuid,
2499 const UUID *out_pipe_uuid,
ULONG *flow_control_increment,
2505 BYTE *data_from_server;
2507 ULONG field1, field3;
2529 TRACE(
"sending HTTP connect header to server\n");
2540 &pkt_from_server, &data_from_server);
2546 TRACE(
"received (%d) from first prepare header\n", field1);
2551 &pkt_from_server, &data_from_server);
2553 if (pkt_from_server.
http.
flags != 0x0001)
break;
2555 TRACE(
"http idle packet, waiting for real packet\n");
2559 ERR(
"HTTP idle packet should have no data items instead of %d\n",
2565 &field1, flow_control_increment,
2569 TRACE(
"received (0x%08x 0x%08x %d) from second prepare header\n", field1, *flow_control_increment, field3);
2576 static const char enc[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
2582 base64[
i++] = enc[(
bin[0] & 0xfc) >> 2];
2583 x = (
bin[0] & 3) << 4;
2588 base64[
i++] = enc[
x];
2593 base64[
i++] = enc[
x | ((
bin[1] & 0xf0) >> 4)];
2594 x = (
bin[1] & 0x0f) << 2;
2599 base64[
i++] = enc[
x];
2603 base64[
i++] = enc[
x | ((
bin[2] & 0xc0) >> 6)];
2606 base64[
i++] = enc[
bin[2] & 0x3f];
2616 if (
c >=
'A' &&
c <=
'Z')
return c -
'A';
2617 if (
c >=
'a' &&
c <=
'z')
return c -
'a' + 26;
2618 if (
c >=
'0' &&
c <=
'9')
return c -
'0' + 52;
2619 if (
c ==
'+')
return 62;
2620 if (
c ==
'/')
return 63;
2627 char c0, c1, c2, c3;
2639 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2640 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2641 buf[
i + 2] = (c2 << 6) | c3;
2652 if (
buf)
buf[
i] = (c0 << 2) | (c1 >> 4);
2655 else if (
p[3] ==
'=')
2663 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2664 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2677 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2678 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2679 buf[
i + 2] = (c2 << 6) | c3;
2777 info->data_len = userlen + passlen + 1;
2784 info->data[userlen] =
':';
2796 static SEC_WCHAR ntlmW[] = {
'N',
'T',
'L',
'M',0},
negotiateW[] = {
'N',
'e',
'g',
'o',
't',
'i',
'a',
't',
'e',0};
2804 WCHAR auth_value[2048];
2832 ERR(
"authentication scheme changed\n");
2842 in_desc.pBuffers = &
in;
2844 p = auth_value + scheme_len;
2853 out.cbBuffer =
info->max_token;
2861 out_desc.pBuffers = &
out;
2865 in.pvBuffer ? &in_desc :
NULL, 0, &
info->ctx, &out_desc,
2872 info->data_len =
out.cbBuffer;
2874 TRACE(
"sending last auth packet\n");
2881 info->data_len =
out.cbBuffer;
2882 TRACE(
"sending next auth packet\n");
2887 ERR(
"InitializeSecurityContextW failed with error 0x%08x\n",
ret);
2911 static const WCHAR authW[] = {
'A',
'u',
't',
'h',
'o',
'r',
'i',
'z',
'a',
't',
'i',
'o',
'n',
':',
' '};
2912 static const WCHAR basicW[] = {
'B',
'a',
's',
'i',
'c',
' '};
2913 static const WCHAR negotiateW[] = {
'N',
'e',
'g',
'o',
't',
'i',
'a',
't',
'e',
' '};
2914 static const WCHAR ntlmW[] = {
'N',
'T',
'L',
'M',
' '};
2916 const WCHAR *scheme_str;
2972 static const WCHAR authW[] = {
'A',
'u',
't',
'h',
'o',
'r',
'i',
'z',
'a',
't',
'i',
'o',
'n',
':',
'\r',
'\n',0};
3015 if (!
id || !
id->User || !
id->Password)
return FALSE;
3030 static WCHAR httpsW[] = {
'h',
't',
't',
'p',
's',0};
3075 static const WCHAR wszVerbIn[] = {
'R',
'P',
'C',
'_',
'I',
'N',
'_',
'D',
'A',
'T',
'A',0};
3076 static const WCHAR wszVerbOut[] = {
'R',
'P',
'C',
'_',
'O',
'U',
'T',
'_',
'D',
'A',
'T',
'A',0};
3077 static const WCHAR wszRpcProxyPrefix[] = {
'/',
'r',
'p',
'c',
'/',
'r',
'p',
'c',
'p',
'r',
'o',
'x',
'y',
'.',
'd',
'l',
'l',
'?',0};
3078 static const WCHAR wszColon[] = {
':',0};
3079 static const WCHAR wszAcceptType[] = {
'a',
'p',
'p',
'l',
'i',
'c',
'a',
't',
'i',
'o',
'n',
'/',
'r',
'p',
'c',0};
3080 LPCWSTR wszAcceptTypes[] = { wszAcceptType,
NULL };
3092 ERR(
"ncacn_http servers not supported yet\n");
3112 memcpy(
url, wszRpcProxyPrefix,
sizeof(wszRpcProxyPrefix));
3176 &Connection->
assoc->http_uuid, credentials);
3231 TRACE(
"(%p, %p, %p)\n", Connection,
Header, Payload);
3236 if (dwRead !=
sizeof(common_hdr)) {
3237 WARN(
"Short read of header, %d bytes\n", dwRead);
3241 if (!
memcmp(&common_hdr,
"HTTP/1.1",
sizeof(
"HTTP/1.1")) ||
3242 !
memcmp(&common_hdr,
"HTTP/1.0",
sizeof(
"HTTP/1.0")))
3253 if (hdr_length == 0) {
3254 WARN(
"header length == 0\n");
3269 if (dwRead != hdr_length -
sizeof(common_hdr)) {
3270 WARN(
"bad header length, %d bytes, hdr_length %d\n", dwRead, hdr_length);
3275 if (common_hdr.
frag_len - hdr_length)
3285 if (dwRead != common_hdr.
frag_len - hdr_length)
3287 WARN(
"bad data length, %d/%d\n", dwRead, common_hdr.
frag_len - hdr_length);
3295 if ((*Header)->common.ptype ==
PKT_HTTP)
3299 ERR(
"invalid http packet of length %d bytes\n", (*Header)->common.frag_len);
3303 if ((*Header)->http.flags == 0x0001)
3305 TRACE(
"http idle packet, waiting for real packet\n");
3306 if ((*Header)->http.num_data_items != 0)
3308 ERR(
"HTTP idle packet should have no data items instead of %d\n", (*Header)->http.num_data_items);
3313 else if ((*Header)->http.flags == 0x0002)
3315 ULONG bytes_transmitted;
3316 ULONG flow_control_increment;
3321 &flow_control_increment,
3325 TRACE(
"received http flow control header (0x%x, 0x%x, %s)\n",
3326 bytes_transmitted, flow_control_increment,
debugstr_guid(&pipe_uuid));
3331 FIXME(
"unrecognised http packet with flags 0x%04x\n", (*Header)->http.flags);
3357 DWORD bytes_written;
3381 DWORD bytes_written;
3388 return ret ? bytes_written : -1;
3451 const char *networkaddr,
3613 TRACE(
"(Connection == ^%p)\n", Connection);
3616 return Connection->
ops->open_connection_client(Connection);
3621 TRACE(
"(Connection == ^%p)\n", Connection);
3635 static LONG next_id;
3642 FIXME(
"not supported for protseq %s\n", Protseq);
3646 NewConnection = ops->
alloc();
3647 NewConnection->
ref = 1;
3649 NewConnection->
ops = ops;
3659 NewConnection->
AuthInfo = AuthInfo;
3662 NewConnection->
QOS =
QOS;
3667 TRACE(
"connection: %p\n", NewConnection);
3668 *Connection = NewConnection;
3699 if (connection->
ref > 1)
3714 TRACE(
"%p ref=%u\n", connection,
ref);
3739 TRACE(
"%p ref=%u\n", connection,
ref);
3768 FIXME(
"not supported for protseq %s\n", protseq);
3777 const char *protseq,
3778 const char *networkaddr,
3791 *tower_size =
sizeof(*protocol_floor);
3801 tower_data +=
sizeof(*protocol_floor);
3807 *tower_size +=
sizeof(*protocol_floor);
3824 if (tower_size <
sizeof(*protocol_floor))
3828 tower_data +=
sizeof(*protocol_floor);
3829 tower_size -=
sizeof(*protocol_floor);
3831 (protocol_floor->
count_rhs > tower_size))
3833 tower_data += protocol_floor->
count_rhs;
3834 tower_size -= protocol_floor->
count_rhs;
3837 if ((tower_size <
sizeof(*floor4)) ||
3910 for (
i = 0;
i < (*protseqs)->Count;
i++)
3928 for (
i = 0;
i < (*protseqs)->Count;
i++)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
static struct sockaddr_in sa
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void user(int argc, const char *argv[])
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
static SID_IDENTIFIER_AUTHORITY NtAuthority
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
BOOL WINAPI InitializeAcl(PACL pAcl, DWORD nAclLength, DWORD dwAclRevision)
BOOL WINAPI ImpersonateNamedPipeClient(HANDLE hNamedPipe)
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
BOOL WINAPI AddAccessAllowedAce(PACL pAcl, DWORD dwAceRevision, DWORD AccessMask, PSID pSid)
PVOID WINAPI FreeSid(PSID pSid)
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define stricmp(_String1, _String2)
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
BOOL WINAPI FlushFileBuffers(IN HANDLE hFile)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
BOOL WINAPI DECLSPEC_HOTPATCH CancelIoEx(HANDLE handle, LPOVERLAPPED overlapped)
BOOL WINAPI RevertToSelf(void)
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
static SID_IDENTIFIER_AUTHORITY WorldAuthority
BOOL WINAPI HttpAddRequestHeadersW(HINTERNET hHttpRequest, LPCWSTR lpszHeader, DWORD dwHeaderLength, DWORD dwModifier)
BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, LPINTERNET_BUFFERSW lpBuffersIn, LPINTERNET_BUFFERSW lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext)
HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession, LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion, LPCWSTR lpszReferrer, LPCWSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer, DWORD dwNumOfBytesToWrite, LPDWORD lpdwNumOfBytesWritten)
BOOL WINAPI InternetReadFileExW(HINTERNET hFile, LPINTERNET_BUFFERSW lpBuffer, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags, LPWSTR lpszUrl, LPDWORD lpdwUrlLength)
INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW(HINTERNET hInternet, INTERNET_STATUS_CALLBACK lpfnIntCB)
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
BOOL WINAPI InternetQueryDataAvailable(HINTERNET hFile, LPDWORD lpdwNumberOfBytesAvailable, DWORD dwFlags, DWORD_PTR dwContext)
HINTERNET WINAPI InternetConnectW(HINTERNET hInternet, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
INT WSAAPI WSAEventSelect(IN SOCKET s, IN WSAEVENT hEventObject, IN LONG lNetworkEvents)
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
#define InterlockedExchangePointer(Target, Value)
#define EPM_PROTOCOL_NETBIOS
#define EPM_PROTOCOL_PIPE
#define EPM_PROTOCOL_NCALRPC
#define EPM_PROTOCOL_HTTP
#define EPM_PROTOCOL_NCACN
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
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
static unsigned char * in_buffer
NTSYSAPI NTSTATUS WINAPI NtCancelIoFileEx(HANDLE, PIO_STATUS_BLOCK, PIO_STATUS_BLOCK)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define InterlockedExchangeAdd
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define memcpy(s1, s2, n)
#define FILE_FLAG_OVERLAPPED
LPCWSTR LPCWSTR LPCWSTR DWORD dwFlags
#define sprintf(buf, format,...)
static struct _PeImage bin
static HANDLE PIO_APC_ROUTINE void PIO_STATUS_BLOCK io_status
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID out_buffer
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG in_size
static const WCHAR httpW[]
struct _ACCESS_ALLOWED_ACE ACCESS_ALLOWED_ACE
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG DaclSize
BOOL WINAPI WaitNamedPipeA(LPCSTR lpNamedPipeName, DWORD nTimeOut)
HANDLE WINAPI CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI SetNamedPipeHandleState(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout)
NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI NTSTATUS NTAPI NtFsControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
#define FSCTL_PIPE_LISTEN
NTSTATUS NTAPI NtCancelIoFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock)
#define STATUS_PIPE_CONNECTED
#define SecIsValidHandle(x)
#define SECPKG_CRED_OUTBOUND
#define SECURITY_NETWORK_DREP
#define ISC_REQ_MUTUAL_AUTH
#define SecInvalidateHandle(x)
#define ISC_REQ_CONNECTION
#define ISC_REQ_USE_DCE_STYLE
void RpcAssoc_ConnectionReleased(RpcAssoc *assoc)
ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo)
ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos)
ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo)
void RPCRT4_strfree(LPSTR src)
RPC_STATUS RPCRT4_ReleaseBinding(RpcBinding *Binding)
LPWSTR RPCRT4_strndupW(LPCWSTR src, INT slen)
ULONG RpcQualityOfService_Release(RpcQualityOfService *qos)
static const char * rpcrt4_conn_get_name(const RpcConnection *Connection)
static RPC_STATUS rpcrt4_conn_handoff(RpcConnection *old_conn, RpcConnection *new_conn)
#define RPCRT4_strdupA(x)
#define RPCRT4_strdupW(x)
static int rpcrt4_conn_close(RpcConnection *Connection)
#define RPC_MAX_PACKET_SIZE
VOID RPCRT4_FreeHeader(RpcPktHdr *Header)
BOOL RPCRT4_IsValidHttpPacket(RpcPktHdr *hdr, unsigned char *data, unsigned short data_len)
RPC_STATUS RPCRT4_default_authorize(RpcConnection *conn, BOOL first_time, unsigned char *in_buffer, unsigned int in_size, unsigned char *out_buffer, unsigned int *out_size)
RpcPktHdr * RPCRT4_BuildHttpHeader(ULONG DataRepresentation, unsigned short flags, unsigned short num_data_items, unsigned int payload_size)
BOOL RPCRT4_default_is_authorized(RpcConnection *Connection)
RPC_STATUS RPCRT4_ValidateCommonHeader(const RpcPktCommonHdr *hdr)
RPC_STATUS RPCRT4_default_inquire_auth_client(RpcConnection *conn, RPC_AUTHZ_HANDLE *privs, RPC_WSTR *server_princ_name, ULONG *authn_level, ULONG *authn_svc, ULONG *authz_svc, ULONG flags)
RPC_STATUS RPCRT4_ParseHttpFlowControlHeader(RpcPktHdr *header, unsigned char *data, BOOL server, ULONG *bytes_transmitted, ULONG *flow_control_increment, UUID *pipe_uuid)
DWORD RPCRT4_GetHeaderSize(const RpcPktHdr *Header)
RPC_STATUS RPCRT4_default_revert_to_self(RpcConnection *conn)
RPC_STATUS RPCRT4_ParseHttpPrepareHeader2(RpcPktHdr *header, unsigned char *data, ULONG *field1, ULONG *bytes_until_next_packet, ULONG *field3)
RPC_STATUS RPCRT4_default_secure_packet(RpcConnection *Connection, enum secure_packet_direction dir, RpcPktHdr *hdr, unsigned int hdr_size, unsigned char *stub_data, unsigned int stub_data_size, RpcAuthVerifier *auth_hdr, unsigned char *auth_value, unsigned int auth_value_size)
RPC_STATUS RPCRT4_ParseHttpPrepareHeader1(RpcPktHdr *header, unsigned char *data, ULONG *field1)
RpcPktHdr * RPCRT4_BuildHttpConnectHeader(int out_pipe, const UUID *connection_uuid, const UUID *pipe_uuid, const UUID *association_uuid)
RpcPktHdr * RPCRT4_BuildHttpFlowControlHeader(BOOL server, ULONG bytes_transmitted, ULONG flow_control_increment, const UUID *pipe_uuid)
RPC_STATUS RPCRT4_default_impersonate_client(RpcConnection *conn)
void RPCRT4_new_client(RpcConnection *conn)
static struct list protseqs
static RPC_STATUS is_pipe_listening(const char *pipe_name)
static VOID WINAPI rpcrt4_http_internet_callback(HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength)
static HANDLE get_np_event(RpcConnection_np *connection)
RPC_STATUS RPCRT4_IsServerListening(const char *protseq, const char *endpoint)
RPC_STATUS WINAPI RpcProtseqVectorFreeA(RPC_PROTSEQ_VECTORA **protseqs)
static void * rpcrt4_protseq_sock_get_wait_array(RpcServerProtseq *protseq, void *prev_array, unsigned int *count)
const struct protseq_ops * rpcrt4_get_protseq_ops(const char *protseq)
static int rpcrt4_ncacn_http_read(RpcConnection *Connection, void *buffer, unsigned int count)
static RpcConnection * rpcrt4_conn_tcp_alloc(void)
static RPC_STATUS rpcrt4_http_internet_connect(RpcConnection_http *httpc)
static void rpcrt4_ncacn_http_cancel_call(RpcConnection *Connection)
static const WCHAR digestW[]
static void release_np_event(RpcConnection_np *connection, HANDLE event)
static int rpcrt4_conn_np_close(RpcConnection *conn)
struct _RpcConnection_tcp RpcConnection_tcp
static void drain_content(HINTERNET request, RpcHttpAsyncData *async_data, HANDLE cancel_event)
static const struct @592 auth_schemes[]
static RPC_STATUS rpcrt4_ncacn_np_handoff(RpcConnection *old_conn, RpcConnection *new_conn)
static RPC_STATUS wait_async_request(RpcHttpAsyncData *async_data, BOOL call_ret, HANDLE cancel_event)
static void rpcrt4_conn_tcp_cancel_call(RpcConnection *conn)
static void rpcrt4_protseq_np_free_wait_array(RpcServerProtseq *protseq, void *array)
RPC_STATUS WINAPI RpcNetworkInqProtseqsA(RPC_PROTSEQ_VECTORA **protseqs)
static RPC_STATUS rpcrt4_ncacn_http_parse_top_of_tower(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint)
static RPC_STATUS rpcrt4_http_read_http_packet(HINTERNET request, RpcHttpAsyncData *async_data, HANDLE cancel_event, RpcPktHdr *hdr, BYTE **data)
static DWORD auth_scheme_from_header(const WCHAR *header)
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)
static const WCHAR passportW[]
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 size_t rpcrt4_ip_tcp_get_top_of_tower(unsigned char *tower_data, const char *networkaddr, unsigned char tcp_protid, const char *endpoint)
static int rpcrt4_protseq_sock_wait_for_new_connection(RpcServerProtseq *protseq, unsigned int count, void *wait_array)
RPC_STATUS WINAPI RpcNetworkIsProtseqValidW(RPC_WSTR protseq)
static BOOL is_secure(RpcConnection_http *httpc)
RPC_STATUS RPCRT4_CreateConnection(RpcConnection **Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAuthInfo *AuthInfo, RpcQualityOfService *QOS, LPCWSTR CookieAuth)
static BOOL rpcrt4_ncalrpc_is_authorized(RpcConnection *conn)
static RPC_STATUS do_authorization(HINTERNET request, SEC_WCHAR *servername, const RPC_HTTP_TRANSPORT_CREDENTIALS_W *creds, struct authinfo **auth_ptr)
static RPC_STATUS rpcrt4_http_prepare_in_pipe(HINTERNET in_request, RpcHttpAsyncData *async_data, HANDLE cancel_event, const UUID *connection_uuid, const UUID *in_pipe_uuid, const UUID *association_uuid, BOOL authorized)
static void rpcrt4_conn_np_cancel_call(RpcConnection *conn)
static const WCHAR basicW[]
static int rpcrt4_conn_tcp_wait_for_incoming_data(RpcConnection *Connection)
struct _HttpTimerThreadData HttpTimerThreadData
static RpcConnection * rpcrt4_ncacn_http_alloc(void)
static RpcServerProtseq * rpcrt4_protseq_np_alloc(void)
static RPC_STATUS insert_content_length_header(HINTERNET request, DWORD len)
static void rpcrt4_conn_np_close_read(RpcConnection *conn)
static unsigned int decode_base64(const WCHAR *base64, unsigned int len, char *buf)
struct _RpcServerProtseq_sock RpcServerProtseq_sock
static RPC_STATUS rpcrt4_ncalrpc_secure_packet(RpcConnection *conn, enum secure_packet_direction dir, RpcPktHdr *hdr, unsigned int hdr_size, unsigned char *stub_data, unsigned int stub_data_size, RpcAuthVerifier *auth_hdr, unsigned char *auth_value, unsigned int auth_value_size)
static int rpcrt4_conn_tcp_close(RpcConnection *conn)
static const struct protseq_ops protseq_list[]
RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data, size_t tower_size, char **protseq, char **networkaddr, char **endpoint)
static DWORD rpcrt4_http_timer_calc_timeout(DWORD *last_sent_time)
static const struct connection_ops * rpcrt4_get_conn_protseq_ops(const char *protseq)
static const WCHAR negotiateW[]
static RPC_STATUS authorize_request(RpcConnection_http *httpc, HINTERNET request)
#define DEFAULT_NCACN_HTTP_TIMEOUT
static char decode_char(WCHAR c)
static RPC_STATUS rpcrt4_conn_np_revert_to_self(RpcConnection *conn)
static int rpcrt4_conn_np_read(RpcConnection *conn, void *buffer, unsigned int count)
static RPC_STATUS rpcrt4_ncacn_ip_tcp_open(RpcConnection *Connection)
static RPC_STATUS rpcrt4_ncalrpc_np_is_server_listening(const char *endpoint)
RPC_STATUS WINAPI RpcProtseqVectorFreeW(RPC_PROTSEQ_VECTORW **protseqs)
static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq *protseq, const char *endpoint)
static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname, BOOL wait)
static DWORD CALLBACK rpcrt4_http_timer_thread(PVOID param)
static RPC_STATUS rpcrt4_conn_tcp_is_server_listening(const char *endpoint)
struct _RpcHttpAsyncData RpcHttpAsyncData
static void * rpcrt4_protseq_np_get_wait_array(RpcServerProtseq *protseq, void *prev_array, unsigned int *count)
struct _RpcConnection_http RpcConnection_http
static int rpcrt4_conn_np_write(RpcConnection *conn, const void *buffer, unsigned int count)
static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection *Connection)
static struct authinfo * alloc_authinfo(void)
static RpcConnection * rpcrt4_conn_np_alloc(void)
static UINT encode_base64(const char *bin, unsigned int len, WCHAR *base64)
static RPC_STATUS rpcrt4_ncacn_np_is_server_listening(const char *endpoint)
RPC_STATUS RPCRT4_CloseConnection(RpcConnection *Connection)
static RPC_STATUS insert_authorization_header(HINTERNET request, ULONG scheme, char *data, int data_len)
static char * ncacn_pipe_name(const char *endpoint)
static RpcConnection * rpcrt4_spawn_connection(RpcConnection *old_connection)
static void rpcrt4_protseq_sock_free_wait_array(RpcServerProtseq *protseq, void *array)
static size_t rpcrt4_ncacn_np_get_top_of_tower(unsigned char *tower_data, const char *networkaddr, const char *endpoint)
RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection *Connection)
static RPC_STATUS rpcrt4_ncacn_http_receive_fragment(RpcConnection *Connection, RpcPktHdr **Header, void **Payload)
static size_t rpcrt4_ncalrpc_get_top_of_tower(unsigned char *tower_data, const char *networkaddr, const char *endpoint)
static BOOL has_credentials(RpcConnection_http *httpc)
static RPC_STATUS rpcrt4_conn_create_pipe(RpcConnection *conn)
static RPC_STATUS rpcrt4_ncacn_np_parse_top_of_tower(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint)
static void prepare_async_request(RpcHttpAsyncData *async_data)
static RPC_STATUS rpcrt4_ncacn_ip_tcp_parse_top_of_tower(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint)
struct _RpcServerProtseq_np RpcServerProtseq_np
static void rpcrt4_conn_tcp_close_read(RpcConnection *conn)
static RPC_STATUS rpcrt4_http_check_response(HINTERNET hor)
static ULONG RpcHttpAsyncData_AddRef(RpcHttpAsyncData *data)
static BOOL get_authvalue(HINTERNET request, DWORD scheme, WCHAR *buffer, DWORD buflen)
static RPC_STATUS rpcrt4_protseq_ncacn_ip_tcp_open_endpoint(RpcServerProtseq *protseq, const char *endpoint)
static RPC_STATUS set_auth_cookie(RpcConnection_http *httpc, const WCHAR *value)
static int rpcrt4_ncacn_http_write(RpcConnection *Connection, const void *buffer, unsigned int count)
static BOOL rpcrt4_sock_wait_for_send(RpcConnection_tcp *tcpc)
static int rpcrt4_protseq_np_wait_for_new_connection(RpcServerProtseq *protseq, unsigned int count, void *wait_array)
static RPC_STATUS rpcrt4_ncalrpc_parse_top_of_tower(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint)
RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_size, const char *protseq, const char *networkaddr, const char *endpoint)
static const struct connection_ops conn_protseq_list[]
static RPC_STATUS rpcrt4_ncacn_http_open(RpcConnection *Connection)
static RPC_STATUS rpcrt4_ncacn_http_is_server_listening(const char *endpoint)
static RpcServerProtseq * rpcrt4_protseq_sock_alloc(void)
void rpcrt4_conn_release_and_wait(RpcConnection *connection)
static char * ncalrpc_pipe_name(const char *endpoint)
static ULONG RpcHttpAsyncData_Release(RpcHttpAsyncData *data)
RpcConnection * RPCRT4_GrabConnection(RpcConnection *connection)
static int rpcrt4_ncacn_http_close(RpcConnection *Connection)
static int rpcrt4_conn_tcp_read(RpcConnection *Connection, void *buffer, unsigned int count)
RPC_STATUS WINAPI RpcNetworkInqProtseqsW(RPC_PROTSEQ_VECTORW **protseqs)
static void rpcrt4_protseq_sock_signal_state_changed(RpcServerProtseq *protseq)
static int rpcrt4_conn_np_wait_for_incoming_data(RpcConnection *conn)
static size_t rpcrt4_ncacn_ip_tcp_get_top_of_tower(unsigned char *tower_data, const char *networkaddr, const char *endpoint)
static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection *Connection)
static void destroy_authinfo(struct authinfo *info)
static RPC_STATUS rpcrt4_conn_np_impersonate_client(RpcConnection *conn)
static BOOL rpcrt4_sock_wait_for_recv(RpcConnection_tcp *tcpc)
static int rpcrt4_conn_tcp_write(RpcConnection *Connection, const void *buffer, unsigned int count)
struct _RpcConnection_np RpcConnection_np
static VOID rpcrt4_http_keep_connection_active_timer_proc(PVOID param, BOOLEAN dummy)
static void rpcrt4_ncacn_http_close_read(RpcConnection *conn)
static RPC_STATUS rpcrt4_ncacn_http_handoff(RpcConnection *old_conn, RpcConnection *new_conn)
static RPC_STATUS rpcrt4_ncalrpc_inquire_auth_client(RpcConnection *conn, RPC_AUTHZ_HANDLE *privs, RPC_WSTR *server_princ_name, ULONG *authn_level, ULONG *authn_svc, ULONG *authz_svc, ULONG flags)
static BOOL rpcrt4_sock_wait_init(RpcConnection_tcp *tcpc)
static void rpcrt4_conn_np_handoff(RpcConnection_np *old_npc, RpcConnection_np *new_npc)
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)
static void rpcrt4_protseq_np_signal_state_changed(RpcServerProtseq *protseq)
static const WCHAR ntlmW[]
static RPC_STATUS rpcrt4_ncalrpc_handoff(RpcConnection *old_conn, RpcConnection *new_conn)
static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protseq, const char *endpoint)
void RPCRT4_ReleaseConnection(RpcConnection *connection)
static int rpcrt4_http_async_read(HINTERNET req, RpcHttpAsyncData *async_data, HANDLE cancel_event, void *buffer, unsigned int count)
static size_t rpcrt4_ncacn_http_get_top_of_tower(unsigned char *tower_data, const char *networkaddr, const char *endpoint)
static RPC_STATUS send_echo_request(HINTERNET req, RpcHttpAsyncData *async_data, HANDLE cancel_event)
static int rpcrt4_ncacn_http_wait_for_incoming_data(RpcConnection *Connection)
RPC_STATUS WINAPI RpcNetworkIsProtseqValidA(RPC_CSTR protseq)
static RPC_STATUS rpcrt4_conn_tcp_handoff(RpcConnection *old_conn, RpcConnection *new_conn)
#define RPC_C_HTTP_AUTHN_SCHEME_BASIC
#define RPC_C_HTTP_FLAG_USE_SSL
unsigned short * RPC_WSTR
#define RPC_C_HTTP_AUTHN_SCHEME_PASSPORT
#define RPC_C_IMP_LEVEL_IDENTIFY
#define RPC_C_HTTP_AUTHN_SCHEME_DIGEST
#define RPC_C_QOS_IDENTITY_DYNAMIC
#define RPC_C_AUTHN_LEVEL_PKT_PRIVACY
#define RPC_C_HTTP_AUTHN_TARGET_SERVER
#define RPC_C_IMP_LEVEL_DELEGATE
#define RPC_C_IMP_LEVEL_IMPERSONATE
#define RPC_C_IMP_LEVEL_ANONYMOUS
#define RPC_C_AUTHN_INFO_TYPE_HTTP
#define RPC_C_AUTHN_WINNT
#define RPC_C_HTTP_AUTHN_SCHEME_NEGOTIATE
#define RPC_C_HTTP_AUTHN_SCHEME_NTLM
#define RPC_C_IMP_LEVEL_DEFAULT
#define NDR_LOCAL_DATA_REPRESENTATION
#define RPC_S_OUT_OF_MEMORY
#define RPC_S_ACCESS_DENIED
void WINAPI I_RpcFree(void *Object)
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
void *WINAPI I_RpcAllocate(unsigned int Size)
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_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)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, BOOL bOwnerDefaulted)
BOOL WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor, PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, LPDWORD lpdwBufferLength)
BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup, BOOL bGroupDefaulted)
#define STATUS_BUFFER_OVERFLOW
NTSTATUS NTAPI NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key)
BOOL WINAPI SHIM_OBJ_NAME() GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
namespace GUID const ADDRINFOEXW * hints
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
INT WSAAPI setsockopt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen)
INT WSAAPI listen(IN SOCKET s, IN INT backlog)
INT WSAAPI shutdown(IN SOCKET s, IN INT how)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
unsigned short num_data_items
ULONG NumberOfAuthnSchemes
ULONG AuthenticationTarget
SEC_WINNT_AUTH_IDENTITY_W * TransportCredentials
unsigned char * Protseq[1]
unsigned short * Protseq[1]
RPC_HTTP_TRANSPORT_CREDENTIALS_W * HttpCredentials
ULONG AdditionalSecurityInfoType
union _RPC_SECURITY_QOS_V2_W::@3406 u
PRTL_CRITICAL_SECTION_DEBUG DebugInfo
ULONG flow_control_increment
RpcHttpAsyncData * async_data
IO_STATUS_BLOCK io_status
struct list conn_pool_entry
struct _RpcBinding * server_binding
USHORT MaxTransmissionSize
const struct connection_ops * ops
RpcQualityOfService * QOS
struct list protseq_entry
struct _RpcServerProtseq * protseq
INTERNET_BUFFERSW inet_buffers
RPC_SECURITY_QOS_V2_W * qos
LPVOID lpSecurityDescriptor
unsigned short * Password
struct sockaddr * ai_addr
struct addrinfo * ai_next
RpcConnection *(* alloc)(void)
RPC_STATUS(* is_server_listening)(const char *endpoint)
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
DWORD WINAPI WaitForMultipleObjectsEx(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds, IN BOOL bAlertable)
Character const *const prefix
#define CONTAINING_RECORD(address, type, field)
static EFI_HANDLE * handles
const char *WSAAPI inet_ntop(int af, const void *src, char *dst, size_t cnt)
static rfbScreenInfoPtr server
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
DWORD WINAPI GetLastError(void)
#define NMPWAIT_WAIT_FOREVER
#define SECURITY_DELEGATION
#define NMPWAIT_USE_DEFAULT_WAIT
#define PIPE_ACCESS_DUPLEX
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define WAIT_IO_COMPLETION
#define SECURITY_IMPERSONATION
DWORD WINAPI GetCurrentProcessId(void)
#define SECURITY_ANONYMOUS
#define PIPE_READMODE_MESSAGE
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define SECURITY_SQOS_PRESENT
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define SECURITY_IDENTIFICATION
#define PIPE_TYPE_MESSAGE
#define PIPE_UNLIMITED_INSTANCES
#define SECURITY_CONTEXT_TRACKING
#define MAX_COMPUTERNAME_LENGTH
#define RPC_S_SERVER_TOO_BUSY
#define RPC_S_PROTSEQ_NOT_SUPPORTED
#define ERROR_BAD_NETPATH
#define RPC_S_OUT_OF_RESOURCES
#define EPT_S_NOT_REGISTERED
#define RPC_S_CANT_CREATE_ENDPOINT
#define RPC_S_CALL_CANCELLED
#define ERROR_FILE_EXISTS
#define RPC_S_PROTOCOL_ERROR
#define ERROR_CANNOT_IMPERSONATE
#define RPC_S_NO_CONTEXT_AVAILABLE
#define RPC_S_NOT_LISTENING
#define SEC_I_CONTINUE_NEEDED
#define RPC_S_SERVER_UNAVAILABLE
#define RPC_S_INVALID_ENDPOINT_FORMAT
#define RPC_S_INVALID_BINDING
#define RPC_S_DUPLICATE_ENDPOINT
#define RPC_S_INVALID_RPC_PROTSEQ
#define HTTP_STATUS_DENIED
#define INTERNET_DEFAULT_HTTP_PORT
#define INTERNET_DEFAULT_HTTPS_PORT
BOOL WINAPI InternetSetCookieW(const WCHAR *url, const WCHAR *name, const WCHAR *data)
#define HTTP_ADDREQ_FLAG_REPLACE
struct _INTERNET_BUFFERSW INTERNET_BUFFERSW
#define INTERNET_FLAG_PRAGMA_NOCACHE
#define INTERNET_FLAG_NO_AUTO_REDIRECT
#define INTERNET_FLAG_ASYNC
#define INTERNET_FLAG_KEEP_CONNECTION
#define HTTP_QUERY_STATUS_TEXT
#define HTTP_QUERY_FLAG_NUMBER
#define INTERNET_FLAG_NO_CACHE_WRITE
#define INTERNET_FLAG_SECURE
#define HTTP_ADDREQ_FLAG_ADD
#define INTERNET_STATUS_REQUEST_COMPLETE
#define INTERNET_OPEN_TYPE_PROXY
#define HTTP_QUERY_STATUS_CODE
#define INTERNET_OPEN_TYPE_PRECONFIG
#define HTTP_QUERY_WWW_AUTHENTICATE
#define HTTP_QUERY_CONTENT_LENGTH
#define INTERNET_SERVICE_HTTP
#define INTERNET_FLAG_NO_AUTH
struct _QualityOfService QOS
int PASCAL FAR WSAGetLastError(void)
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)
SECURITY_STATUS WINAPI InitializeSecurityContextW(PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
SECURITY_STATUS WINAPI DeleteSecurityContext(PCtxtHandle phContext)
SECURITY_STATUS WINAPI QuerySecurityPackageInfoW(SEC_WCHAR *pszPackageName, PSecPkgInfoW *ppPackageInfo)
SECURITY_STATUS WINAPI FreeCredentialsHandle(PCredHandle phCredential)
#define SECURITY_ANONYMOUS_LOGON_RID
#define SECURITY_BUILTIN_DOMAIN_RID
#define SECURITY_WORLD_SID_AUTHORITY
#define SECURITY_WORLD_RID
#define SECURITY_NT_AUTHORITY
#define SECURITY_DESCRIPTOR_REVISION
#define DOMAIN_ALIAS_RID_ADMINS