@@ -78,9 +78,6 @@ private enum REGKIND
7878 { VarEnum . VT_R8 , "Double" } ,
7979 } ;
8080
81- [ DllImport ( "kernel32.dll" ) ]
82- public static extern bool IsBadReadPtr ( IntPtr lp , uint ucb ) ;
83-
8481 private string GetTypeName ( TYPEDESC desc , ITypeInfo info )
8582 {
8683 var vt = ( VarEnum ) desc . vt ;
@@ -89,11 +86,6 @@ private string GetTypeName(TYPEDESC desc, ITypeInfo info)
8986 switch ( vt )
9087 {
9188 case VarEnum . VT_PTR :
92- if ( IsBadReadPtr ( desc . lpValue , ( uint ) IntPtr . Size ) )
93- {
94- Debug . WriteLine ( "Bad read pointer; returning fallback 'Object' type name." ) ;
95- return "Object" ;
96- }
9789 tdesc = ( TYPEDESC ) Marshal . PtrToStructure ( desc . lpValue , typeof ( TYPEDESC ) ) ;
9890 return GetTypeName ( tdesc , info ) ;
9991 case VarEnum . VT_USERDEFINED :
@@ -191,7 +183,6 @@ public IEnumerable<Declaration> GetDeclarationsForReference(Reference reference)
191183 info . GetTypeAttr ( out typeAttributesPointer ) ;
192184
193185 var typeAttributes = ( TYPEATTR ) Marshal . PtrToStructure ( typeAttributesPointer , typeof ( TYPEATTR ) ) ;
194- info . ReleaseTypeAttr ( typeAttributesPointer ) ;
195186
196187 var attributes = new Attributes ( ) ;
197188 if ( typeAttributes . wTypeFlags . HasFlag ( TYPEFLAGS . TYPEFLAG_FPREDECLID ) )
@@ -277,7 +268,6 @@ private Declaration CreateMemberDeclaration(out FUNCDESC memberDescriptor, TYPEK
277268 IntPtr memberDescriptorPointer ;
278269 info . GetFuncDesc ( memberIndex , out memberDescriptorPointer ) ;
279270 memberDescriptor = ( FUNCDESC ) Marshal . PtrToStructure ( memberDescriptorPointer , typeof ( FUNCDESC ) ) ;
280- info . ReleaseFuncDesc ( memberDescriptorPointer ) ;
281271
282272 if ( memberDescriptor . callconv != CALLCONV . CC_STDCALL )
283273 {
@@ -411,7 +401,6 @@ private Declaration CreateFieldDeclaration(ITypeInfo info, int fieldIndex, Decla
411401 info . GetVarDesc ( fieldIndex , out ppVarDesc ) ;
412402
413403 var varDesc = ( VARDESC ) Marshal . PtrToStructure ( ppVarDesc , typeof ( VARDESC ) ) ;
414- info . ReleaseVarDesc ( ppVarDesc ) ;
415404
416405 var names = new string [ 255 ] ;
417406 int namesArrayLength ;
0 commit comments