[Wintun] Does wintun.dll support IOCP API?

zhengfish zhengfish at gmail.com
Mon Apr 5 05:07:11 UTC 2021


Hi,
Does wintun.dll support IOCP API?
If yes, how to do it?

I tried to use Wintun.dll with IOCP. And while associating the Wintun
Session handle to IOCP handle, it outputted an error with code 6.

    Context0.Iocp = CreateIoCompletionPort((HANDLE)Session0, hIocp,
(ULONG_PTR)lpPerSessionContext, 0); // To Associate IOCP handle
    if (Context0.Iocp == NULL)
        wprintf(_T("error, CreateIoCompletionPort associate failed...,
GetLastError: %d\n"), GetLastError());
    else
        wprintf(_T("success, CreateIoCompletionPort associate success....\n"));

    ASSERT(Context0.Iocp==hIocp);

I checked this system error code, that means a invalid handle:

    https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
    ERROR_INVALID_HANDLE 6 (0x6) The handle is invalid.


Thanks.


More information about the WireGuard mailing list