mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:26:00 +00:00
[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
This commit is contained in:
parent
8a978a179f
commit
1f377076d7
258 changed files with 4047 additions and 2387 deletions
|
@ -70,7 +70,7 @@ FxWorkItemEventQueue::QueueWorkItem(
|
|||
// object), taking this ref prevents the globals from going away until a
|
||||
// corresponding deref at the end of workitem.
|
||||
//
|
||||
m_PkgPnp->GetDriverGlobals()->ADDREF(_WorkItemCallback);
|
||||
m_PkgPnp->GetDriverGlobals()->ADDREF((PVOID)_WorkItemCallback);
|
||||
|
||||
m_WorkItem.Enqueue(
|
||||
(PMX_WORKITEM_ROUTINE) _WorkItemCallback,
|
||||
|
@ -112,7 +112,7 @@ Routine Description:
|
|||
//
|
||||
// Release the ref on FxDriverGlobals taken before queuing this workitem.
|
||||
//
|
||||
pFxDriverGlobals->RELEASE(_WorkItemCallback);
|
||||
pFxDriverGlobals->RELEASE((PVOID)_WorkItemCallback);
|
||||
|
||||
Mx::MxDereferenceObject(pDriverObject);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include "..\pnppriv.hpp"
|
||||
#include "../pnppriv.hpp"
|
||||
|
||||
#include <initguid.h>
|
||||
#include <wdmguid.h>
|
||||
|
@ -456,108 +456,110 @@ FxPkgFdo::QueryForDsfInterface(
|
|||
VOID
|
||||
)
|
||||
{
|
||||
WDF_DSF_INTERFACE dsfInterface;
|
||||
NTSTATUS status;
|
||||
BOOLEAN derefQI = FALSE;
|
||||
// __REACTOS__ : not supported
|
||||
// WDF_DSF_INTERFACE dsfInterface;
|
||||
// NTSTATUS status;
|
||||
// BOOLEAN derefQI = FALSE;
|
||||
|
||||
RtlZeroMemory(&dsfInterface, sizeof(dsfInterface));
|
||||
// RtlZeroMemory(&dsfInterface, sizeof(dsfInterface));
|
||||
|
||||
//
|
||||
// Since there are some stacks that are not PnP re-entrant (like USBHUB,
|
||||
// xpsp2), we specify that the QI goes only to our attached device and
|
||||
// not to the top of the stack as a normal QI irp would.
|
||||
//
|
||||
// We also do this a preventative measure for other stacks we don't know
|
||||
// about internally and do not have access to when testing.
|
||||
//
|
||||
status = m_Device->QueryForInterface(&GUID_WDF_DSF_INTERFACE,
|
||||
(PINTERFACE) &dsfInterface,
|
||||
sizeof(dsfInterface),
|
||||
WDM_DSF_INTERFACE_V1_0,
|
||||
NULL,
|
||||
m_Device->GetAttachedDevice()
|
||||
);
|
||||
// //
|
||||
// // Since there are some stacks that are not PnP re-entrant (like USBHUB,
|
||||
// // xpsp2), we specify that the QI goes only to our attached device and
|
||||
// // not to the top of the stack as a normal QI irp would.
|
||||
// //
|
||||
// // We also do this a preventative measure for other stacks we don't know
|
||||
// // about internally and do not have access to when testing.
|
||||
// //
|
||||
// status = m_Device->QueryForInterface(&GUID_WDF_DSF_INTERFACE,
|
||||
// (PINTERFACE) &dsfInterface,
|
||||
// sizeof(dsfInterface),
|
||||
// WDM_DSF_INTERFACE_V1_0,
|
||||
// NULL,
|
||||
// m_Device->GetAttachedDevice()
|
||||
// );
|
||||
|
||||
if (status == STATUS_NOT_SUPPORTED) {
|
||||
DoTraceLevelMessage(
|
||||
GetDriverGlobals(), TRACE_LEVEL_WARNING, TRACINGPNP,
|
||||
"Lower stack does not have a DSF interface");
|
||||
status = STATUS_SUCCESS;
|
||||
goto Done;
|
||||
}
|
||||
// if (status == STATUS_NOT_SUPPORTED) {
|
||||
// DoTraceLevelMessage(
|
||||
// GetDriverGlobals(), TRACE_LEVEL_WARNING, TRACINGPNP,
|
||||
// "Lower stack does not have a DSF interface");
|
||||
// status = STATUS_SUCCESS;
|
||||
// goto Done;
|
||||
// }
|
||||
|
||||
if (!NT_SUCCESS(status)) {
|
||||
DoTraceLevelMessage(
|
||||
GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
|
||||
"Lower stack returned an error for query DSF interface, %!STATUS!",
|
||||
status);
|
||||
goto Done;
|
||||
}
|
||||
// if (!NT_SUCCESS(status)) {
|
||||
// DoTraceLevelMessage(
|
||||
// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
|
||||
// "Lower stack returned an error for query DSF interface, %!STATUS!",
|
||||
// status);
|
||||
// goto Done;
|
||||
// }
|
||||
|
||||
derefQI = TRUE;
|
||||
// derefQI = TRUE;
|
||||
|
||||
//
|
||||
// Basic run time checks.
|
||||
//
|
||||
if (dsfInterface.Interface.Version != WDM_DSF_INTERFACE_V1_0) {
|
||||
status = STATUS_REVISION_MISMATCH;
|
||||
DoTraceLevelMessage(
|
||||
GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
|
||||
"Lower DSF stack supports v(%x), requested v(%x), %!STATUS!",
|
||||
dsfInterface.Interface.Version,
|
||||
WDM_DSF_INTERFACE_V1_0,
|
||||
status);
|
||||
goto Done;
|
||||
}
|
||||
// //
|
||||
// // Basic run time checks.
|
||||
// //
|
||||
// if (dsfInterface.Interface.Version != WDM_DSF_INTERFACE_V1_0) {
|
||||
// status = STATUS_REVISION_MISMATCH;
|
||||
// DoTraceLevelMessage(
|
||||
// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
|
||||
// "Lower DSF stack supports v(%x), requested v(%x), %!STATUS!",
|
||||
// dsfInterface.Interface.Version,
|
||||
// WDM_DSF_INTERFACE_V1_0,
|
||||
// status);
|
||||
// goto Done;
|
||||
// }
|
||||
|
||||
//
|
||||
// Ex functions should be both set or cleared.
|
||||
// Active/Inactive functions should be both set or cleared.
|
||||
// Ex function must be present.
|
||||
// Note: !!(ptr) expression below converts ptr value to true/false value.
|
||||
// I.e., ptr==NULL to false and ptr!=NULL to true.
|
||||
//
|
||||
if (!((!!(dsfInterface.IoConnectInterruptEx) ==
|
||||
!!(dsfInterface.IoDisconnectInterruptEx)) &&
|
||||
(!!(dsfInterface.IoReportInterruptActive) ==
|
||||
!!(dsfInterface.IoReportInterruptInactive)) &&
|
||||
(dsfInterface.IoConnectInterruptEx != NULL)
|
||||
)) {
|
||||
status = STATUS_DATA_ERROR;
|
||||
DoTraceLevelMessage(
|
||||
GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
|
||||
"Function mismatch detected in DSF interface, %!STATUS!",
|
||||
status);
|
||||
goto Done;
|
||||
}
|
||||
// //
|
||||
// // Ex functions should be both set or cleared.
|
||||
// // Active/Inactive functions should be both set or cleared.
|
||||
// // Ex function must be present.
|
||||
// // Note: !!(ptr) expression below converts ptr value to true/false value.
|
||||
// // I.e., ptr==NULL to false and ptr!=NULL to true.
|
||||
// //
|
||||
// if (!((!!(dsfInterface.IoConnectInterruptEx) ==
|
||||
// !!(dsfInterface.IoDisconnectInterruptEx)) &&
|
||||
// (!!(dsfInterface.IoReportInterruptActive) ==
|
||||
// !!(dsfInterface.IoReportInterruptInactive)) &&
|
||||
// (dsfInterface.IoConnectInterruptEx != NULL)
|
||||
// )) {
|
||||
// status = STATUS_DATA_ERROR;
|
||||
// DoTraceLevelMessage(
|
||||
// GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
|
||||
// "Function mismatch detected in DSF interface, %!STATUS!",
|
||||
// status);
|
||||
// goto Done;
|
||||
// }
|
||||
|
||||
//
|
||||
// Info is correct.
|
||||
//
|
||||
m_IoConnectInterruptEx = dsfInterface.IoConnectInterruptEx;
|
||||
m_IoDisconnectInterruptEx = dsfInterface.IoDisconnectInterruptEx;
|
||||
// //
|
||||
// // Info is correct.
|
||||
// //
|
||||
// m_IoConnectInterruptEx = dsfInterface.IoConnectInterruptEx;
|
||||
// m_IoDisconnectInterruptEx = dsfInterface.IoDisconnectInterruptEx;
|
||||
|
||||
//
|
||||
// If DSF interface provides active/inactive functions then use them
|
||||
//
|
||||
if (dsfInterface.IoReportInterruptActive != NULL)
|
||||
{
|
||||
m_IoReportInterruptActive = dsfInterface.IoReportInterruptActive;
|
||||
m_IoReportInterruptInactive = dsfInterface.IoReportInterruptInactive;
|
||||
}
|
||||
// //
|
||||
// // If DSF interface provides active/inactive functions then use them
|
||||
// //
|
||||
// if (dsfInterface.IoReportInterruptActive != NULL)
|
||||
// {
|
||||
// m_IoReportInterruptActive = dsfInterface.IoReportInterruptActive;
|
||||
// m_IoReportInterruptInactive = dsfInterface.IoReportInterruptInactive;
|
||||
// }
|
||||
|
||||
Done:
|
||||
// Done:
|
||||
|
||||
//
|
||||
// The contract with the DSF layer is to release the interface right away;
|
||||
// the embedded interrupt function ptrs will be valid until this driver is
|
||||
// unloaded.
|
||||
//
|
||||
if (derefQI) {
|
||||
dsfInterface.Interface.InterfaceDereference(dsfInterface.Interface.Context);
|
||||
}
|
||||
// //
|
||||
// // The contract with the DSF layer is to release the interface right away;
|
||||
// // the embedded interrupt function ptrs will be valid until this driver is
|
||||
// // unloaded.
|
||||
// //
|
||||
// if (derefQI) {
|
||||
// dsfInterface.Interface.InterfaceDereference(dsfInterface.Interface.Context);
|
||||
// }
|
||||
|
||||
return status;
|
||||
// return status;
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
_Must_inspect_result_
|
||||
|
|
|
@ -24,7 +24,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include "..\pnppriv.hpp"
|
||||
#include "../pnppriv.hpp"
|
||||
#include <wdmguid.h>
|
||||
|
||||
// Tracing support
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// Copyright (C) Microsoft. All rights reserved.
|
||||
//
|
||||
#include "..\pnppriv.hpp"
|
||||
#include "../pnppriv.hpp"
|
||||
|
||||
#include <initguid.h>
|
||||
#include <wdmguid.h>
|
||||
|
@ -307,70 +307,70 @@ FxPkgPnp::WriteStateToRegistry(
|
|||
ZwSetValueKey(RegKey, ValueName, 0, REG_DWORD, &Value, sizeof(Value));
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
FxPkgPnp::UpdateWmiInstanceForS0Idle(
|
||||
__in FxWmiInstanceAction Action
|
||||
)
|
||||
{
|
||||
FxWmiProvider* pProvider;
|
||||
NTSTATUS status;
|
||||
// NTSTATUS __REACTOS__
|
||||
// FxPkgPnp::UpdateWmiInstanceForS0Idle(
|
||||
// __in FxWmiInstanceAction Action
|
||||
// )
|
||||
// {
|
||||
// FxWmiProvider* pProvider;
|
||||
// NTSTATUS status;
|
||||
|
||||
switch(Action) {
|
||||
case AddInstance:
|
||||
if (m_PowerPolicyMachine.m_Owner->m_IdleSettings.WmiInstance == NULL) {
|
||||
FxWmiInstanceInternalCallbacks cb;
|
||||
// switch(Action) {
|
||||
// case AddInstance:
|
||||
// if (m_PowerPolicyMachine.m_Owner->m_IdleSettings.WmiInstance == NULL) {
|
||||
// FxWmiInstanceInternalCallbacks cb;
|
||||
|
||||
cb.SetInstance = _S0IdleSetInstance;
|
||||
cb.QueryInstance = _S0IdleQueryInstance;
|
||||
cb.SetItem = _S0IdleSetItem;
|
||||
// cb.SetInstance = _S0IdleSetInstance;
|
||||
// cb.QueryInstance = _S0IdleQueryInstance;
|
||||
// cb.SetItem = _S0IdleSetItem;
|
||||
|
||||
status = RegisterPowerPolicyWmiInstance(
|
||||
&GUID_POWER_DEVICE_ENABLE,
|
||||
&cb,
|
||||
&m_PowerPolicyMachine.m_Owner->m_IdleSettings.WmiInstance);
|
||||
// status = RegisterPowerPolicyWmiInstance(
|
||||
// &GUID_POWER_DEVICE_ENABLE,
|
||||
// &cb,
|
||||
// &m_PowerPolicyMachine.m_Owner->m_IdleSettings.WmiInstance);
|
||||
|
||||
if (!NT_SUCCESS(status)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pProvider = m_PowerPolicyMachine.m_Owner->m_IdleSettings.
|
||||
WmiInstance->GetProvider();
|
||||
// if (!NT_SUCCESS(status)) {
|
||||
// return status;
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// pProvider = m_PowerPolicyMachine.m_Owner->m_IdleSettings.
|
||||
// WmiInstance->GetProvider();
|
||||
|
||||
//
|
||||
// Enable the WMI GUID by adding the instance back to the provider's
|
||||
// list. If there is an error, ignore it. It just means we were
|
||||
// racing with another thread removing or adding the instance.
|
||||
//
|
||||
(void) pProvider->AddInstance(
|
||||
m_PowerPolicyMachine.m_Owner->m_IdleSettings.WmiInstance,
|
||||
TRUE
|
||||
);
|
||||
}
|
||||
break;
|
||||
// //
|
||||
// // Enable the WMI GUID by adding the instance back to the provider's
|
||||
// // list. If there is an error, ignore it. It just means we were
|
||||
// // racing with another thread removing or adding the instance.
|
||||
// //
|
||||
// (void) pProvider->AddInstance(
|
||||
// m_PowerPolicyMachine.m_Owner->m_IdleSettings.WmiInstance,
|
||||
// TRUE
|
||||
// );
|
||||
// }
|
||||
// break;
|
||||
|
||||
case RemoveInstance:
|
||||
if (m_PowerPolicyMachine.m_Owner->m_IdleSettings.WmiInstance != NULL) {
|
||||
//
|
||||
// Disable the WMI guid by removing it from the provider's list of
|
||||
// instances.
|
||||
//
|
||||
pProvider = m_PowerPolicyMachine.m_Owner->m_IdleSettings.
|
||||
WmiInstance->GetProvider();
|
||||
// case RemoveInstance:
|
||||
// if (m_PowerPolicyMachine.m_Owner->m_IdleSettings.WmiInstance != NULL) {
|
||||
// //
|
||||
// // Disable the WMI guid by removing it from the provider's list of
|
||||
// // instances.
|
||||
// //
|
||||
// pProvider = m_PowerPolicyMachine.m_Owner->m_IdleSettings.
|
||||
// WmiInstance->GetProvider();
|
||||
|
||||
pProvider->RemoveInstance(
|
||||
m_PowerPolicyMachine.m_Owner->m_IdleSettings.WmiInstance
|
||||
);
|
||||
}
|
||||
break;
|
||||
// pProvider->RemoveInstance(
|
||||
// m_PowerPolicyMachine.m_Owner->m_IdleSettings.WmiInstance
|
||||
// );
|
||||
// }
|
||||
// break;
|
||||
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
break;
|
||||
}
|
||||
// default:
|
||||
// ASSERT(FALSE);
|
||||
// break;
|
||||
// }
|
||||
|
||||
return STATUS_SUCCESS;;
|
||||
}
|
||||
// return STATUS_SUCCESS;;
|
||||
// }
|
||||
|
||||
VOID
|
||||
FxPkgPnp::ReadRegistryS0Idle(
|
||||
|
@ -401,69 +401,69 @@ FxPkgPnp::ReadRegistryS0Idle(
|
|||
}
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
FxPkgPnp::UpdateWmiInstanceForSxWake(
|
||||
__in FxWmiInstanceAction Action
|
||||
)
|
||||
{
|
||||
FxWmiProvider* pProvider;
|
||||
NTSTATUS status;
|
||||
// NTSTATUS __REACTOS__
|
||||
// FxPkgPnp::UpdateWmiInstanceForSxWake(
|
||||
// __in FxWmiInstanceAction Action
|
||||
// )
|
||||
// {
|
||||
// FxWmiProvider* pProvider;
|
||||
// NTSTATUS status;
|
||||
|
||||
switch(Action) {
|
||||
case AddInstance:
|
||||
if (m_PowerPolicyMachine.m_Owner->m_WakeSettings.WmiInstance == NULL) {
|
||||
FxWmiInstanceInternalCallbacks cb;
|
||||
// switch(Action) {
|
||||
// case AddInstance:
|
||||
// if (m_PowerPolicyMachine.m_Owner->m_WakeSettings.WmiInstance == NULL) {
|
||||
// FxWmiInstanceInternalCallbacks cb;
|
||||
|
||||
cb.SetInstance = _SxWakeSetInstance;
|
||||
cb.QueryInstance = _SxWakeQueryInstance;
|
||||
cb.SetItem = _SxWakeSetItem;
|
||||
// cb.SetInstance = _SxWakeSetInstance;
|
||||
// cb.QueryInstance = _SxWakeQueryInstance;
|
||||
// cb.SetItem = _SxWakeSetItem;
|
||||
|
||||
status = RegisterPowerPolicyWmiInstance(
|
||||
&GUID_POWER_DEVICE_WAKE_ENABLE,
|
||||
&cb,
|
||||
&m_PowerPolicyMachine.m_Owner->m_WakeSettings.WmiInstance);
|
||||
// status = RegisterPowerPolicyWmiInstance(
|
||||
// &GUID_POWER_DEVICE_WAKE_ENABLE,
|
||||
// &cb,
|
||||
// &m_PowerPolicyMachine.m_Owner->m_WakeSettings.WmiInstance);
|
||||
|
||||
if (!NT_SUCCESS(status)) {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
pProvider = m_PowerPolicyMachine.m_Owner->m_WakeSettings.
|
||||
WmiInstance->GetProvider();
|
||||
// if (!NT_SUCCESS(status)) {
|
||||
// return status;
|
||||
// }
|
||||
// } else {
|
||||
// pProvider = m_PowerPolicyMachine.m_Owner->m_WakeSettings.
|
||||
// WmiInstance->GetProvider();
|
||||
|
||||
//
|
||||
// Enable the WMI GUID by adding the instance back to the provider's
|
||||
// list. If there is an error, ignore it. It just means we were
|
||||
// racing with another thread removing or adding the instance.
|
||||
//
|
||||
(void) pProvider->AddInstance(
|
||||
m_PowerPolicyMachine.m_Owner->m_WakeSettings.WmiInstance,
|
||||
TRUE
|
||||
);
|
||||
}
|
||||
break;
|
||||
// //
|
||||
// // Enable the WMI GUID by adding the instance back to the provider's
|
||||
// // list. If there is an error, ignore it. It just means we were
|
||||
// // racing with another thread removing or adding the instance.
|
||||
// //
|
||||
// (void) pProvider->AddInstance(
|
||||
// m_PowerPolicyMachine.m_Owner->m_WakeSettings.WmiInstance,
|
||||
// TRUE
|
||||
// );
|
||||
// }
|
||||
// break;
|
||||
|
||||
case RemoveInstance:
|
||||
if (m_PowerPolicyMachine.m_Owner->m_WakeSettings.WmiInstance != NULL) {
|
||||
//
|
||||
// Disable the WMI guid by removing it from the provider's list of
|
||||
// instances.
|
||||
//
|
||||
pProvider = m_PowerPolicyMachine.m_Owner->m_WakeSettings.
|
||||
WmiInstance->GetProvider();
|
||||
// case RemoveInstance:
|
||||
// if (m_PowerPolicyMachine.m_Owner->m_WakeSettings.WmiInstance != NULL) {
|
||||
// //
|
||||
// // Disable the WMI guid by removing it from the provider's list of
|
||||
// // instances.
|
||||
// //
|
||||
// pProvider = m_PowerPolicyMachine.m_Owner->m_WakeSettings.
|
||||
// WmiInstance->GetProvider();
|
||||
|
||||
pProvider->RemoveInstance(
|
||||
m_PowerPolicyMachine.m_Owner->m_WakeSettings.WmiInstance
|
||||
);
|
||||
}
|
||||
break;
|
||||
// pProvider->RemoveInstance(
|
||||
// m_PowerPolicyMachine.m_Owner->m_WakeSettings.WmiInstance
|
||||
// );
|
||||
// }
|
||||
// break;
|
||||
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
break;
|
||||
}
|
||||
// default:
|
||||
// ASSERT(FALSE);
|
||||
// break;
|
||||
// }
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
// return STATUS_SUCCESS;
|
||||
// }
|
||||
|
||||
VOID
|
||||
FxPkgPnp::ReadRegistrySxWake(
|
||||
|
@ -530,7 +530,8 @@ FxPkgPnp::RevokeDmaEnablerResources(
|
|||
__in FxDmaEnabler *DmaEnabler
|
||||
)
|
||||
{
|
||||
DmaEnabler->RevokeResources();
|
||||
// DmaEnabler->RevokeResources();
|
||||
ROSWDFNOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
|
@ -31,7 +31,7 @@ Revision History:
|
|||
#include "pnppriv.hpp"
|
||||
|
||||
// Tracing support
|
||||
#include "InterruptObjectKm.tmh"
|
||||
// #include "InterruptObjectKm.tmh"
|
||||
|
||||
_Must_inspect_result_
|
||||
NTSTATUS
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
#define _PNPPRIVKM_H_
|
||||
|
||||
// public headers
|
||||
#include "WdfDmaEnabler.h"
|
||||
#include "wdfdmaenabler.h"
|
||||
|
||||
// private headers
|
||||
#include "FxIrpQueue.hpp"
|
||||
#include "FxCallback.hpp"
|
||||
#include "fxirpqueue.hpp"
|
||||
#include "fxcallback.hpp"
|
||||
|
||||
// <FxSystemWorkItem.hpp>
|
||||
__drv_functionClass(EVT_SYSTEMWORKITEM)
|
||||
|
@ -26,25 +26,41 @@ typedef EVT_SYSTEMWORKITEM *PFN_WDF_SYSTEMWORKITEM;
|
|||
|
||||
// </FxSystemWorkItem.hpp>
|
||||
|
||||
#include "FxCallbackSpinlock.hpp"
|
||||
#include "FxCallbackMutexLock.hpp"
|
||||
#include "FxPackage.hpp"
|
||||
#include "IfxMemory.hpp"
|
||||
#include "FxCallback.hpp"
|
||||
#include "FxRequestContext.hpp"
|
||||
#include "FxRequestContextTypes.h"
|
||||
#include "FxRequestBase.hpp"
|
||||
#include "FxRequest.hpp"
|
||||
#include "FxPkgPnp.hpp"
|
||||
#include "FxPkgIo.hpp"
|
||||
#include "FxIoQueue.hpp"
|
||||
#include "fxcallbackspinlock.hpp"
|
||||
#include "fxcallbackmutexlock.hpp"
|
||||
#include "fxpackage.hpp"
|
||||
#include "ifxmemory.hpp"
|
||||
#include "fxcallback.hpp"
|
||||
#include "fxrequestcontext.hpp"
|
||||
#include "fxrequestcontexttypes.h"
|
||||
#include "fxrequestbase.hpp"
|
||||
#include "fxrequest.hpp"
|
||||
#include "fxpkgpnp.hpp"
|
||||
#include "fxpkgio.hpp"
|
||||
#include "fxioqueue.hpp"
|
||||
|
||||
#include "FxDmaEnabler.hpp"
|
||||
#include "FxSystemWorkItem.hpp"
|
||||
#include "fxdmaenabler.hpp"
|
||||
#include "fxsystemworkitem.hpp"
|
||||
|
||||
// #include "FxDsf.h" // DSF support.
|
||||
// #include <device_common.h>
|
||||
// #include "FxTelemetry.hpp"
|
||||
// __REACTOS__
|
||||
typedef struct _STACK_DEVICE_CAPABILITIES {
|
||||
//
|
||||
// The capabilities as garnered from IRP_MN_QUERY_CAPABILITIES.
|
||||
//
|
||||
DEVICE_CAPABILITIES DeviceCaps;
|
||||
|
||||
//
|
||||
// The lowest-power D-state that a device can be in and still generate
|
||||
// a wake signal, indexed by system state. (PowerSystemUnspecified is
|
||||
// an unused slot in this array.)
|
||||
//
|
||||
DEVICE_WAKE_DEPTH DeepestWakeableDstate[PowerSystemHibernate+1];
|
||||
} STACK_DEVICE_CAPABILITIES, *PSTACK_DEVICE_CAPABILITIES;
|
||||
// end __REACTOS__
|
||||
|
||||
#include "FxDsf.h" // DSF support.
|
||||
#include <device_common.h>
|
||||
#include "FxTelemetry.hpp"
|
||||
|
||||
_Must_inspect_result_
|
||||
NTSTATUS
|
||||
|
|
|
@ -24,7 +24,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include "..\pnppriv.hpp"
|
||||
#include "../pnppriv.hpp"
|
||||
#include <wdmguid.h>
|
||||
|
||||
#include<ntstrsafe.h>
|
||||
|
|
|
@ -17,13 +17,13 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include "..\pnppriv.hpp"
|
||||
#include "../pnppriv.hpp"
|
||||
|
||||
#if FX_IS_KERNEL_MODE
|
||||
#include <usbdrivr.h>
|
||||
#endif
|
||||
|
||||
#include "FxUsbIdleInfo.hpp"
|
||||
#include "fxusbidleinfo.hpp"
|
||||
|
||||
extern "C" {
|
||||
#if defined(EVENT_TRACING)
|
||||
|
@ -163,33 +163,34 @@ FxPkgPnp::PowerPolicySubmitUsbIdleNotification(
|
|||
VOID
|
||||
)
|
||||
{
|
||||
FxIrp* usbIdleIrp;
|
||||
// FxIrp* usbIdleIrp;
|
||||
|
||||
//
|
||||
// This will be set to TRUE if USBSS completion event gets dropped.
|
||||
//
|
||||
m_PowerPolicyMachine.m_Owner->m_UsbIdle->m_EventDropped = FALSE;
|
||||
// //
|
||||
// // This will be set to TRUE if USBSS completion event gets dropped.
|
||||
// //
|
||||
// m_PowerPolicyMachine.m_Owner->m_UsbIdle->m_EventDropped = FALSE;
|
||||
|
||||
usbIdleIrp = &m_PowerPolicyMachine.m_Owner->m_UsbIdle->m_IdleIrp;
|
||||
// usbIdleIrp = &m_PowerPolicyMachine.m_Owner->m_UsbIdle->m_IdleIrp;
|
||||
|
||||
usbIdleIrp->Reuse();
|
||||
// usbIdleIrp->Reuse();
|
||||
|
||||
usbIdleIrp->SetCompletionRoutineEx(
|
||||
m_Device->GetDeviceObject(),
|
||||
_PowerPolicyUsbSelectiveSuspendCompletionRoutine,
|
||||
this);
|
||||
// usbIdleIrp->SetCompletionRoutineEx(
|
||||
// m_Device->GetDeviceObject(),
|
||||
// _PowerPolicyUsbSelectiveSuspendCompletionRoutine,
|
||||
// this);
|
||||
|
||||
usbIdleIrp->SetMajorFunction(IRP_MJ_INTERNAL_DEVICE_CONTROL);
|
||||
usbIdleIrp->SetParameterIoctlCode(
|
||||
IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION);
|
||||
usbIdleIrp->SetParameterIoctlInputBufferLength(
|
||||
sizeof(m_PowerPolicyMachine.m_Owner->m_UsbIdle->m_CallbackInfo));
|
||||
usbIdleIrp->SetParameterIoctlType3InputBuffer(
|
||||
(PVOID) &m_PowerPolicyMachine.m_Owner->m_UsbIdle->m_CallbackInfo);
|
||||
// usbIdleIrp->SetMajorFunction(IRP_MJ_INTERNAL_DEVICE_CONTROL);
|
||||
// usbIdleIrp->SetParameterIoctlCode(
|
||||
// IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION);
|
||||
// usbIdleIrp->SetParameterIoctlInputBufferLength(
|
||||
// sizeof(m_PowerPolicyMachine.m_Owner->m_UsbIdle->m_CallbackInfo));
|
||||
// usbIdleIrp->SetParameterIoctlType3InputBuffer(
|
||||
// (PVOID) &m_PowerPolicyMachine.m_Owner->m_UsbIdle->m_CallbackInfo);
|
||||
|
||||
m_PowerPolicyMachine.m_Owner->m_UsbIdle->m_IdleIrp.CallDriver(
|
||||
m_Device->GetAttachedDevice()
|
||||
);
|
||||
// m_PowerPolicyMachine.m_Owner->m_UsbIdle->m_IdleIrp.CallDriver(
|
||||
// m_Device->GetAttachedDevice()
|
||||
// );
|
||||
ROSWDFNOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
|
@ -23,7 +23,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include "..\pnppriv.hpp"
|
||||
#include "../pnppriv.hpp"
|
||||
|
||||
extern "C" {
|
||||
#if defined(EVENT_TRACING)
|
||||
|
@ -51,8 +51,8 @@ Return Value:
|
|||
--*/
|
||||
|
||||
{
|
||||
FxTransactionedEntry* ple;
|
||||
NTSTATUS status;
|
||||
// FxTransactionedEntry* ple;
|
||||
// NTSTATUS status;
|
||||
BOOLEAN result;
|
||||
|
||||
result = TRUE;
|
||||
|
@ -60,21 +60,21 @@ Return Value:
|
|||
//
|
||||
// Power up each dma enabler
|
||||
//
|
||||
if (m_DmaEnablerList != NULL) {
|
||||
m_DmaEnablerList->LockForEnum(GetDriverGlobals());
|
||||
// if (m_DmaEnablerList != NULL) {
|
||||
// m_DmaEnablerList->LockForEnum(GetDriverGlobals());
|
||||
|
||||
ple = NULL;
|
||||
while ((ple = m_DmaEnablerList->GetNextEntry(ple)) != NULL) {
|
||||
status = ((FxDmaEnabler*) ple->GetTransactionedObject())->PowerUp();
|
||||
// ple = NULL;
|
||||
// while ((ple = m_DmaEnablerList->GetNextEntry(ple)) != NULL) {
|
||||
// status = ((FxDmaEnabler*) ple->GetTransactionedObject())->PowerUp();
|
||||
|
||||
if (!NT_SUCCESS(status)) {
|
||||
result = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if (!NT_SUCCESS(status)) {
|
||||
// result = FALSE;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
m_DmaEnablerList->UnlockFromEnum(GetDriverGlobals());
|
||||
}
|
||||
// m_DmaEnablerList->UnlockFromEnum(GetDriverGlobals());
|
||||
// }
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -97,8 +97,8 @@ Return Value:
|
|||
|
||||
--*/
|
||||
{
|
||||
FxTransactionedEntry* ple;
|
||||
NTSTATUS status;
|
||||
// FxTransactionedEntry* ple;
|
||||
// NTSTATUS status;
|
||||
BOOLEAN result;
|
||||
|
||||
result = TRUE;
|
||||
|
@ -106,25 +106,25 @@ Return Value:
|
|||
//
|
||||
// Power up each dma enabler
|
||||
//
|
||||
if (m_DmaEnablerList != NULL) {
|
||||
m_DmaEnablerList->LockForEnum(GetDriverGlobals());
|
||||
// if (m_DmaEnablerList != NULL) {
|
||||
// m_DmaEnablerList->LockForEnum(GetDriverGlobals());
|
||||
|
||||
ple = NULL;
|
||||
while ((ple = m_DmaEnablerList->GetNextEntry(ple)) != NULL) {
|
||||
status = ((FxDmaEnabler*) ple->GetTransactionedObject())->PowerDown();
|
||||
// ple = NULL;
|
||||
// while ((ple = m_DmaEnablerList->GetNextEntry(ple)) != NULL) {
|
||||
// status = ((FxDmaEnabler*) ple->GetTransactionedObject())->PowerDown();
|
||||
|
||||
if (!NT_SUCCESS(status)) {
|
||||
//
|
||||
// We do not break out of the loop on power down failure. We will
|
||||
// continue to power down each channel regardless of the previous
|
||||
// channel's power down status.
|
||||
//
|
||||
result = FALSE;
|
||||
}
|
||||
}
|
||||
// if (!NT_SUCCESS(status)) {
|
||||
// //
|
||||
// // We do not break out of the loop on power down failure. We will
|
||||
// // continue to power down each channel regardless of the previous
|
||||
// // channel's power down status.
|
||||
// //
|
||||
// result = FALSE;
|
||||
// }
|
||||
// }
|
||||
|
||||
m_DmaEnablerList->UnlockFromEnum(GetDriverGlobals());
|
||||
}
|
||||
// m_DmaEnablerList->UnlockFromEnum(GetDriverGlobals());
|
||||
// }
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include "..\pnppriv.hpp"
|
||||
#include "../pnppriv.hpp"
|
||||
#include <wdmguid.h>
|
||||
|
||||
#if defined(EVENT_TRACING)
|
||||
|
@ -200,7 +200,11 @@ Return value:
|
|||
Pointer to the object that can be passed in to IoAllocateWorkItem
|
||||
--*/
|
||||
{
|
||||
return (PVOID) FxLibraryGlobals.DriverObject;
|
||||
// return (PVOID) FxLibraryGlobals.DriverObject;
|
||||
// __REACTOS__ : we don't have a WDF driver object here, use a child one
|
||||
|
||||
PFX_DRIVER_GLOBALS fxDriverGlobals = GetFxDriverGlobals(WdfDriverGlobals);
|
||||
return fxDriverGlobals->Driver->GetDriverObject();
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
|
@ -291,6 +295,7 @@ SendDeviceUsageNotificationWorker(
|
|||
}
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
_DeviceUsageNotificationWorkItem(
|
||||
__in MdDeviceObject DeviceObject,
|
||||
__in PVOID Context
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue