public unsafe static uint GetGenericParamConstraintTypeToken(IMetaDataImport2 mdi2, uint token) { if (mdi2 == null) return 0; uint tkConstraintType; int hr = mdi2.GetGenericParamConstraintProps(token, IntPtr.Zero, new IntPtr(&tkConstraintType)); if (hr != 0) return 0; return tkConstraintType; }
public unsafe static uint GetGenericParamConstraintOwnerRid(IMetaDataImport2 mdi2, uint token) { if (mdi2 == null) return 0; uint ownerToken; int hr = mdi2.GetGenericParamConstraintProps(token, new IntPtr(&ownerToken), IntPtr.Zero); if (hr != 0) return 0; var ownerMdToken = new MDToken(ownerToken); return ownerMdToken.Table == Table.GenericParam ? ownerMdToken.Rid : 0; }