/// <summary>
 ///  The SamrConnect5 method obtains a handle to a server
 ///  object. Opnum: 64 
 /// </summary>
 /// <param name="ServerName">
 ///  The null-terminated NETBIOS name of the server; this
 ///  parameter MAYServerName is ignored on receipt.  be
 ///  ignored on receipt.
 /// </param>
 /// <param name="DesiredAccess">
 ///  An ACCESS_MASK that indicates the access requested for
 ///  ServerHandle on output. For a listing of possible values,
 ///  see section.
 /// </param>
 /// <param name="InVersion">
 ///  Indicates which field of the InRevisionInfo union is
 ///  used.
 /// </param>
 /// <param name="InRevisionInfo">
 ///  Revision information. For details, see the definition
 ///  of the SAMPR_REVISION_INFO_V1 structure, which is contained
 ///  in the SAMPR_REVISION_INFO union.
 /// </param>
 /// <param name="OutVersion">
 ///  Indicates which field of the OutRevisionInfo union is
 ///  used.
 /// </param>
 /// <param name="OutRevisionInfo">
 ///  Revision information. For details, see the definition
 ///  of the SAMPR_REVISION_INFO_V1 structure, which is contained
 ///  in the SAMPR_REVISION_INFO union.
 /// </param>
 /// <param name="ServerHandle">
 ///  An RPC context handle, as specified in section.
 /// </param>
 /// <returns>
 /// status of the function call, for example: 0 indicates STATUS_SUCCESS
 /// </returns>
 public int SamrConnect5(string ServerName,
     uint DesiredAccess,
     uint InVersion,
     //[Switch("InVersion")]
     SAMPR_REVISION_INFO InRevisionInfo,
     out System.UInt32 OutVersion,
     //[Switch("*OutVersion")]
     out SAMPR_REVISION_INFO OutRevisionInfo,
     out System.IntPtr ServerHandle)
 {
     return rpc.SamrConnect5(ServerName, DesiredAccess, InVersion, InRevisionInfo, out OutVersion,
         out OutRevisionInfo, out ServerHandle);
 }
 /// <summary>
 ///  Decodes the request stub, and fills the fields of the class
 /// </summary>
 /// <param name="sessionContext">The session context of the request received</param>
 /// <param name="requestStub">The request stub got from RPCE layer</param>
 internal override void Decode(SamrServerSessionContext sessionContext, byte[] requestStub)
 {
     using (RpceInt3264Collection inParams = RpceStubDecoder.ToParamList(
    RpceStubHelper.GetPlatform(),
     SamrRpcStubFormatString.TypeFormatString,
     new RpceStubExprEval[]{
         new RpceStubExprEval(SamrRpcAdapter.samr_SAMPR_USER_LOGON_INFORMATIONExprEval_0000),
         new RpceStubExprEval(SamrRpcAdapter.samr_SAMPR_USER_LOGON_HOURS_INFORMATIONExprEval_0001),
         new RpceStubExprEval(SamrRpcAdapter.samr_SAMPR_USER_ACCOUNT_INFORMATIONExprEval_0002),
         new RpceStubExprEval(SamrRpcAdapter.samr_SAMPR_LOGON_HOURSExprEval_0003)},
     SamrRpcStubFormatString.ProcFormatString,
     SamrRpcStubFormatString.ProcFormatStringOffsetTable[(int)Opnum],
     false,
     requestStub))
     {
         ServerName = Marshal.PtrToStringAuto(inParams[0]);
         DesiredAccess = inParams[1].ToUInt32();
         InVersion = inParams[2].ToUInt32();
         InRevisionInfo = TypeMarshal.ToStruct<SAMPR_REVISION_INFO>(inParams[3], InVersion, null, null);
     }
 }