none
Alternatives to localRedirectContext on Windows 7 | Connect Redirect with WFP RRS feed

  • Question

  • There is a little difference in the documentation and the code around FWPS_CONNECT_REQUEST.
    The documentation comments that the localRedirectContext though available on Windows 7 will not be freed by WFP as is the case starting with Windows 8.

    Assuming that the document is erroneous/misleading, what are the alternatives to localRedirectContext on Windows 7?

    Also, how do the IOCTLs (SIO_QUERY_WFP_CONNECTION_REDIRECT_RECORDS / SIO_QUERY_WFP_CONNECTION_REDIRECT_CONTEXT) from the proxy service will respond on Windows 7?

    Ref -

    Using Bind or Connect Redirection | MSDN - https://docs.microsoft.com/en-us/windows-hardware/drivers/network/using-bind-or-connect-redirection

    FWPS_CONNECT_REQUEST | MSDN https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/fwpsk/ns-fwpsk-_fwps_connect_request0 

    FWPS_CONNECT_REQUEST | Code snippet from fwpsk.h

    //
    // Layer data type of ALE_CONNECT_REDIRECT layers
    //
    typedef struct _FWPS_CONNECT_REQUEST0
    {
       //
       // Read-Write fields on a writable copy of the structure. 
       //
       /* IN OUT */ SOCKADDR_STORAGE localAddressAndPort;
       /* IN OUT */ SOCKADDR_STORAGE remoteAddressAndPort;
       /* OUT */ UINT64 portReservationToken;

       //
       // When redirecting a connection to localhost, the callout must supply
       // the PID of the process that will be accepting the redirected connection. 
       //

       /* OUT */ DWORD localRedirectTargetPID;

       //
       // Modification History. (Read-Only)
       //
       struct _FWPS_CONNECT_REQUEST0* previousVersion;
       UINT64 modifierFilterId;
    #if (NTDDI_VERSION >= NTDDI_WIN8)
       //
       // Handle created using the FwpsRedirectHandleCreate0 function. 
       //
       /* OUT */ HANDLE localRedirectHandle;

       //
       // Arbitrary callout supplied context allocated using the 
       // ExAllocatePoolWithTag function. 
       //
       /* OUT */ void* localRedirectContext;
       /* OUT */ SIZE_T localRedirectContextSize; 
    #endif // NTDDI_VERSION >= NTDDI_WIN8      
    } FWPS_CONNECT_REQUEST0;
    • Edited by foobar1024 Monday, September 16, 2019 10:55 PM Remove extra tags
    Monday, September 16, 2019 10:54 PM

All replies