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
6c40b63d
Commit
6c40b63d
authored
Oct 27, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Moved formatting pipe names to helper functions.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2fdccc24
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
24 deletions
+29
-24
rpc_transport.c
dlls/rpcrt4/rpc_transport.c
+29
-24
No files found.
dlls/rpcrt4/rpc_transport.c
View file @
6c40b63d
...
...
@@ -247,10 +247,21 @@ static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname,
return
RPC_S_OK
;
}
static
char
*
ncalrpc_pipe_name
(
const
char
*
endpoint
)
{
static
const
char
prefix
[]
=
"
\\\\
.
\\
pipe
\\
lrpc
\\
"
;
char
*
pipe_name
;
/* protseq=ncalrpc: supposed to use NT LPC ports,
* but we'll implement it with named pipes for now */
pipe_name
=
I_RpcAllocate
(
sizeof
(
prefix
)
+
strlen
(
endpoint
));
strcat
(
strcpy
(
pipe_name
,
prefix
),
endpoint
);
return
pipe_name
;
}
static
RPC_STATUS
rpcrt4_ncalrpc_open
(
RpcConnection
*
Connection
)
{
RpcConnection_np
*
npc
=
(
RpcConnection_np
*
)
Connection
;
static
const
char
prefix
[]
=
"
\\\\
.
\\
pipe
\\
lrpc
\\
"
;
RPC_STATUS
r
;
LPSTR
pname
;
...
...
@@ -258,10 +269,7 @@ static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection)
if
(
npc
->
pipe
)
return
RPC_S_OK
;
/* protseq=ncalrpc: supposed to use NT LPC ports,
* but we'll implement it with named pipes for now */
pname
=
I_RpcAllocate
(
strlen
(
prefix
)
+
strlen
(
Connection
->
Endpoint
)
+
1
);
strcat
(
strcpy
(
pname
,
prefix
),
Connection
->
Endpoint
);
pname
=
ncalrpc_pipe_name
(
Connection
->
Endpoint
);
r
=
rpcrt4_conn_open_pipe
(
Connection
,
pname
,
TRUE
);
I_RpcFree
(
pname
);
...
...
@@ -270,7 +278,6 @@ static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection)
static
RPC_STATUS
rpcrt4_protseq_ncalrpc_open_endpoint
(
RpcServerProtseq
*
protseq
,
const
char
*
endpoint
)
{
static
const
char
prefix
[]
=
"
\\\\
.
\\
pipe
\\
lrpc
\\
"
;
RPC_STATUS
r
;
LPSTR
pname
;
RpcConnection
*
Connection
;
...
...
@@ -291,10 +298,7 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq
if
(
r
!=
RPC_S_OK
)
return
r
;
/* protseq=ncalrpc: supposed to use NT LPC ports,
* but we'll implement it with named pipes for now */
pname
=
I_RpcAllocate
(
strlen
(
prefix
)
+
strlen
(
Connection
->
Endpoint
)
+
1
);
strcat
(
strcpy
(
pname
,
prefix
),
Connection
->
Endpoint
);
pname
=
ncalrpc_pipe_name
(
Connection
->
Endpoint
);
r
=
rpcrt4_conn_create_pipe
(
Connection
,
pname
);
I_RpcFree
(
pname
);
...
...
@@ -306,10 +310,20 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq
return
r
;
}
static
char
*
ncacn_pipe_name
(
const
char
*
endpoint
)
{
static
const
char
prefix
[]
=
"
\\\\
."
;
char
*
pipe_name
;
/* protseq=ncacn_np: named pipes */
pipe_name
=
I_RpcAllocate
(
sizeof
(
prefix
)
+
strlen
(
endpoint
));
strcat
(
strcpy
(
pipe_name
,
prefix
),
endpoint
);
return
pipe_name
;
}
static
RPC_STATUS
rpcrt4_ncacn_np_open
(
RpcConnection
*
Connection
)
{
RpcConnection_np
*
npc
=
(
RpcConnection_np
*
)
Connection
;
static
const
char
prefix
[]
=
"
\\\\
."
;
RPC_STATUS
r
;
LPSTR
pname
;
...
...
@@ -317,9 +331,7 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection)
if
(
npc
->
pipe
)
return
RPC_S_OK
;
/* protseq=ncacn_np: named pipes */
pname
=
I_RpcAllocate
(
strlen
(
prefix
)
+
strlen
(
Connection
->
Endpoint
)
+
1
);
strcat
(
strcpy
(
pname
,
prefix
),
Connection
->
Endpoint
);
pname
=
ncacn_pipe_name
(
Connection
->
Endpoint
);
r
=
rpcrt4_conn_open_pipe
(
Connection
,
pname
,
FALSE
);
I_RpcFree
(
pname
);
...
...
@@ -328,7 +340,6 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection)
static
RPC_STATUS
rpcrt4_protseq_ncacn_np_open_endpoint
(
RpcServerProtseq
*
protseq
,
const
char
*
endpoint
)
{
static
const
char
prefix
[]
=
"
\\\\
."
;
RPC_STATUS
r
;
LPSTR
pname
;
RpcConnection
*
Connection
;
...
...
@@ -349,9 +360,7 @@ static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protse
if
(
r
!=
RPC_S_OK
)
return
r
;
/* protseq=ncacn_np: named pipes */
pname
=
I_RpcAllocate
(
strlen
(
prefix
)
+
strlen
(
Connection
->
Endpoint
)
+
1
);
strcat
(
strcpy
(
pname
,
prefix
),
Connection
->
Endpoint
);
pname
=
ncacn_pipe_name
(
Connection
->
Endpoint
);
r
=
rpcrt4_conn_create_pipe
(
Connection
,
pname
);
I_RpcFree
(
pname
);
...
...
@@ -379,12 +388,10 @@ static RPC_STATUS rpcrt4_ncacn_np_handoff(RpcConnection *old_conn, RpcConnection
{
RPC_STATUS
status
;
LPSTR
pname
;
static
const
char
prefix
[]
=
"
\\\\
."
;
rpcrt4_conn_np_handoff
((
RpcConnection_np
*
)
old_conn
,
(
RpcConnection_np
*
)
new_conn
);
pname
=
I_RpcAllocate
(
strlen
(
prefix
)
+
strlen
(
old_conn
->
Endpoint
)
+
1
);
strcat
(
strcpy
(
pname
,
prefix
),
old_conn
->
Endpoint
);
pname
=
ncacn_pipe_name
(
old_conn
->
Endpoint
);
status
=
rpcrt4_conn_create_pipe
(
old_conn
,
pname
);
I_RpcFree
(
pname
);
...
...
@@ -395,14 +402,12 @@ static RPC_STATUS rpcrt4_ncalrpc_handoff(RpcConnection *old_conn, RpcConnection
{
RPC_STATUS
status
;
LPSTR
pname
;
static
const
char
prefix
[]
=
"
\\\\
.
\\
pipe
\\
lrpc
\\
"
;
TRACE
(
"%s
\n
"
,
old_conn
->
Endpoint
);
rpcrt4_conn_np_handoff
((
RpcConnection_np
*
)
old_conn
,
(
RpcConnection_np
*
)
new_conn
);
pname
=
I_RpcAllocate
(
strlen
(
prefix
)
+
strlen
(
old_conn
->
Endpoint
)
+
1
);
strcat
(
strcpy
(
pname
,
prefix
),
old_conn
->
Endpoint
);
pname
=
ncalrpc_pipe_name
(
old_conn
->
Endpoint
);
status
=
rpcrt4_conn_create_pipe
(
old_conn
,
pname
);
I_RpcFree
(
pname
);
...
...
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