Skip to content

Commit

Permalink
Remove some optional passthrough functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Apr 27, 2018
1 parent dbf5b32 commit 3833549
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 290 deletions.
198 changes: 0 additions & 198 deletions packetWin7/npf/npf/Openclos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,50 +1461,6 @@ NPF_CreateOpenObject(
return Open;
}

//-------------------------------------------------------------------

_Use_decl_annotations_
NDIS_STATUS
NPF_RegisterOptions(
NDIS_HANDLE NdisFilterHandle,
NDIS_HANDLE FilterDriverContext
)
/*++
Routine Description:
Register optional handlers with NDIS. This sample does not happen to
have any optional handlers to register, so this routine does nothing
and could simply have been omitted. However, for illustrative purposes,
it is presented here.
Arguments:
NdisFilterHandle - pointer the driver handle received from
NdisFRegisterFilterDriver
FilterDriverContext - pointer to our context passed into
NdisFRegisterFilterDriver
Return Value:
NDIS_STATUS_SUCCESS
--*/
{
TRACE_ENTER();

ASSERT(FilterDriverContext == (NDIS_HANDLE)FilterDriverObject);
if (FilterDriverContext != (NDIS_HANDLE)FilterDriverObject)
{
IF_LOUD(DbgPrint("NPF_RegisterOptions: driver doesn't match error, FilterDriverContext = %p, FilterDriverObject = %p.\n", FilterDriverContext, FilterDriverObject);)
return NDIS_STATUS_INVALID_PARAMETER;
}

TRACE_EXIT();

return NDIS_STATUS_SUCCESS;
}

//-------------------------------------------------------------------

Expand Down Expand Up @@ -2228,50 +2184,6 @@ Routine Description:
TRACE_EXIT();
}

//-------------------------------------------------------------------

_Use_decl_annotations_
VOID
NPF_Status(
NDIS_HANDLE FilterModuleContext,
PNDIS_STATUS_INDICATION StatusIndication
)
/*++
Routine Description:
Status indication handler
Arguments:
FilterModuleContext - our filter context
StatusIndication - the status being indicated
NOTE: called at <= DISPATCH_LEVEL
FILTER driver may call NdisFIndicateStatus to generate a status indication to
all higher layer modules.
--*/
{
POPEN_INSTANCE Open = (POPEN_INSTANCE) FilterModuleContext;

// TRACE_ENTER();
// IF_LOUD(DbgPrint("NPF: Status Indication\n");)

IF_LOUD(DbgPrint("status %x\n", StatusIndication->StatusCode);)

//
// The filter may do processing on the status indication here, including
// intercepting and dropping it entirely. However, the sample does nothing
// with status indications except pass them up to the higher layer. It is
// more efficient to omit the FilterStatus handler entirely if it does
// nothing, but it is included in this sample for illustrative purposes.
//
NdisFIndicateStatus(Open->AdapterHandle, StatusIndication);

/* TRACE_EXIT();*/
}

//-------------------------------------------------------------------

Expand Down Expand Up @@ -2377,117 +2289,7 @@ NOTE: called at PASSIVE_LEVEL
return Status;
}

//-------------------------------------------------------------------

_Use_decl_annotations_
VOID
NPF_ReturnEx(
NDIS_HANDLE FilterModuleContext,
PNET_BUFFER_LIST NetBufferLists,
ULONG ReturnFlags
)
/*++

Routine Description:
FilterReturnNetBufferLists handler.
FilterReturnNetBufferLists is an optional function. If provided, NDIS calls
FilterReturnNetBufferLists to return the ownership of one or more NetBufferLists
and their embedded NetBuffers to the filter driver. If this handler is NULL, NDIS
will skip calling this filter when returning NetBufferLists to the underlying
miniport and will call the next lower driver in the stack. A filter that doesn't
provide a FilterReturnNetBufferLists handler cannot originate a receive indication
on its own.
Arguments:
FilterInstanceContext - our filter context area
NetBufferLists - a linked list of NetBufferLists that this
filter driver indicated in a previous call to
NdisFIndicateReceiveNetBufferLists
ReturnFlags - flags specifying if the caller is at DISPATCH_LEVEL
--*/
{
POPEN_INSTANCE Open = (POPEN_INSTANCE) FilterModuleContext;
PNET_BUFFER_LIST CurrNbl = NetBufferLists;
UINT NumOfNetBufferLists = 0;
BOOLEAN DispatchLevel;
ULONG Ref;

/* TRACE_ENTER();*/

// Return the received NBLs. If you removed any NBLs from the chain, make
// sure the chain isn't empty (i.e., NetBufferLists!=NULL).
NdisFReturnNetBufferLists(Open->AdapterHandle, NetBufferLists, ReturnFlags);

/* TRACE_EXIT();*/
}

