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); }
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; }