-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
area-Interop-coreclros-alpineuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-Interop-coreclros-alpineuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner