Skip to content

Commit

Permalink
[#15] type information: set "own" param to false on retrieved structures
Browse files Browse the repository at this point in the history
  • Loading branch information
maul.esel committed Feb 24, 2012
1 parent 9add2f9 commit 815db96
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions TypeComp/TypeComp.ahk
Expand Up @@ -47,6 +47,9 @@ class TypeComp extends Unknown
Returns:
BOOL success - true on success, false otherwise
Remarks:
If a VARDESC or FUNCDESC is returned via "outValue", the caller is responsible for deleting it with the returned type description ("info") by calling ITypeInfo::ReleaseFuncDesc or ITypeInfo::ReleaseVarDesc on it.
*/
Bind(name, hash := 0, flags := 0, byRef info := "", byRef kind := 0, byRef outValue := 0)
{
Expand All @@ -57,9 +60,9 @@ class TypeComp extends Unknown
if (info && IsObject(TypeInfo))
info := new TypeInfo(info)
if (kind == 1 && IsObject(FUNCDESC))
outValue := FUNCDESC.FromStructPtr(outValue)
outValue := FUNCDESC.FromStructPtr(outValue, false)
if ((kind == 2 || kind == 4) && IsObject(VARDESC))
outValue := VARDESC.FromStructPtr(outValue)
outValue := VARDESC.FromStructPtr(outValue, false)
if (kind == 3)
outValue := new TypeComp(outValue)
return bool
Expand Down
9 changes: 6 additions & 3 deletions TypeInfo/TypeInfo.ahk
Expand Up @@ -39,12 +39,15 @@ class TypeInfo extends Unknown
Returns:
TYPEATTR info - an instance of the TYPEATTR class containing the information
Remarks:
Free the returned structure by passing it to <ReleaseTypeAttr>.
*/
GetTypeAttr()
{
local out
this._Error(DllCall(NumGet(this.vt+03*A_PtrSize), "ptr", this.ptr, "ptr*", out))
return TYPEATTR.FromStructPtr(out)
return TYPEATTR.FromStructPtr(out, false)
}

/*
Expand Down Expand Up @@ -78,7 +81,7 @@ class TypeInfo extends Unknown
{
local out
this._Error(DllCall(NumGet(this.vt+05*A_PtrSize), "ptr", this.ptr, "UInt", index, "ptr*", out))
return IsObject(FUNCDESC) ? FUNCDESC.FromStructPtr(out) : out
return IsObject(FUNCDESC) ? FUNCDESC.FromStructPtr(out, false) : out
}

/*
Expand All @@ -98,7 +101,7 @@ class TypeInfo extends Unknown
{
local out
this._Error(DllCall(NumGet(this.vt+06*A_PtrSize), "ptr", this.ptr, "UInt", index, "ptr*", out))
return IsObject(VARDESC) ? VARDESC.FromStructPtr(out) : out
return IsObject(VARDESC) ? VARDESC.FromStructPtr(out, false) : out
}

/*
Expand Down
2 changes: 1 addition & 1 deletion TypeLib/TypeLib.ahk
Expand Up @@ -159,7 +159,7 @@ class TypeLib extends Unknown
{
local out
this._Error(DllCall(NumGet(this.vt+07*A_PtrSize), "ptr", this.ptr, "ptr*", out))
return TLIBATTR.FromStructPtr(out)
return TLIBATTR.FromStructPtr(out, false)
}

/*
Expand Down

0 comments on commit 815db96

Please sign in to comment.