Here is the relevant part of my structure...
[StructLayout(LayoutKind.Sequential)]
public unsafe struct PPF_FILTER_DESCRIPTOR
{
public int* SrcAddr;
public int* SrcMask;
public int* DstAddr;
public int* DstMask;
}
private PPF_FILTER_DESCRIPTOR filter;
I'm trying to fill the field, SrcAddr -
an int* PPF_FILTER_DESCRIPTOR.SrcAddr
as filter.SrcAddr
I can't seem to do this w/o errors...
Obviously, this is a hobby project.
Here's what I've been trying
IPAddress sip = IPAddress.Parse("10.1.1.1");
Unsafe {
src = BitConverter.ToInt32(sip.GetAddressBytes(), 0);
filter.SrcAddr = &src;
}
This errors w/: You can only take the address of an unfixed expression
inside of a fixed statement initializer
I've tried:
fixed(filter.SrcAddr = &src;)
This errors w/: Type or namespace name expected, but fieldname found.
Not sure what to try next. Any suggestions?
Thanks