On linux-musl-release-x64 builds, the return value from a native function returning false is sometimes incorrectly interpreted as true because of the mismatch between the number of bytes expected for bool on native and managed sides.
Repro:
The host defines a native function bundle_probe with type
bool STDMETHODCALLTYPE bundle_probe(const char16_t* path, int64_t* offset, int64_t* size)
If this function is called from managed code using the following delegate:
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate bool BundleProbeDelegate([MarshalAs(UnmanagedType.LPWStr)] string path, IntPtr size, IntPtr offset);
The invocations where bundle_probe return false, are interpreted as true. Gor example:
Probe(bundleProbeDelegate, "", isExpected: false);
Once this issue is fixed, this test asset should be updated to use the bool return type in the PInvoke delegate.
On linux-musl-release-x64 builds, the return value from a native function returning
falseis sometimes incorrectly interpreted astruebecause of the mismatch between the number of bytes expected forboolon native and managed sides.Repro:
The host defines a native function bundle_probe with type
If this function is called from managed code using the following delegate:
The invocations where
bundle_probereturnfalse, are interpreted astrue. Gor example:Once this issue is fixed, this test asset should be updated to use the
boolreturn type in the PInvoke delegate.