Пример #1
0
        public int GetSignature(
            int bufferLength,
            out int count,
            [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out] byte[] signature)
        {
            if (_lazySignature == null)
            {
                InitializeValueAndSignature();
            }

            return(InteropUtilities.BytesToBuffer(_lazySignature, bufferLength, out count, signature));
        }
Пример #2
0
        public int GetChecksum(
            int bufferLength,
            out int count,
            [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]byte[] checksum)
        {
            var document = SymReader.MetadataReader.GetDocument(Handle);
            if (document.Hash.IsNil)
            {
                count = 0;
                return HResult.S_FALSE;
            }

            var hash = SymReader.MetadataReader.GetBlobBytes(document.Hash);
            return InteropUtilities.BytesToBuffer(hash, bufferLength, out count, checksum);
        }
Пример #3
0
        public int GetChecksum(
            int bufferLength,
            out int count,
            [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out] byte[] checksum)
        {
            // diasymreader returns no checksum for documents once EnC has been performed:
            if (SymReader.Version > 1)
            {
                count = 0;
                return(HResult.S_FALSE);
            }

            var document = PdbReader.MetadataReader.GetDocument(Handle);

            if (document.Hash.IsNil)
            {
                count = 0;
                return(HResult.S_FALSE);
            }

            var hash = PdbReader.MetadataReader.GetBlobBytes(document.Hash);

            return(InteropUtilities.BytesToBuffer(hash, bufferLength, out count, checksum));
        }