本文整理汇总了C++中DoTraceLevelMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ DoTraceLevelMessage函数的具体用法?C++ DoTraceLevelMessage怎么用?C++ DoTraceLevelMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DoTraceLevelMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WDFEXPORT
NTSTATUS
WDFEXPORT(WdfDeviceIndicateWakeStatus)(
__in
PWDF_DRIVER_GLOBALS DriverGlobals,
__in
WDFDEVICE Device,
__in
NTSTATUS WaitWakeStatus
)
{
NTSTATUS status;
FxDevice *pDevice;
PFX_DRIVER_GLOBALS pFxDriverGlobals;
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals),
Device,
FX_TYPE_DEVICE,
(PVOID *) &pDevice,
&pFxDriverGlobals);
if (Device == NULL ||
WaitWakeStatus == STATUS_PENDING || WaitWakeStatus == STATUS_CANCELLED) {
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
"NULL WDFDEVICE handle %p or invalid %!STATUS!",
Device, WaitWakeStatus);
return STATUS_INVALID_PARAMETER;
}
if (pDevice->m_PkgPnp->m_SharedPower.m_WaitWakeOwner) {
if (pDevice->m_PkgPnp->PowerIndicateWaitWakeStatus(WaitWakeStatus)) {
status = STATUS_SUCCESS;
}
else {
//
// There was no request to complete
//
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
"WDFDEVICE 0x%p No request to complete"
" STATUS_INVALID_DEVICE_REQUEST",
Device);
status = STATUS_INVALID_DEVICE_REQUEST;
}
}
else {
//
// We cannot complete what we do not own
//
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
"WDFDEVICE 0x%p Not the waitwake owner"
" STATUS_INVALID_DEVICE_STATE",
Device);
status = STATUS_INVALID_DEVICE_STATE;
}
return status;
}
示例2: DoTraceLevelMessage
VOID
FxPoxInterface::ComponentIdleCallback(
__in PVOID Context,
__in ULONG Component
)
{
PPOX_SETTINGS poxSettings = NULL;
FxPoxInterface * pThis = NULL;
pThis = (FxPoxInterface*) Context;
DoTraceLevelMessage(
pThis->m_PkgPnp->GetDriverGlobals(),
TRACE_LEVEL_VERBOSE,
TRACINGPNP,
"WDFDEVICE 0x%p !devobj 0x%p PO_FX_COMPONENT_IDLE_CONDITION_CALLBACK "
"invoked.",
pThis->m_PkgPnp->GetDevice()->GetHandle(),
pThis->m_PkgPnp->GetDevice()->GetDeviceObject()
);
//
// If the client driver has specified power framework settings, retrieve
// them.
//
poxSettings = pThis->GetPowerFrameworkSettings();
//
// If the client driver has specified a component-idle callback, invoke it
//
if ((NULL != poxSettings) &&
(NULL != poxSettings->ComponentIdleConditionCallback)) {
DoTraceLevelMessage(
pThis->m_PkgPnp->GetDriverGlobals(),
TRACE_LEVEL_VERBOSE,
TRACINGPNP,
"WDFDEVICE 0x%p !devobj 0x%p Invoking client driver's "
"PO_FX_COMPONENT_IDLE_CONDITION_CALLBACK.",
pThis->m_PkgPnp->GetDevice()->GetHandle(),
pThis->m_PkgPnp->GetDevice()->GetDeviceObject()
);
poxSettings->ComponentIdleConditionCallback(
poxSettings->PoFxDeviceContext,
Component
);
} else {
//
// We're being notified that we're idle, but there is no action that we
// need to take here. We power down the device only when we get the
// device-power-not-required event.
//
PoFxCompleteIdleCondition(pThis->m_PoHandle, Component);
}
return;
}
示例3: DoTraceLevelMessage
VOID
FxInterrupt::ReportInactive(
_In_ BOOLEAN Internal
)
{
IO_REPORT_INTERRUPT_ACTIVE_STATE_PARAMETERS parameters;
FxPkgPnp* fxPkgPnp;
fxPkgPnp = m_Device->m_PkgPnp;
if (Internal == FALSE) {
//
// if the interrupt is not connected, you can't report active or inactive
//
if(m_Connected == FALSE || m_Interrupt == NULL) {
DoTraceLevelMessage(
GetDriverGlobals(), TRACE_LEVEL_WARNING, TRACINGPNP,
"Driver is reporting WDFINTERRUPT %p as being inactive even though"
" it is not connected.", GetHandle());
FxVerifierDbgBreakPoint(GetDriverGlobals());
return;
}
if (fxPkgPnp->m_IoReportInterruptInactive == NULL) {
DoTraceLevelMessage(
GetDriverGlobals(), TRACE_LEVEL_WARNING, TRACINGPNP,
"Driver is calling DDI WdfInterruptReportInactive() on an OS that "
"doesn't support the DDI.");
FxVerifierDbgBreakPoint(GetDriverGlobals());
return;
}
}
//
// No need to report Inactive if interrupt is already Inactive
//
if (m_Active == FALSE) {
return;
}
RtlZeroMemory(¶meters, sizeof(parameters));
if (FxIsProcessorGroupSupported()) {
parameters.Version = CONNECT_FULLY_SPECIFIED_GROUP;
}
else {
parameters.Version = CONNECT_FULLY_SPECIFIED;
}
parameters.ConnectionContext.InterruptObject = m_Interrupt;
fxPkgPnp->m_IoReportInterruptInactive(¶meters);
m_Active = FALSE;
return;
}
示例4: FX_VF_FUNCTION
VOID
FX_VF_FUNCTION(VerifyWdfDeviceWdmDispatchIrp) (
_In_ PFX_DRIVER_GLOBALS FxDriverGlobals,
_In_ PWDF_DRIVER_GLOBALS DriverGlobals,
_In_ FxDevice* device,
_In_ WDFCONTEXT DispatchContext
)
{
UNREFERENCED_PARAMETER(FxDriverGlobals);
FxDriver* driver;
BOOLEAN ctxValid;
PLIST_ENTRY next;
NTSTATUS status;
PAGED_CODE_LOCKED();
status = STATUS_SUCCESS;
driver = GetFxDriverGlobals(DriverGlobals)->Driver;
ctxValid = (PLIST_ENTRY)DispatchContext ==
&device->m_PreprocessInfoListHead ? TRUE : FALSE;
//
// Driver should be a cx.
//
if (device->IsCxDriverInIoPath(driver) == FALSE) {
status = STATUS_INVALID_DEVICE_REQUEST;
DoTraceLevelMessage(
device->GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGIO,
"This API can only be called by wdf extension driver "
"from its pre-process IRP callback, %!STATUS!",
status);
FxVerifierDbgBreakPoint(device->GetDriverGlobals());
}
//
// Validate DispatchContext.
//
for (next = device->m_PreprocessInfoListHead.Flink;
next != &device->m_PreprocessInfoListHead;
next = next->Flink) {
if ((PLIST_ENTRY)DispatchContext == next) {
ctxValid = TRUE;
break;
}
}
if (FALSE == ctxValid) {
status = STATUS_INVALID_PARAMETER;
DoTraceLevelMessage(
device->GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGIO,
"DispatchContext 0x%p is invalid, %!STATUS!",
DispatchContext, status);
FxVerifierDbgBreakPoint(device->GetDriverGlobals());
}
}
示例5: CreateEvent
HRESULT
FxInterruptWaitblock::Initialize(
__in FxInterruptThreadpool* Threadpool,
__in FxInterrupt* Interrupt,
__in PTP_WAIT_CALLBACK WaitCallback
)
{
HRESULT hr = S_OK;
DWORD error;
//
// create a per-interrupt auto-reset event, non-signalled to begin with.
//
m_Event = CreateEvent(
NULL, // LPSECURITY_ATTRIBUTES lpEventAttributes,
FALSE, // BOOL bManualReset,
FALSE, // BOOL bInitialState,
NULL // LPCTSTR lpName
);
if (m_Event == NULL) {
error = GetLastError();
hr = HRESULT_FROM_WIN32(error);
DoTraceLevelMessage(GetDriverGlobals(),
TRACE_LEVEL_ERROR, TRACINGPNP,
"Event creation failed for FxInterrupt object"
" %!winerr!", error);
goto exit;
}
//
// create a per-interrupt thread pool wait structure. This wait structure is
// needed to associate an event-based wait callback with threadpool.
//
m_Wait = Threadpool->CreateThreadpoolWait(WaitCallback,
Interrupt);
if (m_Wait == NULL) {
error = GetLastError();
hr = HRESULT_FROM_WIN32(error);
DoTraceLevelMessage(GetDriverGlobals(),
TRACE_LEVEL_ERROR, TRACINGPNP,
"Event creation failed for FxInterrupt object"
" %!winerr!", error);
goto exit;
}
exit:
return hr;
}
示例6: GetDriverGlobals
VOID
FxWorkItem::Enqueue(
VOID
)
{
PFX_DRIVER_GLOBALS pFxDriverGlobals;
KIRQL irql;
BOOLEAN enqueue;
pFxDriverGlobals = GetDriverGlobals();
enqueue = FALSE;
Lock(&irql);
if (m_Enqueued) {
DoTraceLevelMessage(
pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGDEVICE,
"Previously queued WDFWORKITEM 0x%p is already pending. "
"Ignoring the request to queue again", GetHandle());
}
else if (m_RunningDown) {
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGDEVICE,
"WDFWORKITEM 0x%p is already deleted", GetHandle());
FxVerifierDbgBreakPoint(pFxDriverGlobals);
}
else {
m_WorkItemCompleted.Clear();
m_Enqueued = TRUE;
//
// We are going to enqueue the work item. Reference this FxWorkItem
// object and Globals while they are outstanding.
// These will be released when the workitem completes.
//
ADDREF(WorkItemThunk);
pFxDriverGlobals->ADDREF(WorkItemThunk);
enqueue = TRUE;
}
Unlock(irql);
if (enqueue) {
m_WorkItem. Enqueue(FxWorkItem::WorkItemThunk, this);
}
return;
}
示例7: FX_VERIFY
HRESULT
FxInterruptWaitblock::_CreateAndInit(
_In_ FxInterruptThreadpool* Threadpool,
_In_ FxInterrupt* Interrupt,
_In_ PTP_WAIT_CALLBACK WaitCallback,
_Out_ FxInterruptWaitblock** Waitblock
)
{
HRESULT hr = S_OK;
FxInterruptWaitblock* waitblock = NULL;
PFX_DRIVER_GLOBALS driverGlobals;
FX_VERIFY(INTERNAL, CHECK_NOT_NULL(Waitblock));
*Waitblock = NULL;
driverGlobals = Interrupt->GetDriverGlobals();
//
// create an instance of interrupt wait block
//
waitblock = new (driverGlobals) FxInterruptWaitblock(driverGlobals);
if (waitblock == NULL) {
hr = E_OUTOFMEMORY;
DoTraceLevelMessage(driverGlobals,
TRACE_LEVEL_ERROR, TRACINGPNP,
"Waitblock creation failed %!hresult!", hr);
goto exit;
}
hr = waitblock->Initialize(Threadpool,
Interrupt,
WaitCallback);
if (SUCCEEDED(hr)) {
*Waitblock = waitblock;
}
else {
DoTraceLevelMessage(driverGlobals,
TRACE_LEVEL_ERROR, TRACINGPNP,
"Waitblock init failed %!hresult!", hr);
}
exit:
if(FAILED(hr) && waitblock != NULL) {
delete waitblock;
}
return hr;
}
示例8: DoTraceLevelMessage
FxDriver::~FxDriver()
{
// Make it always present right now even on free builds
if (IsDisposed() == FALSE) {
DoTraceLevelMessage(
GetDriverGlobals(), TRACE_LEVEL_FATAL, TRACINGDRIVER,
"FxDriver 0x%p not disposed: this maybe a driver reference count "
"problem with WDFDRIVER 0x%p", this, GetObjectHandleUnchecked());
FxVerifierBugCheck(GetDriverGlobals(),
WDF_OBJECT_ERROR,
(ULONG_PTR) GetObjectHandleUnchecked(),
(ULONG_PTR) this);
}
//
// Free the memory for the registry path if required.
//
if (m_RegistryPath.Buffer) {
FxPoolFree(m_RegistryPath.Buffer);
}
if (m_DisposeList != NULL) {
m_DisposeList->DeleteObject();
}
#if FX_IS_USER_MODE
//
// Close the R/W handle to the driver's service parameters key
// that we opened during Initialize.
//
if (m_DriverParametersKey != NULL) {
NTSTATUS status = FxRegKey::_Close(m_DriverParametersKey);
if (!NT_SUCCESS(status)) {
DoTraceLevelMessage(GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGDRIVER,
"Cannot close Driver Parameters key %!STATUS!",
status);
}
m_DriverParametersKey = NULL;
}
//
// The host-created driver object holds a reference to this
// FxDriver object. Clear it, since this object was deleted.
//
ClearDriverObjectFxDriver();
#endif
}
示例9: WDFEXPORT
NTSTATUS
WDFAPI
WDFEXPORT(WdfUsbTargetPipeReadSynchronously)(
__in
PWDF_DRIVER_GLOBALS DriverGlobals,
__in
WDFUSBPIPE Pipe,
__in_opt
WDFREQUEST Request,
__in_opt
PWDF_REQUEST_SEND_OPTIONS RequestOptions,
__in_opt
PWDF_MEMORY_DESCRIPTOR MemoryDescriptor,
__out_opt
PULONG BytesRead
)
{
DDI_ENTRY();
DoTraceLevelMessage(GetFxDriverGlobals(DriverGlobals), TRACE_LEVEL_VERBOSE, TRACINGIOTARGET,
"WDFUSBPIPE %p", Pipe);
return FxUsbPipe::_SendTransfer(
GetFxDriverGlobals(DriverGlobals),
Pipe,
Request,
RequestOptions,
MemoryDescriptor,
BytesRead,
USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK
);
}
示例10: FxPackage
FxPkgIo::FxPkgIo(
__in PFX_DRIVER_GLOBALS FxDriverGlobals,
__in CfxDevice *Device
) :
FxPackage(FxDriverGlobals, Device, FX_TYPE_PACKAGE_IO),
m_InCallerContextCallback(FxDriverGlobals)
{
LARGE_INTEGER tickCount;
m_Device = Device;
m_DefaultQueue = NULL;
RtlZeroMemory(m_DispatchTable, sizeof(m_DispatchTable));
m_Filter = FALSE;
m_PowerStateOn = FALSE;
m_QueuesAreShuttingDown = FALSE;
InitializeListHead(&m_IoQueueListHead);
InitializeListHead(&m_DynamicDispatchInfoListHead);
Mx::MxQueryTickCount(&tickCount);
m_RandomSeed = tickCount.LowPart;
DoTraceLevelMessage(FxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIO,
"Constructed FxPkgIo 0x%p",this);
}
示例11: DoTraceLevelMessage
VOID
FxPkgIo::ResetStateForRestart(
VOID
)
/*++
Routine Description:
This is called on a device which has been restarted from the removed
state. It will reset purged queues so that they can accept new requests
when ResumeProcessingForPower is called afterwards.
Arguments:
None
Return Value:
None
--*/
{
KIRQL irql;
FxIoQueue* queue;
SINGLE_LIST_ENTRY queueList, *ple;
DoTraceLevelMessage(GetDriverGlobals(), TRACE_LEVEL_INFORMATION, TRACINGIO,
"Restart queues from purged state for WDFDEVICE 0x%p due to "
"device restart", m_Device->GetHandle());
queueList.Next = NULL;
Lock(&irql);
GetIoQueueListLocked(&queueList, FxIoQueueIteratorListPowerOn);
Unlock(irql);
for (ple = PopEntryList(&queueList);
ple != NULL;
ple = PopEntryList(&queueList)) {
queue = FxIoQueue::_FromPowerSListEntry(ple);
queue->ResetStateForRestart();
ple->Next = NULL;
queue->RELEASE(IO_ITERATOR_POWER_TAG);
}
Lock(&irql);
m_PowerStateOn = TRUE;
m_QueuesAreShuttingDown = FALSE;
Unlock(irql);
return;
}
示例12: GetDriverGlobals
_Must_inspect_result_
NTSTATUS
FxPkgIo::FlushAllQueuesByFileObject(
__in MdFileObject FileObject
)
/*++
Routine Description:
Enumerate all the queues and cancel the requests that have
the same fileobject as the Cleanup IRP.
We are making an assumption that cleanup irps are sent only
at passive-level.
Return Value:
NTSTATUS
--*/
{
FxIoQueue* queue = NULL;
PFX_DRIVER_GLOBALS pFxDriverGlobals = GetDriverGlobals();
FxIoQueueNode flushBookmark(FxIoQueueNodeTypeBookmark);
KIRQL irql;
if(Mx::MxGetCurrentIrql() != PASSIVE_LEVEL) {
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIO,
"Currently framework allow flushing of queues "
"by fileobject on cleanup only at PASSIVE_LEVEL");
FxVerifierDbgBreakPoint(pFxDriverGlobals);
return STATUS_SUCCESS;
}
//
// Iterate through the queue list and flush each one.
//
Lock(&irql);
queue = GetFirstIoQueueLocked(&flushBookmark, IO_ITERATOR_FLUSH_TAG);
Unlock(irql);
while(queue != NULL) {
queue->FlushByFileObject(FileObject);
queue->RELEASE(IO_ITERATOR_FLUSH_TAG);
Lock(&irql);
queue = GetNextIoQueueLocked(&flushBookmark, IO_ITERATOR_FLUSH_TAG);
Unlock(irql);
}
return STATUS_SUCCESS;
}
示例13: WDFEXPORT
VOID
WDFEXPORT(WdfCollectionRemove)(
__in
PWDF_DRIVER_GLOBALS DriverGlobals,
__in
WDFCOLLECTION Collection,
__in
WDFOBJECT Item
)
{
DDI_ENTRY();
PFX_DRIVER_GLOBALS pFxDriverGlobals;
FxCollection *pCollection;
FxCollectionEntry *pEntry;
FxObject* pObject;
NTSTATUS status;
KIRQL irql;
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals),
Collection,
FX_TYPE_COLLECTION,
(PVOID*) &pCollection,
&pFxDriverGlobals);
FxObjectHandleGetPtr(pFxDriverGlobals,
Item,
FX_TYPE_OBJECT,
(PVOID*) &pObject);
pCollection->Lock(&irql);
pEntry = pCollection->FindEntryByObject(pObject);
if (pEntry != NULL) {
pCollection->CleanupEntry(pEntry);
status = STATUS_SUCCESS;
}
else {
pObject = NULL;
status = STATUS_NOT_FOUND;
}
pCollection->Unlock(irql);
if (pObject != NULL) {
pCollection->CleanupEntryObject(pObject);
}
if (!NT_SUCCESS(status)) {
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGERROR,
"WDFOBJECT %p not in WDFCOLLECTION %p, %!STATUS!",
Item, Collection, status);
FxVerifierDbgBreakPoint(pFxDriverGlobals);
}
}
示例14: WDFEXPORT
NTSTATUS
WDFEXPORT(WdfWmiProviderCreate)(
__in
PWDF_DRIVER_GLOBALS DriverGlobals,
__in
WDFDEVICE Device,
__in
PWDF_WMI_PROVIDER_CONFIG WmiProviderConfig,
__in_opt
PWDF_OBJECT_ATTRIBUTES ProviderAttributes,
__out
WDFWMIPROVIDER* WmiProvider
)
{
FxDevice* pDevice;
FxPowerPolicyOwnerSettings* ownerSettings;
FxWmiProvider* pProvider;
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals),
Device,
FX_TYPE_DEVICE,
(PVOID*) &pDevice);
FxPointerNotNull(GetFxDriverGlobals(DriverGlobals), WmiProviderConfig);
FxPointerNotNull(GetFxDriverGlobals(DriverGlobals), WmiProvider);
//
// If the Device is a power policy owner then do not allow client drivers
// to register for GUID_POWER_DEVICE_ENABLE or GUID_POWER_DEVICE_WAKE_ENABLE
// if the framework has already register a provider for those guids.
//
if (pDevice->m_PkgPnp->IsPowerPolicyOwner()) {
ownerSettings = pDevice->m_PkgPnp->m_PowerPolicyMachine.m_Owner;
if ((FxIsEqualGuid(&WmiProviderConfig->Guid,
&GUID_POWER_DEVICE_ENABLE) &&
ownerSettings->m_IdleSettings.WmiInstance != NULL) ||
(FxIsEqualGuid(&WmiProviderConfig->Guid,
&GUID_POWER_DEVICE_WAKE_ENABLE) &&
ownerSettings->m_WakeSettings.WmiInstance != NULL)) {
DoTraceLevelMessage(GetFxDriverGlobals(DriverGlobals), TRACE_LEVEL_ERROR,
TRACINGDEVICE, "WMI Guid already registered by "
"framework");
return STATUS_WMI_GUID_DISCONNECTED;
}
}
return FxWmiProvider::_Create(GetFxDriverGlobals(DriverGlobals),
Device,
ProviderAttributes,
WmiProviderConfig,
WmiProvider,
&pProvider);
}
示例15: DoTraceLevelMessage
_Must_inspect_result_
NTSTATUS
FxPkgFdo::_PnpQueryPnpDeviceState(
__inout FxPkgPnp* This,
__inout FxIrp *Irp
)
/*++
Routine Description:
This method is invoked in response to a Pnp QueryPnpDeviceState IRP.
Arguments:
Irp - a pointer to the FxIrp
Returns:
NTSTATUS
--*/
{
FxPkgFdo* pThis;
NTSTATUS status;
pThis = (FxPkgFdo*) This;
status = pThis->SendIrpSynchronously(Irp);
if (status == STATUS_NOT_SUPPORTED) {
//
// Morph into a successful code so that we process the request
//
status = STATUS_SUCCESS;
Irp->SetStatus(status);
}
if (NT_SUCCESS(status)) {
pThis->HandleQueryPnpDeviceStateCompletion(Irp);
}
else {
DoTraceLevelMessage(
This->GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
"Lower stack returned error for query pnp device state, %!STATUS!",
status);
}
//
// Since we already sent the request down the stack, we must complete it
// now.
//
return pThis->CompletePnpRequest(Irp, status);
}