\ImageGlass.WinTouch\NativeMethods.cs PInvoke.GetGestureInfo error when Microsoft.Windows.CsWin32 update to 0.3.106 #1921
Unanswered
Charltsing
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Components\ImageGlass.WinTouch\NativeMethods.cs
line 83
var result = PInvoke.GetGestureInfo(new HGESTUREINFO(gestureInfoHandle), out pGestureInfo);
the first parameter type is error when Microsoft.Windows.CsWin32 update to 0.3.106, it should be SafeHandle
How to change the first parameter type to safehandle?
internal static unsafe winmdroot.Foundation.BOOL GetGestureInfo(SafeHandle hGestureInfo, out winmdroot.UI.Input.Touch.GESTUREINFO pGestureInfo)
{
bool hGestureInfoAddRef = false;
try
{
fixed (winmdroot.UI.Input.Touch.GESTUREINFO* pGestureInfoLocal = &pGestureInfo)
{
winmdroot.UI.Input.Touch.HGESTUREINFO hGestureInfoLocal;
if (hGestureInfo is object)
{
hGestureInfo.DangerousAddRef(ref hGestureInfoAddRef);
hGestureInfoLocal = (winmdroot.UI.Input.Touch.HGESTUREINFO)hGestureInfo.DangerousGetHandle();
}
else
throw new ArgumentNullException(nameof(hGestureInfo));
winmdroot.Foundation.BOOL __result = PInvoke.GetGestureInfo(hGestureInfoLocal, pGestureInfoLocal);
return __result;
}
}
finally
{
if (hGestureInfoAddRef)
hGestureInfo.DangerousRelease();
}
}
Beta Was this translation helpful? Give feedback.
All reactions