You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usingVanara.PInvoke;varsrc=User32.MB_GetString(1);// Crash here// I estimate `LPWStr` cannot be used in the Chinese system.// [return: MarshalAs(UnmanagedType.LPWStr)]
My solution code:
publicstaticclassUser32X{[DllImport(Lib.User32,SetLastError=true,CharSet=CharSet.Unicode)]publicstaticexternnintMB_GetString(uintwBtn);}varsrc=Marshal.PtrToStringAuto(User32X.MB_GetString(1));// return src is "取消"(meaning `Cancel`)
What code is involved
User32.MB_GetString
Expected behavior
MB_GetString make exe crashed and ExitCode is 3221226356 (0xc0000374)
I have this resolved and need to update the master branch. For the return value, it should use StrPtrUni instead of string?. The value returned is a pointer into system memory. I'll close one I commit the fix.
Describe the bug and how to reproduce
BUG code:
My solution code:
What code is involved
User32.MB_GetString
Expected behavior
MB_GetString make exe crashed and ExitCode is 3221226356 (0xc0000374)
Screenshots
程序“[4784] XXX.exe”已退出,返回值为 3221226356 (0xc0000374)。
Translated to English:
The program '[4784] XXX. exe' has exited with a return value of 3221226356 (0xc0000374).
The text was updated successfully, but these errors were encountered: