_IRQL_requires_same_
VOID NTAPI CompleteBasicPacketModification(_In_ VOID* pContext,
                                           _Inout_ NET_BUFFER_LIST* pNetBufferList,
                                           _In_ BOOLEAN dispatchLevel)
{
   NT_ASSERT(pContext);
   NT_ASSERT(((BASIC_PACKET_MODIFICATION_COMPLETION_DATA*)pContext)->pClassifyData);
   NT_ASSERT(((BASIC_PACKET_MODIFICATION_COMPLETION_DATA*)pContext)->pClassifyData->pClassifyValues);
   NT_ASSERT(((BASIC_PACKET_MODIFICATION_COMPLETION_DATA*)pContext)->pClassifyData->pClassifyOut);
   NT_ASSERT(((BASIC_PACKET_MODIFICATION_COMPLETION_DATA*)pContext)->pClassifyData->pFilter);
   NT_ASSERT(pNetBufferList);
   NT_ASSERT(NT_SUCCESS(pNetBufferList->Status));

   UNREFERENCED_PARAMETER(dispatchLevel);

   NTSTATUS                                   status          = pNetBufferList->Status;
   BASIC_PACKET_MODIFICATION_COMPLETION_DATA* pCompletionData = (BASIC_PACKET_MODIFICATION_COMPLETION_DATA*)pContext;
   UINT32                                     layerID         = pCompletionData->pClassifyData->pClassifyValues->layerId;
   UINT64                                     filterID        = pCompletionData->pClassifyData->pFilter->filterId;

   DbgPrintEx(DPFLTR_IHVNETWORK_ID,
              DPFLTR_INFO_LEVEL,
              " ---> CompleteBasicPacketModification() [Layer: %s][FilterID: %#I64x][NBL->Status: %#x]",
              KrnlHlprFwpsLayerIDToString(layerID),
              filterID,
              status);

   BasicPacketModificationCompletionDataDestroy(&pCompletionData);

   if(status != STATUS_SUCCESS)
      DbgPrintEx(DPFLTR_IHVNETWORK_ID,
                 DPFLTR_ERROR_LEVEL,
                 " !!!! CompleteBasicPacketModification() [status: %#x]\n",
                 pNetBufferList->Status);

   FwpsFreeCloneNetBufferList(pNetBufferList,
                              0);

   DbgPrintEx(DPFLTR_IHVNETWORK_ID,
              DPFLTR_INFO_LEVEL,
              " <--- CompleteBasicPacketModification() [Layer: %s][FilterID: %#I64x][NBL->Status: %#x]",
              KrnlHlprFwpsLayerIDToString(layerID),
              filterID,
              status);

   return;
}
_IRQL_requires_same_
VOID CompleteBasicPacketModification(_In_ VOID* pContext,
                                     _Inout_ NET_BUFFER_LIST* pNetBufferList,
                                     _In_ BOOLEAN dispatchLevel)
{
#if DBG

   DbgPrintEx(DPFLTR_IHVNETWORK_ID,
              DPFLTR_INFO_LEVEL,
              " ---> CompleteBasicPacketModification()\n");

#endif /// DBG

   UNREFERENCED_PARAMETER(dispatchLevel);

   NT_ASSERT(pContext);
   NT_ASSERT(pNetBufferList);
   NT_ASSERT(NT_SUCCESS(pNetBufferList->Status));

   if(pNetBufferList->Status != STATUS_SUCCESS)
      DbgPrintEx(DPFLTR_IHVNETWORK_ID,
                 DPFLTR_ERROR_LEVEL,
                 " !!!! CompleteBasicPacketModification() [status: %#x]\n",
                 pNetBufferList->Status);

   FwpsFreeCloneNetBufferList(pNetBufferList,
                              0);

   BasicPacketModificationCompletionDataDestroy((BASIC_PACKET_MODIFICATION_COMPLETION_DATA**)&pContext);

#if DBG

   DbgPrintEx(DPFLTR_IHVNETWORK_ID,
              DPFLTR_INFO_LEVEL,
              " <--- CompleteBasicPacketModification()\n");

#endif /// DBG

   return;
}