Skip to content
Discussion options

You must be logged in to vote

The FWP_BYTE_ARRAY16 you refer to is generated with several helpers, depending on the language version and target framework of your project.

When targeting net472 and using C# 10, you get this:

internal unsafe readonly void CopyTo(Span<byte> target, int length = 16)
{
	if (length > 16) throw new ArgumentOutOfRangeException("length");
	fixed (byte* p0 = &_0) 
		for(int i = 0; i < length; i++) target[i]= p0[i];
}

We also offer these extension methods, that allow indexing in:

internal static unsafe ref readonly byte ReadOnlyItemRef(this in winmdroot.NetworkManagement.WindowsFilteringPlatform.FWP_BYTE_ARRAY16.__byte_16 @this, int index)
{
    fixed (byte* p0 = &@this._0)
        return ref p0[i…

Replies: 2 comments 15 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
15 replies
@HavenDV
Comment options

@AArnott
Comment options

@HavenDV
Comment options

@jnm2
Comment options

@AArnott
Comment options

Answer selected by HavenDV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants