27#define WIN32_NO_STATUS
54#define DEFAULT_NCACN_HTTP_TIMEOUT (60 * 1000)
71#define CancelIoEx CancelIoEx_
144 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate Everyone SID (error %lu)\n", ErrCode);
155 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate Anonymous SID (error %lu)\n", ErrCode);
167 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate Admins SID (error %lu)\n", ErrCode);
175 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate absolute SD\n");
182 ERR(
"rpcrt4_create_pipe_security(): Failed to create absolute SD (error %lu)\n", ErrCode);
195 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate DACL\n");
202 ERR(
"rpcrt4_create_pipe_security(): Failed to create DACL (error %lu)\n", ErrCode);
212 ERR(
"rpcrt4_create_pipe_security(): Failed to set up ACE for Everyone SID (error %lu)\n", ErrCode);
222 ERR(
"rpcrt4_create_pipe_security(): Failed to set up ACE for Anonymous SID (error %lu)\n", ErrCode);
232 ERR(
"rpcrt4_create_pipe_security(): Failed to set up ACE for Admins SID (error %lu)\n", ErrCode);
239 ERR(
"rpcrt4_create_pipe_security(): Failed to set DACL to absolute SD (error %lu)\n", ErrCode);
246 ERR(
"rpcrt4_create_pipe_security(): Failed to set SD owner (error %lu)\n", ErrCode);
253 ERR(
"rpcrt4_create_pipe_security(): Failed to set SD group (error %lu)\n", ErrCode);
261 ERR(
"rpcrt4_create_pipe_security(): error %lu, expected ERROR_INSUFFICIENT_BUFFER\n", ErrCode);
269 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate relative SD\n");
276 ERR(
"rpcrt4_create_pipe_security(): Failed to allocate relative SD (error %lu)\n", ErrCode);
285 if (EveryoneSid !=
NULL)
288 if (AnonymousSid !=
NULL)
291 if (AdminsSid !=
NULL)
316 ErrCode = rpcrt4_create_pipe_security(&PipeSecDesc);
319 ERR(
"rpcrt4_conn_create_pipe(): Pipe security descriptor creation failed\n");
394 TRACE(
"retrying busy server\n");
397 TRACE(
"connection failed, error=%lx\n",
err);
401 TRACE(
"connection failed, error=%x\n",
err);
407 WARN(
"connection failed, error=%lx\n",
err);
423 static const char prefix[] =
"\\\\.\\pipe\\lrpc\\";
454 char generated_endpoint[22];
458 static LONG lrpc_nameless_id;
461 snprintf(generated_endpoint,
sizeof(generated_endpoint),
462 "LRPC%08lx.%08lx", process_id,
id);
489 static const char prefix[] =
"\\\\";
490 static const char local[] =
".";
494 static const char prefix[] =
"\\\\.";
557 char generated_endpoint[26];
561 static LONG np_nameless_id;
564 snprintf(generated_endpoint,
sizeof(generated_endpoint),
565 "\\\\pipe\\\\%08lx.%03lx", process_id,
id);
612 ERR(
"Failed to retrieve the computer name, error %lu\n",
GetLastError());
664 ERR(
"Failed to retrieve the computer name, error %lu\n",
GetLastError());
732 if (connection->
pipe)
736 connection->
pipe = 0;
776 const char *networkaddr,
782 size_t networkaddr_size;
783 size_t endpoint_size;
787 networkaddr_size = networkaddr ?
strlen(networkaddr) + 1 : 1;
789 size =
sizeof(*smb_floor) + endpoint_size +
sizeof(*nb_floor) + networkaddr_size;
796 tower_data +=
sizeof(*smb_floor);
806 tower_data += endpoint_size;
810 tower_data +=
sizeof(*nb_floor);
817 memcpy(tower_data, networkaddr, networkaddr_size);
832 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
834 if (tower_size <
sizeof(*smb_floor))
837 tower_data +=
sizeof(*smb_floor);
838 tower_size -=
sizeof(*smb_floor);
843 (tower_data[smb_floor->
count_rhs - 1] !=
'\0'))
856 if (tower_size <
sizeof(*nb_floor))
861 tower_data +=
sizeof(*nb_floor);
862 tower_size -=
sizeof(*nb_floor);
867 (tower_data[nb_floor->
count_rhs - 1] !=
'\0'))
893 TRACE(
"(%p)\n", conn);
902 WARN(
"ImpersonateNamedPipeClient failed with error %lu\n",
error);
916 TRACE(
"(%p)\n", conn);
952 HANDLE *objs = prev_array;
997 ERR(
"couldn't allocate objs\n");
1021 HANDLE *objs = wait_array;
1066 ERR(
"failed to locate connection for handle %p\n", b_handle);
1075 const char *networkaddr,
1080 size_t endpoint_size;
1085 size =
sizeof(*pipe_floor) + endpoint_size;
1092 tower_data +=
sizeof(*pipe_floor);
1110 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
1112 if (tower_size <
sizeof(*pipe_floor))
1115 tower_data +=
sizeof(*pipe_floor);
1116 tower_size -=
sizeof(*pipe_floor);
1121 (tower_data[pipe_floor->
count_rhs - 1] !=
'\0'))
1125 *networkaddr =
NULL;
1158 unsigned char *stub_data,
unsigned int stub_data_size,
1160 unsigned char *auth_value,
unsigned int auth_value_size)
1171 TRACE(
"(%p, %p, %p, %p, %p, %p, 0x%lx)\n", conn, privs,
1172 server_princ_name, authn_level, authn_svc, authz_svc,
flags);
1176 FIXME(
"privs not implemented\n");
1179 if (server_princ_name)
1181 FIXME(
"server_princ_name not implemented\n");
1182 *server_princ_name =
NULL;
1188 FIXME(
"authorization service not implemented\n");
1192 FIXME(
"flags 0x%lx not implemented\n",
flags);
1207 const char *networkaddr,
1208 unsigned char tcp_protid,
1216 size_t size =
sizeof(*tcp_floor) +
sizeof(*ipv4_floor);
1224 tower_data +=
sizeof(*tcp_floor);
1229 tcp_floor->
protid = tcp_protid;
1241 hints.ai_addrlen = 0;
1247 static BOOL wsa_inited;
1272 tcp_floor->
port =
sin->sin_port;
1290 unsigned char tcp_protid,
1297 TRACE(
"(%p, %d, %p, %p)\n", tower_data, (
int)tower_size, networkaddr,
endpoint);
1299 if (tower_size <
sizeof(*tcp_floor))
1302 tower_data +=
sizeof(*tcp_floor);
1303 tower_size -=
sizeof(*tcp_floor);
1305 if (tower_size <
sizeof(*ipv4_floor))
1311 (tcp_floor->
protid != tcp_protid) ||
1343 *networkaddr =
NULL;
1366 static BOOL wsa_inited;
1379 ERR(
"event creation failed\n");
1405 ERR(
"WaitForMultipleObjects() failed with error %ld\n",
GetLastError());
1424 ERR(
"WaitForMultipleObjects() failed with error %ld\n",
GetLastError());
1455 if (tcpc->
sock != -1)
1462 hints.ai_addrlen = 0;
1470 ERR(
"getaddrinfo for %s:%s failed, error %u\n", Connection->
NetworkAddr,
1475 for (ai_cur = ai; ai_cur; ai_cur = ai_cur->
ai_next)
1482 TRACE(
"skipping non-IP/IPv6 address family\n");
1491 host,
sizeof(
host), service,
sizeof(service),
1519 TRACE(
"connected\n");
1543 hints.ai_addrlen = 0;
1557 for (ai_cur = ai; ai_cur; ai_cur = ai_cur->
ai_next)
1568 TRACE(
"skipping non-IP/IPv6 address family\n");
1576 host,
sizeof(
host), service,
sizeof(service),
1601 sa_len =
sizeof(
sa);
1611 NULL, 0, service,
sizeof(service),
1648 WARN(
"couldn't make socket non-blocking, error %d\n",
ret);
1685 ERR(
"Failed to accept a TCP connection: error %d\n",
ret);
1697 ERR(
"Failed to retrieve the IP address, error %d\n",
ret);
1701 TRACE(
"Accepted a new TCP connection from %s\n",
client->common.NetworkAddr);
1710 while (bytes_read !=
count)
1738 int bytes_written = 0;
1739 while (bytes_written !=
count)
1755 return bytes_written;
1764 if (connection->
sock != -1)
1766 connection->
sock = -1;
1782 TRACE(
"%p\n", connection);
1797 TRACE(
"%p\n", Connection);
1805 const char *networkaddr,
1823 static BOOL wsa_inited;
1845 HANDLE *objs = prev_array;
1855 if (conn->
sock != -1)
1863 ERR(
"couldn't allocate objs\n");
1872 if (conn->
sock != -1)
1896 HANDLE *objs = wait_array;
1936 ERR(
"failed to locate connection for handle %p\n", b_handle);
1957#define HTTP_IDLE_TIME 60000
1981 TRACE(
"destroying async data %p\n",
data);
1983 free(
data->inet_buffers.lpvBuffer);
1984 data->cs.DebugInfo->Spare[0] = 0;
2015 TRACE(
"Cancelled\n");
2020 ERR(
"Async request failed with error %d\n", async_data->
async_result);
2063 httpc =
calloc(1,
sizeof(*httpc));
2064 if (!httpc)
return NULL;
2096 DWORD bytes_written;
2105 DWORD cached_last_sent_time = *last_sent_time;
2137 DWORD dwInternetStatus,
2138 LPVOID lpvStatusInformation,
2139 DWORD dwStatusInformationLength)
2143 switch (dwInternetStatus)
2146 TRACE(
"INTERNET_STATUS_REQUEST_COMPLETED\n");
2186 if(status_text !=
buf)
free(status_text);
2235 const WCHAR *value_end;
2240 value_end = value_start +
lstrlenW(value_start);
2241 for (
p = value_start;
p < value_end;
p++)
2248 TRACE(
"RpcProxy value is %s\n",
debugstr_wn(value_start, value_end-value_start));
2254 const WCHAR *value_end;
2258 value_end = value_start +
lstrlenW(value_start);
2259 TRACE(
"HttpProxy value is %s\n",
debugstr_wn(value_start, value_end-value_start));
2321 unsigned int bytes_left =
count;
2335 TRACE(
"call cancelled\n");
2361 TRACE(
"sending echo request to server\n");
2388 const UUID *connection_uuid,
const UUID *in_pipe_uuid,
2389 const UUID *association_uuid,
BOOL authorized)
2395 DWORD bytes_written;
2403 memset(&buffers_in, 0,
sizeof(buffers_in));
2415 TRACE(
"sending HTTP connect header to server\n");
2432 unsigned short data_len;
2439 ERR(
"wrong packet type received %d or wrong frag_len %d\n",
2440 hdr->common.ptype,
hdr->common.frag_len);
2444 size =
sizeof(
hdr->http) -
sizeof(
hdr->common);
2448 data_len =
hdr->common.frag_len -
sizeof(
hdr->http);
2465 ERR(
"invalid http packet\n");
2475 HANDLE cancel_event,
const UUID *connection_uuid,
2476 const UUID *out_pipe_uuid,
ULONG *flow_control_increment,
2482 BYTE *data_from_server;
2484 ULONG field1, field3;
2506 TRACE(
"sending HTTP connect header to server\n");
2517 &pkt_from_server, &data_from_server);
2521 free(data_from_server);
2523 TRACE(
"received (%ld) from first prepare header\n", field1);
2528 &pkt_from_server, &data_from_server);
2530 if (pkt_from_server.
http.
flags != 0x0001)
break;
2532 TRACE(
"http idle packet, waiting for real packet\n");
2533 free(data_from_server);
2536 ERR(
"HTTP idle packet should have no data items instead of %d\n",
2542 &field1, flow_control_increment,
2544 free(data_from_server);
2546 TRACE(
"received (0x%08lx 0x%08lx %ld) from second prepare header\n", field1, *flow_control_increment, field3);
2553 static const char enc[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
2559 base64[
i++] = enc[(
bin[0] & 0xfc) >> 2];
2560 x = (
bin[0] & 3) << 4;
2565 base64[
i++] = enc[
x];
2570 base64[
i++] = enc[
x | ((
bin[1] & 0xf0) >> 4)];
2571 x = (
bin[1] & 0x0f) << 2;
2576 base64[
i++] = enc[
x];
2580 base64[
i++] = enc[
x | ((
bin[2] & 0xc0) >> 6)];
2583 base64[
i++] = enc[
bin[2] & 0x3f];
2593 if (
c >=
'A' &&
c <=
'Z')
return c -
'A';
2594 if (
c >=
'a' &&
c <=
'z')
return c -
'a' + 26;
2595 if (
c >=
'0' &&
c <=
'9')
return c -
'0' + 52;
2596 if (
c ==
'+')
return 62;
2597 if (
c ==
'/')
return 63;
2604 char c0, c1, c2, c3;
2616 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2617 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2618 buf[
i + 2] = (c2 << 6) | c3;
2629 if (
buf)
buf[
i] = (c0 << 2) | (c1 >> 4);
2632 else if (
p[3] ==
'=')
2640 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2641 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2654 buf[
i + 0] = (c0 << 2) | (c1 >> 4);
2655 buf[
i + 1] = (c1 << 4) | (c2 >> 2);
2656 buf[
i + 2] = (c2 << 6) | c3;
2748 info->data_len = userlen + passlen + 1;
2755 info->data[userlen] =
':';
2775 WCHAR auth_value[2048];
2803 ERR(
"authentication scheme changed\n");
2813 in_desc.pBuffers = &
in;
2815 p = auth_value + scheme_len;
2820 if (!(
in.pvBuffer =
malloc(
in.cbBuffer)))
break;
2824 out.cbBuffer =
info->max_token;
2832 out_desc.pBuffers = &
out;
2836 in.pvBuffer ? &in_desc :
NULL, 0, &
info->ctx, &out_desc,
2843 info->data_len =
out.cbBuffer;
2845 TRACE(
"sending last auth packet\n");
2852 info->data_len =
out.cbBuffer;
2853 TRACE(
"sending next auth packet\n");
2858 ERR(
"InitializeSecurityContextW failed with error 0x%08lx\n",
ret);
2882 static const WCHAR authW[] = {
'A',
'u',
't',
'h',
'o',
'r',
'i',
'z',
'a',
't',
'i',
'o',
'n',
':',
' '};
2883 static const WCHAR basicW[] = {
'B',
'a',
's',
'i',
'c',
' '};
2884 static const WCHAR negotiateW[] = {
'N',
'e',
'g',
'o',
't',
'i',
'a',
't',
'e',
' '};
2885 static const WCHAR ntlmW[] = {
'N',
'T',
'L',
'M',
' '};
2887 const WCHAR *scheme_str;
2985 if (!
id || !
id->User || !
id->Password)
return FALSE;
3000 static WCHAR httpsW[] =
L"https";
3045 static const WCHAR wszRpcProxyPrefix[] =
L"/rpc/rpcproxy.dll?";
3046 LPCWSTR wszAcceptTypes[] = {
L"application/rpc",
NULL };
3058 ERR(
"ncacn_http servers not supported yet\n");
3075 url =
malloc(
sizeof(wszRpcProxyPrefix) +
3079 memcpy(
url, wszRpcProxyPrefix,
sizeof(wszRpcProxyPrefix));
3143 &Connection->
assoc->http_uuid, credentials);
3157 timer_data =
malloc(
sizeof(*timer_data));
3198 TRACE(
"(%p, %p, %p)\n", Connection,
Header, Payload);
3203 if (dwRead !=
sizeof(common_hdr)) {
3204 WARN(
"Short read of header, %ld bytes\n", dwRead);
3208 if (!
memcmp(&common_hdr,
"HTTP/1.1",
sizeof(
"HTTP/1.1")) ||
3209 !
memcmp(&common_hdr,
"HTTP/1.0",
sizeof(
"HTTP/1.0")))
3220 if (hdr_length == 0) {
3221 WARN(
"header length == 0\n");
3236 if (dwRead != hdr_length -
sizeof(common_hdr)) {
3237 WARN(
"bad header length, %ld bytes, hdr_length %ld\n", dwRead, hdr_length);
3242 if (common_hdr.
frag_len - hdr_length)
3252 if (dwRead != common_hdr.
frag_len - hdr_length)
3254 WARN(
"bad data length, %ld/%ld\n", dwRead, common_hdr.
frag_len - hdr_length);
3262 if ((*Header)->common.ptype ==
PKT_HTTP)
3266 ERR(
"invalid http packet of length %d bytes\n", (*Header)->common.frag_len);
3270 if ((*Header)->http.flags == 0x0001)
3272 TRACE(
"http idle packet, waiting for real packet\n");
3273 if ((*Header)->http.num_data_items != 0)
3275 ERR(
"HTTP idle packet should have no data items instead of %d\n", (*Header)->http.num_data_items);
3280 else if ((*Header)->http.flags == 0x0002)
3282 ULONG bytes_transmitted;
3283 ULONG flow_control_increment;
3288 &flow_control_increment,
3292 TRACE(
"received http flow control header (0x%lx, 0x%lx, %s)\n",
3293 bytes_transmitted, flow_control_increment,
debugstr_guid(&pipe_uuid));
3298 FIXME(
"unrecognised http packet with flags 0x%04x\n", (*Header)->http.flags);
3324 DWORD bytes_written;
3348 DWORD bytes_written;
3355 return ret ? bytes_written : -1;
3418 const char *networkaddr,
3584 TRACE(
"(Connection == ^%p)\n", Connection);
3587 return Connection->
ops->open_connection_client(Connection);
3592 TRACE(
"(Connection == ^%p)\n", Connection);
3606 static LONG next_id;
3613 FIXME(
"not supported for protseq %s\n", Protseq);
3617 NewConnection = ops->
alloc();
3618 NewConnection->
ref = 1;
3620 NewConnection->
ops = ops;
3630 NewConnection->
AuthInfo = AuthInfo;
3633 NewConnection->
QOS =
QOS;
3638 TRACE(
"connection: %p\n", NewConnection);
3639 *Connection = NewConnection;
3670 if (connection->
ref > 1)
3685 TRACE(
"%p ref=%lu\n", connection,
ref);
3710 TRACE(
"%p ref=%lu\n", connection,
ref);
3739 FIXME(
"not supported for protseq %s\n", protseq);
3748 const char *protseq,
3749 const char *networkaddr,
3762 *tower_size =
sizeof(*protocol_floor);
3772 tower_data +=
sizeof(*protocol_floor);
3778 *tower_size +=
sizeof(*protocol_floor);
3795 if (tower_size <
sizeof(*protocol_floor))
3799 tower_data +=
sizeof(*protocol_floor);
3800 tower_size -=
sizeof(*protocol_floor);
3802 (protocol_floor->
count_rhs > tower_size))
3804 tower_data += protocol_floor->
count_rhs;
3805 tower_size -= protocol_floor->
count_rhs;
3808 if ((tower_size <
sizeof(*floor4)) ||
3881 for (
i = 0;
i < (*protseqs)->Count;
i++)
3882 free((*protseqs)->Protseq[
i]);
3899 for (
i = 0;
i < (*protseqs)->Count;
i++)
3900 free((*protseqs)->Protseq[
i]);
BOOL WINAPI GetNamedPipeClientProcessId(HANDLE pipe, ULONG *id)
HRESULT WINAPI DECLSPEC_HOTPATCH SetThreadDescription(HANDLE thread, PCWSTR description)
_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 InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
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
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
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
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
static const WCHAR basicW[]
static const WCHAR negotiateW[]
static const WCHAR ntlmW[]
void RpcAssoc_ConnectionReleased(RpcAssoc *assoc)
ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo)
ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos)
ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo)
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)
static int rpcrt4_conn_close(RpcConnection *Connection)
#define RPC_MAX_PACKET_SIZE
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 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 RPC_STATUS rpcrt4_ncalrpc_inquire_client_pid(RpcConnection *conn, ULONG *pid)
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 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 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 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 const struct @593 auth_schemes[]
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 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 char *__cdecl strdup(_In_opt_z_ const char *_Src)
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
_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]
union _RPC_SECURITY_QOS_V2_W::@3414 u
RPC_HTTP_TRANSPORT_CREDENTIALS_W * HttpCredentials
ULONG AdditionalSecurityInfoType
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)
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
HANDLE WINAPI GetCurrentThread(void)
#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
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
#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
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
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