Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
efc974d1
Commit
efc974d1
authored
Jun 01, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 02, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: All of the parameters to TowerExplode are optional.
parent
e15e60b9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
49 deletions
+70
-49
rpc_epmap.c
dlls/rpcrt4/rpc_epmap.c
+7
-4
rpc_transport.c
dlls/rpcrt4/rpc_transport.c
+59
-45
rpc.c
dlls/rpcrt4/tests/rpc.c
+4
-0
No files found.
dlls/rpcrt4/rpc_epmap.c
View file @
efc974d1
...
...
@@ -265,9 +265,12 @@ RPC_STATUS WINAPI TowerExplode(
const
twr_uuid_floor_t
*
object_floor
;
const
twr_uuid_floor_t
*
syntax_floor
;
*
protseq
=
NULL
;
*
endpoint
=
NULL
;
*
address
=
NULL
;
if
(
protseq
)
*
protseq
=
NULL
;
if
(
endpoint
)
*
endpoint
=
NULL
;
if
(
address
)
*
address
=
NULL
;
tower_size
=
tower
->
tower_length
;
...
...
@@ -305,7 +308,7 @@ RPC_STATUS WINAPI TowerExplode(
return
EPT_S_NOT_REGISTERED
;
status
=
RpcTransport_ParseTopOfTower
(
p
,
tower_size
,
protseq
,
address
,
endpoint
);
if
(
status
==
RPC_S_OK
)
if
(
(
status
==
RPC_S_OK
)
&&
syntax
&&
object
)
{
syntax
->
SyntaxGUID
=
syntax_floor
->
uuid
;
syntax
->
SyntaxVersion
.
MajorVersion
=
syntax_floor
->
major_version
;
...
...
dlls/rpcrt4/rpc_transport.c
View file @
efc974d1
...
...
@@ -308,9 +308,6 @@ static RPC_STATUS rpcrt4_ncacn_np_parse_top_of_tower(const unsigned char *tower_
TRACE
(
"(%p, %d, %p, %p)
\n
"
,
tower_data
,
tower_size
,
networkaddr
,
endpoint
);
*
networkaddr
=
NULL
;
*
endpoint
=
NULL
;
if
(
tower_size
<
sizeof
(
*
smb_floor
))
return
EPT_S_NOT_REGISTERED
;
...
...
@@ -321,11 +318,14 @@ static RPC_STATUS rpcrt4_ncacn_np_parse_top_of_tower(const unsigned char *tower_
(
smb_floor
->
protid
!=
EPM_PROTOCOL_SMB
)
||
(
smb_floor
->
count_rhs
>
tower_size
))
return
EPT_S_NOT_REGISTERED
;
*
endpoint
=
HeapAlloc
(
GetProcessHeap
(),
0
,
smb_floor
->
count_rhs
);
if
(
!*
endpoint
)
return
RPC_S_OUT_OF_RESOURCES
;
memcpy
(
*
endpoint
,
tower_data
,
smb_floor
->
count_rhs
);
if
(
endpoint
)
{
*
endpoint
=
HeapAlloc
(
GetProcessHeap
(),
0
,
smb_floor
->
count_rhs
);
if
(
!*
endpoint
)
return
RPC_S_OUT_OF_RESOURCES
;
memcpy
(
*
endpoint
,
tower_data
,
smb_floor
->
count_rhs
);
}
tower_data
+=
smb_floor
->
count_rhs
;
tower_size
-=
smb_floor
->
count_rhs
;
...
...
@@ -342,14 +342,20 @@ static RPC_STATUS rpcrt4_ncacn_np_parse_top_of_tower(const unsigned char *tower_
(
nb_floor
->
count_rhs
>
tower_size
))
return
EPT_S_NOT_REGISTERED
;
*
networkaddr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nb_floor
->
count_rhs
);
if
(
!*
networkaddr
)
if
(
networkaddr
)
{
HeapFree
(
GetProcessHeap
(),
0
,
*
endpoint
);
*
endpoint
=
NULL
;
return
RPC_S_OUT_OF_RESOURCES
;
*
networkaddr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nb_floor
->
count_rhs
);
if
(
!*
networkaddr
)
{
if
(
endpoint
)
{
HeapFree
(
GetProcessHeap
(),
0
,
*
endpoint
);
*
endpoint
=
NULL
;
}
return
RPC_S_OUT_OF_RESOURCES
;
}
memcpy
(
*
networkaddr
,
tower_data
,
nb_floor
->
count_rhs
);
}
memcpy
(
*
networkaddr
,
tower_data
,
nb_floor
->
count_rhs
);
return
RPC_S_OK
;
}
...
...
@@ -406,11 +412,14 @@ static RPC_STATUS rpcrt4_ncalrpc_parse_top_of_tower(const unsigned char *tower_d
(
pipe_floor
->
protid
!=
EPM_PROTOCOL_SMB
)
||
(
pipe_floor
->
count_rhs
>
tower_size
))
return
EPT_S_NOT_REGISTERED
;
*
endpoint
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pipe_floor
->
count_rhs
);
if
(
!*
endpoint
)
return
RPC_S_OUT_OF_RESOURCES
;
memcpy
(
*
endpoint
,
tower_data
,
pipe_floor
->
count_rhs
);
if
(
endpoint
)
{
*
endpoint
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pipe_floor
->
count_rhs
);
if
(
!*
endpoint
)
return
RPC_S_OUT_OF_RESOURCES
;
memcpy
(
*
endpoint
,
tower_data
,
pipe_floor
->
count_rhs
);
}
return
RPC_S_OK
;
}
...
...
@@ -620,9 +629,6 @@ static RPC_STATUS rpcrt4_ncacn_ip_tcp_parse_top_of_tower(const unsigned char *to
TRACE
(
"(%p, %d, %p, %p)
\n
"
,
tower_data
,
tower_size
,
networkaddr
,
endpoint
);
*
networkaddr
=
NULL
;
*
endpoint
=
NULL
;
if
(
tower_size
<
sizeof
(
*
tcp_floor
))
return
EPT_S_NOT_REGISTERED
;
...
...
@@ -642,27 +648,39 @@ static RPC_STATUS rpcrt4_ncacn_ip_tcp_parse_top_of_tower(const unsigned char *to
(
ipv4_floor
->
count_rhs
!=
sizeof
(
ipv4_floor
->
ipv4addr
)))
return
EPT_S_NOT_REGISTERED
;
*
endpoint
=
HeapAlloc
(
GetProcessHeap
(),
0
,
6
);
if
(
!*
endpoint
)
return
RPC_S_OUT_OF_RESOURCES
;
sprintf
(
*
endpoint
,
"%u"
,
ntohs
(
tcp_floor
->
port
));
*
networkaddr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
INET_ADDRSTRLEN
);
if
(
!*
networkaddr
)
if
(
endpoint
)
{
HeapFree
(
GetProcessHeap
(),
0
,
*
endpoint
);
*
endpoint
=
NULL
;
return
RPC_S_OUT_OF_RESOURCES
;
*
endpoint
=
HeapAlloc
(
GetProcessHeap
(),
0
,
6
);
if
(
!*
endpoint
)
return
RPC_S_OUT_OF_RESOURCES
;
sprintf
(
*
endpoint
,
"%u"
,
ntohs
(
tcp_floor
->
port
));
}
in_addr
.
s_addr
=
ipv4_floor
->
ipv4addr
;
if
(
!
inet_ntop
(
AF_INET
,
&
in_addr
,
*
networkaddr
,
INET_ADDRSTRLEN
)
)
if
(
networkaddr
)
{
ERR
(
"inet_ntop: %s
\n
"
,
strerror
(
errno
));
HeapFree
(
GetProcessHeap
(),
0
,
*
endpoint
);
HeapFree
(
GetProcessHeap
(),
0
,
*
networkaddr
);
*
networkaddr
=
NULL
;
*
endpoint
=
NULL
;
return
EPT_S_NOT_REGISTERED
;
*
networkaddr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
INET_ADDRSTRLEN
);
if
(
!*
networkaddr
)
{
if
(
endpoint
)
{
HeapFree
(
GetProcessHeap
(),
0
,
*
endpoint
);
*
endpoint
=
NULL
;
}
return
RPC_S_OUT_OF_RESOURCES
;
}
in_addr
.
s_addr
=
ipv4_floor
->
ipv4addr
;
if
(
!
inet_ntop
(
AF_INET
,
&
in_addr
,
*
networkaddr
,
INET_ADDRSTRLEN
))
{
ERR
(
"inet_ntop: %s
\n
"
,
strerror
(
errno
));
HeapFree
(
GetProcessHeap
(),
0
,
*
networkaddr
);
*
networkaddr
=
NULL
;
if
(
endpoint
)
{
HeapFree
(
GetProcessHeap
(),
0
,
*
endpoint
);
*
endpoint
=
NULL
;
}
return
EPT_S_NOT_REGISTERED
;
}
}
return
RPC_S_OK
;
...
...
@@ -837,10 +855,6 @@ RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data,
RPC_STATUS
status
;
int
i
;
*
protseq
=
NULL
;
*
networkaddr
=
NULL
;
*
endpoint
=
NULL
;
if
(
tower_size
<
sizeof
(
*
protocol_floor
))
return
EPT_S_NOT_REGISTERED
;
...
...
@@ -869,7 +883,7 @@ RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data,
status
=
protseq_ops
->
parse_top_of_tower
(
tower_data
,
tower_size
,
networkaddr
,
endpoint
);
if
(
status
==
RPC_S_OK
)
if
(
(
status
==
RPC_S_OK
)
&&
protseq
)
{
*
protseq
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
protseq_ops
->
name
)
+
1
);
strcpy
(
*
protseq
,
protseq_ops
->
name
);
...
...
dlls/rpcrt4/tests/rpc.c
View file @
efc974d1
...
...
@@ -265,6 +265,10 @@ static void test_towers(void)
I_RpcFree
(
protseq
);
I_RpcFree
(
endpoint
);
I_RpcFree
(
address
);
ret
=
TowerExplode
(
tower
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
RPC_S_OK
,
"TowerExplode failed with error %ld
\n
"
,
ret
);
I_RpcFree
(
tower
);
}
...
...
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