public static long oHpiHandlerCreate( long SessionId, oHpiHandlerConfigT HandlerConfig, out long HandlerId ) { long rv; bool rc; HandlerId = HpiConst.SAHPI_LAST_ENTRY; rc = OhpiUtil.Check(HandlerConfig); if (!rc) { return(HpiConst.SA_ERR_HPI_INVALID_PARAMS); } HpiSession s = HpiCore.GetSession(SessionId); if (s == null) { return(HpiConst.SA_ERR_HPI_INVALID_SESSION); } OhpiMarshal m = s.GetMarshal(); if (m == null) { return(HpiConst.SA_ERR_HPI_NO_RESPONSE); } m.MarshalSaHpiSessionIdT(s.GetRemoteSid()); m.MarshaloHpiHandlerConfigT(HandlerConfig); rc = m.Interchange(OhpiConst.RPC_OHPI_HANDLER_CREATE); if (!rc) { m.Close(); return(HpiConst.SA_ERR_HPI_NO_RESPONSE); } rv = m.DemarshalSaErrorT(); if (rv == HpiConst.SA_OK) { HandlerId = m.DemarshaloHpiHandlerIdT(); } s.PutMarshal(m); return(rv); }
public static long oHpiHandlerFind( long SessionId, long ResourceId, out long HandlerId ) { long rv; bool rc; HandlerId = HpiConst.SAHPI_LAST_ENTRY; HpiSession s = HpiCore.GetSession(SessionId); if (s == null) { return(HpiConst.SA_ERR_HPI_INVALID_SESSION); } OhpiMarshal m = s.GetMarshal(); if (m == null) { return(HpiConst.SA_ERR_HPI_NO_RESPONSE); } m.MarshalSaHpiSessionIdT(s.GetRemoteSid()); m.MarshalSaHpiResourceIdT(ResourceId); rc = m.Interchange(OhpiConst.RPC_OHPI_HANDLER_FIND); if (!rc) { m.Close(); return(HpiConst.SA_ERR_HPI_NO_RESPONSE); } rv = m.DemarshalSaErrorT(); if (rv == HpiConst.SA_OK) { HandlerId = m.DemarshaloHpiHandlerIdT(); } s.PutMarshal(m); return(rv); }