Esempio n. 1
0
        public HRESULT GetBlob(Guid guidKey, byte[] pBuf, int cbBufSize, IntPtr pcbBlobSize)
        {
            var hr = _type.GetBlob(guidKey, pBuf, cbBufSize, pcbBlobSize);

            Trace("guid: " + guidKey.ToName() + " buf: " + Conversions.ToHexa(pBuf, 64) + " size: " + cbBufSize + " len: " + pcbBlobSize + " hr: " + hr);
            return(hr);
        }
Esempio n. 2
0
        public static string TraceValue(this IMFAttributes input, Guid key)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            var value = GetValue(input, key);

            if (value == null)
            {
                return("<null>");
            }

            if (value is byte[] bytes)
            {
                return(Conversions.ToHexa(bytes, 64));
            }

            if (value is Guid guid)
            {
                return(guid.ToName());
            }

            if (value is string s)
            {
                return("`" + s + "`");
            }

            return(string.Format(CultureInfo.InvariantCulture, "{0}", value));
        }
Esempio n. 3
0
        public HRESULT SetBlob(Guid guidKey, byte[] pBuf, int cbBufSize)
        {
            var hr = _type.SetBlob(guidKey, pBuf, cbBufSize);

            Trace("key: " + guidKey.ToName() + " buf: " + Conversions.ToHexa(pBuf, 64) + " size: " + cbBufSize + " hr: " + hr);
            return(hr);
        }