49#define AUTH_ALIGNMENT 16
52#define ROUND_UP_AMOUNT(value, alignment) \
53 (((alignment) - (((value) % (alignment)))) % (alignment))
54#define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1))
60 static const DWORD header_sizes[] = {
62 sizeof(
Header->fault), 0, 0, 0, 0, 0, 0, 0,
sizeof(
Header->bind),
64 0, 0,
sizeof(
Header->auth3), 0, 0, 0,
sizeof(
Header->http)
71 FIXME(
"unhandled packet type %u\n",
Header->common.ptype);
75 WARN(
"invalid packet type %u\n",
Header->common.ptype);
96 switch (
Header->common.ptype)
110 ULONG DataRepresentation)
114 Header->ptype = PacketType;
127 unsigned short ProcNum,
143 header->request.context_id = 0;
144 header->request.opnum = ProcNum;
164 header->common.frag_len =
sizeof(*header);
180 header->common.frag_len =
sizeof(*header);
187 unsigned short MaxTransmissionSize,
188 unsigned short MaxReceiveSize,
204 header->bind.max_tsize = MaxTransmissionSize;
205 header->bind.max_rsize = MaxReceiveSize;
206 header->bind.assoc_gid = AssocGroupId;
207 header->bind.num_elements = 1;
224 header->common.frag_len =
sizeof(*header);
230 unsigned char RpcVersion,
231 unsigned char RpcVersionMinor,
232 unsigned short RejectReason)
246 header->reject_reason = RejectReason;
247 header->protocols_count = 1;
248 header->protocols[0].rpc_ver = RpcVersion;
249 header->protocols[0].rpc_ver_minor = RpcVersionMinor;
255 unsigned short MaxTransmissionSize,
256 unsigned short MaxReceiveSize,
259 unsigned char ResultCount,
267 header_size =
sizeof(
header->bind_ack) +
277 header->common.frag_len = header_size;
278 header->bind_ack.max_tsize = MaxTransmissionSize;
279 header->bind_ack.max_rsize = MaxReceiveSize;
280 header->bind_ack.assoc_gid = AssocGroupId;
286 results->num_results = ResultCount;
287 memcpy(&
results->results[0], Results, ResultCount *
sizeof(*Results));
293 unsigned short flags,
294 unsigned short num_data_items,
295 unsigned int payload_size)
301 ERR(
"failed to allocate memory\n");
309 header->common.call_id = 0;
310 header->common.frag_len =
sizeof(
header->http) + payload_size;
312 header->http.num_data_items = num_data_items;
317#define WRITE_HTTP_PAYLOAD_FIELD_UINT32(payload, type, value) \
319 *(unsigned int *)(payload) = (type); \
321 *(unsigned int *)(payload) = (value); \
325#define WRITE_HTTP_PAYLOAD_FIELD_UUID(payload, type, uuid) \
327 *(unsigned int *)(payload) = (type); \
329 *(UUID *)(payload) = (uuid); \
330 (payload) += sizeof(UUID); \
333#define WRITE_HTTP_PAYLOAD_FIELD_FLOW_CONTROL(payload, bytes_transmitted, flow_control_increment, uuid) \
335 *(unsigned int *)(payload) = 0x00000001; \
337 *(unsigned int *)(payload) = (bytes_transmitted); \
339 *(unsigned int *)(payload) = (flow_control_increment); \
341 *(UUID *)(payload) = (uuid); \
342 (payload) += sizeof(UUID); \
346 const UUID *connection_uuid,
347 const UUID *pipe_uuid,
348 const UUID *association_uuid)
359 out_pipe ? 4 : 6,
size);
361 payload = (
char *)(&
header->http+1);
386 ULONG flow_control_increment,
387 const UUID *pipe_uuid)
395 payload = (
char *)(&
header->http+1);
400 flow_control_increment, *pipe_uuid);
480 unsigned short data_len)
485 for (
i = 0;
i <
hdr->http.num_data_items;
i++)
489 if (data_len <
sizeof(
ULONG))
494 data_len -=
sizeof(
ULONG);
500 if (data_len <
sizeof(
GUID))
503 data_len -=
sizeof(
GUID);
511 if (data_len <
sizeof(
ULONG))
514 data_len -=
sizeof(
ULONG);
523 FIXME(
"unimplemented type 0x%lx\n",
type);
553 FIXME(
"unimplemented type 0x%lx\n",
type);
558#define READ_HTTP_PAYLOAD_FIELD_TYPE(data) *(ULONG *)(data)
559#define GET_HTTP_PAYLOAD_FIELD_DATA(data) ((data) + sizeof(ULONG))
566 if (
header->http.flags != 0x0)
568 ERR(
"invalid flags 0x%x\n",
header->http.flags);
571 if (
header->http.num_data_items != 1)
573 ERR(
"invalid number of data items %d\n",
header->http.num_data_items);
577 if (
type != 0x00000002)
579 ERR(
"invalid type 0x%08lx\n",
type);
589 ULONG *bytes_until_next_packet,
593 if (
header->http.flags != 0x0)
595 ERR(
"invalid flags 0x%x\n",
header->http.flags);
598 if (
header->http.num_data_items != 3)
600 ERR(
"invalid number of data items %d\n",
header->http.num_data_items);
605 if (
type != 0x00000006)
607 ERR(
"invalid type for field 1: 0x%08lx\n",
type);
614 if (
type != 0x00000000)
616 ERR(
"invalid type for field 2: 0x%08lx\n",
type);
623 if (
type != 0x00000002)
625 ERR(
"invalid type for field 3: 0x%08lx\n",
type);
635 ULONG *bytes_transmitted,
636 ULONG *flow_control_increment,
640 if (
header->http.flags != 0x2)
642 ERR(
"invalid flags 0x%x\n",
header->http.flags);
645 if (
header->http.num_data_items != 2)
647 ERR(
"invalid number of data items %d\n",
header->http.num_data_items);
652 if (
type != 0x0000000d)
654 ERR(
"invalid type for field 1: 0x%08lx\n",
type);
665 if (
type != 0x00000001)
667 ERR(
"invalid type for field 2: 0x%08lx\n",
type);
681 unsigned char *stub_data,
unsigned int stub_data_size,
683 unsigned char *auth_value,
unsigned int auth_value_size)
693 buffers[0].cbBuffer = hdr_size;
696 buffers[1].cbBuffer = stub_data_size;
698 buffers[1].pvBuffer = stub_data;
699 buffers[2].cbBuffer =
sizeof(*auth_hdr);
701 buffers[2].pvBuffer = auth_hdr;
702 buffers[3].cbBuffer = auth_value_size;
704 buffers[3].pvBuffer = auth_value;
713 ERR(
"EncryptMessage failed with 0x%08lx\n", sec_status);
722 ERR(
"MakeSignature failed with 0x%08lx\n", sec_status);
734 ERR(
"DecryptMessage failed with 0x%08lx\n", sec_status);
743 ERR(
"VerifySignature failed with 0x%08lx\n", sec_status);
759 const void *Auth,
unsigned int AuthLength)
772 hdr_size =
Header->common.frag_len;
774 Header->common.auth_len = AuthLength;
783 Header->common.auth_len = 0;
785 Header->common.flags &= ~RPC_FLG_LAST;
791 unsigned int pkt_size =
BufferLength + hdr_size + alen + auth_pad_len;
794 if (pkt_size <= Connection->MaxTransmissionSize) {
796 Header->common.frag_len = pkt_size;
810 if (hdr_size ==
Header->common.frag_len)
813 memcpy(pkt + hdr_size, buffer_pos,
Header->common.frag_len - hdr_size - auth_pad_len - alen);
816 if (
Header->common.auth_len)
828 memcpy(auth_hdr + 1, Auth, AuthLength);
833 pkt + hdr_size,
Header->common.frag_len - hdr_size - alen,
835 (
unsigned char *)(auth_hdr + 1),
Header->common.auth_len);
849 WARN(
"rpcrt4_conn_write failed (auth)\n");
854 buffer_pos +=
Header->common.frag_len - hdr_size - alen - auth_pad_len;
856 Header->common.flags &= ~RPC_FLG_FIRST;
878 BOOL continue_needed;
898 out_desc.pBuffers = &
out;
902 inp_desc.pBuffers = &
in;
915 first_time ?
NULL : &conn->
ctx,
918 &out_desc, &conn->
attr, &conn->
exp);
939 first_time ?
NULL : &inp_desc, 0, &conn->
ctx,
940 &out_desc, &conn->
attr, &conn->
exp);
944 WARN(
"InitializeSecurityContext failed with error 0x%08lx\n",
r);
948 TRACE(
"r = 0x%08lx, attr = 0x%08lx\n",
r, conn->
attr);
954 TRACE(
"complete needed\n");
958 WARN(
"CompleteAuthToken failed with error 0x%08lx\n",
r);
963 TRACE(
"cbBuffer = %ld\n",
out.cbBuffer);
965 if (!continue_needed)
970 WARN(
"QueryContextAttributes failed with error 0x%08lx\n",
r);
994 unsigned int out_len = 0;
996 TRACE(
"challenge %s, %ld bytes\n", challenge,
count);
1024 ULONG auth_length_in,
1025 unsigned char **auth_data_out,
1026 ULONG *auth_length_out)
1055 ERR(
"unknown authentication service %u\n", auth_data_in->
auth_type);
1081 conn,
start, (
unsigned char *)(auth_data_in + 1),
1089 conn,
start, (
unsigned char *)(auth_data_in + 1),
1099 ERR(
"expected authentication to be complete but SSP returned data of "
1100 "%u bytes to be sent back to client\n",
out_size);
1131 TRACE(
"(%p)\n", conn);
1137 WARN(
"ImpersonateSecurityContext returned 0x%08lx\n", sec_status);
1159 TRACE(
"(%p)\n", conn);
1165 WARN(
"RevertSecurityContext returned 0x%08lx\n", sec_status);
1193 FIXME(
"privs not implemented\n");
1196 if (server_princ_name)
1205 FIXME(
"authorization service not implemented\n");
1209 FIXME(
"flags 0x%lx not implemented\n",
flags);
1259 WARN(
"unhandled packet version\n");
1264 if (hdr_length == 0)
1266 WARN(
"header length == 0\n");
1270 if (
hdr->frag_len < hdr_length)
1272 WARN(
"bad frag length %d\n",
hdr->frag_len);
1294 TRACE(
"(%p, %p, %p)\n", Connection,
Header, Payload);
1298 if (dwRead !=
sizeof(common_hdr)) {
1299 WARN(
"Short read of header, %ld bytes\n", dwRead);
1308 if (hdr_length == 0) {
1309 WARN(
"header length == 0\n");
1318 dwRead =
rpcrt4_conn_read(Connection, &(*Header)->common + 1, hdr_length -
sizeof(common_hdr));
1319 if (dwRead != hdr_length -
sizeof(common_hdr)) {
1320 WARN(
"bad header length, %ld bytes, hdr_length %ld\n", dwRead, hdr_length);
1325 if (common_hdr.
frag_len - hdr_length)
1335 if (dwRead != common_hdr.
frag_len - hdr_length)
1337 WARN(
"bad data length, %ld/%ld\n", dwRead, common_hdr.
frag_len - hdr_length);
1360 if (Connection->
ops->receive_fragment)
1361 return Connection->
ops->receive_fragment(Connection,
Header, Payload);
1374 unsigned char **auth_data_out,
1375 ULONG *auth_length_out)
1379 unsigned short first_flag;
1381 ULONG buffer_length;
1382 ULONG auth_length = 0;
1383 unsigned char *auth_data =
NULL;
1385 void *payload =
NULL;
1389 if (auth_data_out) *auth_data_out =
NULL;
1390 if (auth_length_out) *auth_length_out = 0;
1392 TRACE(
"(%p, %p, %p, %p)\n", Connection,
Header, pMsg, auth_data_out);
1402 switch ((*Header)->common.ptype) {
1423 auth_length = (*Header)->common.auth_len;
1440 (CurrentHeader->
common.
frag_len - hdr_length < header_auth_len)) {
1441 WARN(
"frag_len %d too small for hdr_length %ld and auth_len %d\n",
1448 WARN(
"auth_len header field changed from %ld to %d\n",
1455 TRACE(
"invalid packet flags\n");
1460 data_length = CurrentHeader->
common.
frag_len - hdr_length - header_auth_len;
1461 if (data_length + buffer_length > pMsg->
BufferLength) {
1462 TRACE(
"allocation hint exceeded, new buffer length = %ld\n",
1463 data_length + buffer_length);
1469 memcpy((
unsigned char *)pMsg->
Buffer + buffer_length, payload, data_length);
1471 if (header_auth_len) {
1474 WARN(
"bad auth verifier length %d\n", header_auth_len);
1484 memcpy(auth_data, (
unsigned char *)payload + data_length, header_auth_len);
1491 CurrentHeader, hdr_length,
1492 (
unsigned char *)pMsg->
Buffer + buffer_length, data_length,
1500 buffer_length += data_length;
1502 TRACE(
"next header\n");
1504 if (*
Header != CurrentHeader)
1506 free(CurrentHeader);
1507 CurrentHeader =
NULL;
1527 if (CurrentHeader != *
Header)
1528 free(CurrentHeader);
1536 *auth_length_out = auth_length;
1537 *auth_data_out = auth_data;
1576 TRACE(
"(%p)\n", pMsg);
1580 ERR(
"no binding\n");
1590 if (!
bind->Endpoint || !
bind->Endpoint[0])
1592 TRACE(
"automatically resolving partially bound binding\n");
1643 WARN(
"no binding\n");
1700 ERR(
"no binding\n");
1726 if (
state && conn->
ops->wait_for_incoming_data(conn) != -1)
1729 switch (
state->NotificationType)
1732 TRACE(
"RpcNotificationTypeEvent %p\n",
state->u.hEvent);
1736 TRACE(
"RpcNotificationTypeApc %p\n",
state->u.APC.hThread);
1740 TRACE(
"RpcNotificationTypeIoc %p, 0x%lx, 0x%Ix, %p\n",
1741 state->u.IOC.hIOPort,
state->u.IOC.dwNumberOfBytesTransferred,
1742 state->u.IOC.dwCompletionKey,
state->u.IOC.lpOverlapped);
1744 state->u.IOC.dwNumberOfBytesTransferred,
1745 state->u.IOC.dwCompletionKey,
1746 state->u.IOC.lpOverlapped);
1749 TRACE(
"RpcNotificationTypeHwnd %p 0x%x\n",
state->u.HWND.hWnd,
1754 TRACE(
"RpcNotificationTypeCallback %p\n",
state->u.NotificationRoutine);
1758 TRACE(
"RpcNotificationTypeNone\n");
1761 FIXME(
"unknown NotificationType: %d/0x%x\n",
state->NotificationType,
state->NotificationType);
1795 TRACE(
"(%p)\n", pMsg);
1814 WARN(
"Send failed, trying to reconnect\n");
1860 TRACE(
"(%p)\n", pMsg);
1866 WARN(
"receive failed with error %lx\n",
status);
1870 switch (
hdr->common.ptype) {
1874 ERR (
"we got fault packet with status 0x%x\n",
hdr->fault.status);
1880 WARN(
"bad packet type %d\n",
hdr->common.ptype);
1917 void *original_buffer;
1919 TRACE(
"(%p)\n", pMsg);
1921 original_buffer = pMsg->
Buffer;
1950 TRACE(
"(%p, %p)\n", pMsg, pAsync);
static struct _test_info results[8]
ACPI_SIZE strlen(const char *String)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
struct protocol * protocols
#define STATUS_INTEGER_OVERFLOW
_Inout_ PIRP _In_ NTSTATUS ExceptionCode
#define ERROR_INVALID_PARAMETER
#define ERROR_INVALID_HANDLE
#define ERROR_ACCESS_DENIED
DWORD WINAPI QueueUserAPC(IN PAPCFUNC pfnAPC, IN HANDLE hThread, IN ULONG_PTR dwData)
BOOL WINAPI QueueUserWorkItem(IN LPTHREAD_START_ROUTINE Function, IN PVOID Context, IN ULONG Flags)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
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
BOOL WINAPI PostQueuedCompletionStatus(IN HANDLE CompletionHandle, IN DWORD dwNumberOfBytesTransferred, IN ULONG_PTR dwCompletionKey, IN LPOVERLAPPED lpOverlapped)
#define memcpy(s1, s2, n)
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 NCA_S_FAULT_ILL_INST
#define NCA_S_MANAGER_NOT_ENTERED
#define NCA_S_FAULT_INT_DIV_BY_ZERO
#define NCA_S_UNSPEC_REJECT
#define NCA_S_FAULT_INT_OVERFLOW
#define NCA_S_FAULT_PIPE_MEMORY
#define NCA_S_FAULT_REMOTE_NO_MEMORY
#define NCA_S_RPC_VERSION_MISMATCH
#define NCA_S_COMM_FAILURE
#define NCA_S_SERVER_TOO_BUSY
#define NCA_S_FAULT_FP_OVERFLOW
#define NCA_S_FAULT_UNSPEC
#define NCA_S_FAULT_FP_DIV_ZERO
#define NCA_S_FAULT_FP_ERROR
#define NCA_S_FAULT_PIPE_CLOSED
#define NCA_S_FAULT_CONTEXT_MISMATCH
#define NCA_S_UNSUPPORTED_TYPE
#define NCA_S_FAULT_ADDR_ERROR
#define NCA_S_WHO_ARE_YOU_FAILED
#define NCA_S_FAULT_PIPE_DISCIPLINE
#define NCA_S_FAULT_PIPE_EMPTY
#define NCA_S_FAULT_CANCEL
#define NCA_S_OUT_ARGS_TOO_BIG
#define NCA_S_OP_RNG_ERROR
#define NCA_S_FAULT_PIPE_COMM_ERROR
#define NCA_S_YOU_CRASHED
#define NCA_S_FAULT_FP_UNDERFLOW
#define NCA_S_FAULT_INVALID_TAG
#define NCA_S_FAULT_INVALID_BOUND
#define NCA_S_PROTO_ERROR
#define NCA_S_FAULT_PIPE_ORDER
#define STATUS_FLOAT_UNDERFLOW
#define STATUS_FLOAT_OVERFLOW
#define STATUS_FLOAT_DIVIDE_BY_ZERO
#define STATUS_FLOAT_INVALID_OPERATION
#define STATUS_INTEGER_DIVIDE_BY_ZERO
#define ISC_REQ_CONFIDENTIALITY
#define SecIsValidHandle(x)
#define ASC_REQ_CONNECTION
#define ASC_REQ_CONFIDENTIALITY
#define SECURITY_NETWORK_DREP
#define ISC_REQ_INTEGRITY
#define SECBUFFER_READONLY_WITH_CHECKSUM
#define ASC_REQ_USE_DCE_STYLE
#define SECPKG_ATTR_SIZES
#define ISC_REQ_MUTUAL_AUTH
#define ASC_REQ_INTEGRITY
#define SecInvalidateHandle(x)
#define SECBUFFER_VERSION
#define ISC_REQ_CONNECTION
#define ISC_REQ_USE_DCE_STYLE
RPC_STATUS RpcAuthInfo_Create(ULONG AuthnLevel, ULONG AuthnSvc, CredHandle cred, TimeStamp exp, ULONG cbMaxToken, RPC_AUTH_IDENTITY_HANDLE identity, RpcAuthInfo **ret)
void RPCRT4_AddRefBinding(RpcBinding *Binding)
RPC_STATUS RPCRT4_CloseBinding(RpcBinding *Binding, RpcConnection *Connection)
ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo)
RPC_STATUS RPCRT4_ReleaseBinding(RpcBinding *Binding)
RPC_STATUS RPCRT4_OpenBinding(RpcBinding *Binding, RpcConnection **Connection, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId, BOOL *from_cache)
static RPC_STATUS rpcrt4_conn_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_read(RpcConnection *Connection, void *buffer, unsigned int len)
static int rpcrt4_conn_write(RpcConnection *Connection, const void *buffer, unsigned int len)
void RPCRT4_ReleaseConnection(RpcConnection *Connection)
static RPC_STATUS rpcrt4_conn_authorize(RpcConnection *conn, BOOL first_time, unsigned char *in_buffer, unsigned int in_len, unsigned char *out_buffer, unsigned int *out_len)
static BOOL rpcrt4_conn_is_authorized(RpcConnection *Connection)
void RPCRT4_SetThreadCurrentConnection(RpcConnection *Connection)
#define RPC_AUTH_VERIFIER_LEN(common_hdr)
#define RPC_FLG_OBJECT_UUID
RPC_STATUS WINAPI RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec)
RPC_STATUS WINAPI I_RpcGetBuffer(PRPC_MESSAGE pMsg)
RPC_STATUS RPCRT4_ReceiveWithAuth(RpcConnection *Connection, RpcPktHdr **Header, PRPC_MESSAGE pMsg, unsigned char **auth_data_out, ULONG *auth_length_out)
RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg)
#define WRITE_HTTP_PAYLOAD_FIELD_UUID(payload, type, uuid)
static RPC_STATUS RPCRT4_default_receive_fragment(RpcConnection *Connection, RpcPktHdr **Header, void **Payload)
RpcPktHdr * RPCRT4_BuildFaultHeader(ULONG DataRepresentation, RPC_STATUS Status)
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)
static unsigned char * RPCRT4_NextHttpHeaderField(unsigned char *data)
RpcPktHdr * RPCRT4_BuildHttpHeader(ULONG DataRepresentation, unsigned short flags, unsigned short num_data_items, unsigned int payload_size)
static BOOL packet_does_auth_negotiation(const RpcPktHdr *Header)
static RpcPktHdr * RPCRT4_BuildRequestHeader(ULONG DataRepresentation, ULONG BufferLength, unsigned short ProcNum, UUID *ObjectUuid)
BOOL RPCRT4_default_is_authorized(RpcConnection *Connection)
RPC_STATUS WINAPI I_RpcAsyncSetHandle(PRPC_MESSAGE pMsg, PRPC_ASYNC_STATE pAsync)
RPC_STATUS WINAPI I_RpcNegotiateTransferSyntax(PRPC_MESSAGE pMsg)
#define GET_HTTP_PAYLOAD_FIELD_DATA(data)
RPC_STATUS WINAPI I_RpcAsyncAbortCall(PRPC_ASYNC_STATE pAsync, ULONG ExceptionCode)
RpcPktHdr * RPCRT4_BuildBindHeader(ULONG DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, ULONG AssocGroupId, const RPC_SYNTAX_IDENTIFIER *AbstractId, const RPC_SYNTAX_IDENTIFIER *TransferId)
RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg)
#define READ_HTTP_PAYLOAD_FIELD_TYPE(data)
RPC_STATUS RPCRT4_ValidateCommonHeader(const RpcPktCommonHdr *hdr)
RpcPktHdr * RPCRT4_BuildBindAckHeader(ULONG DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, ULONG AssocGroupId, LPCSTR ServerAddress, unsigned char ResultCount, const RpcResult *Results)
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)
#define WRITE_HTTP_PAYLOAD_FIELD_FLOW_CONTROL(payload, bytes_transmitted, flow_control_increment, uuid)
NCA_STATUS RPC2NCA_STATUS(RPC_STATUS status)
RPC_STATUS RPCRT4_ParseHttpFlowControlHeader(RpcPktHdr *header, unsigned char *data, BOOL server, ULONG *bytes_transmitted, ULONG *flow_control_increment, UUID *pipe_uuid)
#define ROUND_UP(value, alignment)
static BOOL packet_has_auth_verifier(const RpcPktHdr *Header)
#define ROUND_UP_AMOUNT(value, alignment)
RPC_STATUS WINAPI I_RpcSendReceive(PRPC_MESSAGE pMsg)
static VOID RPCRT4_BuildCommonHeader(RpcPktCommonHdr *Header, unsigned char PacketType, ULONG DataRepresentation)
RpcPktHdr * RPCRT4_BuildBindNackHeader(ULONG DataRepresentation, unsigned char RpcVersion, unsigned char RpcVersionMinor, unsigned short RejectReason)
static DWORD WINAPI async_notifier_proc(LPVOID p)
static RPC_STATUS I_RpcReAllocateBuffer(PRPC_MESSAGE pMsg)
DWORD RPCRT4_GetHeaderSize(const RpcPktHdr *Header)
RPC_STATUS WINAPI I_RpcFreeBuffer(PRPC_MESSAGE pMsg)
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)
static void CALLBACK async_apc_notifier_proc(ULONG_PTR ulParam)
#define WRITE_HTTP_PAYLOAD_FIELD_UINT32(payload, type, value)
static RPC_STATUS RPCRT4_receive_fragment(RpcConnection *Connection, RpcPktHdr **Header, void **Payload)
RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength)
RPC_STATUS RPCRT4_ClientConnectionAuth(RpcConnection *conn, BYTE *challenge, ULONG count)
RpcPktHdr * RPCRT4_BuildResponseHeader(ULONG DataRepresentation, ULONG BufferLength)
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_ServerConnectionAuth(RpcConnection *conn, BOOL start, RpcAuthVerifier *auth_data_in, ULONG auth_length_in, unsigned char **auth_data_out, ULONG *auth_length_out)
static BOOL packet_has_body(const RpcPktHdr *Header)
RPC_STATUS RPCRT4_ParseHttpPrepareHeader1(RpcPktHdr *header, unsigned char *data, ULONG *field1)
static RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, PRPC_MESSAGE pMsg)
static RpcPktHdr * RPCRT4_BuildAuthHeader(ULONG DataRepresentation)
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)
static RPC_STATUS NCA2RPC_STATUS(NCA_STATUS status)
static BOOL is_hard_error(RPC_STATUS status)
RPC_STATUS RPCRT4_SendWithAuth(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength, const void *Auth, unsigned int AuthLength)
RPC_STATUS RPCRT4_default_impersonate_client(RpcConnection *conn)
RPC_STATUS RPCRT4_ServerGetRegisteredAuthInfo(USHORT auth_type, CredHandle *cred, TimeStamp *exp, ULONG *max_token)
@ RpcNotificationTypeHwnd
@ RpcNotificationTypeEvent
@ RpcNotificationTypeNone
@ RpcNotificationTypeCallback
unsigned short * RPC_WSTR
#define RPC_C_AUTHN_LEVEL_PKT_PRIVACY
#define RPC_C_AUTHN_LEVEL_NONE
#define RPC_C_AUTHN_LEVEL_PKT_INTEGRITY
#define RPC_FLAGS_VALID_BIT
#define NDR_LOCAL_DATA_REPRESENTATION
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
void WINAPI I_RpcFree(void *Object)
void *WINAPI I_RpcAllocate(unsigned int Size)
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
char string[ANYSIZE_ARRAY]
unsigned char auth_pad_length
unsigned char auth_reserved
unsigned int auth_context_id
RPC_SYNTAX_IDENTIFIER transfer_syntaxes[ANYSIZE_ARRAY]
RPC_SYNTAX_IDENTIFIER abstract_syntax
unsigned char num_syntaxes
RPC_SYNTAX_IDENTIFIER InterfaceId
RPC_SYNTAX_IDENTIFIER TransferSyntax
unsigned int BufferLength
void * RpcInterfaceInformation
void * ReservedForRuntime
RPC_BINDING_HANDLE Handle
LPWSTR server_principal_name
USHORT MaxTransmissionSize
RPC_ASYNC_STATE * async_state
const struct connection_ops * ops
ULONG encryption_auth_len
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
#define FIELD_OFFSET(t, f)
static rfbScreenInfoPtr server
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
#define RPC_S_SERVER_TOO_BUSY
#define RPC_S_OUT_OF_RESOURCES
#define RPC_S_CALL_FAILED_DNE
#define RPC_S_ADDRESS_ERROR
#define RPC_X_SS_HANDLES_MISMATCH
#define RPC_X_WRONG_PIPE_ORDER
#define RPC_S_INVALID_BOUND
#define RPC_S_CALL_FAILED
#define RPC_S_INVALID_TAG
#define RPC_S_FP_DIV_ZERO
#define RPC_X_PIPE_DISCIPLINE_ERROR
#define RPC_S_UNSUPPORTED_TYPE
#define RPC_S_BINDING_HAS_NO_AUTH
#define SEC_E_NO_IMPERSONATION
#define RPC_S_CANNOT_SUPPORT
#define RPC_S_INVALID_ASYNC_HANDLE
#define RPC_S_FP_UNDERFLOW
#define SEC_E_UNSUPPORTED_FUNCTION
#define RPC_S_CALL_CANCELLED
#define RPC_S_PROTOCOL_ERROR
#define SEC_I_COMPLETE_NEEDED
#define RPC_X_PIPE_CLOSED
#define RPC_S_ZERO_DIVIDE
#define RPC_S_NO_CONTEXT_AVAILABLE
#define RPC_S_NOT_LISTENING
#define SEC_I_CONTINUE_NEEDED
#define SEC_I_COMPLETE_AND_CONTINUE
#define RPC_S_SEC_PKG_ERROR
#define RPC_S_INTERFACE_NOT_FOUND
#define RPC_S_INVALID_BINDING
#define RPC_S_COMM_FAILURE
#define RPC_S_PROCNUM_OUT_OF_RANGE
#define RPC_S_FP_OVERFLOW
#define ERROR_NOT_ENOUGH_SERVER_MEMORY
#define WT_EXECUTELONGFUNCTION
#define WT_EXECUTEDEFAULT
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
SECURITY_STATUS WINAPI EncryptMessage(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
SECURITY_STATUS WINAPI MakeSignature(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
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 CompleteAuthToken(PCtxtHandle phContext, PSecBufferDesc pToken)
SECURITY_STATUS WINAPI DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
SECURITY_STATUS WINAPI VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
SECURITY_STATUS WINAPI QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
SECURITY_STATUS WINAPI AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
SECURITY_STATUS WINAPI DeleteSecurityContext(PCtxtHandle phContext)
SECURITY_STATUS WINAPI ImpersonateSecurityContext(PCtxtHandle phContext)
SECURITY_STATUS WINAPI FreeCredentialsHandle(PCredHandle phCredential)
SECURITY_STATUS WINAPI RevertSecurityContext(PCtxtHandle phContext)