Sync to Wine-20050524:

Alexandre Julliard <julliard@winehq.org>
- Added rules for building import libraries in the individual dll
  makefiles, and added support for building a .def.a static import
  library too.
Vincent Beron <vberon@mecano.gme.usherb.ca>
- Provide minimal API documentation in advapi/eventlog.c to silence some
  winapi_check output.
- Move around functions in riched20, richedit and rpcrt4 to achieve the
  same goal.
Robert Shearman <rob@codeweavers.com>
- Fix RpcServerListen so that it doesn't return
  RPC_S_ALREADY_LISTENING when the only interfaces it is listening on
  are auto listens.
- Only synchronize with server thread when necessary and move this
  into RpcMgmtWaitServerListen.
Francois Gouget <fgouget@free.fr>
- Tweak the API documentation to silence winapi_check warnings.
Hartmut Birr <hartmut.birr@gmx.de>
- Clean up if named pipe is not available.
  (merge back from WineHQ)

svn path=/trunk/; revision=15581
This commit is contained in:
Gé van Geldorp 2005-05-28 15:04:47 +00:00
parent 98b2118f6b
commit 020f1fc22b
5 changed files with 36 additions and 41 deletions

View file

@ -4,6 +4,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = rpcrt4.dll
IMPORTLIB = librpcrt4.$(IMPLIBEXT)
IMPORTS = iphlpapi advapi32 kernel32 ntdll
EXTRALIBS = -luuid

View file

@ -41,7 +41,11 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
LONG_PTR /* CLIENT_CALL_RETURN */ RPCRT4_NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, va_list args)
/***********************************************************************
* Note: this should return a CLIENT_CALL_RETURN, but calling convention for
* returning structures/unions is different between Windows and gcc on i386.
*/
LONG_PTR RPCRT4_NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, va_list args)
{
RPC_CLIENT_INTERFACE *rpc_cli_if = (RPC_CLIENT_INTERFACE *)(pStubDesc->RpcInterfaceInformation);
@ -83,8 +87,11 @@ LONG_PTR /* CLIENT_CALL_RETURN */ RPCRT4_NdrClientCall2(PMIDL_STUB_DESC pStubDes
/***********************************************************************
* NdrClientCall2 [RPCRT4.@]
*
* Note: this should return a CLIENT_CALL_RETURN, but calling convention for
* returning structures/unions is different between Windows and gcc on i386.
*/
LONG_PTR /* CLIENT_CALL_RETURN */ WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc,
LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc,
PFORMAT_STRING pFormat, ...)
{
LONG_PTR ret;

View file

@ -103,8 +103,6 @@ static HANDLE mgr_event;
static HANDLE mgr_mutex;
/* set when server thread has finished opening connections */
static HANDLE server_ready_event;
/* thread that waits for connections */
static HANDLE server_thread;
static CRITICAL_SECTION spacket_cs;
static CRITICAL_SECTION_DEBUG spacket_cs_debug =
@ -587,14 +585,18 @@ static void RPCRT4_sync_with_server_thread(void)
ReleaseMutex(mgr_mutex);
}
static void RPCRT4_start_listen(BOOL auto_listen)
static RPC_STATUS RPCRT4_start_listen(BOOL auto_listen)
{
RPC_STATUS status = RPC_S_ALREADY_LISTENING;
TRACE("\n");
EnterCriticalSection(&listen_cs);
if (auto_listen || (manual_listen_count++ == 0))
{
status = RPC_S_OK;
if (++listen_count == 1) {
HANDLE server_thread;
/* first listener creates server thread */
if (!mgr_mutex) mgr_mutex = CreateMutexW(NULL, FALSE, NULL);
if (!mgr_event) mgr_event = CreateEventW(NULL, FALSE, FALSE, NULL);
@ -603,13 +605,12 @@ static void RPCRT4_start_listen(BOOL auto_listen)
if (!worker_tls) worker_tls = TlsAlloc();
std_listen = TRUE;
server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, NULL, 0, NULL);
} else {
LeaveCriticalSection(&listen_cs);
RPCRT4_sync_with_server_thread();
return;
CloseHandle(server_thread);
}
}
LeaveCriticalSection(&listen_cs);
return status;
}
static void RPCRT4_stop_listen(BOOL auto_listen)
@ -977,23 +978,16 @@ RPC_STATUS WINAPI RpcServerRegisterAuthInfoW( LPWSTR ServerPrincName, unsigned l
*/
RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait )
{
RPC_STATUS status;
TRACE("(%u,%u,%u)\n", MinimumCallThreads, MaxCalls, DontWait);
if (!protseqs)
return RPC_S_NO_PROTSEQS_REGISTERED;
EnterCriticalSection(&listen_cs);
status = RPCRT4_start_listen(FALSE);
if (std_listen) {
LeaveCriticalSection(&listen_cs);
return RPC_S_ALREADY_LISTENING;
}
RPCRT4_start_listen(FALSE);
LeaveCriticalSection(&listen_cs);
if (DontWait) return RPC_S_OK;
if (DontWait || (status != RPC_S_OK)) return status;
return RpcMgmtWaitServerListen();
}
@ -1003,29 +997,20 @@ RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT
*/
RPC_STATUS WINAPI RpcMgmtWaitServerListen( void )
{
RPC_STATUS rslt = RPC_S_OK;
TRACE("\n");
TRACE("()\n");
EnterCriticalSection(&listen_cs);
if (!std_listen)
if ( (rslt = RpcServerListen(1, 0, TRUE)) != RPC_S_OK ) {
LeaveCriticalSection(&listen_cs);
return rslt;
}
if (!std_listen) {
LeaveCriticalSection(&listen_cs);
return RPC_S_NOT_LISTENING;
}
LeaveCriticalSection(&listen_cs);
while (std_listen) {
WaitForSingleObject(mgr_event, INFINITE);
if (!std_listen) {
Sleep(100); /* don't spin violently */
TRACE("spinning.\n");
}
}
RPCRT4_sync_with_server_thread();
return rslt;
return RPC_S_OK;
}
/***********************************************************************

View file

@ -767,7 +767,10 @@ BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPC
return TRUE;
}
/* DceErrorInqText
#define MAX_RPC_ERROR_TEXT 256
/******************************************************************************
* DceErrorInqTextW (rpcrt4.@)
*
* Notes
* 1. On passing a NULL pointer the code does bomb out.
@ -778,9 +781,6 @@ BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPC
* 4. The MSDN documentation currently declares that the second argument is
* unsigned char *, even for the W version. I don't believe it.
*/
#define MAX_RPC_ERROR_TEXT 256
RPC_STATUS RPC_ENTRY DceErrorInqTextW (RPC_STATUS e, unsigned short *buffer)
{
DWORD count;
@ -801,6 +801,9 @@ RPC_STATUS RPC_ENTRY DceErrorInqTextW (RPC_STATUS e, unsigned short *buffer)
return RPC_S_OK;
}
/******************************************************************************
* DceErrorInqTextA (rpcrt4.@)
*/
RPC_STATUS RPC_ENTRY DceErrorInqTextA (RPC_STATUS e, unsigned char *buffer)
{
RPC_STATUS status;

View file

@ -84,7 +84,6 @@ HANDLE RPCRT4_RpcssNPConnect(void)
if (! WaitNamedPipeA(NAME_RPCSS_NAMED_PIPE, MASTER_MUTEX_WAITNAMEDPIPE_TIMEOUT))
{
ERR("Named pipe unavailable after waiting. Something is probably wrong.\n");
CloseHandle(the_pipe);
the_pipe = NULL;
break;
}