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
Hmmmm... unless we special case it (and we try to minimize such cases), the most natural way to achieve this is to get the metadata to change from void* to byte*. If they were to do that, I believe you'd automatically get what you want. And with some other enhancements, the nNumberOfBytesToWrite would also disappear from the friendly overload because that value can come from the span's length.
Although strictly speaking, the current void* allows pointers to any other blittable structure, if that ever was useful to anyone they could do a typecast to make it look like byte* and proceed anyway.
So I'm in favor of this change. Moving to the metadata repo.
(0.1.506-beta)
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-writefile#parameters has
void* lpBuffer, uint nNumberOfBytesToWrite
. Since the second parameter explicitly defines the previous parameter in terms of bytes, it seems like the friendly overload could replace both parameters withReadOnlySpan<byte> buffer
.The benefit would be avoiding adding unsafe + fixed around the call.
The text was updated successfully, but these errors were encountered: