Tag: unmanaged memory

C#中的WinDivert

我想在C#代码中调用5个WinDivert函数,第一reflection:PInvoke这里是签名: internal enum WINDIVERT_LAYER { WINDIVERT_LAYER_NETWORK = 0, /* Network layer. */ WINDIVERT_LAYER_NETWORK_FORWARD = 1 /* Network layer (forwarded packets) */ } internal const UInt64 WINDIVERT_FLAG_SNIFF = 1; /* * typedef struct { UINT32 IfIdx; UINT32 SubIfIdx; UINT8 Direction; } WINDIVERT_ADDRESS, *PWINDIVERT_ADDRESS; * */ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] internal struct WINDIVERT_ADDRESS { UInt32 IfIdx; UInt32 […]