545423805834a501dbd3aa719208680b8a00d224
1 /* $Id: compses.c 13731 2005-02-23 23:37:06Z ea $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS system libraries
5 * FILE: lib/smlib/compses.c
6 * PURPOSE: Call SM API SM_API_COMPLETE_SESSION
10 #include <sm/helper.h>
15 /**********************************************************************
20 * This function is called by an environment subsystem server to
21 * tell the SM it finished initialization phase and is ready to
22 * manage processes it registered for (SmConnectApiPort).
25 * hSmApiPort: port handle returned by SmConnectApiPort;
26 * hSbApiPort: call back API port of the subsystem (handle);
27 * hApiPort : API port of the subsystem (handle).
30 * Success status as handed by the SM reply; otherwise a failure
34 SmCompleteSession (IN HANDLE hSmApiPort
,
39 SM_PORT_MESSAGE SmReqMsg
;
41 DPRINT("SMLIB: %s called\n", __FUNCTION__
);
43 /* Marshal Ses in the LPC message */
44 SmReqMsg
.Request
.CompSes
.hApiPort
= hApiPort
;
45 SmReqMsg
.Request
.CompSes
.hSbApiPort
= hSbApiPort
;
47 /* SM API to invoke */
48 SmReqMsg
.SmHeader
.ApiIndex
= SM_API_COMPLETE_SESSION
;
51 SmReqMsg
.Header
.MessageType
= LPC_NEW_MESSAGE
;
52 SmReqMsg
.Header
.DataSize
= SM_PORT_DATA_SIZE(SmReqMsg
.Request
);
53 SmReqMsg
.Header
.MessageSize
= SM_PORT_MESSAGE_SIZE
;
54 Status
= NtRequestWaitReplyPort (hSmApiPort
, (PLPC_MESSAGE
) & SmReqMsg
, (PLPC_MESSAGE
) & SmReqMsg
);
55 if (NT_SUCCESS(Status
))
57 return SmReqMsg
.SmHeader
.Status
;
59 DPRINT("SMLIB: %s failed (Status=0x%08lx)\n", __FUNCTION__
, Status
);