コード例 #1
0
ファイル: SymReader.cs プロジェクト: NileshMoradiya/roslyn
 public int GetConstants(int cConstants, out int pcConstants, ISymUnmanagedConstant[] constants)
 {
     ((ISymUnmanagedScope2)_scope).GetConstants(cConstants, out pcConstants, constants);
     if (constants != null)
     {
         for (int i = 0; i < pcConstants; i++)
         {
             var    c             = constants[i];
             var    signaturesOpt = _reader._constantSignaturesOpt;
             byte[] signature     = null;
             if (signaturesOpt != null)
             {
                 int length;
                 int hresult = c.GetName(0, out length, null);
                 SymUnmanagedReaderExtensions.ThrowExceptionForHR(hresult);
                 var chars = new char[length];
                 hresult = c.GetName(length, out length, chars);
                 SymUnmanagedReaderExtensions.ThrowExceptionForHR(hresult);
                 var name = new string(chars, 0, length - 1);
                 signaturesOpt.TryGetValue(name, out signature);
             }
             constants[i] = new SymConstant(c, signature);
         }
     }
     return(SymUnmanagedReaderExtensions.S_OK);
 }
コード例 #2
0
ファイル: SymReader.cs プロジェクト: elemk0vv/roslyn-1
 public int GetConstants(int cConstants, out int pcConstants, ISymUnmanagedConstant[] constants)
 {
     ((ISymUnmanagedScope2)_scope).GetConstants(cConstants, out pcConstants, constants);
     if (constants != null)
     {
         for (int i = 0; i < pcConstants; i++)
         {
             var c = constants[i];
             var signaturesOpt = _reader._constantSignaturesOpt;
             byte[] signature = null;
             if (signaturesOpt != null)
             {
                 int length;
                 int hresult = c.GetName(0, out length, null);
                 SymUnmanagedReaderExtensions.ThrowExceptionForHR(hresult);
                 var chars = new char[length];
                 hresult = c.GetName(length, out length, chars);
                 SymUnmanagedReaderExtensions.ThrowExceptionForHR(hresult);
                 var name = new string(chars, 0, length - 1);
                 signaturesOpt.TryGetValue(name, out signature);
             }
             constants[i] = new SymConstant(c, signature);
         }
     }
     return SymUnmanagedReaderExtensions.S_OK;
 }