diff options
| author | J M Rossy <[email protected]> | 2015-07-29 15:40:09 -0700 |
|---|---|---|
| committer | J M Rossy <[email protected]> | 2015-07-29 16:34:40 -0700 |
| commit | 5d61a4a79a1e96dc5d9af1e5e712c84507307544 (patch) | |
| tree | 49ed270893578cd18758b74ffcca16dc7ab948d6 /network/trans/WFPSampler/sys/SubscriptionFunctions_BFEState.cpp | |
| parent | 5d41613e26e147d2300c786bb2b34cb4b4067a25 (diff) | |
Samples update for public Windows 10 release
Fix #2 Enabling WPP Recorder in Sensors Samples causes errors
Fix #4 Add back fixed KMDOD sample
Add new BarcodeScanner sample in pos folder
Add new MagneticStripeReader sample in pos folder
Add new SynpaticsTouch sample in input folder
Add new Power Engine Plugin sample in pofx folder
Add new DeviceMft sample in avstream folder
Add new AvsCamera sample in root
Add new SimBatt sample in root
Add other pre-existing samples not yet released for Win10
Diffstat (limited to 'network/trans/WFPSampler/sys/SubscriptionFunctions_BFEState.cpp')
| -rw-r--r-- | network/trans/WFPSampler/sys/SubscriptionFunctions_BFEState.cpp | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/network/trans/WFPSampler/sys/SubscriptionFunctions_BFEState.cpp b/network/trans/WFPSampler/sys/SubscriptionFunctions_BFEState.cpp new file mode 100644 index 00000000..8c141627 --- /dev/null +++ b/network/trans/WFPSampler/sys/SubscriptionFunctions_BFEState.cpp @@ -0,0 +1,99 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) 2014 Microsoft Corporation. All Rights Reserved. +// +// Module Name: +// SubscriptionFunctions_BFEState.cpp +// +// Abstract: +// This module contains WFP callback functions for changes in the BFE state. +// +// Naming Convention: +// +// <Module><Scenario> +// +// i.e. +// +// SubscriptionBFEStateChangeCallback +// +// <Module> +// Subscription - Function pertains to a subscription. +// <Scenario> +// BFEStateChangeCallback - Function demonstates use of the BFE service state change +// callback. +// +// Author: +// Dusty Harper (DHarper) +// +// Revision History: +// +// [ Month ][Day] [Year] - [Revision]-[ Comments ] +// May 01, 2010 - 1.0 - Creation +// December 13, 2013 - 1.1 - Enhance function declaration for IntelliSense +// +//////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "Framework_WFPSamplerCalloutDriver.h" /// . +#include "SubscriptionFunctions_BFEState.tmh" /// $(OBJ_PATH)\$(O)\ + +/** + @notify_function="SubscriptionBFEStateChangeCallback" + + Purpose: Callback, invoked on BFE service state change, which will get or release a handle + to the engine. <br> + <br> + Notes: <br> + <br> + MSDN_Ref: HTTP://MSDN.Microsoft.com/En-US/Library/Windows/Hardware/FF550062.aspx <br> +*/ +_IRQL_requires_(PASSIVE_LEVEL) +_IRQL_requires_same_ +VOID CALLBACK SubscriptionBFEStateChangeCallback(_Inout_ VOID* pContext, + _In_ FWPM_SERVICE_STATE bfeState) +{ +#if DBG + + DbgPrintEx(DPFLTR_IHVNETWORK_ID, + DPFLTR_INFO_LEVEL, + " ---> SubscriptionBFEStateChangeCallback()\n"); + +#endif /// DBG + + NT_ASSERT(pContext); + + NTSTATUS status = STATUS_SUCCESS; + WFPSAMPLER_DEVICE_DATA* pDeviceData = (WFPSAMPLER_DEVICE_DATA*)pContext; + + switch(bfeState) + { + case FWPM_SERVICE_RUNNING: + { + if(pDeviceData->pEngineHandle == 0) + { + status = KrnlHlprFwpmSessionCreateEngineHandle(&(pDeviceData->pEngineHandle)); + HLPR_BAIL_ON_FAILURE(status); + } + + break; + } + case FWPM_SERVICE_STOP_PENDING: + { + KrnlHlprFwpmSessionDestroyEngineHandle(&(pDeviceData->pEngineHandle)); + + break; + } + } + + HLPR_BAIL_LABEL: + +#if DBG + + DbgPrintEx(DPFLTR_IHVNETWORK_ID, + DPFLTR_INFO_LEVEL, + " <--- SubscriptionBFEStateChangeCallback() [status: %#x]\n", + status); + +#endif /// DBG + + return; +} |
