Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
8a87d916
Commit
8a87d916
authored
Jul 20, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Jul 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Convert bind ack and nack reject reasons into RPC status codes when binding.
parent
433393fd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
17 deletions
+111
-17
rpc_defs.h
dlls/rpcrt4/rpc_defs.h
+19
-3
rpc_message.c
dlls/rpcrt4/rpc_message.c
+1
-0
rpc_server.c
dlls/rpcrt4/rpc_server.c
+1
-1
rpc_transport.c
dlls/rpcrt4/rpc_transport.c
+90
-13
No files found.
dlls/rpcrt4/rpc_defs.h
View file @
8a87d916
...
@@ -177,9 +177,25 @@ typedef struct
...
@@ -177,9 +177,25 @@ typedef struct
#define PKT_CO_CANCEL 18
#define PKT_CO_CANCEL 18
#define PKT_ORPHANED 19
#define PKT_ORPHANED 19
#define RESULT_ACCEPT 0
#define RESULT_ACCEPT 0
#define RESULT_USER_REJECTION 1
#define NO_REASON 0
#define RESULT_PROVIDER_REJECTION 2
#define REASON_NONE 0
#define REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED 1
#define REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED 2
#define REASON_LOCAL_LIMIT_EXCEEDED 3
#define REJECT_REASON_NOT_SPECIFIED 0
#define REJECT_TEMPORARY_CONGESTION 1
#define REJECT_LOCAL_LIMIT_EXCEEDED 2
#define REJECT_CALLED_PADDR_UNKNOWN 3
/* not used */
#define REJECT_PROTOCOL_VERSION_NOT_SUPPORTED 4
#define REJECT_DEFAULT_CONTEXT_NOT_SUPPORTED 5
/* not used */
#define REJECT_USER_DATA_NOT_READABLE 6
/* not used */
#define REJECT_NO_PSAP_AVAILABLE 7
/* not used */
#define REJECT_UNKNOWN_AUTHN_SERVICE 8
#define REJECT_INVALID_CHECKSUM 9
#define NCADG_IP_UDP 0x08
#define NCADG_IP_UDP 0x08
#define NCACN_IP_TCP 0x07
#define NCACN_IP_TCP 0x07
...
...
dlls/rpcrt4/rpc_message.c
View file @
8a87d916
...
@@ -230,6 +230,7 @@ RpcPktHdr *RPCRT4_BuildBindNackHeader(unsigned long DataRepresentation,
...
@@ -230,6 +230,7 @@ RpcPktHdr *RPCRT4_BuildBindNackHeader(unsigned long DataRepresentation,
RPCRT4_BuildCommonHeader
(
header
,
PKT_BIND_NACK
,
DataRepresentation
);
RPCRT4_BuildCommonHeader
(
header
,
PKT_BIND_NACK
,
DataRepresentation
);
header
->
common
.
frag_len
=
sizeof
(
header
->
bind_nack
);
header
->
common
.
frag_len
=
sizeof
(
header
->
bind_nack
);
header
->
bind_nack
.
reject_reason
=
REJECT_REASON_NOT_SPECIFIED
;
header
->
bind_nack
.
protocols_count
=
1
;
header
->
bind_nack
.
protocols_count
=
1
;
header
->
bind_nack
.
protocols
[
0
].
rpc_ver
=
RpcVersion
;
header
->
bind_nack
.
protocols
[
0
].
rpc_ver
=
RpcVersion
;
header
->
bind_nack
.
protocols
[
0
].
rpc_ver_minor
=
RpcVersionMinor
;
header
->
bind_nack
.
protocols
[
0
].
rpc_ver_minor
=
RpcVersionMinor
;
...
...
dlls/rpcrt4/rpc_server.c
View file @
8a87d916
...
@@ -198,7 +198,7 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
...
@@ -198,7 +198,7 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
RPC_MAX_PACKET_SIZE
,
RPC_MAX_PACKET_SIZE
,
RPC_MAX_PACKET_SIZE
,
RPC_MAX_PACKET_SIZE
,
conn
->
Endpoint
,
conn
->
Endpoint
,
RESULT_ACCEPT
,
NO_REASON
,
RESULT_ACCEPT
,
REASON_NONE
,
&
sif
->
If
->
TransferSyntax
);
&
sif
->
If
->
TransferSyntax
);
/* save the interface for later use */
/* save the interface for later use */
...
...
dlls/rpcrt4/rpc_transport.c
View file @
8a87d916
...
@@ -1473,6 +1473,8 @@ ULONG RpcAssoc_Release(RpcAssoc *assoc)
...
@@ -1473,6 +1473,8 @@ ULONG RpcAssoc_Release(RpcAssoc *assoc)
return
refs
;
return
refs
;
}
}
#define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1))
static
RPC_STATUS
RpcAssoc_BindConnection
(
RpcAssoc
*
assoc
,
RpcConnection
*
conn
,
static
RPC_STATUS
RpcAssoc_BindConnection
(
RpcAssoc
*
assoc
,
RpcConnection
*
conn
,
const
RPC_SYNTAX_IDENTIFIER
*
InterfaceId
,
const
RPC_SYNTAX_IDENTIFIER
*
InterfaceId
,
const
RPC_SYNTAX_IDENTIFIER
*
TransferSyntax
)
const
RPC_SYNTAX_IDENTIFIER
*
TransferSyntax
)
...
@@ -1501,23 +1503,98 @@ static RPC_STATUS RpcAssoc_BindConnection(RpcAssoc *assoc, RpcConnection *conn,
...
@@ -1501,23 +1503,98 @@ static RPC_STATUS RpcAssoc_BindConnection(RpcAssoc *assoc, RpcConnection *conn,
return
status
;
return
status
;
}
}
if
(
response_hdr
->
common
.
ptype
!=
PKT_BIND_ACK
)
switch
(
response_hdr
->
common
.
ptype
)
{
case
PKT_BIND_ACK
:
{
{
ERR
(
"failed to bind for interface %s, %d.%d
\n
"
,
RpcAddressString
*
server_address
=
msg
.
Buffer
;
debugstr_guid
(
&
InterfaceId
->
SyntaxGUID
),
if
((
msg
.
BufferLength
>=
FIELD_OFFSET
(
RpcAddressString
,
string
[
0
]))
||
InterfaceId
->
SyntaxVersion
.
MajorVersion
,
(
msg
.
BufferLength
>=
ROUND_UP
(
FIELD_OFFSET
(
RpcAddressString
,
string
[
server_address
->
length
]),
4
)))
InterfaceId
->
SyntaxVersion
.
MinorVersion
);
{
RPCRT4_FreeHeader
(
response_hdr
);
unsigned
short
remaining
=
msg
.
BufferLength
-
return
RPC_S_PROTOCOL_ERROR
;
ROUND_UP
(
FIELD_OFFSET
(
RpcAddressString
,
string
[
server_address
->
length
]),
4
);
RpcResults
*
results
=
(
RpcResults
*
)((
ULONG_PTR
)
server_address
+
ROUND_UP
(
FIELD_OFFSET
(
RpcAddressString
,
string
[
server_address
->
length
]),
4
));
if
((
results
->
num_results
==
1
)
&&
(
remaining
>=
sizeof
(
*
results
)))
{
switch
(
results
->
results
[
0
].
result
)
{
case
RESULT_ACCEPT
:
conn
->
assoc_group_id
=
response_hdr
->
bind_ack
.
assoc_gid
;
conn
->
MaxTransmissionSize
=
response_hdr
->
bind_ack
.
max_tsize
;
conn
->
ActiveInterface
=
*
InterfaceId
;
break
;
case
RESULT_PROVIDER_REJECTION
:
switch
(
results
->
results
[
0
].
reason
)
{
case
REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED
:
ERR
(
"syntax %s, %d.%d not supported
\n
"
,
debugstr_guid
(
&
InterfaceId
->
SyntaxGUID
),
InterfaceId
->
SyntaxVersion
.
MajorVersion
,
InterfaceId
->
SyntaxVersion
.
MinorVersion
);
status
=
RPC_S_UNKNOWN_IF
;
break
;
case
REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED
:
ERR
(
"transfer syntax not supported
\n
"
);
status
=
RPC_S_SERVER_UNAVAILABLE
;
break
;
case
REASON_NONE
:
default:
status
=
RPC_S_CALL_FAILED_DNE
;
}
break
;
case
RESULT_USER_REJECTION
:
default:
ERR
(
"rejection result %d
\n
"
,
results
->
results
[
0
].
result
);
status
=
RPC_S_CALL_FAILED_DNE
;
}
}
else
{
ERR
(
"incorrect results size
\n
"
);
status
=
RPC_S_CALL_FAILED_DNE
;
}
}
else
{
ERR
(
"bind ack packet too small (%d)
\n
"
,
msg
.
BufferLength
);
status
=
RPC_S_PROTOCOL_ERROR
;
}
break
;
}
case
PKT_BIND_NACK
:
switch
(
response_hdr
->
bind_nack
.
reject_reason
)
{
case
REJECT_LOCAL_LIMIT_EXCEEDED
:
case
REJECT_TEMPORARY_CONGESTION
:
ERR
(
"server too busy
\n
"
);
status
=
RPC_S_SERVER_TOO_BUSY
;
break
;
case
REJECT_PROTOCOL_VERSION_NOT_SUPPORTED
:
ERR
(
"protocol version not supported
\n
"
);
status
=
RPC_S_PROTOCOL_ERROR
;
break
;
case
REJECT_UNKNOWN_AUTHN_SERVICE
:
ERR
(
"unknown authentication service
\n
"
);
status
=
RPC_S_UNKNOWN_AUTHN_SERVICE
;
break
;
case
REJECT_INVALID_CHECKSUM
:
ERR
(
"invalid checksum
\n
"
);
status
=
ERROR_ACCESS_DENIED
;
break
;
default:
ERR
(
"rejected bind for reason %d
\n
"
,
response_hdr
->
bind_nack
.
reject_reason
);
status
=
RPC_S_CALL_FAILED_DNE
;
}
break
;
default:
ERR
(
"wrong packet type received %d
\n
"
,
response_hdr
->
common
.
ptype
);
status
=
RPC_S_PROTOCOL_ERROR
;
break
;
}
}
/* FIXME: do more checks? */
conn
->
assoc_group_id
=
response_hdr
->
bind_ack
.
assoc_gid
;
conn
->
MaxTransmissionSize
=
response_hdr
->
bind_ack
.
max_tsize
;
conn
->
ActiveInterface
=
*
InterfaceId
;
RPCRT4_FreeHeader
(
response_hdr
);
RPCRT4_FreeHeader
(
response_hdr
);
return
RPC_S_OK
;
return
status
;
}
}
static
RpcConnection
*
RpcAssoc_GetIdleConnection
(
RpcAssoc
*
assoc
,
static
RpcConnection
*
RpcAssoc_GetIdleConnection
(
RpcAssoc
*
assoc
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment