Exemplo n.º 1
0
        internal static uint CorSigUncompressData(IntPtrSq pData)
        {
            Byte pBytes = pData.ReadByte(); ;
                uint retval =0;
                // Handle smallest data inline.
                if ((pBytes & 0x80) == 0x00) {
                    retval = (uint)(pBytes);
                }else if ((pBytes & 0xC0) == 0x80) {
                    retval = (uint)((pBytes & 0x3f) << 8);
                    retval |= pData.ReadByte();
                } else {
                    retval = (uint)(pBytes & 0x1f) << 24;
                    retval |= (uint)(pData.ReadByte()) << 16;
                    retval |= (uint)(pData.ReadByte()) << 8;
                    retval |= (uint)(pData.ReadByte());
                }

                return retval;
        }
Exemplo n.º 2
0
        // [IN,OUT] compressed data
        internal static uint CorSigUncompressToken(   // return the token.    
             IntPtrSq pData)
        {
            uint tk;
            uint tkType;

            tk = CorSigUncompressData(pData);
            tkType = g_tkCorEncodeToken[tk & 0x3];
            tk = TokenFromRid(tk >> 2, tkType);
            return tk;
        }