//-------------------------------------------------------------------

_Use_decl_annotations_
VOID
NPF_CancelSendNetBufferLists(
NDIS_HANDLE FilterModuleContext,
PVOID CancelId
)
/*++
Routine Description:
This function cancels any NET_BUFFER_LISTs pended in the filter and then
calls the NdisFCancelSendNetBufferLists to propagate the cancel operation.
If your driver does not queue any send NBLs, you may omit this routine.
NDIS will propagate the cancelation on your behalf more efficiently.
Arguments:
FilterModuleContext - our filter context area.
CancelId - an identifier for all NBLs that should be dequeued
Return Value:
None
*/
{
POPEN_INSTANCE Open = (POPEN_INSTANCE) FilterModuleContext;

NdisFCancelSendNetBufferLists(Open->AdapterHandle, CancelId);
}

//-------------------------------------------------------------------

_Use_decl_annotations_
NDIS_STATUS
NPF_SetModuleOptions(
NDIS_HANDLE FilterModuleContext
)
/*++
Routine Description:
This function set the optional handlers for the filter
Arguments:
FilterModuleContext: The FilterModuleContext given to NdisFSetAttributes
Return Value:
NDIS_STATUS_SUCCESS
NDIS_STATUS_RESOURCES
NDIS_STATUS_FAILURE
--*/
{
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
UNREFERENCED_PARAMETER(FilterModuleContext);

return Status;
}

//-------------------------------------------------------------------

Expand Down
5 changes: 0 additions & 5 deletions packetWin7/npf/npf/Packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,24 +514,19 @@ NPF_registerLWF(
pFChars->ServiceName = ServiceName;
}

pFChars->SetOptionsHandler = NPF_RegisterOptions;
pFChars->AttachHandler = NPF_AttachAdapter;
pFChars->DetachHandler = NPF_DetachAdapter;
pFChars->RestartHandler = NPF_Restart;
pFChars->PauseHandler = NPF_Pause;
pFChars->SetFilterModuleOptionsHandler = NPF_SetModuleOptions;
pFChars->OidRequestHandler = NPF_OidRequest;
pFChars->OidRequestCompleteHandler = NPF_OidRequestComplete;
pFChars->CancelOidRequestHandler = NPF_CancelOidRequest;

pFChars->SendNetBufferListsHandler = NPF_SendEx;
pFChars->ReturnNetBufferListsHandler = NPF_ReturnEx;
pFChars->SendNetBufferListsCompleteHandler = NPF_SendCompleteEx;
pFChars->ReceiveNetBufferListsHandler = NPF_TapEx;
pFChars->DevicePnPEventNotifyHandler = NPF_DevicePnPEventNotify;
pFChars->NetPnPEventHandler = NPF_NetPnPEvent;
pFChars->StatusHandler = NPF_Status;
pFChars->CancelSendNetBufferListsHandler = NPF_CancelSendNetBufferLists;
}

