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
c3a08421
Commit
c3a08421
authored
May 18, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
May 18, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Fix and test RpcNetworkIsProtseqValid.
parent
0f8f927a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
43 deletions
+49
-43
rpc_binding.c
dlls/rpcrt4/rpc_binding.c
+0
-43
rpc_transport.c
dlls/rpcrt4/rpc_transport.c
+37
-0
rpc.c
dlls/rpcrt4/tests/rpc.c
+12
-0
No files found.
dlls/rpcrt4/rpc_binding.c
View file @
c3a08421
...
...
@@ -835,49 +835,6 @@ RPC_STATUS WINAPI I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING
}
/***********************************************************************
* RpcNetworkIsProtseqValidA (RPCRT4.@)
*/
RPC_STATUS
WINAPI
RpcNetworkIsProtseqValidA
(
unsigned
char
*
protseq
)
{
UNICODE_STRING
protseqW
;
if
(
!
protseq
)
return
RPC_S_INVALID_RPC_PROTSEQ
;
/* ? */
if
(
RtlCreateUnicodeStringFromAsciiz
(
&
protseqW
,
(
char
*
)
protseq
))
{
RPC_STATUS
ret
=
RpcNetworkIsProtseqValidW
(
protseqW
.
Buffer
);
RtlFreeUnicodeString
(
&
protseqW
);
return
ret
;
}
else
return
RPC_S_OUT_OF_MEMORY
;
}
/***********************************************************************
* RpcNetworkIsProtseqValidW (RPCRT4.@)
*
* Checks if the given protocol sequence is known by the RPC system.
* If it is, returns RPC_S_OK, otherwise RPC_S_PROTSEQ_NOT_SUPPORTED.
*
* We currently support:
* ncalrpc local-only rpc over LPC (LPC is not really used)
* ncacn_np rpc over named pipes
*/
RPC_STATUS
WINAPI
RpcNetworkIsProtseqValidW
(
LPWSTR
protseq
)
{
static
const
WCHAR
protseqsW
[][
15
]
=
{
{
'n'
,
'c'
,
'a'
,
'l'
,
'r'
,
'p'
,
'c'
,
0
},
{
'n'
,
'c'
,
'a'
,
'c'
,
'n'
,
'_'
,
'n'
,
'p'
,
0
}
};
static
const
int
count
=
sizeof
(
protseqsW
)
/
sizeof
(
protseqsW
[
0
]);
int
i
;
if
(
!
protseq
)
return
RPC_S_INVALID_RPC_PROTSEQ
;
/* ? */
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
!
strcmpW
(
protseq
,
protseqsW
[
i
]))
return
RPC_S_OK
;
}
FIXME
(
"Unknown protseq %s - we probably need to implement it one day
\n
"
,
debugstr_w
(
protseq
));
return
RPC_S_PROTSEQ_NOT_SUPPORTED
;
}
/***********************************************************************
* RpcImpersonateClient (RPCRT4.@)
*
* Impersonates the client connected via a binding handle so that security
...
...
dlls/rpcrt4/rpc_transport.c
View file @
c3a08421
...
...
@@ -488,3 +488,40 @@ RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection)
HeapFree
(
GetProcessHeap
(),
0
,
Connection
);
return
RPC_S_OK
;
}
/***********************************************************************
* RpcNetworkIsProtseqValidW (RPCRT4.@)
*
* Checks if the given protocol sequence is known by the RPC system.
* If it is, returns RPC_S_OK, otherwise RPC_S_PROTSEQ_NOT_SUPPORTED.
*
*/
RPC_STATUS
WINAPI
RpcNetworkIsProtseqValidW
(
LPWSTR
protseq
)
{
char
ps
[
0x10
];
WideCharToMultiByte
(
CP_ACP
,
0
,
protseq
,
-
1
,
ps
,
sizeof
ps
,
NULL
,
NULL
);
if
(
rpcrt4_get_protseq_ops
(
ps
))
return
RPC_S_OK
;
FIXME
(
"Unknown protseq %s
\n
"
,
debugstr_w
(
protseq
));
return
RPC_S_INVALID_RPC_PROTSEQ
;
}
/***********************************************************************
* RpcNetworkIsProtseqValidA (RPCRT4.@)
*/
RPC_STATUS
WINAPI
RpcNetworkIsProtseqValidA
(
unsigned
char
*
protseq
)
{
UNICODE_STRING
protseqW
;
if
(
RtlCreateUnicodeStringFromAsciiz
(
&
protseqW
,
(
char
*
)
protseq
))
{
RPC_STATUS
ret
=
RpcNetworkIsProtseqValidW
(
protseqW
.
Buffer
);
RtlFreeUnicodeString
(
&
protseqW
);
return
ret
;
}
return
RPC_S_OUT_OF_MEMORY
;
}
dlls/rpcrt4/tests/rpc.c
View file @
c3a08421
...
...
@@ -165,10 +165,22 @@ static void TestDceErrorInqText (void)
ok
(
0
,
"Cannot set up for DceErrorInqText
\n
"
);
}
static
void
test_rpc_ncacn_ip_tcp
(
void
)
{
RPC_STATUS
status
;
status
=
RpcNetworkIsProtseqValid
((
unsigned
char
*
)
"foo"
);
ok
(
status
==
RPC_S_INVALID_RPC_PROTSEQ
,
"return wrong
\n
"
);
status
=
RpcNetworkIsProtseqValid
((
unsigned
char
*
)
"ncacn_ip_tcp"
);
ok
(
status
==
RPC_S_OK
,
"return wrong
\n
"
);
}
START_TEST
(
rpc
)
{
trace
(
" ** Uuid Conversion and Comparison Tests **
\n
"
);
UuidConversionAndComparison
();
trace
(
" ** DceErrorInqText **
\n
"
);
TestDceErrorInqText
();
test_rpc_ncacn_ip_tcp
();
}
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