コード例 #1
0
        private byte[] CreateCDBBuffer_PersistentReserveOut(
            PERSISTENT_RESERVE_OUT_SERVICE_ACTION ServiceAction,
            PERSISTENT_RESERVATION_SCOPE_AND_TYPE_CODE ScopeAndType)
        {
            // cdbBuffer has a fixed length.
            // There could be several zeros in the end of the buffer because the real CDB info is not so long.
            PERSISTENT_RESERVE_OUT persistentReserveOut = new PERSISTENT_RESERVE_OUT();

            persistentReserveOut.OperationCode       = OPERATION_CODE.PERSISTENT_RESERVE_OUT;
            persistentReserveOut.ServiceAction       = ServiceAction;
            persistentReserveOut.ParameterListLength = 24; // The parameter list shall be 24 bytes in length
            persistentReserveOut.ScopeAndType        = ScopeAndType;

            byte[] cdb       = TypeMarshal.ToBytes <PERSISTENT_RESERVE_OUT>(persistentReserveOut);
            byte[] cdbBuffer = new byte[RsvdConst.RSVD_CDB_GENERIC_LENGTH];
            cdb.CopyTo(cdbBuffer, 0);
            return(cdbBuffer);
        }
コード例 #2
0
        private byte[] CreateCDBBuffer_PersistentReserveOut(
            PERSISTENT_RESERVE_OUT_SERVICE_ACTION ServiceAction,
            PERSISTENT_RESERVATION_SCOPE_AND_TYPE_CODE ScopeAndType)
        {
            // cdbBuffer has a fixed length.
            // There could be several zeros in the end of the buffer because the real CDB info is not so long.
            PERSISTENT_RESERVE_OUT persistentReserveOut = new PERSISTENT_RESERVE_OUT();
            persistentReserveOut.OperationCode = OPERATION_CODE.PERSISTENT_RESERVE_OUT;
            persistentReserveOut.ServiceAction = ServiceAction;
            persistentReserveOut.ParameterListLength = 24; // The parameter list shall be 24 bytes in length
            persistentReserveOut.ScopeAndType = ScopeAndType;

            byte[] cdb = TypeMarshal.ToBytes<PERSISTENT_RESERVE_OUT>(persistentReserveOut);
            byte[] cdbBuffer = new byte[RsvdConst.RSVD_CDB_GENERIC_LENGTH];
            cdb.CopyTo(cdbBuffer, 0);
            return cdbBuffer;
        }