내가 WFP (Windows 필터링 플랫폼)에 대한 내 C# 래퍼를 쓰기왔다, 내가 WinDivert 1.0.5, 이 수입 구문WinDivert 1.0.5 DivertRecv() 메소드 받기 마지막 오류 998
[DllImportAttribute("WinDivert.dll", EntryPoint = "DivertRecv",SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAsAttribute(UnmanagedType.Bool)]
public static extern bool DivertRecv([InAttribute()] System.IntPtr handle,
[OutAttribute()] System.IntPtr pPacket,
[InAttribute()] uint packetLen,
[ OutAttribute()] System.IntPtr pAddr,
[OutAttribute()] System.IntPtr readLen);
사용이 함수 호출 구문
if(DivertRecv(handle, Ppacket, (uint)(8 * packet.Length-1),
Paddr, Ppacket_len) == false)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("warning: failed to read packet {0} .", Marshal.GetLastWin32Error());
Console.ResetColor();
Console.WriteLine(" Press any key to Exit ...");
Console.ReadKey();
Environment.Exit(1);
}
하지만 기능은 모든 호출 false를 반환하고, GetLastWin32Error()는 오류 코드 998을 얻는다. PLZ 도와주세요.
[이 질문] (http://stackoverflow.com/questions/23296106/windivert-in-c-sharp)을보고 도와주세요. 나는 당신이 해결 한 것과 같은 문제가있을 것이라고 생각합니다. – JohnTube
@SecurityCrazy windivert에 대한 C# 래퍼를 공유하면 멋지다. 나는 하나를 함께 고투하는 과정에있다. ;) –