- RpcMgmtStopServerListen should not affect auto-listen interfaces.
- Implement stub for RpcRevertToSelfEx. - Change the more verbose files to use a new debug channel, "rpc."
This commit is contained in:
parent
6cf8602ebb
commit
64280a6de4
|
@ -44,7 +44,7 @@
|
||||||
#include "ndr_misc.h"
|
#include "ndr_misc.h"
|
||||||
#include "rpcndr.h"
|
#include "rpcndr.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
WINE_DEFAULT_DEBUG_CHANNEL(rpc);
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* NdrProxyInitialize [RPCRT4.@]
|
* NdrProxyInitialize [RPCRT4.@]
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#include "rpc_binding.h"
|
#include "rpc_binding.h"
|
||||||
#include "rpc_message.h"
|
#include "rpc_message.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
WINE_DEFAULT_DEBUG_CHANNEL(rpc);
|
||||||
|
|
||||||
LPSTR RPCRT4_strndupA(LPCSTR src, INT slen)
|
LPSTR RPCRT4_strndupA(LPCSTR src, INT slen)
|
||||||
{
|
{
|
||||||
|
@ -1109,9 +1109,38 @@ RPC_STATUS WINAPI RpcNetworkIsProtseqValidW(LPWSTR protseq) {
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Success: RPS_S_OK.
|
* Success: RPS_S_OK.
|
||||||
* Failure: RPC_STATUS value.
|
* Failure: RPC_STATUS value.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
*
|
||||||
|
* If BindingHandle is NULL then the function impersonates the client
|
||||||
|
* connected to the binding handle of the current thread.
|
||||||
*/
|
*/
|
||||||
RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
|
RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
|
||||||
{
|
{
|
||||||
FIXME("(%p): stub\n", BindingHandle);
|
FIXME("(%p): stub\n", BindingHandle);
|
||||||
return RPC_S_NO_CONTEXT_AVAILABLE;
|
return RPC_S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* RpcRevertToSelfEx (RPCRT4.@)
|
||||||
|
*
|
||||||
|
* Stops impersonating the client connected to the binding handle so that security
|
||||||
|
* checks are no longer done in the context of the client.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* BindingHandle [I] Handle to the binding to the client.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: RPS_S_OK.
|
||||||
|
* Failure: RPC_STATUS value.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
*
|
||||||
|
* If BindingHandle is NULL then the function stops impersonating the client
|
||||||
|
* connected to the binding handle of the current thread.
|
||||||
|
*/
|
||||||
|
RPC_STATUS WINAPI RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle)
|
||||||
|
{
|
||||||
|
FIXME("(%p): stub\n", BindingHandle);
|
||||||
|
return RPC_S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#include "rpc_misc.h"
|
#include "rpc_misc.h"
|
||||||
#include "rpc_defs.h"
|
#include "rpc_defs.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
WINE_DEFAULT_DEBUG_CHANNEL(rpc);
|
||||||
|
|
||||||
DWORD RPCRT4_GetHeaderSize(RpcPktHdr *Header)
|
DWORD RPCRT4_GetHeaderSize(RpcPktHdr *Header)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
#define MAX_THREADS 128
|
#define MAX_THREADS 128
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
WINE_DEFAULT_DEBUG_CHANNEL(rpc);
|
||||||
|
|
||||||
typedef struct _RpcPacket
|
typedef struct _RpcPacket
|
||||||
{
|
{
|
||||||
|
@ -91,8 +91,12 @@ static CRITICAL_SECTION_DEBUG listen_cs_debug =
|
||||||
};
|
};
|
||||||
static CRITICAL_SECTION listen_cs = { &listen_cs_debug, -1, 0, 0, 0, 0 };
|
static CRITICAL_SECTION listen_cs = { &listen_cs_debug, -1, 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
/* whether the server is currently listening */
|
||||||
static BOOL std_listen;
|
static BOOL std_listen;
|
||||||
static LONG listen_count = -1;
|
/* number of manual listeners (calls to RpcServerListen) */
|
||||||
|
static LONG manual_listen_count;
|
||||||
|
/* total listeners including auto listeners */
|
||||||
|
static LONG listen_count;
|
||||||
/* set on change of configuration (e.g. listening on new protseq) */
|
/* set on change of configuration (e.g. listening on new protseq) */
|
||||||
static HANDLE mgr_event;
|
static HANDLE mgr_event;
|
||||||
/* mutex for ensuring only one thread can change state at a time */
|
/* mutex for ensuring only one thread can change state at a time */
|
||||||
|
@ -156,7 +160,7 @@ static RpcServerInterface* RPCRT4_find_interface(UUID* object,
|
||||||
while (cif) {
|
while (cif) {
|
||||||
if (!memcmp(if_id, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER)) &&
|
if (!memcmp(if_id, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER)) &&
|
||||||
(check_object == FALSE || UuidEqual(MgrType, &cif->MgrTypeUuid, &status)) &&
|
(check_object == FALSE || UuidEqual(MgrType, &cif->MgrTypeUuid, &status)) &&
|
||||||
(std_listen || (cif->Flags & RPC_IF_AUTOLISTEN))) break;
|
std_listen) break;
|
||||||
cif = cif->Next;
|
cif = cif->Next;
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&server_cs);
|
LeaveCriticalSection(&server_cs);
|
||||||
|
@ -571,38 +575,44 @@ static void RPCRT4_sync_with_server_thread(void)
|
||||||
ReleaseMutex(mgr_mutex);
|
ReleaseMutex(mgr_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RPCRT4_start_listen(void)
|
static void RPCRT4_start_listen(BOOL auto_listen)
|
||||||
{
|
{
|
||||||
TRACE("\n");
|
TRACE("\n");
|
||||||
|
|
||||||
EnterCriticalSection(&listen_cs);
|
EnterCriticalSection(&listen_cs);
|
||||||
if (! ++listen_count) {
|
if (auto_listen || (manual_listen_count++ == 0))
|
||||||
if (!mgr_mutex) mgr_mutex = CreateMutexW(NULL, FALSE, NULL);
|
{
|
||||||
if (!mgr_event) mgr_event = CreateEventW(NULL, FALSE, FALSE, NULL);
|
if (++listen_count == 1) {
|
||||||
if (!server_ready_event) server_ready_event = CreateEventW(NULL, FALSE, FALSE, NULL);
|
/* first listener creates server thread */
|
||||||
if (!server_sem) server_sem = CreateSemaphoreW(NULL, 0, MAX_THREADS, NULL);
|
if (!mgr_mutex) mgr_mutex = CreateMutexW(NULL, FALSE, NULL);
|
||||||
if (!worker_tls) worker_tls = TlsAlloc();
|
if (!mgr_event) mgr_event = CreateEventW(NULL, FALSE, FALSE, NULL);
|
||||||
std_listen = TRUE;
|
if (!server_ready_event) server_ready_event = CreateEventW(NULL, FALSE, FALSE, NULL);
|
||||||
server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, NULL, 0, NULL);
|
if (!server_sem) server_sem = CreateSemaphoreW(NULL, 0, MAX_THREADS, NULL);
|
||||||
LeaveCriticalSection(&listen_cs);
|
if (!worker_tls) worker_tls = TlsAlloc();
|
||||||
} else {
|
std_listen = TRUE;
|
||||||
LeaveCriticalSection(&listen_cs);
|
server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, NULL, 0, NULL);
|
||||||
RPCRT4_sync_with_server_thread();
|
LeaveCriticalSection(&listen_cs);
|
||||||
|
} else {
|
||||||
|
LeaveCriticalSection(&listen_cs);
|
||||||
|
RPCRT4_sync_with_server_thread();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RPCRT4_stop_listen(void)
|
static void RPCRT4_stop_listen(BOOL auto_listen)
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&listen_cs);
|
EnterCriticalSection(&listen_cs);
|
||||||
if (listen_count == -1)
|
if (auto_listen || (--manual_listen_count == 0))
|
||||||
LeaveCriticalSection(&listen_cs);
|
{
|
||||||
else if (--listen_count == -1) {
|
if (listen_count != 0 && --listen_count == 0) {
|
||||||
std_listen = FALSE;
|
std_listen = FALSE;
|
||||||
LeaveCriticalSection(&listen_cs);
|
LeaveCriticalSection(&listen_cs);
|
||||||
RPCRT4_sync_with_server_thread();
|
RPCRT4_sync_with_server_thread();
|
||||||
} else
|
return;
|
||||||
LeaveCriticalSection(&listen_cs);
|
}
|
||||||
assert(listen_count > -2);
|
assert(listen_count >= 0);
|
||||||
|
}
|
||||||
|
LeaveCriticalSection(&listen_cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq* ps)
|
static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq* ps)
|
||||||
|
@ -835,7 +845,7 @@ RPC_STATUS WINAPI RpcServerRegisterIf2( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
|
||||||
|
|
||||||
if (sif->Flags & RPC_IF_AUTOLISTEN) {
|
if (sif->Flags & RPC_IF_AUTOLISTEN) {
|
||||||
/* well, start listening, I think... */
|
/* well, start listening, I think... */
|
||||||
RPCRT4_start_listen();
|
RPCRT4_start_listen(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return RPC_S_OK;
|
return RPC_S_OK;
|
||||||
|
@ -966,7 +976,7 @@ RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT
|
||||||
return RPC_S_ALREADY_LISTENING;
|
return RPC_S_ALREADY_LISTENING;
|
||||||
}
|
}
|
||||||
|
|
||||||
RPCRT4_start_listen();
|
RPCRT4_start_listen(FALSE);
|
||||||
|
|
||||||
LeaveCriticalSection(&listen_cs);
|
LeaveCriticalSection(&listen_cs);
|
||||||
|
|
||||||
|
@ -1017,11 +1027,7 @@ RPC_STATUS WINAPI RpcMgmtStopServerListening ( RPC_BINDING_HANDLE Binding )
|
||||||
return RPC_S_WRONG_KIND_OF_BINDING;
|
return RPC_S_WRONG_KIND_OF_BINDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hmm... */
|
RPCRT4_stop_listen(FALSE);
|
||||||
EnterCriticalSection(&listen_cs);
|
|
||||||
while (std_listen)
|
|
||||||
RPCRT4_stop_listen();
|
|
||||||
LeaveCriticalSection(&listen_cs);
|
|
||||||
|
|
||||||
return RPC_S_OK;
|
return RPC_S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
@ stdcall RpcRaiseException(long)
|
@ stdcall RpcRaiseException(long)
|
||||||
@ stub RpcRegisterAsyncInfo
|
@ stub RpcRegisterAsyncInfo
|
||||||
@ stub RpcRevertToSelf
|
@ stub RpcRevertToSelf
|
||||||
@ stub RpcRevertToSelfEx
|
@ stdcall RpcRevertToSelfEx(ptr)
|
||||||
@ stdcall RpcServerInqBindings(ptr)
|
@ stdcall RpcServerInqBindings(ptr)
|
||||||
@ stub RpcServerInqCallAttributesA # wxp
|
@ stub RpcServerInqCallAttributesA # wxp
|
||||||
@ stub RpcServerInqCallAttributesW # wxp
|
@ stub RpcServerInqCallAttributesW # wxp
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
WINE_DEFAULT_DEBUG_CHANNEL(rpc);
|
||||||
|
|
||||||
static UUID uuid_nil;
|
static UUID uuid_nil;
|
||||||
static HANDLE master_mutex;
|
static HANDLE master_mutex;
|
||||||
|
|
Loading…
Reference in New Issue