27#define WIN32_NO_STATUS
29#define NONAMELESSUNION
43#include "wine/winternl.h"
57#define DEFAULT_NCACN_HTTP_TIMEOUT (60 * 1000)
144 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate Everyone SID (error code %d)\n",
GetLastError());
154 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate Anonymous SID (error code %d)\n",
GetLastError());
166 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate Admins SID (error code %d)\n",
GetLastError());
174 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate absolute SD!\n");
181 ERR(
"rpcrt4_create_pipe_security(): Failed to create absolute SD (error code %d)\n",
GetLastError());
195 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate DACL!\n");
202 ERR(
"rpcrt4_create_pipe_security(): Failed to create DACL (error code %d)\n",
GetLastError());
212 ERR(
"rpcrt4_create_pipe_security(): Failed to set up ACE for Everyone SID (error code %d)\n",
GetLastError());
222 ERR(
"rpcrt4_create_pipe_security(): Failed to set up ACE for Anonymous SID (error code %d)\n",
GetLastError());
232 ERR(
"rpcrt4_create_pipe_security(): Failed to set up ACE for Admins SID (error code %d)\n",
GetLastError());
239 ERR(
"rpcrt4_create_pipe_security(): Failed to set DACL to absolute SD (error code %d)\n",
GetLastError());
246 ERR(
"rpcrt4_create_pipe_security(): Failed to set SD owner (error code %d)\n",
GetLastError());
253 ERR(
"rpcrt4_create_pipe_security(): Failed to set SD group (error code %d)\n",
GetLastError());
260 ERR(
"rpcrt4_create_pipe_security(): Unexpected error code (error code %d -- must be ERROR_INSUFFICIENT_BUFFER)\n",
GetLastError());
268 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate relative SD!\n");
275 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate relative SD, buffer too smal (expected size %lu)\n", RelSDSize);
280 TRACE(
"rpcrt4_create_pipe_security(): Success!\n");
293 if (EveryoneSid !=
NULL)
298 if (AnonymousSid !=
NULL)
303 if (AdminsSid !=
NULL)
334 ErrCode = rpcrt4_create_pipe_security(&PipeSecDesc);
337 ERR(
"rpcrt4_conn_create_pipe(): Pipe security descriptor creation failed!\n");
412 TRACE(
"retrying busy server\n");
415 TRACE(
"connection failed, error=%x\n",
err);
419 TRACE(
"connection failed, error=%x\n",
err);
425 WARN(
"connection failed, error=%x\n",
err);
441 static const char prefix[] =
"\\\\.\\pipe\\lrpc\\";
472 char generated_endpoint[22];
476 static LONG lrpc_nameless_id;
479 snprintf(generated_endpoint,
sizeof(generated_endpoint),
480 "LRPC%08x.%08x", process_id,
id);
507 static const char prefix[] =
"\\\\";
508 static const char local[] =
".";
512 static const char prefix[] =
"\\\\.";
575 char generated_endpoint[26];
579 static LONG np_nameless_id;
582 snprintf(generated_endpoint,
sizeof(generated_endpoint),
583 "\\\\pipe\\\\%08x.%03x", process_id,
id);
630 ERR(
"Failed to retrieve the computer name, error %u\n",
GetLastError());
682 ERR(
"Failed to retrieve the computer name, error %u\n",
GetLastError());
750 if (connection->
pipe)
754 connection->
pipe = 0;
794 const char *networkaddr,
800 size_t networkaddr_size;
801 size_t endpoint_size;
805 networkaddr_size = networkaddr ?
strlen(networkaddr) + 1 : 1;
807 size =
sizeof(*smb_floor) + endpoint_size +
sizeof(*nb_floor) + networkaddr_size;
814 tower_data +=
sizeof(*smb_floor);
824 tower_data += endpoint_size;
828 tower_data +=
sizeof(*nb_floor);
835 memcpy(tower_data, networkaddr, networkaddr_size);
850 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
852 if (tower_size <
sizeof(*smb_floor))
855 tower_data +=
sizeof(*smb_floor);
856 tower_size -=
sizeof(*smb_floor);
861 (tower_data[smb_floor->
count_rhs - 1] !=
'\0'))
874 if (tower_size <
sizeof(*nb_floor))
879 tower_data +=
sizeof(*nb_floor);
880 tower_size -=
sizeof(*nb_floor);
885 (tower_data[nb_floor->
count_rhs - 1] !=
'\0'))
911 TRACE(
"(%p)\n", conn);
920 WARN(
"ImpersonateNamedPipeClient failed with error %u\n",
error);
934 TRACE(
"(%p)\n", conn);
970 HANDLE *objs = prev_array;
1018 ERR(
"couldn't allocate objs\n");
1042 HANDLE *objs = wait_array;
1087 ERR(
"failed to locate connection for handle %p\n", b_handle);
1096 const char *networkaddr,
1101 size_t endpoint_size;
1106 size =
sizeof(*pipe_floor) + endpoint_size;
1113 tower_data +=
sizeof(*pipe_floor);
1131 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
1133 if (tower_size <
sizeof(*pipe_floor))
1136 tower_data +=
sizeof(*pipe_floor);
1137 tower_size -=
sizeof(*pipe_floor);
1142 (tower_data[pipe_floor->
count_rhs - 1] !=
'\0'))
1146 *networkaddr =
NULL;
1179 unsigned char *stub_data,
unsigned int stub_data_size,
1181 unsigned char *auth_value,
unsigned int auth_value_size)
1192 TRACE(
"(%p, %p, %p, %p, %p, %p, 0x%x)\n", conn, privs,
1193 server_princ_name, authn_level, authn_svc, authz_svc,
flags);
1197 FIXME(
"privs not implemented\n");
1200 if (server_princ_name)
1202 FIXME(
"server_princ_name not implemented\n");
1203 *server_princ_name =
NULL;
1209 FIXME(
"authorization service not implemented\n");
1213 FIXME(
"flags 0x%x not implemented\n",
flags);
1221 const char *networkaddr,
1222 unsigned char tcp_protid,
1230 size_t size =
sizeof(*tcp_floor) +
sizeof(*ipv4_floor);
1238 tower_data +=
sizeof(*tcp_floor);
1243 tcp_floor->
protid = tcp_protid;
1255 hints.ai_addrlen = 0;
1261 static BOOL wsa_inited;
1278 ERR(
"getaddrinfo failed: %s\n", gai_strerror(
ret));
1286 tcp_floor->
port =
sin->sin_port;
1304 unsigned char tcp_protid,
1311 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
1313 if (tower_size <
sizeof(*tcp_floor))
1316 tower_data +=
sizeof(*tcp_floor);
1317 tower_size -=
sizeof(*tcp_floor);
1319 if (tower_size <
sizeof(*ipv4_floor))
1325 (tcp_floor->
protid != tcp_protid) ||
1357 *networkaddr =
NULL;
1380 static BOOL wsa_inited;
1393 ERR(
"event creation failed\n");
1419 ERR(
"WaitForMultipleObjects() failed with error %d\n",
GetLastError());
1438 ERR(
"WaitForMultipleObjects() failed with error %d\n",
GetLastError());
1469 if (tcpc->
sock != -1)
1476 hints.ai_addrlen = 0;
1484 ERR(
"getaddrinfo for %s:%s failed: %s\n", Connection->
NetworkAddr,
1489 for (ai_cur = ai; ai_cur; ai_cur = ai_cur->
ai_next)
1496 TRACE(
"skipping non-IP/IPv6 address family\n");
1505 host,
sizeof(
host), service,
sizeof(service),
1533 TRACE(
"connected\n");
1557 hints.ai_addrlen = 0;
1565 ERR(
"getaddrinfo for port %s failed: %s\n",
endpoint,
1572 for (ai_cur = ai; ai_cur; ai_cur = ai_cur->
ai_next)
1583 TRACE(
"skipping non-IP/IPv6 address family\n");
1591 host,
sizeof(
host), service,
sizeof(service),
1616 sa_len =
sizeof(
sa);
1626 NULL, 0, service,
sizeof(service),
1630 WARN(
"getnameinfo failed: %s\n", gai_strerror(
ret));
1663 WARN(
"couldn't make socket non-blocking, error %d\n",
ret);
1700 ERR(
"Failed to accept a TCP connection: error %d\n",
ret);
1712 ERR(
"Failed to retrieve the IP address, error %d\n",
ret);
1716 TRACE(
"Accepted a new TCP connection from %s\n",
client->common.NetworkAddr);
1725 while (bytes_read !=
count)
1753 int bytes_written = 0;
1754 while (bytes_written !=
count)
1770 return bytes_written;
1779 if (connection->
sock != -1)
1781 connection->
sock = -1;
1797 TRACE(
"%p\n", connection);
1812 TRACE(
"%p\n", Connection);
1820 const char *networkaddr,
1838 static BOOL wsa_inited;
1860 HANDLE *objs = prev_array;
1870 if (conn->
sock != -1)
1881 ERR(
"couldn't allocate objs\n");
1890 if (conn->
sock != -1)
1914 HANDLE *objs = wait_array;
1954 ERR(
"failed to locate connection for handle %p\n", b_handle);
1975#define HTTP_IDLE_TIME 60000
1999 TRACE(
"destroying async data %p\n",
data);
2002 data->cs.DebugInfo->Spare[0] = 0;
2033 TRACE(
"Cancelled\n");
2038 ERR(
"Async request failed with error %d\n", async_data->
async_result);
2082 if (!httpc)
return NULL;
2114 DWORD bytes_written;
2123 DWORD cached_last_sent_time = *last_sent_time;
2153 DWORD dwInternetStatus,
2154 LPVOID lpvStatusInformation,
2155 DWORD dwStatusInformationLength)
2159 switch (dwInternetStatus)
2162 TRACE(
"INTERNET_STATUS_REQUEST_COMPLETED\n");
2211 static const WCHAR wszUserAgent[] = {
'M',
'S',
'R',
'P',
'C',0};
2249 static const WCHAR wszRpcProxy[] = {
'R',
'p',
'c',
'P',
'r',
'o',
'x',
'y',
'=',0};
2250 static const WCHAR wszHttpProxy[] = {
'H',
't',
't',
'p',
'P',
'r',
'o',
'x',
'y',
'=',0};
2255 const WCHAR *value_end;
2260 value_end = value_start +
lstrlenW(value_start);
2261 for (
p = value_start;
p < value_end;
p++)
2268 TRACE(
"RpcProxy value is %s\n",
debugstr_wn(value_start, value_end-value_start));
2274 const WCHAR *value_end;
2278 value_end = value_start +
lstrlenW(value_start);
2279 TRACE(
"HttpProxy value is %s\n",
debugstr_wn(value_start, value_end-value_start));
2341 unsigned int bytes_left =
count;
2355 TRACE(
"call cancelled\n");
2381 TRACE(
"sending echo request to server\n");
2399 static const WCHAR fmtW[] =
2400 {
'C',
'o',
'n',
't',
'e',
'n',
't',
'-',
'L',
'e',
'n',
'g',
't',
'h',
':',
' ',
'%',
'u',
'\r',
'\n',0};
2410 const UUID *connection_uuid,
const UUID *in_pipe_uuid,
2411 const UUID *association_uuid,
BOOL authorized)
2417 DWORD bytes_written;
2425 memset(&buffers_in, 0,
sizeof(buffers_in));
2437 TRACE(
"sending HTTP connect header to server\n");
2454 unsigned short data_len;
2461 ERR(
"wrong packet type received %d or wrong frag_len %d\n",
2462 hdr->common.ptype,
hdr->common.frag_len);
2466 size =
sizeof(
hdr->http) -
sizeof(
hdr->common);
2470 data_len =
hdr->common.frag_len -
sizeof(
hdr->http);
2487 ERR(
"invalid http packet\n");
2497 HANDLE cancel_event,
const UUID *connection_uuid,
2498 const UUID *out_pipe_uuid,
ULONG *flow_control_increment,
2504 BYTE *data_from_server;
2506 ULONG field1, field3;
2528 TRACE(
"sending HTTP connect header to server\n");
2539 &pkt_from_server, &data_from_server);
2545 TRACE(
"received (%d) from first prepare header\n", field1);
2550 &pkt_from_server, &data_from_server);
2552 if (pkt_from_server.
http.
flags != 0x0001)
break;
2554 TRACE(
"http idle packet, waiting for real packet\n");
2558 ERR(
"HTTP idle packet should have no data items instead of %d\n",
2564 &field1, flow_control_increment,
2568 TRACE(
"received (0x%08x 0x%08x %d) from second prepare header\n", field1, *flow_control_increment, field3);
2575 static const char enc[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
2581 base64[
i++] = enc[(
bin[0] & 0xfc) >> 2];
2582 x = (
bin[0] & 3) << 4;
2587 base64[
i++] = enc[
x];
2592 base64[
i++] = enc[
x | ((
bin[1] & 0xf0) >> 4)];
2593 x = (
bin[1] & 0x0f) << 2;
2598 base64[
i++] = enc[
x];
2602 base64[
i++] = enc[
x | ((
bin[2] & 0xc0) >> 6)];
2605 base64[
i++] = enc[
bin[2] & 0x3f];
2615 if (
c >=
'A' &&
c <=
'Z')
return c -
'A';
2616 if (
c >=
'a' &&
c <=
'z')
return c -
'a' + 26;
2617 if (
c >=
'0' &&
c <=
'9')
return c -
'0' + 52;
2618 if (
c ==
'+')
return 62;
2619 if (
c ==
'/')
return 63;
2626 char c0, c1, c2, c3;
2638 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2639 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2640 buf[
i + 2] = (c2 << 6) | c3;
2651 if (
buf)
buf[
i] = (c0 << 2) | (c1 >> 4);
2654 else if (
p[3] ==
'=')
2662 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2663 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2676 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2677 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2678 buf[
i + 2] = (c2 << 6) | c3;
2776 info->data_len = userlen + passlen + 1;
2783 info->data[userlen] =
':';
2795 static SEC_WCHAR ntlmW[] = {
'N',
'T',
'L',
'M',0},
negotiateW[] = {
'N',
'e',
'g',
'o',
't',
'i',
'a',
't',
'e',0};
2803 WCHAR auth_value[2048];
2831 ERR(
"authentication scheme changed\n");
2841 in_desc.pBuffers = &
in;
2843 p = auth_value + scheme_len;
2852 out.cbBuffer =
info->max_token;
2860 out_desc.pBuffers = &
out;
2864 in.pvBuffer ? &in_desc :
NULL, 0, &
info->ctx, &out_desc,
2871 info->data_len =
out.cbBuffer;
2873 TRACE(
"sending last auth packet\n");
2880 info->data_len =
out.cbBuffer;
2881 TRACE(
"sending next auth packet\n");
2886 ERR(
"InitializeSecurityContextW failed with error 0x%08x\n",
ret);
2910 static const WCHAR authW[] = {
'A',
'u',
't',
'h',
'o',
'r',
'i',
'z',
'a',
't',
'i',
'o',
'n',
':',
' '};
2911 static const WCHAR basicW[] = {
'B',
'a',
's',
'i',
'c',
' '};
2912 static const WCHAR negotiateW[] = {
'N',
'e',
'g',
'o',
't',
'i',
'a',
't',
'e',
' '};
2913 static const WCHAR ntlmW[] = {
'N',
'T',
'L',
'M',
' '};
2915 const WCHAR *scheme_str;
2971 static const WCHAR authW[] = {
'A',
'u',
't',
'h',
'o',
'r',
'i',
'z',
'a',
't',
'i',
'o',
'n',
':',
'\r',
'\n',0};
3014 if (!
id || !
id->User || !
id->Password)
return FALSE;
3029 static WCHAR httpsW[] = {
'h',
't',
't',
'p',
's',0};
3074 static const WCHAR wszVerbIn[] = {
'R',
'P',
'C',
'_',
'I',
'N',
'_',
'D',
'A',
'T',
'A',0};
3075 static const WCHAR wszVerbOut[] = {
'R',
'P',
'C',
'_',
'O',
'U',
'T',
'_',
'D',
'A',
'T',
'A',0};
3076 static const WCHAR wszRpcProxyPrefix[] = {
'/',
'r',
'p',
'c',
'/',
'r',
'p',
'c',
'p',
'r',
'o',
'x',
'y',
'.',
'd',
'l',
'l',
'?',0};
3077 static const WCHAR wszColon[] = {
':',0};
3078 static const WCHAR wszAcceptType[] = {
'a',
'p',
'p',
'l',
'i',
'c',
'a',
't',
'i',
'o',
'n',
'/',
'r',
'p',
'c',0};
3079 LPCWSTR wszAcceptTypes[] = { wszAcceptType,
NULL };
3091 ERR(
"ncacn_http servers not supported yet\n");
3111 memcpy(
url, wszRpcProxyPrefix,
sizeof(wszRpcProxyPrefix));
3175 &Connection->
assoc->http_uuid, credentials);
3230 TRACE(
"(%p, %p, %p)\n", Connection,
Header, Payload);
3235 if (dwRead !=
sizeof(common_hdr)) {
3236 WARN(
"Short read of header, %d bytes\n", dwRead);
3240 if (!
memcmp(&common_hdr,
"HTTP/1.1",
sizeof(
"HTTP/1.1")) ||
3241 !
memcmp(&common_hdr,
"HTTP/1.0",
sizeof(
"HTTP/1.0")))
3252 if (hdr_length == 0) {
3253 WARN(
"header length == 0\n");
3268 if (dwRead != hdr_length -
sizeof(common_hdr)) {
3269 WARN(
"bad header length, %d bytes, hdr_length %d\n", dwRead, hdr_length);
3274 if (common_hdr.
frag_len - hdr_length)
3284 if (dwRead != common_hdr.
frag_len - hdr_length)
3286 WARN(
"bad data length, %d/%d\n", dwRead, common_hdr.
frag_len - hdr_length);
3294 if ((*Header)->common.ptype ==
PKT_HTTP)
3298 ERR(
"invalid http packet of length %d bytes\n", (*Header)->common.frag_len);
3302 if ((*Header)->http.flags == 0x0001)
3304 TRACE(
"http idle packet, waiting for real packet\n");
3305 if ((*Header)->http.num_data_items != 0)
3307 ERR(
"HTTP idle packet should have no data items instead of %d\n", (*Header)->http.num_data_items);
3312 else if ((*Header)->http.flags == 0x0002)
3314 ULONG bytes_transmitted;
3315 ULONG flow_control_increment;
3320 &flow_control_increment,
3324 TRACE(
"received http flow control header (0x%x, 0x%x, %s)\n",
3325 bytes_transmitted, flow_control_increment,
debugstr_guid(&pipe_uuid));
3330 FIXME(
"unrecognised http packet with flags 0x%04x\n", (*Header)->http.flags);
3356 DWORD bytes_written;
3380 DWORD bytes_written;
3387 return ret ? bytes_written : -1;
3450 const char *networkaddr,
3612 TRACE(
"(Connection == ^%p)\n", Connection);
3615 return Connection->
ops->open_connection_client(Connection);
3620 TRACE(
"(Connection == ^%p)\n", Connection);
3634 static LONG next_id;
3641 FIXME(
"not supported for protseq %s\n", Protseq);
3645 NewConnection = ops->
alloc();
3646 NewConnection->
ref = 1;
3648 NewConnection->
ops = ops;
3658 NewConnection->
AuthInfo = AuthInfo;
3661 NewConnection->
QOS =
QOS;
3666 TRACE(
"connection: %p\n", NewConnection);
3667 *Connection = NewConnection;
3698 if (connection->
ref > 1)
3713 TRACE(
"%p ref=%u\n", connection,
ref);
3738 TRACE(
"%p ref=%u\n", connection,
ref);
3767 FIXME(
"not supported for protseq %s\n", protseq);
3776 const char *protseq,
3777 const char *networkaddr,
3790 *tower_size =
sizeof(*protocol_floor);
3800 tower_data +=
sizeof(*protocol_floor);
3806 *tower_size +=
sizeof(*protocol_floor);
3823 if (tower_size <
sizeof(*protocol_floor))
3827 tower_data +=
sizeof(*protocol_floor);
3828 tower_size -=
sizeof(*protocol_floor);
3830 (protocol_floor->
count_rhs > tower_size))
3832 tower_data += protocol_floor->
count_rhs;
3833 tower_size -= protocol_floor->
count_rhs;
3836 if ((tower_size <
sizeof(*floor4)) ||
3909 for (
i = 0;
i < (*protseqs)->Count;
i++)
3927 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)
DWORD WINAPI 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
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
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
#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
#define FSCTL_PIPE_LISTEN
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)
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 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 const struct @562 auth_schemes[]
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_ _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
PCRITICAL_SECTION_DEBUG DebugInfo
ULONG NumberOfAuthnSchemes
ULONG AuthenticationTarget
SEC_WINNT_AUTH_IDENTITY_W * TransportCredentials
unsigned char * Protseq[1]
unsigned short * Protseq[1]
union _RPC_SECURITY_QOS_V2_W::@3300 u
RPC_HTTP_TRANSPORT_CREDENTIALS_W * HttpCredentials
ULONG AdditionalSecurityInfoType
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
BOOL WINAPI RevertToSelf(void)
#define PIPE_UNLIMITED_INSTANCES
#define SECURITY_CONTEXT_TRACKING
#define MAX_COMPUTERNAME_LENGTH
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#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