2005-06-02 13:17:37 +00:00
|
|
|
/* $Id$
|
|
|
|
*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
|
|
|
* FILE: lib/smlib/compses.c
|
|
|
|
* PURPOSE: Call SM API SM_API_COMPLETE_SESSION
|
|
|
|
*/
|
2005-10-19 17:03:38 +00:00
|
|
|
#include "precomp.h"
|
2005-06-02 13:17:37 +00:00
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* NAME EXPORTED
|
|
|
|
* SmCompleteSession/3
|
|
|
|
*
|
|
|
|
* DESCRIPTION
|
|
|
|
* This function is called by an environment subsystem server to
|
|
|
|
* tell the SM it finished initialization phase and is ready to
|
|
|
|
* manage processes it registered for (SmConnectApiPort).
|
|
|
|
*
|
|
|
|
* ARGUMENTS
|
|
|
|
* hSmApiPort: port handle returned by SmConnectApiPort;
|
|
|
|
* hSbApiPort: call back API port of the subsystem (handle);
|
|
|
|
* hApiPort : API port of the subsystem (handle).
|
|
|
|
*
|
|
|
|
* RETURN VALUE
|
|
|
|
* Success status as handed by the SM reply; otherwise a failure
|
|
|
|
* status code.
|
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
NTSTATUS WINAPI
|
2005-06-02 13:17:37 +00:00
|
|
|
SmCompleteSession (IN HANDLE hSmApiPort,
|
|
|
|
IN HANDLE hSbApiPort,
|
|
|
|
IN HANDLE hApiPort)
|
|
|
|
{
|
|
|
|
NTSTATUS Status;
|
|
|
|
SM_PORT_MESSAGE SmReqMsg;
|
2007-10-19 23:21:45 +00:00
|
|
|
|
2005-06-02 13:17:37 +00:00
|
|
|
DPRINT("SMLIB: %s called\n", __FUNCTION__);
|
|
|
|
|
|
|
|
/* Marshal Ses in the LPC message */
|
|
|
|
SmReqMsg.Request.CompSes.hApiPort = hApiPort;
|
|
|
|
SmReqMsg.Request.CompSes.hSbApiPort = hSbApiPort;
|
|
|
|
|
|
|
|
/* SM API to invoke */
|
|
|
|
SmReqMsg.SmHeader.ApiIndex = SM_API_COMPLETE_SESSION;
|
|
|
|
|
|
|
|
/* Port message */
|
2005-08-11 02:58:54 +00:00
|
|
|
SmReqMsg.Header.u2.s2.Type = LPC_NEW_MESSAGE;
|
|
|
|
SmReqMsg.Header.u1.s1.DataLength = SM_PORT_DATA_SIZE(SmReqMsg.Request);
|
|
|
|
SmReqMsg.Header.u1.s1.TotalLength = SM_PORT_MESSAGE_SIZE;
|
|
|
|
Status = NtRequestWaitReplyPort (hSmApiPort, (PPORT_MESSAGE) & SmReqMsg, (PPORT_MESSAGE) & SmReqMsg);
|
2005-06-02 13:17:37 +00:00
|
|
|
if (NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
return SmReqMsg.SmHeader.Status;
|
|
|
|
}
|
|
|
|
DPRINT("SMLIB: %s failed (Status=0x%08lx)\n", __FUNCTION__, Status);
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|