Description of the problem
There is a problem with how UI_ANIMATION_KEYFRAME is mapped in SharpDX.Animation.
In UIAnimation.h, UI_ANIMATION_KEYFRAME is defined as a pointer to an opaque structure (__MIDL___MIDL_itf_UIAnimation_0000_0002_0003), and UI_ANIMATION_KEYFRAME_STORYBOARD_STARTis defined as a pointer of value -1.
In SharpDX.Animation, UI_ANIMATION_KEYFRAME is not mapped directly. Instead, the type __MIDL___MIDL_itf_UIAnimation_0000_0002_0003 is mapped to a structure KeyFrame which contains a single field of type IntPtr.
The problem is that COM methods with parameters of type UI_ANIMATION_KEYFRAME are recognized by the mapper as pointers to __MIDL___MIDL_itf_UIAnimation_0000_0002_0003 structures, and therefore the generated code for these methods don't pass the value of the IntPtr field of the mapped KeyFrame parameter, but pass instead a pointer to the KeyFrame structure, which is invalid.
Solution
The solution, but I'm not sure how it must be implemented via the mapping system, would be to keep the KeyFrame type as it is now, but force the mapper to generate code for methods with UI_ANIMATION_KEYFRAME parameters that pass the inner IntPtr by copy instead of passing a pointer to the KeyFrame value.
Description of the problem There is a problem with how
UI_ANIMATION_KEYFRAME
is mapped inSharpDX.Animation
.In
UIAnimation.h
,UI_ANIMATION_KEYFRAME
is defined as a pointer to an opaque structure (__MIDL___MIDL_itf_UIAnimation_0000_0002_0003
), andUI_ANIMATION_KEYFRAME_STORYBOARD_START
is defined as a pointer of value -1.In
SharpDX.Animation
,UI_ANIMATION_KEYFRAME
is not mapped directly. Instead, the type__MIDL___MIDL_itf_UIAnimation_0000_0002_0003
is mapped to a structureKeyFrame
which contains a single field of typeIntPtr
.The problem is that COM methods with parameters of type
UI_ANIMATION_KEYFRAME
are recognized by the mapper as pointers to__MIDL___MIDL_itf_UIAnimation_0000_0002_0003
structures, and therefore the generated code for these methods don't pass the value of theIntPtr
field of the mappedKeyFrame
parameter, but pass instead a pointer to theKeyFrame
structure, which is invalid.Solution
The solution, but I'm not sure how it must be implemented via the mapping system, would be to keep the
KeyFrame
type as it is now, but force the mapper to generate code for methods withUI_ANIMATION_KEYFRAME
parameters that pass the innerIntPtr
by copy instead of passing a pointer to theKeyFrame
value.