예제 #1
0
        public CommAreaGroupDescriptor(
            DrdaStreamReader reader)
        {
            if (reader.ReadUInt8() == 0xFF)
            {
                return;
            }

            SqlCode  = reader.ReadUInt32();
            SqlState = reader.ReadString(5);
            var sqlErrProc = reader.ReadString(8);

            if (reader.ReadUInt8() != 0xFF)
            {
                RowsFetched = reader.ReadUInt64();
                RowsUpdated = reader.ReadUInt32();

                var sqlErrs = reader.ReadBytes(12); // 3 * sizeof(UInt32)
                var sqlWarn = reader.ReadBytes(11); // 11 * sizeof(Byte)

                var rdbName = reader.ReadUInt16();

                SqlMessage = reader.ReadVcmVcs();
            }

            if (reader.ReadUInt8() != 0xFF)
            {
                // WORKWORK
            }
        }
예제 #2
0
 public DrdaResultSet(
     DrdaStreamReader reader)
 {
     Locator    = reader.ReadUInt32();
     CursorName = reader.ReadVcmVcs();
     Rows       = reader.ReadUInt32();
 }
예제 #3
0
 public UInt32Parameter(
     DrdaStreamReader reader,
     CodePoint codePoint)
     : this(
         codePoint,
         reader.ReadUInt32())
 {
 }
예제 #4
0
        public static IDrdaMessage Deserialize(
            DrdaStreamReader reader)
        {
            var size      = (UInt32)reader.ReadUInt16();
            var codePoint = (CodePoint)reader.ReadUInt16();

            if (size == 0x8004)
            {
                // TODO: olegra - check how we can obtain real message length here
            }
            else if ((size & 0x8000) == 0x8000)
            {
                size = reader.ReadUInt32() + sizeof(UInt16) + sizeof(UInt16);
            }

            // TODO: olegra - find the better way for handling code points here

            switch (codePoint)
            {
            case PBSD:
            case EXSATRM:
            case ACCSECRM:
            case SECCHKRM:
            case ACCRDBRM:
            case CMDCHKRM:
            case SQLERRRM:
            case RDBUPDRM:
            case SYNTAXRM:
            case RSLSETRM:
            case OPNQRYRM:
            case ENDUOWRM:
                return(new CompositeCommand(reader, size, codePoint));

            // In fact they are composite but we don't need them right now
            case MGRLVLLS:
            case TYPDEFOVR:
            case PKGSNLST:
                return(new BytesParameter(reader, size, codePoint));    //-V3139

            case QRYDSC:
            case QRYDTA:
            case EXTDTA:
            case SQLCARD:
            case SQLDARD:
            case SQLCINRD:
            case SQLRSLRD:
                return(new ReaderCommand(reader, size, codePoint));

            case UOWDSP:
            case PBSD_ISO:
            case SYNERRCD:
            case SECCHKCD:
            case SQLCSRHLD:
            case QRYATTUPD:
                return(new UInt8Parameter(reader, codePoint));

            case SECMEC:
            case SRVCOD:
            case QRYPRCTYP:
                return(new UInt16Parameter(reader, codePoint));

            case QRYINSID:
                return(new UInt64Parameter(reader, codePoint));

            case PRDID:
            case RDBNAM:
            case EXTNAM:
            case SRVNAM:
            case SRVCLSNM:
            case SRVRLSLV:
            case TYPDEFNAM:
            case PBSD_SCHEMA:
                // TODO: olegra - create string parameter type?
                return(new BytesParameter(reader, size, codePoint));

            default:
                TraceWarning("Unknown code point value: 0x{0:X}", codePoint);
                return(new BytesParameter(reader, size, codePoint));
            }
        }