//-------------------------------------------------------------------
Expand Down
87 changes: 0 additions & 87 deletions packetWin7/npf/npf/Packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,6 @@ extern struct time_conv G_Start_Time; // from openclos.c
* @{
*/

FILTER_SET_OPTIONS NPF_RegisterOptions;


/*!
\brief Callback for NDIS AttachHandler. Not used by NPF.
Expand Down Expand Up @@ -603,16 +601,6 @@ FILTER_CANCEL_OID_REQUEST NPF_CancelOidRequest;

FILTER_OID_REQUEST_COMPLETE NPF_OidRequestComplete;

/*!
\brief Callback for NDIS StatusHandler. Not used by NPF
*/
FILTER_STATUS NPF_Status;
// VOID
// NPF_Status(
// NDIS_HANDLE FilterModuleContext,
// PNDIS_STATUS_INDICATION StatusIndication
// );


/*!
\brief Device PNP event handler.
Expand Down Expand Up @@ -669,30 +657,6 @@ FILTER_SEND_NET_BUFFER_LISTS NPF_SendEx;
// );


/*!
\brief Callback for NDIS ReturnNetBufferListsHandler.
\param FilterModuleContext Pointer to the filter context structure.
\param NetBufferLists A linked list of NetBufferLists that this
filter driver indicated in a previous call to
NdisFIndicateReceiveNetBufferLists.
\param ReturnFlags Flags specifying if the caller is at DISPATCH_LEVEL.
FilterReturnNetBufferLists is an optional function. If provided, NDIS calls
FilterReturnNetBufferLists to return the ownership of one or more NetBufferLists
and their embedded NetBuffers to the filter driver. If this handler is NULL, NDIS
will skip calling this filter when returning NetBufferLists to the underlying
miniport and will call the next lower driver in the stack. A filter that doesn't
provide a FilterReturnNetBufferLists handler cannot originate a receive indication
on its own.
*/
FILTER_RETURN_NET_BUFFER_LISTS NPF_ReturnEx;
// VOID
// NPF_ReturnEx(
// NDIS_HANDLE FilterModuleContext,
// PNET_BUFFER_LIST NetBufferLists,
// ULONG ReturnFlags
// );

/*!
\brief Function to free the Net Buffer Lists initiated by ourself.
*/
Expand Down Expand Up @@ -754,39 +718,6 @@ FILTER_RECEIVE_NET_BUFFER_LISTS NPF_TapEx;
// );


/*!
\brief Callback for NDIS CancelSendNetBufferListsHandler.
\param FilterModuleContext Pointer to the filter context structure.
\param CancelId An identifier for all NBLs that should be dequeued.
This function cancels any NET_BUFFER_LISTs pended in the filter and then
calls the NdisFCancelSendNetBufferLists to propagate the cancel operation.
If your driver does not queue any send NBLs, you may omit this routine.
NDIS will propagate the cancelation on your behalf more efficiently.
*/
FILTER_CANCEL_SEND_NET_BUFFER_LISTS NPF_CancelSendNetBufferLists;
// VOID
// NPF_CancelSendNetBufferLists(
// NDIS_HANDLE FilterModuleContext,
// PVOID CancelId
// );


/*!
\brief Callback for NDIS SetFilterModuleOptionsHandler.
\param FilterModuleContext Pointer to the filter context structure.
\return NDIS_STATUS_SUCCESS
NDIS_STATUS_RESOURCES
NDIS_STATUS_FAILURE
This function set the optional handlers for the filter. Not used by NPF
*/
FILTER_SET_MODULE_OPTIONS NPF_SetModuleOptions;
// NDIS_STATUS
// NPF_SetModuleOptions(
// NDIS_HANDLE FilterModuleContext
// );

/*!
\brief Get the physical medium of the adapter.
\param FilterModuleContext Pointer to the filter context structure.
Expand Down Expand Up @@ -1196,24 +1127,6 @@ NPF_LoopbackSendNetBufferLists(
);
#endif

/*!
\brief Callback for NDIS StatusHandler. Not used by NPF
*/
VOID
NPF_StatusEx(
IN NDIS_HANDLE ProtocolBindingContext,
IN PNDIS_STATUS_INDICATION StatusIndication
);


/*!
\brief Callback for NDIS StatusCompleteHandler. Not used by NPF
*/
VOID
NPF_StatusComplete(
IN NDIS_HANDLE ProtocolBindingContext
);


/*!
\brief Function that serves the user's reads.
Expand Down

0 comments on commit 3833549

Please sign in to comment.