Skip to content

Commit

Permalink
Fix COM interop ELEMDESC (#1254) (#1266)
Browse files Browse the repository at this point in the history
ELEMDESC doesn't contain a pointer. This fixes a regression introduced in #818.

Fixes #896
  • Loading branch information
wtgodbe authored and AdamYoblick committed Jul 2, 2019
1 parent e6eae24 commit 52be7e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Common/src/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5397,7 +5397,7 @@ public enum tagVARFLAGS
[StructLayout(LayoutKind.Sequential)]
public unsafe struct tagELEMDESC
{
public NativeMethods.tagTYPEDESC* tdesc;
public NativeMethods.tagTYPEDESC tdesc;
public NativeMethods.tagPARAMDESC paramdesc;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ private static void ProcessFunctions(UnsafeNativeMethods.ITypeInfo typeInfo, IDi

unsafe
{
typeDesc = *funcDesc.elemdescFunc.tdesc;
typeDesc = funcDesc.elemdescFunc.tdesc;
}
}
else
Expand All @@ -734,7 +734,7 @@ private static void ProcessFunctions(UnsafeNativeMethods.ITypeInfo typeInfo, IDi
ref readonly NativeMethods.tagELEMDESC ed = ref UnsafeNativeMethods.PtrToRef<NativeMethods.tagELEMDESC>(funcDesc.lprgelemdescParam);
unsafe
{
typeDesc = *ed.tdesc;
typeDesc = ed.tdesc;
}
}
pi = ProcessDataCore(typeInfo, propInfoList, funcDesc.memid, nameDispID, in typeDesc, funcDesc.wFuncFlags);
Expand Down Expand Up @@ -973,7 +973,7 @@ private static void ProcessVariables(UnsafeNativeMethods.ITypeInfo typeInfo, IDi

unsafe
{
PropInfo pi = ProcessDataCore(typeInfo, propInfoList, varDesc.memid, nameDispID, in *varDesc.elemdescVar.tdesc, varDesc.wVarFlags);
PropInfo pi = ProcessDataCore(typeInfo, propInfoList, varDesc.memid, nameDispID, in varDesc.elemdescVar.tdesc, varDesc.wVarFlags);
if (pi.ReadOnly != PropInfo.ReadOnlyTrue)
{
pi.ReadOnly = PropInfo.ReadOnlyFalse;
Expand Down

0 comments on commit 52be7e5

Please sign in to comment.