[WDF] Fix KMDF so it can compile with ReactOS SDK
Not all files are included, but these are necessary to compile cdrom driver.
So far it can only be statically linked with drivers, a proper
implementation requires wdfldr helper driver
···4444// available in public symbols. Various WDFKD debug commands use these
4545// internal structures to provide information about WDF.
4646//-----------------------------------------------------------------------------
4747-#include "FxIFR.h"
4747+#include "fxifr.h"
48484949extern "C" {
5050···78787979extern "C" {
80808181-#include "FxDynamics.h"
8181+#include "fxdynamics.h"
82828383-#include "FxLibraryCommon.h"
8383+#include "fxlibrarycommon.h"
84848585#define KMDF_DEFAULT_NAME "Wdf" ## \
8686 LITERAL(__WDF_MAJOR_VERSION_STRING) ## \
···2222#include "fxwmipch.hpp"
23232424extern "C" {
2525-#include "FxWmiInstance.tmh"
2525+// #include "FxWmiInstance.tmh"
2626}
27272828FxWmiInstance::FxWmiInstance(
···5656 // of instances. If we don't do this, the provider will have a list which
5757 // contains entries which have been freed.
5858 //
5959- return __super::Dispose();
5959+ return FxNonPagedObject::Dispose(); // __super call
6060}
61616262_Must_inspect_result_
···2222--*/
23232424#include "coreprivshared.hpp"
2525-#include "FxNPagedLookasideList.hpp"
2626-#include "FxMemoryBufferFromLookaside.hpp"
2525+#include "fxnpagedlookasidelist.hpp"
2626+#include "fxmemorybufferfromlookaside.hpp"
27272828FxMemoryBufferFromLookaside::FxMemoryBufferFromLookaside(
2929 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
···215215 // within the destructor b/c then all parent objects would be destructing on
216216 // freed pool.
217217 //
218218- FxMemoryBufferFromLookaside::~FxMemoryBufferFromLookaside();
218218+ this->~FxMemoryBufferFromLookaside();
219219220220 //
221221 // After FxLookaside::Reclaim, this no longer points to valid memory so we
···268268 //
269269 // Free the object itself
270270 //
271271- __super::SelfDestruct();
271271+ FxMemoryBufferFromLookaside::SelfDestruct(); // __super call
272272}
273273274274_Must_inspect_result_
···26262727// Tracing support
2828extern "C" {
2929-#include "FxSyncRequest.tmh"
2929+// #include "FxSyncRequest.tmh"
3030}
31313232FxSyncRequest::FxSyncRequest(
···126126 // Release the initial reference taken on create. Use the base release call
127127 // so that we don't unnecessarily set the event unless we have to.
128128 //
129129- count = __super::RELEASE(NULL);
129129+ count = FxRequestBase::RELEASE(NULL); // __super call
130130131131 //
132132 // For a driver supplied request(m_TrueRequest) the request context is
···26262727#include "coreprivshared.hpp"
28282929-#include "FxWorkItem.hpp"
2929+#include "fxworkitem.hpp"
30303131#if (FX_CORE_MODE == FX_CORE_USER_MODE)
3232//
···37373838// Tracing support
3939extern "C" {
4040-#include "FxWorkItem.tmh"
4040+// #include "FxWorkItem.tmh"
4141}
42424343FxWorkItem::FxWorkItem(
···319319 // object and Globals while they are outstanding.
320320 // These will be released when the workitem completes.
321321 //
322322- ADDREF(WorkItemThunk);
323323- pFxDriverGlobals->ADDREF(WorkItemThunk);
322322+ ADDREF((PVOID)WorkItemThunk);
323323+ pFxDriverGlobals->ADDREF((PVOID)WorkItemThunk);
324324325325 enqueue = TRUE;
326326 }
···436436 // Release the reference on the FxWorkItem and Globals taken when Enqueue
437437 // was done. This may release the FxWorkItem if it is running down.
438438 //
439439- pWorkItem->RELEASE(WorkItemThunk);
439439+ pWorkItem->RELEASE((PVOID)WorkItemThunk);
440440441441 //
442442 // This may release the driver if it is running down.
443443 //
444444- pFxDriverGlobals->RELEASE(WorkItemThunk);
444444+ pFxDriverGlobals->RELEASE((PVOID)WorkItemThunk);
445445}
446446447447VOID
···2525#ifndef _FXDRIVER_H_
2626#define _FXDRIVER_H_
27272828-#include "FxDriverCallbacks.hpp"
2828+#include "fxdrivercallbacks.hpp"
292930303131//
···4646// Unique value to retrieve the FxDriver* from the MdDriverObject. Use a value
4747// that is not exposed to the driver writer through the dispatch table or WDM.
4848//
4949-#define FX_DRIVER_ID (FxDriver::GetFxDriver)
4949+#define FX_DRIVER_ID ((PVOID)FxDriver::GetFxDriver)
50505151//
5252// The following are support classes for FxDriver
···321321 break;
322322323323 default:
324324- return __super::QueryInterface(Params);
324324+ return FxNonPagedObject::QueryInterface(Params); // __super call
325325 }
326326327327 return STATUS_SUCCESS;
···340340 //
341341 ASSERT(Mx::MxGetCurrentIrql() == PASSIVE_LEVEL);
342342343343- __super::DeleteObject();
343343+ FxNonPagedObject::DeleteObject(); // __super call
344344 }
345345346346 virtual
···6666// We cannot define FxHandleValueMask as an enumerant in FxHandleFlags because
6767// an enum is limited to sizeof(ULONG), which doesn't work for us on a 64 bit OS
6868//
6969-extern __declspec(selectany) const ULONG_PTR FxHandleValueMask = (~((ULONG_PTR) FxHandleFlagMask));
6969+extern DECLSPEC_SELECTANY const ULONG_PTR FxHandleValueMask = (~((ULONG_PTR) FxHandleFlagMask));
70707171//
7272// The type itself is aligned, but the pointer is not b/c those interested in the
···114114// 1) have its size rounded up to an alignment value
115115// 2) extra size and context header appended to the allocation
116116//
117117-enum FxObjectType {
117117+enum FxObjectType : UINT32 {
118118 FxObjectTypeInvalid = 0,
119119 FxObjectTypeInternal,
120120 FxObjectTypeExternal,
···2828292930303131-#include "FxPkgIoShared.hpp"
3232-#include "FxIrpDynamicDispatchInfo.hpp"
3333-#include "FxDeviceCallbacks.hpp"
3434-#include "FxCxDeviceInfo.hpp"
3131+#include "fxpkgioshared.hpp"
3232+#include "fxirpdynamicdispatchinfo.hpp"
3333+#include "fxdevicecallbacks.hpp"
3434+#include "fxcxdeviceinfo.hpp"
35353636//
3737// This flag is or-ed with a pointer value that is ptr aligned, only lower 2 bits are available.
···44#ifndef _FXUSBPIPE_H_
55#define _FXUSBPIPE_H_
6677-#include "FxUsbRequestContext.hpp"
88-#include "FxUsbInterface.hpp"
77+#include "fxusbrequestcontext.hpp"
88+#include "fxusbinterface.hpp"
991010//
1111// Technically, EHCI can support 4MB, but the usb driver stack doesn't
···127127 //
128128 // Release the other buffer and all __super related fields
129129 //
130130- __super::ReleaseAndRestore(Request);
130130+ FxRequestContext::ReleaseAndRestore(Request); // __super call
131131}
132132133133__inline
···6666 //
6767 // Release the other buffer and all __super related fields
6868 //
6969- __super::ReleaseAndRestore(Request);
6969+ FxRequestContext::ReleaseAndRestore(Request); // __super call
7070}
71717272__inline
···11//
22// Copyright (C) Microsoft. All rights reserved.
33//
44-#include "..\ioprivshared.hpp"
44+#include "../ioprivshared.hpp"
556677extern "C" {
···511511 return status;
512512 }
513513514514- RtlZeroMemory(m_FwdProgContext, sizeof(FXIO_FORWARD_PROGRESS_CONTEXT));
514514+ *m_FwdProgContext = {};
515515516516 //
517517 // Initialize the things which will not fail first
···353353 // Important to do this last since this will cause a pnp state machine
354354 // transition
355355 //
356356- __super::FinishInitialize(DeviceInit);
356356+ FxPkgPnp::FinishInitialize(DeviceInit); // __super call
357357}
358358359359_Must_inspect_result_
···521521 // reference, so that even if we return error, the reference is
522522 // still there to be removed on cleanup.
523523 //
524524- ADDREF(_InterruptThunk);
524524+ ADDREF((PVOID)_InterruptThunk);
525525526526 //
527527 // Values always supplied by the caller
···881881 //
882882 // Use the base FxObject's DeleteObject implementation which will Dispose us
883883 //
884884- __super::DeleteObject();
884884+ FxNonPagedObject::DeleteObject(); // __super call
885885}
886886887887//
···16781678 //
16791679 // Release the reference taken in FxInterrupt::Initialize
16801680 //
16811681- RELEASE(_InterruptThunk);
16811681+ RELEASE((PVOID)_InterruptThunk);
16821682}
1683168316841684//
···7070 // object), taking this ref prevents the globals from going away until a
7171 // corresponding deref at the end of workitem.
7272 //
7373- m_PkgPnp->GetDriverGlobals()->ADDREF(_WorkItemCallback);
7373+ m_PkgPnp->GetDriverGlobals()->ADDREF((PVOID)_WorkItemCallback);
74747575 m_WorkItem.Enqueue(
7676 (PMX_WORKITEM_ROUTINE) _WorkItemCallback,
···112112 //
113113 // Release the ref on FxDriverGlobals taken before queuing this workitem.
114114 //
115115- pFxDriverGlobals->RELEASE(_WorkItemCallback);
115115+ pFxDriverGlobals->RELEASE((PVOID)_WorkItemCallback);
116116117117 Mx::MxDereferenceObject(pDriverObject);
118118}
···25252626--*/
27272828-#include "..\pnppriv.hpp"
2828+#include "../pnppriv.hpp"
29293030#include <initguid.h>
3131#include <wdmguid.h>
···456456 VOID
457457 )
458458{
459459- WDF_DSF_INTERFACE dsfInterface;
460460- NTSTATUS status;
461461- BOOLEAN derefQI = FALSE;
459459+// __REACTOS__ : not supported
460460+// WDF_DSF_INTERFACE dsfInterface;
461461+// NTSTATUS status;
462462+// BOOLEAN derefQI = FALSE;
462463463463- RtlZeroMemory(&dsfInterface, sizeof(dsfInterface));
464464+// RtlZeroMemory(&dsfInterface, sizeof(dsfInterface));
464465465465- //
466466- // Since there are some stacks that are not PnP re-entrant (like USBHUB,
467467- // xpsp2), we specify that the QI goes only to our attached device and
468468- // not to the top of the stack as a normal QI irp would.
469469- //
470470- // We also do this a preventative measure for other stacks we don't know
471471- // about internally and do not have access to when testing.
472472- //
473473- status = m_Device->QueryForInterface(&GUID_WDF_DSF_INTERFACE,
474474- (PINTERFACE) &dsfInterface,
475475- sizeof(dsfInterface),
476476- WDM_DSF_INTERFACE_V1_0,
477477- NULL,
478478- m_Device->GetAttachedDevice()
479479- );
466466+// //
467467+// // Since there are some stacks that are not PnP re-entrant (like USBHUB,
468468+// // xpsp2), we specify that the QI goes only to our attached device and
469469+// // not to the top of the stack as a normal QI irp would.
470470+// //
471471+// // We also do this a preventative measure for other stacks we don't know
472472+// // about internally and do not have access to when testing.
473473+// //
474474+// status = m_Device->QueryForInterface(&GUID_WDF_DSF_INTERFACE,
475475+// (PINTERFACE) &dsfInterface,
476476+// sizeof(dsfInterface),
477477+// WDM_DSF_INTERFACE_V1_0,
478478+// NULL,
479479+// m_Device->GetAttachedDevice()
480480+// );
480481481481- if (status == STATUS_NOT_SUPPORTED) {
482482- DoTraceLevelMessage(
483483- GetDriverGlobals(), TRACE_LEVEL_WARNING, TRACINGPNP,
484484- "Lower stack does not have a DSF interface");
485485- status = STATUS_SUCCESS;
486486- goto Done;
487487- }
482482+// if (status == STATUS_NOT_SUPPORTED) {
483483+// DoTraceLevelMessage(
484484+// GetDriverGlobals(), TRACE_LEVEL_WARNING, TRACINGPNP,
485485+// "Lower stack does not have a DSF interface");
486486+// status = STATUS_SUCCESS;
487487+// goto Done;
488488+// }
488489489489- if (!NT_SUCCESS(status)) {
490490- DoTraceLevelMessage(
491491- GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
492492- "Lower stack returned an error for query DSF interface, %!STATUS!",
493493- status);
494494- goto Done;
495495- }
490490+// if (!NT_SUCCESS(status)) {
491491+// DoTraceLevelMessage(
492492+// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
493493+// "Lower stack returned an error for query DSF interface, %!STATUS!",
494494+// status);
495495+// goto Done;
496496+// }
496497497497- derefQI = TRUE;
498498+// derefQI = TRUE;
498499499499- //
500500- // Basic run time checks.
501501- //
502502- if (dsfInterface.Interface.Version != WDM_DSF_INTERFACE_V1_0) {
503503- status = STATUS_REVISION_MISMATCH;
504504- DoTraceLevelMessage(
505505- GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
506506- "Lower DSF stack supports v(%x), requested v(%x), %!STATUS!",
507507- dsfInterface.Interface.Version,
508508- WDM_DSF_INTERFACE_V1_0,
509509- status);
510510- goto Done;
511511- }
500500+// //
501501+// // Basic run time checks.
502502+// //
503503+// if (dsfInterface.Interface.Version != WDM_DSF_INTERFACE_V1_0) {
504504+// status = STATUS_REVISION_MISMATCH;
505505+// DoTraceLevelMessage(
506506+// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
507507+// "Lower DSF stack supports v(%x), requested v(%x), %!STATUS!",
508508+// dsfInterface.Interface.Version,
509509+// WDM_DSF_INTERFACE_V1_0,
510510+// status);
511511+// goto Done;
512512+// }
512513513513- //
514514- // Ex functions should be both set or cleared.
515515- // Active/Inactive functions should be both set or cleared.
516516- // Ex function must be present.
517517- // Note: !!(ptr) expression below converts ptr value to true/false value.
518518- // I.e., ptr==NULL to false and ptr!=NULL to true.
519519- //
520520- if (!((!!(dsfInterface.IoConnectInterruptEx) ==
521521- !!(dsfInterface.IoDisconnectInterruptEx)) &&
522522- (!!(dsfInterface.IoReportInterruptActive) ==
523523- !!(dsfInterface.IoReportInterruptInactive)) &&
524524- (dsfInterface.IoConnectInterruptEx != NULL)
525525- )) {
526526- status = STATUS_DATA_ERROR;
527527- DoTraceLevelMessage(
528528- GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
529529- "Function mismatch detected in DSF interface, %!STATUS!",
530530- status);
531531- goto Done;
532532- }
514514+// //
515515+// // Ex functions should be both set or cleared.
516516+// // Active/Inactive functions should be both set or cleared.
517517+// // Ex function must be present.
518518+// // Note: !!(ptr) expression below converts ptr value to true/false value.
519519+// // I.e., ptr==NULL to false and ptr!=NULL to true.
520520+// //
521521+// if (!((!!(dsfInterface.IoConnectInterruptEx) ==
522522+// !!(dsfInterface.IoDisconnectInterruptEx)) &&
523523+// (!!(dsfInterface.IoReportInterruptActive) ==
524524+// !!(dsfInterface.IoReportInterruptInactive)) &&
525525+// (dsfInterface.IoConnectInterruptEx != NULL)
526526+// )) {
527527+// status = STATUS_DATA_ERROR;
528528+// DoTraceLevelMessage(
529529+// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
530530+// "Function mismatch detected in DSF interface, %!STATUS!",
531531+// status);
532532+// goto Done;
533533+// }
533534534534- //
535535- // Info is correct.
536536- //
537537- m_IoConnectInterruptEx = dsfInterface.IoConnectInterruptEx;
538538- m_IoDisconnectInterruptEx = dsfInterface.IoDisconnectInterruptEx;
535535+// //
536536+// // Info is correct.
537537+// //
538538+// m_IoConnectInterruptEx = dsfInterface.IoConnectInterruptEx;
539539+// m_IoDisconnectInterruptEx = dsfInterface.IoDisconnectInterruptEx;
539540540540- //
541541- // If DSF interface provides active/inactive functions then use them
542542- //
543543- if (dsfInterface.IoReportInterruptActive != NULL)
544544- {
545545- m_IoReportInterruptActive = dsfInterface.IoReportInterruptActive;
546546- m_IoReportInterruptInactive = dsfInterface.IoReportInterruptInactive;
547547- }
541541+// //
542542+// // If DSF interface provides active/inactive functions then use them
543543+// //
544544+// if (dsfInterface.IoReportInterruptActive != NULL)
545545+// {
546546+// m_IoReportInterruptActive = dsfInterface.IoReportInterruptActive;
547547+// m_IoReportInterruptInactive = dsfInterface.IoReportInterruptInactive;
548548+// }
548549549549-Done:
550550+// Done:
550551551551- //
552552- // The contract with the DSF layer is to release the interface right away;
553553- // the embedded interrupt function ptrs will be valid until this driver is
554554- // unloaded.
555555- //
556556- if (derefQI) {
557557- dsfInterface.Interface.InterfaceDereference(dsfInterface.Interface.Context);
558558- }
552552+// //
553553+// // The contract with the DSF layer is to release the interface right away;
554554+// // the embedded interrupt function ptrs will be valid until this driver is
555555+// // unloaded.
556556+// //
557557+// if (derefQI) {
558558+// dsfInterface.Interface.InterfaceDereference(dsfInterface.Interface.Context);
559559+// }
559560560560- return status;
561561+// return status;
562562+ return STATUS_NOT_IMPLEMENTED;
561563}
562564563565_Must_inspect_result_
···4545 VOID
4646 )
4747{
4848- NTSTATUS status;
4949- FxDevicePwrRequirementMachine * fxDprMachine = NULL;
4848+// NTSTATUS status;
4949+// FxDevicePwrRequirementMachine * fxDprMachine = NULL;
50505151- ASSERT(NULL == m_DevicePowerRequirementMachine);
5151+// ASSERT(NULL == m_DevicePowerRequirementMachine);
52525353- fxDprMachine = new (m_PkgPnp->GetDriverGlobals())
5454- FxDevicePwrRequirementMachine(this);
5555- if (NULL == fxDprMachine) {
5656- status = STATUS_INSUFFICIENT_RESOURCES;
5757- DoTraceLevelMessage(
5858- m_PkgPnp->GetDriverGlobals(),
5959- TRACE_LEVEL_ERROR, TRACINGPNP,
6060- "WDFDEVICE 0x%p !devobj 0x%p failed to allocate "
6161- "FxDevicePwrRequirementMachine. %!STATUS!.",
6262- m_PkgPnp->GetDevice()->GetHandle(),
6363- m_PkgPnp->GetDevice()->GetDeviceObject(),
6464- status);
6565- goto exit;
6666- }
5353+// fxDprMachine = new (m_PkgPnp->GetDriverGlobals())
5454+// FxDevicePwrRequirementMachine(this);
5555+// if (NULL == fxDprMachine) {
5656+// status = STATUS_INSUFFICIENT_RESOURCES;
5757+// DoTraceLevelMessage(
5858+// m_PkgPnp->GetDriverGlobals(),
5959+// TRACE_LEVEL_ERROR, TRACINGPNP,
6060+// "WDFDEVICE 0x%p !devobj 0x%p failed to allocate "
6161+// "FxDevicePwrRequirementMachine. %!STATUS!.",
6262+// m_PkgPnp->GetDevice()->GetHandle(),
6363+// m_PkgPnp->GetDevice()->GetDeviceObject(),
6464+// status);
6565+// goto exit;
6666+// }
67676868- status = fxDprMachine->Initialize(m_PkgPnp->GetDriverGlobals());
6969- if (FALSE == NT_SUCCESS(status)) {
7070- DoTraceLevelMessage(
7171- m_PkgPnp->GetDriverGlobals(),
7272- TRACE_LEVEL_ERROR, TRACINGPNP,
7373- "WDFDEVICE 0x%p !devobj 0x%p Device Power Requirement State Machine"
7474- " Initialize() failed, %!STATUS!",
7575- m_PkgPnp->GetDevice()->GetHandle(),
7676- m_PkgPnp->GetDevice()->GetDeviceObject(),
7777- status);
7878- goto exit;
7979- }
6868+// status = fxDprMachine->Initialize(m_PkgPnp->GetDriverGlobals());
6969+// if (FALSE == NT_SUCCESS(status)) {
7070+// DoTraceLevelMessage(
7171+// m_PkgPnp->GetDriverGlobals(),
7272+// TRACE_LEVEL_ERROR, TRACINGPNP,
7373+// "WDFDEVICE 0x%p !devobj 0x%p Device Power Requirement State Machine"
7474+// " Initialize() failed, %!STATUS!",
7575+// m_PkgPnp->GetDevice()->GetHandle(),
7676+// m_PkgPnp->GetDevice()->GetDeviceObject(),
7777+// status);
7878+// goto exit;
7979+// }
80808181- status = fxDprMachine->Init(
8282- m_PkgPnp,
8383- FxDevicePwrRequirementMachine::_ProcessEventInner
8484- );
8585- if (!NT_SUCCESS(status)) {
8686- DoTraceLevelMessage(
8787- m_PkgPnp->GetDriverGlobals(),
8888- TRACE_LEVEL_ERROR, TRACINGPNP,
8989- "WDFDEVICE 0x%p !devobj 0x%p Device Power Requirement State Machine"
9090- " Init() failed, %!STATUS!",
9191- m_PkgPnp->GetDevice()->GetHandle(),
9292- m_PkgPnp->GetDevice()->GetDeviceObject(),
9393- status);
9494- goto exit;
9595- }
8181+// status = fxDprMachine->Init(
8282+// m_PkgPnp,
8383+// FxDevicePwrRequirementMachine::_ProcessEventInner
8484+// );
8585+// if (!NT_SUCCESS(status)) {
8686+// DoTraceLevelMessage(
8787+// m_PkgPnp->GetDriverGlobals(),
8888+// TRACE_LEVEL_ERROR, TRACINGPNP,
8989+// "WDFDEVICE 0x%p !devobj 0x%p Device Power Requirement State Machine"
9090+// " Init() failed, %!STATUS!",
9191+// m_PkgPnp->GetDevice()->GetHandle(),
9292+// m_PkgPnp->GetDevice()->GetDeviceObject(),
9393+// status);
9494+// goto exit;
9595+// }
96969797- m_DevicePowerRequirementMachine = fxDprMachine;
9797+// m_DevicePowerRequirementMachine = fxDprMachine;
98989999- status = STATUS_SUCCESS;
9999+// status = STATUS_SUCCESS;
100100101101-exit:
102102- if (FALSE == NT_SUCCESS(status)) {
103103- if (NULL != fxDprMachine) {
104104- delete fxDprMachine;
105105- }
106106- }
107107- return status;
101101+// exit:
102102+// if (FALSE == NT_SUCCESS(status)) {
103103+// if (NULL != fxDprMachine) {
104104+// delete fxDprMachine;
105105+// }
106106+// }
107107+// return status;
108108+ ROSWDFNOTIMPLEMENTED;
109109+ return STATUS_SUCCESS;
108110}
109111110112NTSTATUS
···112114 VOID
113115 )
114116{
115115- NTSTATUS status;
116116- PPOX_SETTINGS poxSettings = NULL;
117117- WDFDEVICE fxDevice = NULL;
117117+// NTSTATUS status;
118118+// PPOX_SETTINGS poxSettings = NULL;
119119+// WDFDEVICE fxDevice = NULL;
118120119121120120- if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
121121- m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
122122- //
123123- // Driver-managed idle timeout. Nothing to do.
124124- //
125125- return STATUS_SUCCESS;
126126- }
122122+// if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
123123+// m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
124124+// //
125125+// // Driver-managed idle timeout. Nothing to do.
126126+// //
127127+// return STATUS_SUCCESS;
128128+// }
127129128128- //
129129- // We create the device power requirement state machine only if system-
130130- // managed idle timeout is being used.
131131- //
132132- if (NULL == m_DevicePowerRequirementMachine) {
133133- status = CreateDevicePowerRequirementMachine();
134134- if (FALSE == NT_SUCCESS(status)) {
135135- goto exit;
136136- }
137137- }
130130+// //
131131+// // We create the device power requirement state machine only if system-
132132+// // managed idle timeout is being used.
133133+// //
134134+// if (NULL == m_DevicePowerRequirementMachine) {
135135+// status = CreateDevicePowerRequirementMachine();
136136+// if (FALSE == NT_SUCCESS(status)) {
137137+// goto exit;
138138+// }
139139+// }
138140139139- ASSERT(NULL != m_DevicePowerRequirementMachine);
141141+// ASSERT(NULL != m_DevicePowerRequirementMachine);
140142141141- //
142142- // Register with the power framework
143143- //
144144- status = PoxRegisterDevice();
143143+// //
144144+// // Register with the power framework
145145+// //
146146+// status = PoxRegisterDevice();
145147146146- if (FALSE == NT_SUCCESS(status)) {
147147- DoTraceLevelMessage(
148148- m_PkgPnp->GetDriverGlobals(),
149149- TRACE_LEVEL_ERROR, TRACINGPNP,
150150- "WDFDEVICE 0x%p !devobj 0x%p FxPox::PoxRegisterDevice failed. "
151151- "%!STATUS!.",
152152- m_PkgPnp->GetDevice()->GetHandle(),
153153- m_PkgPnp->GetDevice()->GetDeviceObject(),
154154- status);
155155- goto exit;
156156- }
148148+// if (FALSE == NT_SUCCESS(status)) {
149149+// DoTraceLevelMessage(
150150+// m_PkgPnp->GetDriverGlobals(),
151151+// TRACE_LEVEL_ERROR, TRACINGPNP,
152152+// "WDFDEVICE 0x%p !devobj 0x%p FxPox::PoxRegisterDevice failed. "
153153+// "%!STATUS!.",
154154+// m_PkgPnp->GetDevice()->GetHandle(),
155155+// m_PkgPnp->GetDevice()->GetDeviceObject(),
156156+// status);
157157+// goto exit;
158158+// }
157159158158- //
159159- // At the time of registration, all components are active. When we start the
160160- // power framework's device power management (see below), all components are
161161- // moved to the idle state by default. Take an extra reference on the
162162- // component to prevent this from happening. The power policy state machine
163163- // will evaluate the S0-idle policy later and ask us to drop this reference
164164- // if the policy requires it.
165165- //
166166- PoxActivateComponent();
160160+// //
161161+// // At the time of registration, all components are active. When we start the
162162+// // power framework's device power management (see below), all components are
163163+// // moved to the idle state by default. Take an extra reference on the
164164+// // component to prevent this from happening. The power policy state machine
165165+// // will evaluate the S0-idle policy later and ask us to drop this reference
166166+// // if the policy requires it.
167167+// //
168168+// PoxActivateComponent();
167169168168- //
169169- // Tell the power framework to start its device power management. This will
170170- // drop a reference on the component, but the component will still remain
171171- // active because of the extra reference we took above.
172172- //
173173- PoxStartDevicePowerManagement();
170170+// //
171171+// // Tell the power framework to start its device power management. This will
172172+// // drop a reference on the component, but the component will still remain
173173+// // active because of the extra reference we took above.
174174+// //
175175+// PoxStartDevicePowerManagement();
174176175175- //
176176- // If the client driver has specified power framework settings, retrieve
177177- // them.
178178- //
179179- poxSettings = GetPowerFrameworkSettings();
177177+// //
178178+// // If the client driver has specified power framework settings, retrieve
179179+// // them.
180180+// //
181181+// poxSettings = GetPowerFrameworkSettings();
180182181181- //
182182- // If the driver wanted to receive the POHANDLE, invoke their callback now
183183- //
184184- if ((NULL != poxSettings) &&
185185- (NULL != poxSettings->EvtDeviceWdmPostPoFxRegisterDevice)) {
183183+// //
184184+// // If the driver wanted to receive the POHANDLE, invoke their callback now
185185+// //
186186+// if ((NULL != poxSettings) &&
187187+// (NULL != poxSettings->EvtDeviceWdmPostPoFxRegisterDevice)) {
186188187187- fxDevice = m_PkgPnp->GetDevice()->GetHandle();
189189+// fxDevice = m_PkgPnp->GetDevice()->GetHandle();
188190189189- status = poxSettings->EvtDeviceWdmPostPoFxRegisterDevice(
190190- fxDevice,
191191- m_PoHandle
192192- );
193193- if (FALSE == NT_SUCCESS(status)) {
191191+// status = poxSettings->EvtDeviceWdmPostPoFxRegisterDevice(
192192+// fxDevice,
193193+// m_PoHandle
194194+// );
195195+// if (FALSE == NT_SUCCESS(status)) {
194196195195- DoTraceLevelMessage(
196196- m_PkgPnp->GetDriverGlobals(),
197197- TRACE_LEVEL_ERROR, TRACINGPNP,
198198- "WDFDEVICE 0x%p !devobj 0x%p. The client driver has failed the "
199199- "EvtDeviceWdmPostPoFxRegisterDevice callback with %!STATUS!.",
200200- m_PkgPnp->GetDevice()->GetHandle(),
201201- m_PkgPnp->GetDevice()->GetDeviceObject(),
202202- status);
197197+// DoTraceLevelMessage(
198198+// m_PkgPnp->GetDriverGlobals(),
199199+// TRACE_LEVEL_ERROR, TRACINGPNP,
200200+// "WDFDEVICE 0x%p !devobj 0x%p. The client driver has failed the "
201201+// "EvtDeviceWdmPostPoFxRegisterDevice callback with %!STATUS!.",
202202+// m_PkgPnp->GetDevice()->GetHandle(),
203203+// m_PkgPnp->GetDevice()->GetDeviceObject(),
204204+// status);
203205204204- //
205205- // Notify the driver that the POHANDLE is about to become invalid
206206- //
207207- if (NULL != poxSettings->EvtDeviceWdmPrePoFxUnregisterDevice) {
208208- poxSettings->EvtDeviceWdmPrePoFxUnregisterDevice(
209209- fxDevice,
210210- m_PoHandle
211211- );
212212- }
206206+// //
207207+// // Notify the driver that the POHANDLE is about to become invalid
208208+// //
209209+// if (NULL != poxSettings->EvtDeviceWdmPrePoFxUnregisterDevice) {
210210+// poxSettings->EvtDeviceWdmPrePoFxUnregisterDevice(
211211+// fxDevice,
212212+// m_PoHandle
213213+// );
214214+// }
213215214214- //
215215- // Unregister with the power framework
216216- //
217217- PoxUnregisterDevice();
218218- goto exit;
219219- }
220220- }
216216+// //
217217+// // Unregister with the power framework
218218+// //
219219+// PoxUnregisterDevice();
220220+// goto exit;
221221+// }
222222+// }
221223222222- //
223223- // Tell the device power requirement state machine that we have registered
224224- // with the power framework
225225- //
226226- m_DevicePowerRequirementMachine->ProcessEvent(DprEventRegisteredWithPox);
224224+// //
225225+// // Tell the device power requirement state machine that we have registered
226226+// // with the power framework
227227+// //
228228+// m_DevicePowerRequirementMachine->ProcessEvent(DprEventRegisteredWithPox);
227229228228-exit:
229229- return status;
230230+// exit:
231231+// return status;
232232+ ROSWDFNOTIMPLEMENTED;
233233+ return STATUS_SUCCESS;
230234}
231235232236VOID
···234238 VOID
235239 )
236240{
237237- PPOX_SETTINGS poxSettings = NULL;
241241+ // PPOX_SETTINGS poxSettings = NULL;
238242239239- if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
240240- m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
241241- //
242242- // Driver-managed idle timeout. Nothing to do.
243243- //
244244- return;
245245- }
243243+ // if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
244244+ // m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
245245+ // //
246246+ // // Driver-managed idle timeout. Nothing to do.
247247+ // //
248248+ // return;
249249+ // }
246250247247- ASSERT(NULL != m_DevicePowerRequirementMachine);
251251+ // ASSERT(NULL != m_DevicePowerRequirementMachine);
248252249249- //
250250- // If the client driver has specified power framework settings, retrieve
251251- // them.
252252- //
253253- poxSettings = GetPowerFrameworkSettings();
253253+ // //
254254+ // // If the client driver has specified power framework settings, retrieve
255255+ // // them.
256256+ // //
257257+ // poxSettings = GetPowerFrameworkSettings();
254258255255- //
256256- // Notify the client driver that the POHANDLE is about to become invalid
257257- //
258258- if ((NULL != poxSettings) &&
259259- (NULL != poxSettings->EvtDeviceWdmPrePoFxUnregisterDevice)) {
259259+ // //
260260+ // // Notify the client driver that the POHANDLE is about to become invalid
261261+ // //
262262+ // if ((NULL != poxSettings) &&
263263+ // (NULL != poxSettings->EvtDeviceWdmPrePoFxUnregisterDevice)) {
260264261261- poxSettings->EvtDeviceWdmPrePoFxUnregisterDevice(
262262- m_PkgPnp->GetDevice()->GetHandle(),
263263- m_PoHandle
264264- );
265265- }
265265+ // poxSettings->EvtDeviceWdmPrePoFxUnregisterDevice(
266266+ // m_PkgPnp->GetDevice()->GetHandle(),
267267+ // m_PoHandle
268268+ // );
269269+ // }
266270267267- //
268268- // Unregister with the power framework
269269- //
270270- PoxUnregisterDevice();
271271+ // //
272272+ // // Unregister with the power framework
273273+ // //
274274+ // PoxUnregisterDevice();
271275272272- //
273273- // Tell the device power requirement state machine that we have unregistered
274274- // with the power framework
275275- //
276276- m_DevicePowerRequirementMachine->ProcessEvent(
277277- DprEventUnregisteredWithPox
278278- );
279279- return;
276276+ // //
277277+ // // Tell the device power requirement state machine that we have unregistered
278278+ // // with the power framework
279279+ // //
280280+ // m_DevicePowerRequirementMachine->ProcessEvent(
281281+ // DprEventUnregisteredWithPox
282282+ // );
283283+ // return;
284284+ ROSWDFNOTIMPLEMENTED;
280285}
281286282287VOID
···284289 VOID
285290 )
286291{
287287- if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
288288- m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
289289- //
290290- // Driver-managed idle timeout. Nothing to do.
291291- //
292292- return;
293293- }
292292+ // if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
293293+ // m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
294294+ // //
295295+ // // Driver-managed idle timeout. Nothing to do.
296296+ // //
297297+ // return;
298298+ // }
294299295295- PoxActivateComponent();
296296- return;
300300+ // PoxActivateComponent();
301301+ // return;
302302+ ROSWDFNOTIMPLEMENTED;
297303}
298304299305BOOLEAN
···301307 VOID
302308 )
303309{
304304- BOOLEAN canPowerDown;
310310+ // BOOLEAN canPowerDown;
305311306306- if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
307307- m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
308308- //
309309- // Driver-managed idle timeout. We can power down immediately, without
310310- // waiting for device-power-not-required notification.
311311- //
312312- canPowerDown = TRUE;
313313- } else {
314314- //
315315- // System-managed idle timeout
316316- //
317317- PoxIdleComponent();
312312+ // if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
313313+ // m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
314314+ // //
315315+ // // Driver-managed idle timeout. We can power down immediately, without
316316+ // // waiting for device-power-not-required notification.
317317+ // //
318318+ // canPowerDown = TRUE;
319319+ // } else {
320320+ // //
321321+ // // System-managed idle timeout
322322+ // //
323323+ // PoxIdleComponent();
318324319319- //
320320- // We must wait for device-power-not-required notification before
321321- // powering down.
322322- //
323323- canPowerDown = FALSE;
324324- }
325325+ // //
326326+ // // We must wait for device-power-not-required notification before
327327+ // // powering down.
328328+ // //
329329+ // canPowerDown = FALSE;
330330+ // }
325331326326- return canPowerDown;
332332+ // return canPowerDown;
333333+ ROSWDFNOTIMPLEMENTED;
334334+ return TRUE;
327335}
328336329337VOID
···331339 VOID
332340 )
333341{
334334- ULONGLONG idleTimeoutHint;
342342+ // ULONGLONG idleTimeoutHint;
335343336336- if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
337337- m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
338338- //
339339- // Driver-managed idle timeout. Nothing to do.
340340- //
341341- return;
342342- }
344344+ // if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
345345+ // m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
346346+ // //
347347+ // // Driver-managed idle timeout. Nothing to do.
348348+ // //
349349+ // return;
350350+ // }
343351344344- if (m_NextIdleTimeoutHint != m_CurrentIdleTimeoutHint) {
345345- m_CurrentIdleTimeoutHint = m_NextIdleTimeoutHint;
352352+ // if (m_NextIdleTimeoutHint != m_CurrentIdleTimeoutHint) {
353353+ // m_CurrentIdleTimeoutHint = m_NextIdleTimeoutHint;
346354347347- //
348348- // Convert the idle timeout from milliseconds to 100-nanosecond units
349349- //
350350- idleTimeoutHint = ((ULONGLONG) m_CurrentIdleTimeoutHint) * 10 * 1000;
351351- PoxSetDeviceIdleTimeout(idleTimeoutHint);
352352- }
355355+ // //
356356+ // // Convert the idle timeout from milliseconds to 100-nanosecond units
357357+ // //
358358+ // idleTimeoutHint = ((ULONGLONG) m_CurrentIdleTimeoutHint) * 10 * 1000;
359359+ // PoxSetDeviceIdleTimeout(idleTimeoutHint);
360360+ // }
353361354354- return;
362362+ // return;
363363+ ROSWDFNOTIMPLEMENTED;
355364}
356365357366···360369 VOID
361370 )
362371{
363363- KIRQL irql;
364364- BOOLEAN canPowerOff;
372372+ // KIRQL irql;
373373+ // BOOLEAN canPowerOff;
365374366366- if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
367367- m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
368368- //
369369- // Driver-managed idle timeout. We don't have to take power framework's
370370- // device power requirement into consideration. Just return success.
371371- //
372372- return STATUS_SUCCESS;
373373- }
375375+ // if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
376376+ // m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
377377+ // //
378378+ // // Driver-managed idle timeout. We don't have to take power framework's
379379+ // // device power requirement into consideration. Just return success.
380380+ // //
381381+ // return STATUS_SUCCESS;
382382+ // }
374383375375- //
376376- // Acquire the lock to ensure that device power requirement doesn't change.
377377- //
378378- m_DevicePowerRequiredLock.Acquire(&irql);
379379- if (FALSE == m_DevicePowerRequired) {
380380- //
381381- // Send an event to the device power requirement state machine to tell
382382- // it that we are about to go to Dx.
383383- //
384384- // We send the event inside a lock in order to handle the race condition
385385- // when the power framework notifies us that device power is required at
386386- // the same time that we are about to go to Dx. By sending the event
387387- // inside the lock, we ensure that the DprEventDeviceGoingToDx event is
388388- // always queued to device power requirement state machine before the
389389- // DprEventPoxRequiresPower.
390390- //
391391- // This allows for a clean design in the device power requirement state
392392- // machine by ensuring that it does not have to handle a non-intuitive
393393- // sequence, i.e. DprEventPoxRequiresPower followed by
394394- // DprEventDeviceGoingToDx. This sequence is non-intuitive because it
395395- // doesn't make sense for a device to go to Dx after it has been
396396- // informed that device power is required. Avoiding this non-intuitive
397397- // sequence via locking enables a clean design for the device power
398398- // requirement state machine.
399399- //
400400- m_DevicePowerRequirementMachine->ProcessEvent(DprEventDeviceGoingToDx);
401401- canPowerOff = TRUE;
384384+ // //
385385+ // // Acquire the lock to ensure that device power requirement doesn't change.
386386+ // //
387387+ // m_DevicePowerRequiredLock.Acquire(&irql);
388388+ // if (FALSE == m_DevicePowerRequired) {
389389+ // //
390390+ // // Send an event to the device power requirement state machine to tell
391391+ // // it that we are about to go to Dx.
392392+ // //
393393+ // // We send the event inside a lock in order to handle the race condition
394394+ // // when the power framework notifies us that device power is required at
395395+ // // the same time that we are about to go to Dx. By sending the event
396396+ // // inside the lock, we ensure that the DprEventDeviceGoingToDx event is
397397+ // // always queued to device power requirement state machine before the
398398+ // // DprEventPoxRequiresPower.
399399+ // //
400400+ // // This allows for a clean design in the device power requirement state
401401+ // // machine by ensuring that it does not have to handle a non-intuitive
402402+ // // sequence, i.e. DprEventPoxRequiresPower followed by
403403+ // // DprEventDeviceGoingToDx. This sequence is non-intuitive because it
404404+ // // doesn't make sense for a device to go to Dx after it has been
405405+ // // informed that device power is required. Avoiding this non-intuitive
406406+ // // sequence via locking enables a clean design for the device power
407407+ // // requirement state machine.
408408+ // //
409409+ // m_DevicePowerRequirementMachine->ProcessEvent(DprEventDeviceGoingToDx);
410410+ // canPowerOff = TRUE;
402411403403- } else {
404404- canPowerOff = FALSE;
405405- }
406406- m_DevicePowerRequiredLock.Release(irql);
412412+ // } else {
413413+ // canPowerOff = FALSE;
414414+ // }
415415+ // m_DevicePowerRequiredLock.Release(irql);
407416408408- return canPowerOff ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
417417+ // return canPowerOff ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
418418+ ROSWDFNOTIMPLEMENTED;
419419+ return STATUS_SUCCESS;
409420}
410421411422VOID
···413424 VOID
414425 )
415426{
416416-417417- if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
418418- m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
419419- //
420420- // Driver-managed idle timeout. Nothing to do.
421421- //
422422- return;
423423- }
427427+ ROSWDFNOTIMPLEMENTED;
428428+ // if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
429429+ // m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
430430+ // //
431431+ // // Driver-managed idle timeout. Nothing to do.
432432+ // //
433433+ // return;
434434+ // }
424435425425- //
426426- // System-managed idle timeout. Notify the device power requirement state
427427- // machine that we are back in D0.
428428- //
429429- m_DevicePowerRequirementMachine->ProcessEvent(
430430- DprEventDeviceReturnedToD0
431431- );
432432- return;
436436+ // //
437437+ // // System-managed idle timeout. Notify the device power requirement state
438438+ // // machine that we are back in D0.
439439+ // //
440440+ // m_DevicePowerRequirementMachine->ProcessEvent(
441441+ // DprEventDeviceReturnedToD0
442442+ // );
443443+ // return;
433444}
434445435446PPOX_SETTINGS
···439450{
440451 PPOX_SETTINGS poxSettings = NULL;
441452442442- if (m_PkgPnp->m_PowerPolicyMachine.m_Owner->
443443- m_IdleSettings.m_TimeoutMgmt.DriverSpecifiedPowerFrameworkSettings()) {
453453+ ROSWDFNOTIMPLEMENTED;
454454+ // if (m_PkgPnp->m_PowerPolicyMachine.m_Owner->
455455+ // m_IdleSettings.m_TimeoutMgmt.DriverSpecifiedPowerFrameworkSettings()) {
444456445445- poxSettings = m_PkgPnp->m_PowerPolicyMachine.m_Owner->
446446- m_IdleSettings.m_TimeoutMgmt.GetPowerFrameworkSettings();
457457+ // poxSettings = m_PkgPnp->m_PowerPolicyMachine.m_Owner->
458458+ // m_IdleSettings.m_TimeoutMgmt.GetPowerFrameworkSettings();
447459448448- ASSERT(NULL != poxSettings);
449449- }
460460+ // ASSERT(NULL != poxSettings);
461461+ // }
450462451463 return poxSettings;
452464}
···456468 __in FxDevicePwrRequirementEvents Event
457469 )
458470{
459459- KIRQL irql;
471471+ ROSWDFNOTIMPLEMENTED;
472472+ // KIRQL irql;
460473461461- //
462462- // We should not run the state machine from within a power framework
463463- // callback because we might end up reaching a state where we unregister
464464- // with the power framework. Unregistering from a callback leads to a
465465- // deadlock. Therefore, we raise IRQL before queueing an event to the state
466466- // machine. Raising IRQL causes the event processing to be deferred to a
467467- // worker thread.
468468- //
474474+ // //
475475+ // // We should not run the state machine from within a power framework
476476+ // // callback because we might end up reaching a state where we unregister
477477+ // // with the power framework. Unregistering from a callback leads to a
478478+ // // deadlock. Therefore, we raise IRQL before queueing an event to the state
479479+ // // machine. Raising IRQL causes the event processing to be deferred to a
480480+ // // worker thread.
481481+ // //
469482470470- //
471471- // This path should only be invoked for kernel mode. For user mode, this
472472- // condition is avoided by reflector guranteeing that it queues a worker
473473- // item to send a Pofx event corresponding to any PoFx callback
474474- //
475475- ASSERT(FX_IS_KERNEL_MODE);
483483+ // //
484484+ // // This path should only be invoked for kernel mode. For user mode, this
485485+ // // condition is avoided by reflector guranteeing that it queues a worker
486486+ // // item to send a Pofx event corresponding to any PoFx callback
487487+ // //
488488+ // ASSERT(FX_IS_KERNEL_MODE);
476489477477- Mx::MxRaiseIrql(DISPATCH_LEVEL, &irql);
478478- m_DevicePowerRequirementMachine->ProcessEvent(Event);
479479- Mx::MxLowerIrql(irql);
490490+ // Mx::MxRaiseIrql(DISPATCH_LEVEL, &irql);
491491+ // m_DevicePowerRequirementMachine->ProcessEvent(Event);
492492+ // Mx::MxLowerIrql(irql);
480493}
481494482495VOID
···484497 VOID
485498 )
486499{
487487-488488- if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
489489- m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
490490- //
491491- // Driver-managed idle timeout. Nothing to do.
492492- //
493493- return;
494494- }
500500+ ROSWDFNOTIMPLEMENTED;
501501+ // if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
502502+ // m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
503503+ // //
504504+ // // Driver-managed idle timeout. Nothing to do.
505505+ // //
506506+ // return;
507507+ // }
495508496496- //
497497- // System-managed idle timeout. Notify the device power requirement state
498498- // machine that device power is required.
499499- //
500500- PowerRequiredCallbackWorker(FALSE /* InvokedFromPoxCallback */);
501501- return;
509509+ // //
510510+ // // System-managed idle timeout. Notify the device power requirement state
511511+ // // machine that device power is required.
512512+ // //
513513+ // PowerRequiredCallbackWorker(FALSE /* InvokedFromPoxCallback */);
514514+ // return;
502515}
503516504517VOID
···506519 VOID
507520 )
508521{
509509-510510- if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
511511- m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
512512- //
513513- // Driver-managed idle timeout. Nothing to do.
514514- //
515515- return;
516516- }
522522+ ROSWDFNOTIMPLEMENTED;
523523+ // if (FALSE == m_PkgPnp->m_PowerPolicyMachine.m_Owner->m_IdleSettings.
524524+ // m_TimeoutMgmt.UsingSystemManagedIdleTimeout()) {
525525+ // //
526526+ // // Driver-managed idle timeout. Nothing to do.
527527+ // //
528528+ // return;
529529+ // }
517530518518- //
519519- // System-managed idle timeout. Notify the device power requirement state
520520- // machine that device power is not required.
521521- //
522522- PowerNotRequiredCallbackWorker(FALSE /* InvokedFromPoxCallback */);
523523- return;
531531+ // //
532532+ // // System-managed idle timeout. Notify the device power requirement state
533533+ // // machine that device power is not required.
534534+ // //
535535+ // PowerNotRequiredCallbackWorker(FALSE /* InvokedFromPoxCallback */);
536536+ // return;
524537}
525538526539VOID
···528541 __in BOOLEAN InvokedFromPoxCallback
529542 )
530543{
531531- KIRQL irql;
544544+ ROSWDFNOTIMPLEMENTED;
545545+ // KIRQL irql;
532546533533- //
534534- // Make a note of the fact that device power is required
535535- //
536536- m_DevicePowerRequiredLock.Acquire(&irql);
537537- m_DevicePowerRequired = TRUE;
538538- m_DevicePowerRequiredLock.Release(irql);
547547+ // //
548548+ // // Make a note of the fact that device power is required
549549+ // //
550550+ // m_DevicePowerRequiredLock.Acquire(&irql);
551551+ // m_DevicePowerRequired = TRUE;
552552+ // m_DevicePowerRequiredLock.Release(irql);
539553540540- //
541541- // Send the device-power-required event to the device power requirement
542542- // state machine.
543543- //
544544- if (InvokedFromPoxCallback) {
545545- DprProcessEventFromPoxCallback(DprEventPoxRequiresPower);
546546- } else {
547547- m_DevicePowerRequirementMachine->ProcessEvent(DprEventPoxRequiresPower);
548548- }
549549- return;
554554+ // //
555555+ // // Send the device-power-required event to the device power requirement
556556+ // // state machine.
557557+ // //
558558+ // if (InvokedFromPoxCallback) {
559559+ // DprProcessEventFromPoxCallback(DprEventPoxRequiresPower);
560560+ // } else {
561561+ // m_DevicePowerRequirementMachine->ProcessEvent(DprEventPoxRequiresPower);
562562+ // }
563563+ // return;
550564}
551565552566VOID
···554568 __in BOOLEAN InvokedFromPoxCallback
555569 )
556570{
557557- KIRQL irql;
571571+ ROSWDFNOTIMPLEMENTED;
572572+ // KIRQL irql;
558573559559- //
560560- // Make a note of the fact that device power is not required
561561- //
562562- m_DevicePowerRequiredLock.Acquire(&irql);
563563- m_DevicePowerRequired = FALSE;
564564- m_DevicePowerRequiredLock.Release(irql);
574574+ // //
575575+ // // Make a note of the fact that device power is not required
576576+ // //
577577+ // m_DevicePowerRequiredLock.Acquire(&irql);
578578+ // m_DevicePowerRequired = FALSE;
579579+ // m_DevicePowerRequiredLock.Release(irql);
565580566566- //
567567- // Send the device-power-not-required event to the device power
568568- // requirement state machine.
569569- //
570570- if (InvokedFromPoxCallback) {
571571- DprProcessEventFromPoxCallback(DprEventPoxDoesNotRequirePower);
572572- } else {
573573- m_DevicePowerRequirementMachine->ProcessEvent(
574574- DprEventPoxDoesNotRequirePower
575575- );
576576- }
577577- return;
581581+ // //
582582+ // // Send the device-power-not-required event to the device power
583583+ // // requirement state machine.
584584+ // //
585585+ // if (InvokedFromPoxCallback) {
586586+ // DprProcessEventFromPoxCallback(DprEventPoxDoesNotRequirePower);
587587+ // } else {
588588+ // m_DevicePowerRequirementMachine->ProcessEvent(
589589+ // DprEventPoxDoesNotRequirePower
590590+ // );
591591+ // }
592592+ // return;
578593}
579594
···18181919--*/
20202121-#include "..\..\FxTargetsShared.hpp"
2121+#include "../../fxtargetsshared.hpp"
22222323extern "C" {
2424-#include "FxIoTargetRemoteKm.tmh"
2424+// #include "FxIoTargetRemoteKm.tmh"
2525}
26262727#include <initguid.h>
···4848 // If that is the case, we need to be able to return and deref the object until
4949 // we are done.
5050 //
5151- pThis->ADDREF(_PlugPlayNotification);
5151+ pThis->ADDREF((PVOID)_PlugPlayNotification);
52525353 pFxDriverGlobals = pThis->GetDriverGlobals();
5454···133133 }
134134 }
135135136136- pThis->RELEASE(_PlugPlayNotification);
136136+ pThis->RELEASE((PVOID)_PlugPlayNotification);
137137138138 return status;
139139}
···698698 m_Urb->Hdr.Function = URB_FUNCTION_CONTROL_TRANSFER;
699699 m_Urb->Hdr.Length = sizeof(*m_Urb);
700700701701- __super::StoreAndReferenceMemory(Buffer);
701701+ FxUsbRequestContext::StoreAndReferenceMemory(Buffer); // __super call
702702703703 //
704704 // Set the values using what is stored in the buffer