48 #define AUTH_ALIGNMENT 16 51 #define ROUND_UP_AMOUNT(value, alignment) \ 52 (((alignment) - (((value) % (alignment)))) % (alignment)) 53 #define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1)) 59 static const DWORD header_sizes[] = {
61 sizeof(
Header->fault), 0, 0, 0, 0, 0, 0, 0,
sizeof(
Header->bind),
63 0, 0,
sizeof(
Header->auth3), 0, 0, 0,
sizeof(
Header->http)
70 FIXME(
"unhandled packet type %u\n",
Header->common.ptype);
74 WARN(
"invalid packet type %u\n",
Header->common.ptype);
95 switch (
Header->common.ptype)
109 ULONG DataRepresentation)
113 Header->common.ptype = PacketType;
118 Header->common.auth_len = 0;
119 Header->common.call_id = 1;
126 unsigned short ProcNum,
135 sizeof(
header->request) + (has_object ?
sizeof(
UUID) : 0));
143 header->request.context_id = 0;
144 header->request.opnum = ProcNum;
187 unsigned short MaxTransmissionSize,
188 unsigned short MaxReceiveSize,
205 header->bind.max_tsize = MaxTransmissionSize;
206 header->bind.max_rsize = MaxReceiveSize;
207 header->bind.assoc_gid = AssocGroupId;
208 header->bind.num_elements = 1;
232 unsigned char RpcVersion,
233 unsigned char RpcVersionMinor,
234 unsigned short RejectReason)
245 header->bind_nack.reject_reason = RejectReason;
246 header->bind_nack.protocols_count = 1;
247 header->bind_nack.protocols[0].rpc_ver = RpcVersion;
248 header->bind_nack.protocols[0].rpc_ver_minor = RpcVersionMinor;
254 unsigned short MaxTransmissionSize,
255 unsigned short MaxReceiveSize,
258 unsigned char ResultCount,
266 header_size =
sizeof(
header->bind_ack) +
276 header->common.frag_len = header_size;
277 header->bind_ack.max_tsize = MaxTransmissionSize;
278 header->bind_ack.max_rsize = MaxReceiveSize;
279 header->bind_ack.assoc_gid = AssocGroupId;
285 results->num_results = ResultCount;
286 memcpy(&
results->results[0], Results, ResultCount *
sizeof(*Results));
292 unsigned short flags,
293 unsigned short num_data_items,
294 unsigned int payload_size)
300 ERR(
"failed to allocate memory\n");
308 header->common.call_id = 0;
309 header->common.frag_len =
sizeof(
header->http) + payload_size;
311 header->http.num_data_items = num_data_items;
316 #define WRITE_HTTP_PAYLOAD_FIELD_UINT32(payload, type, value) \ 318 *(unsigned int *)(payload) = (type); \ 320 *(unsigned int *)(payload) = (value); \ 324 #define WRITE_HTTP_PAYLOAD_FIELD_UUID(payload, type, uuid) \ 326 *(unsigned int *)(payload) = (type); \ 328 *(UUID *)(payload) = (uuid); \ 329 (payload) += sizeof(UUID); \ 332 #define WRITE_HTTP_PAYLOAD_FIELD_FLOW_CONTROL(payload, bytes_transmitted, flow_control_increment, uuid) \ 334 *(unsigned int *)(payload) = 0x00000001; \ 336 *(unsigned int *)(payload) = (bytes_transmitted); \ 338 *(unsigned int *)(payload) = (flow_control_increment); \ 340 *(UUID *)(payload) = (uuid); \ 341 (payload) += sizeof(UUID); \ 345 const UUID *connection_uuid,
346 const UUID *pipe_uuid,
347 const UUID *association_uuid)
358 out_pipe ? 4 : 6,
size);
360 payload = (
char *)(&
header->http+1);
385 ULONG flow_control_increment,
386 const UUID *pipe_uuid)
394 payload = (
char *)(&
header->http+1);
399 flow_control_increment, *pipe_uuid);
484 unsigned short data_len)
489 for (
i = 0;
i <
hdr->http.num_data_items;
i++)
493 if (data_len <
sizeof(
ULONG))
498 data_len -=
sizeof(
ULONG);
504 if (data_len <
sizeof(
GUID))
507 data_len -=
sizeof(
GUID);
515 if (data_len <
sizeof(
ULONG))
518 data_len -=
sizeof(
ULONG);
527 FIXME(
"unimplemented type 0x%x\n",
type);
557 FIXME(
"unimplemented type 0x%x\n",
type);
562 #define READ_HTTP_PAYLOAD_FIELD_TYPE(data) *(ULONG *)(data) 563 #define GET_HTTP_PAYLOAD_FIELD_DATA(data) ((data) + sizeof(ULONG)) 572 ERR(
"invalid flags 0x%x\n",
header->http.flags);
575 if (
header->http.num_data_items != 1)
577 ERR(
"invalid number of data items %d\n",
header->http.num_data_items);
581 if (
type != 0x00000002)
583 ERR(
"invalid type 0x%08x\n",
type);
593 ULONG *bytes_until_next_packet,
599 ERR(
"invalid flags 0x%x\n",
header->http.flags);
602 if (
header->http.num_data_items != 3)
604 ERR(
"invalid number of data items %d\n",
header->http.num_data_items);
609 if (
type != 0x00000006)
611 ERR(
"invalid type for field 1: 0x%08x\n",
type);
618 if (
type != 0x00000000)
620 ERR(
"invalid type for field 2: 0x%08x\n",
type);
627 if (
type != 0x00000002)
629 ERR(
"invalid type for field 3: 0x%08x\n",
type);
639 ULONG *bytes_transmitted,
640 ULONG *flow_control_increment,
646 ERR(
"invalid flags 0x%x\n",
header->http.flags);
649 if (
header->http.num_data_items != 2)
651 ERR(
"invalid number of data items %d\n",
header->http.num_data_items);
656 if (
type != 0x0000000d)
658 ERR(
"invalid type for field 1: 0x%08x\n",
type);
669 if (
type != 0x00000001)
671 ERR(
"invalid type for field 2: 0x%08x\n",
type);
685 unsigned char *stub_data,
unsigned int stub_data_size,
687 unsigned char *auth_value,
unsigned int auth_value_size)
697 buffers[0].cbBuffer = hdr_size;
700 buffers[1].cbBuffer = stub_data_size;
702 buffers[1].pvBuffer = stub_data;
703 buffers[2].cbBuffer =
sizeof(*auth_hdr);
705 buffers[2].pvBuffer = auth_hdr;
706 buffers[3].cbBuffer = auth_value_size;
708 buffers[3].pvBuffer = auth_value;
717 ERR(
"EncryptMessage failed with 0x%08x\n", sec_status);
726 ERR(
"MakeSignature failed with 0x%08x\n", sec_status);
738 ERR(
"DecryptMessage failed with 0x%08x\n", sec_status);
747 ERR(
"VerifySignature failed with 0x%08x\n", sec_status);
763 const void *Auth,
unsigned int AuthLength)
776 hdr_size =
Header->common.frag_len;
778 Header->common.auth_len = AuthLength;
787 Header->common.auth_len = 0;
795 unsigned int pkt_size =
BufferLength + hdr_size + alen + auth_pad_len;
798 if (pkt_size <= Connection->MaxTransmissionSize) {
800 Header->common.frag_len = pkt_size;
814 if (hdr_size ==
Header->common.frag_len)
817 memcpy(pkt + hdr_size, buffer_pos,
Header->common.frag_len - hdr_size - auth_pad_len - alen);
820 if (
Header->common.auth_len)
832 memcpy(auth_hdr + 1, Auth, AuthLength);
837 pkt + hdr_size,
Header->common.frag_len - hdr_size - alen,
839 (
unsigned char *)(auth_hdr + 1),
Header->common.auth_len);
853 WARN(
"rpcrt4_conn_write failed (auth)\n");
858 buffer_pos +=
Header->common.frag_len - hdr_size - alen - auth_pad_len;
882 BOOL continue_needed;
902 out_desc.pBuffers = &
out;
906 inp_desc.pBuffers = &
in;
919 first_time ?
NULL : &conn->
ctx,
922 &out_desc, &conn->
attr, &conn->
exp);
943 first_time ?
NULL : &inp_desc, 0, &conn->
ctx,
944 &out_desc, &conn->
attr, &conn->
exp);
948 WARN(
"InitializeSecurityContext failed with error 0x%08x\n",
r);
952 TRACE(
"r = 0x%08x, attr = 0x%08x\n",
r, conn->
attr);
958 TRACE(
"complete needed\n");
962 WARN(
"CompleteAuthToken failed with error 0x%08x\n",
r);
967 TRACE(
"cbBuffer = %d\n",
out.cbBuffer);
969 if (!continue_needed)
974 WARN(
"QueryContextAttributes failed with error 0x%08x\n",
r);
998 unsigned int out_len = 0;
1000 TRACE(
"challenge %s, %d bytes\n", challenge,
count);
1028 ULONG auth_length_in,
1029 unsigned char **auth_data_out,
1030 ULONG *auth_length_out)
1059 ERR(
"unknown authentication service %u\n", auth_data_in->
auth_type);
1085 conn,
start, (
unsigned char *)(auth_data_in + 1),
1093 conn,
start, (
unsigned char *)(auth_data_in + 1),
1103 ERR(
"expected authentication to be complete but SSP returned data of " 1104 "%u bytes to be sent back to client\n",
out_size);
1135 TRACE(
"(%p)\n", conn);
1141 WARN(
"ImpersonateSecurityContext returned 0x%08x\n", sec_status);
1163 TRACE(
"(%p)\n", conn);
1169 WARN(
"RevertSecurityContext returned 0x%08x\n", sec_status);
1197 FIXME(
"privs not implemented\n");
1200 if (server_princ_name)
1209 FIXME(
"authorization service not implemented\n");
1213 FIXME(
"flags 0x%x not implemented\n",
flags);
1263 WARN(
"unhandled packet version\n");
1268 if (hdr_length == 0)
1270 WARN(
"header length == 0\n");
1274 if (
hdr->frag_len < hdr_length)
1276 WARN(
"bad frag length %d\n",
hdr->frag_len);
1298 TRACE(
"(%p, %p, %p)\n", Connection,
Header, Payload);
1302 if (dwRead !=
sizeof(common_hdr)) {
1303 WARN(
"Short read of header, %d bytes\n", dwRead);
1312 if (hdr_length == 0) {
1313 WARN(
"header length == 0\n");
1322 dwRead =
rpcrt4_conn_read(Connection, &(*Header)->common + 1, hdr_length -
sizeof(common_hdr));
1323 if (dwRead != hdr_length -
sizeof(common_hdr)) {
1324 WARN(
"bad header length, %d bytes, hdr_length %d\n", dwRead, hdr_length);
1329 if (common_hdr.frag_len - hdr_length)
1338 dwRead =
rpcrt4_conn_read(Connection, *Payload, common_hdr.frag_len - hdr_length);
1339 if (dwRead != common_hdr.frag_len - hdr_length)
1341 WARN(
"bad data length, %d/%d\n", dwRead, common_hdr.frag_len - hdr_length);
1364 if (Connection->
ops->receive_fragment)
1365 return Connection->
ops->receive_fragment(Connection,
Header, Payload);
1378 unsigned char **auth_data_out,
1379 ULONG *auth_length_out)
1383 unsigned short first_flag;
1385 ULONG buffer_length;
1386 ULONG auth_length = 0;
1387 unsigned char *auth_data =
NULL;
1389 void *payload =
NULL;
1393 if (auth_data_out) *auth_data_out =
NULL;
1394 if (auth_length_out) *auth_length_out = 0;
1396 TRACE(
"(%p, %p, %p, %p)\n", Connection,
Header, pMsg, auth_data_out);
1406 switch ((*Header)->common.ptype) {
1427 auth_length = (*Header)->common.auth_len;
1444 (CurrentHeader->
common.
frag_len - hdr_length < header_auth_len)) {
1445 WARN(
"frag_len %d too small for hdr_length %d and auth_len %d\n",
1452 WARN(
"auth_len header field changed from %d to %d\n",
1459 TRACE(
"invalid packet flags\n");
1464 data_length = CurrentHeader->
common.
frag_len - hdr_length - header_auth_len;
1465 if (data_length + buffer_length > pMsg->
BufferLength) {
1466 TRACE(
"allocation hint exceeded, new buffer length = %d\n",
1467 data_length + buffer_length);
1473 memcpy((
unsigned char *)pMsg->
Buffer + buffer_length, payload, data_length);
1475 if (header_auth_len) {
1478 WARN(
"bad auth verifier length %d\n", header_auth_len);
1488 memcpy(auth_data, (
unsigned char *)payload + data_length, header_auth_len);
1495 CurrentHeader, hdr_length,
1496 (
unsigned char *)pMsg->
Buffer + buffer_length, data_length,
1504 buffer_length += data_length;
1506 TRACE(
"next header\n");
1508 if (*
Header != CurrentHeader)
1511 CurrentHeader =
NULL;
1531 if (CurrentHeader != *
Header)
1540 *auth_length_out = auth_length;
1541 *auth_data_out = auth_data;
1580 TRACE(
"(%p)\n", pMsg);
1584 ERR(
"no binding\n");
1594 if (!
bind->Endpoint || !
bind->Endpoint[0])
1596 TRACE(
"automatically resolving partially bound binding\n");
1647 ERR(
"no binding\n");
1704 ERR(
"no binding\n");
1730 if (
state && conn->
ops->wait_for_incoming_data(conn) != -1)
1733 switch (
state->NotificationType)
1736 TRACE(
"RpcNotificationTypeEvent %p\n",
state->u.hEvent);
1740 TRACE(
"RpcNotificationTypeApc %p\n",
state->u.APC.hThread);
1744 TRACE(
"RpcNotificationTypeIoc %p, 0x%x, 0x%lx, %p\n",
1745 state->u.IOC.hIOPort,
state->u.IOC.dwNumberOfBytesTransferred,
1746 state->u.IOC.dwCompletionKey,
state->u.IOC.lpOverlapped);
1748 state->u.IOC.dwNumberOfBytesTransferred,
1749 state->u.IOC.dwCompletionKey,
1750 state->u.IOC.lpOverlapped);
1753 TRACE(
"RpcNotificationTypeHwnd %p 0x%x\n",
state->u.HWND.hWnd,
1758 TRACE(
"RpcNotificationTypeCallback %p\n",
state->u.NotificationRoutine);
1762 TRACE(
"RpcNotificationTypeNone\n");
1765 FIXME(
"unknown NotificationType: %d/0x%x\n",
state->NotificationType,
state->NotificationType);
1799 TRACE(
"(%p)\n", pMsg);
1818 WARN(
"Send failed, trying to reconnect\n");
1864 TRACE(
"(%p)\n", pMsg);
1870 WARN(
"receive failed with error %x\n",
status);
1874 switch (
hdr->common.ptype) {
1878 ERR (
"we got fault packet with status 0x%x\n",
hdr->fault.status);
1884 WARN(
"bad packet type %d\n",
hdr->common.ptype);
1921 void *original_buffer;
1923 TRACE(
"(%p)\n", pMsg);
1925 original_buffer = pMsg->
Buffer;
1954 TRACE(
"(%p, %p)\n", pMsg, pAsync);
USHORT MaxTransmissionSize
#define ERROR_INVALID_PARAMETER
#define WRITE_HTTP_PAYLOAD_FIELD_UINT32(payload, type, value)
#define NCA_S_FAULT_PIPE_MEMORY
static int rpcrt4_conn_write(RpcConnection *Connection, const void *buffer, unsigned int len)
void * RpcInterfaceInformation
_Inout_ PIRP _In_ NTSTATUS ExceptionCode
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
RpcPktHdr * RPCRT4_BuildBindNackHeader(ULONG DataRepresentation, unsigned char RpcVersion, unsigned char RpcVersionMinor, unsigned short RejectReason)
#define NCA_S_FAULT_PIPE_CLOSED
static BOOL rpcrt4_conn_is_authorized(RpcConnection *Connection)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
#define RPC_S_PROCNUM_OUT_OF_RANGE
static rfbScreenInfoPtr server
#define RPC_S_INVALID_BOUND
ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo)
#define NCA_S_COMM_FAILURE
#define ASC_REQ_USE_DCE_STYLE
RPC_STATUS RPCRT4_default_revert_to_self(RpcConnection *conn)
void WINAPI I_RpcFree(void *Object)
RPC_STATUS RPCRT4_ParseHttpPrepareHeader1(RpcPktHdr *header, unsigned char *data, ULONG *field1)
#define RPC_S_NO_CONTEXT_AVAILABLE
ACPI_SIZE strlen(const char *String)
RPC_STATUS RPCRT4_ClientConnectionAuth(RpcConnection *conn, BYTE *challenge, ULONG count)
IN BOOLEAN OUT PSTR Buffer
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
static BOOL is_hard_error(RPC_STATUS status)
GLdouble GLdouble GLdouble r
#define SecIsValidHandle(x)
GLuint GLuint GLsizei count
#define NCA_S_FAULT_INVALID_TAG
#define NCA_S_UNSUPPORTED_TYPE
#define ERROR_INVALID_HANDLE
#define NCA_S_OP_RNG_ERROR
VOID RPCRT4_FreeHeader(RpcPktHdr *Header)
static unsigned char * RPCRT4_NextHttpHeaderField(unsigned char *data)
GLenum GLuint GLenum GLsizei const GLchar * message
#define ASC_REQ_CONNECTION
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
RPC_STATUS WINAPI I_RpcGetBuffer(PRPC_MESSAGE pMsg)
#define NCA_S_FAULT_REMOTE_NO_MEMORY
SECURITY_STATUS WINAPI FreeCredentialsHandle(PCredHandle phCredential)
#define RPC_X_PIPE_CLOSED
#define RPC_C_AUTHN_LEVEL_PKT_INTEGRITY
void RPCRT4_AddRefBinding(RpcBinding *Binding)
#define NCA_S_RPC_VERSION_MISMATCH
#define NCA_S_UNSPEC_REJECT
LPWSTR server_principal_name
unsigned short * RPC_WSTR
RpcPktHdr * RPCRT4_BuildFaultHeader(ULONG DataRepresentation, RPC_STATUS Status)
#define STATUS_FLOAT_DIVIDE_BY_ZERO
#define SEC_E_UNSUPPORTED_FUNCTION
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)
const struct connection_ops * ops
DWORD RPCRT4_GetHeaderSize(const RpcPktHdr *Header)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID out_buffer
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)
#define NCA_S_FAULT_ADDR_ERROR
static void CALLBACK async_apc_notifier_proc(ULONG_PTR ulParam)
#define NCA_S_FAULT_INT_OVERFLOW
#define STATUS_FLOAT_UNDERFLOW
static unsigned char * in_buffer
#define SecInvalidateHandle(x)
#define NCA_S_MANAGER_NOT_ENTERED
static RpcPktHdr * RPCRT4_BuildRequestHeader(ULONG DataRepresentation, ULONG BufferLength, unsigned short ProcNum, UUID *ObjectUuid)
unsigned int BufferLength
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
DWORD WINAPI QueueUserAPC(IN PAPCFUNC pfnAPC, IN HANDLE hThread, IN ULONG_PTR dwData)
RPC_STATUS WINAPI I_RpcSendReceive(PRPC_MESSAGE pMsg)
#define SECPKG_ATTR_SIZES
#define RPC_X_WRONG_PIPE_ORDER
#define STATUS_FLOAT_OVERFLOW
#define RPC_S_ZERO_DIVIDE
#define NCA_S_FAULT_UNSPEC
#define ERROR_ACCESS_DENIED
#define NCA_S_FAULT_FP_OVERFLOW
#define STATUS_INTEGER_OVERFLOW
#define NCA_S_FAULT_CANCEL
char string[ANYSIZE_ARRAY]
#define READ_HTTP_PAYLOAD_FIELD_TYPE(data)
RpcPktHdr * RPCRT4_BuildHttpConnectHeader(int out_pipe, const UUID *connection_uuid, const UUID *pipe_uuid, const UUID *association_uuid)
RPC_STATUS RpcAuthInfo_Create(ULONG AuthnLevel, ULONG AuthnSvc, CredHandle cred, TimeStamp exp, ULONG cbMaxToken, RPC_AUTH_IDENTITY_HANDLE identity, RpcAuthInfo **ret)
#define STATUS_INTEGER_DIVIDE_BY_ZERO
#define ERROR_NOT_ENOUGH_SERVER_MEMORY
unsigned char num_syntaxes
SECURITY_STATUS WINAPI CompleteAuthToken(PCtxtHandle phContext, PSecBufferDesc pToken)
#define NCA_S_FAULT_FP_UNDERFLOW
#define RPC_S_SEC_PKG_ERROR
#define RPC_S_INVALID_TAG
#define RPC_S_FP_UNDERFLOW
#define RPC_S_CALL_FAILED_DNE
#define SECBUFFER_READONLY_WITH_CHECKSUM
SECURITY_STATUS WINAPI VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
#define RPC_S_INVALID_BINDING
#define SEC_I_COMPLETE_NEEDED
#define ROUND_UP(value, alignment)
RPC_STATUS WINAPI I_RpcFreeBuffer(PRPC_MESSAGE pMsg)
#define NCA_S_FAULT_ILL_INST
#define RPC_S_CANNOT_SUPPORT
#define SEC_I_CONTINUE_NEEDED
RPC_STATUS RPCRT4_default_impersonate_client(RpcConnection *conn)
RPC_STATUS RPCRT4_OpenBinding(RpcBinding *Binding, RpcConnection **Connection, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId, BOOL *from_cache)
unsigned int auth_context_id
unsigned char auth_pad_length
static int rpcrt4_conn_read(RpcConnection *Connection, void *buffer, unsigned int len)
#define RPC_S_FP_OVERFLOW
RPC_STATUS RPCRT4_ValidateCommonHeader(const RpcPktCommonHdr *hdr)
#define ISC_REQ_INTEGRITY
#define RPC_S_NOT_LISTENING
RPC_STATUS RPCRT4_ReleaseBinding(RpcBinding *Binding)
#define RPC_S_PROTOCOL_ERROR
#define NCA_S_FAULT_FP_ERROR
#define RPC_S_INTERFACE_NOT_FOUND
static VOID RPCRT4_BuildCommonHeader(RpcPktHdr *Header, unsigned char PacketType, ULONG DataRepresentation)
void RPCRT4_ReleaseConnection(RpcConnection *Connection) DECLSPEC_HIDDEN
#define GET_HTTP_PAYLOAD_FIELD_DATA(data)
#define RPC_C_AUTHN_LEVEL_PKT_PRIVACY
#define RPC_S_UNSUPPORTED_TYPE
#define WT_EXECUTELONGFUNCTION
BOOL RPCRT4_default_is_authorized(RpcConnection *Connection)
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)
static BOOL packet_has_auth_verifier(const RpcPktHdr *Header)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
NCA_STATUS RPC2NCA_STATUS(RPC_STATUS status)
static RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, PRPC_MESSAGE pMsg)
RpcPktHdr * RPCRT4_BuildBindAckHeader(ULONG DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, ULONG AssocGroupId, LPCSTR ServerAddress, unsigned char ResultCount, const RpcResult *Results)
RPC_STATUS RPCRT4_ParseHttpFlowControlHeader(RpcPktHdr *header, unsigned char *data, BOOL server, ULONG *bytes_transmitted, ULONG *flow_control_increment, UUID *pipe_uuid)
static RpcPktHdr * RPCRT4_BuildAuthHeader(ULONG DataRepresentation)
#define RPC_S_COMM_FAILURE
RPC_STATUS WINAPI I_RpcAsyncSetHandle(PRPC_MESSAGE pMsg, PRPC_ASYNC_STATE pAsync)
SECURITY_STATUS WINAPI AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
#define ASC_REQ_CONFIDENTIALITY
ULONG encryption_auth_len
#define NCA_S_FAULT_FP_DIV_ZERO
#define RPC_FLG_OBJECT_UUID
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG in_size
void * ReservedForRuntime
unsigned char auth_reserved
RPC_STATUS RPCRT4_ReceiveWithAuth(RpcConnection *Connection, RpcPktHdr **Header, PRPC_MESSAGE pMsg, unsigned char **auth_data_out, ULONG *auth_length_out)
#define NCA_S_FAULT_PIPE_DISCIPLINE
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
static struct _test_info results[8]
#define NCA_S_WHO_ARE_YOU_FAILED
#define NCA_S_FAULT_INT_DIV_BY_ZERO
#define RPC_S_CALL_CANCELLED
RPC_STATUS WINAPI I_RpcAsyncAbortCall(PRPC_ASYNC_STATE pAsync, ULONG ExceptionCode)
BOOL WINAPI QueueUserWorkItem(IN LPTHREAD_START_ROUTINE Function, IN PVOID Context, IN ULONG Flags)
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)
RPC_ASYNC_STATE * async_state
BOOL WINAPI PostQueuedCompletionStatus(IN HANDLE CompletionHandle, IN DWORD dwNumberOfBytesTransferred, IN ULONG_PTR dwCompletionKey, IN LPOVERLAPPED lpOverlapped)
RpcPktHdr * RPCRT4_BuildBindHeader(ULONG DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, ULONG AssocGroupId, const RPC_SYNTAX_IDENTIFIER *AbstractId, const RPC_SYNTAX_IDENTIFIER *TransferId)
SECURITY_STATUS WINAPI QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
RPC_STATUS RPCRT4_SendWithAuth(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength, const void *Auth, unsigned int AuthLength)
#define memcpy(s1, s2, n)
#define ASC_REQ_INTEGRITY
#define RPC_S_ADDRESS_ERROR
#define ISC_REQ_USE_DCE_STYLE
RPC_SYNTAX_IDENTIFIER TransferSyntax
#define SECURITY_NETWORK_DREP
RPC_STATUS RPCRT4_ParseHttpPrepareHeader2(RpcPktHdr *header, unsigned char *data, ULONG *field1, ULONG *bytes_until_next_packet, ULONG *field3)
static BOOL packet_does_auth_negotiation(const RpcPktHdr *Header)
#define ROUND_UP_AMOUNT(value, alignment)
#define WRITE_HTTP_PAYLOAD_FIELD_FLOW_CONTROL(payload, bytes_transmitted, flow_control_increment, uuid)
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)
#define RPC_S_SERVER_TOO_BUSY
#define ISC_REQ_CONNECTION
static RPC_STATUS RPCRT4_receive_fragment(RpcConnection *Connection, RpcPktHdr **Header, void **Payload)
#define RPC_S_BINDING_HAS_NO_AUTH
void RPCRT4_SetThreadCurrentConnection(RpcConnection *Connection) DECLSPEC_HIDDEN
#define RPC_AUTH_VERIFIER_LEN(common_hdr)
#define NDR_LOCAL_DATA_REPRESENTATION
RPC_SYNTAX_IDENTIFIER transfer_syntaxes[ANYSIZE_ARRAY]
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)
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
#define NCA_S_FAULT_INVALID_BOUND
#define SECBUFFER_VERSION
RPC_STATUS RPCRT4_CloseBinding(RpcBinding *Binding, RpcConnection *Connection)
#define RPC_X_SS_HANDLES_MISMATCH
#define NCA_S_YOU_CRASHED
#define FIELD_OFFSET(t, f)
static RPC_STATUS RPCRT4_default_receive_fragment(RpcConnection *Connection, RpcPktHdr **Header, void **Payload)
RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength)
static RPC_STATUS NCA2RPC_STATUS(NCA_STATUS status)
#define RPC_FLAGS_VALID_BIT
#define RPC_S_OUT_OF_RESOURCES
RPC_STATUS WINAPI I_RpcNegotiateTransferSyntax(PRPC_MESSAGE pMsg)
SECURITY_STATUS WINAPI DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
#define ISC_REQ_MUTUAL_AUTH
RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg)
RPC_STATUS WINAPI RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec)
RpcPktHdr * RPCRT4_BuildHttpFlowControlHeader(BOOL server, ULONG bytes_transmitted, ULONG flow_control_increment, const UUID *pipe_uuid)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
BOOL RPCRT4_IsValidHttpPacket(RpcPktHdr *hdr, unsigned char *data, unsigned short data_len)
#define NCA_S_OUT_ARGS_TOO_BIG
static BOOL packet_has_body(const RpcPktHdr *Header)
#define NCA_S_FAULT_PIPE_ORDER
static DWORD WINAPI async_notifier_proc(LPVOID p)
RpcPktHdr * RPCRT4_BuildHttpHeader(ULONG DataRepresentation, unsigned short flags, unsigned short num_data_items, unsigned int payload_size)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
char * strcpy(char *DstString, const char *SrcString)
#define NCA_S_FAULT_PIPE_EMPTY
SECURITY_STATUS WINAPI RevertSecurityContext(PCtxtHandle phContext)
#define ISC_REQ_CONFIDENTIALITY
static RPC_STATUS I_RpcReAllocateBuffer(PRPC_MESSAGE pMsg)
RPC_SYNTAX_IDENTIFIER abstract_syntax
#define NCA_S_FAULT_CONTEXT_MISMATCH
#define SEC_E_NO_IMPERSONATION
RPC_STATUS RPCRT4_ServerGetRegisteredAuthInfo(USHORT auth_type, CredHandle *cred, TimeStamp *exp, ULONG *max_token) DECLSPEC_HIDDEN
GLuint GLuint GLsizei GLenum type
#define STATUS_FLOAT_INVALID_OPERATION
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)
#define RPC_S_CALL_FAILED
SECURITY_STATUS WINAPI ImpersonateSecurityContext(PCtxtHandle phContext)
#define NCA_S_PROTO_ERROR
#define RPCRT4_strdupW(x)
#define NCA_S_SERVER_TOO_BUSY
RPC_SYNTAX_IDENTIFIER InterfaceId
SECURITY_STATUS WINAPI MakeSignature(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
static SERVICE_STATUS status
void *WINAPI I_RpcAllocate(unsigned int Size)
#define WRITE_HTTP_PAYLOAD_FIELD_UUID(payload, type, uuid)
#define NCA_S_FAULT_PIPE_COMM_ERROR
RPC_BINDING_HANDLE Handle
#define RPC_C_AUTHN_LEVEL_NONE
#define HeapFree(x, y, z)
RpcPktHdr * RPCRT4_BuildResponseHeader(ULONG DataRepresentation, ULONG BufferLength)
#define RPC_S_INVALID_ASYNC_HANDLE
SECURITY_STATUS WINAPI EncryptMessage(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
#define WT_EXECUTEDEFAULT
SECURITY_STATUS WINAPI DeleteSecurityContext(PCtxtHandle phContext)
RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg)
#define SEC_I_COMPLETE_AND_CONTINUE
#define RPC_X_PIPE_DISCIPLINE_ERROR
WINE_DEFAULT_DEBUG_CHANNEL(rpc)
#define RPC_S_FP_DIV_ZERO