mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 08:42:05 +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
|
@ -68,6 +68,9 @@ Revision History:
|
|||
#define TRACINGDRIVER 0x00001000
|
||||
#define TRACINGPNPPOWERSTATES 0x00002000
|
||||
|
||||
#define TRACINGDMA 0x00004000 // __REACTOS__
|
||||
#define TRACINGIOTARGET 0x00008000 // __REACTOS__
|
||||
|
||||
extern "C" {
|
||||
void
|
||||
__cdecl
|
||||
|
@ -93,7 +96,9 @@ DoTraceLevelMessage (
|
|||
#define WPP_CLEANUP(DriverObject)
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
extern ULONG DebugLevel;
|
||||
extern ULONG DebugFlag;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -28,7 +28,7 @@ Revision History:
|
|||
#define _FXCALLBACKMUTEXLOCK_H_
|
||||
|
||||
extern "C" {
|
||||
#include "FxCallbackMutexLock.hpp.tmh"
|
||||
// #include "FxCallbackMutexLock.hpp.tmh"
|
||||
}
|
||||
|
||||
class FxCallbackMutexLock : public FxCallbackLock {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#ifndef _FXCXDEVICEINFO_H_
|
||||
#define _FXCXDEVICEINFO_H_
|
||||
|
||||
#include "FxDeviceCallbacks.hpp"
|
||||
#include "fxdevicecallbacks.hpp"
|
||||
|
||||
struct FxCxDeviceInfo : public FxStump {
|
||||
FxCxDeviceInfo(PFX_DRIVER_GLOBALS FxDriverGlobals) :
|
||||
|
|
|
@ -91,5 +91,5 @@ public:
|
|||
FxCxDeviceInfo* CxDeviceInfo;
|
||||
};
|
||||
|
||||
#endif __FXCXDEVICEINIT_HPP__
|
||||
#endif // __FXCXDEVICEINIT_HPP__
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@ Revision History:
|
|||
#ifndef _FXDEVICE_H_
|
||||
#define _FXDEVICE_H_
|
||||
|
||||
#include "FxCxDeviceInit.hpp"
|
||||
#include "FxDeviceInit.hpp"
|
||||
#include "FxTelemetry.hpp"
|
||||
#include "fxcxdeviceinit.hpp"
|
||||
#include "fxdeviceinit.hpp"
|
||||
#include "fxtelemetry.hpp"
|
||||
|
||||
struct FxWdmDeviceExtension {
|
||||
#if (FX_CORE_MODE == FX_CORE_USER_MODE)
|
||||
|
@ -1022,6 +1022,7 @@ public:
|
|||
static
|
||||
_Must_inspect_result_
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
Dispatch(
|
||||
__in MdDeviceObject DeviceObject,
|
||||
__in MdIrp OriginalIrp
|
||||
|
@ -1065,6 +1066,7 @@ public:
|
|||
static
|
||||
_Must_inspect_result_
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
DispatchWithLock(
|
||||
__in MdDeviceObject DeviceObject,
|
||||
__in MdIrp OriginalIrp
|
||||
|
@ -1470,7 +1472,7 @@ public:
|
|||
//
|
||||
ASSERT(m_DeviceObjectDeleted);
|
||||
|
||||
__super::DeleteObject();
|
||||
FxDeviceBase::DeleteObject(); // __super call
|
||||
}
|
||||
|
||||
_Must_inspect_result_
|
||||
|
@ -1761,6 +1763,7 @@ public:
|
|||
|
||||
static
|
||||
VOID
|
||||
STDCALL
|
||||
_InterfaceReferenceNoOp(
|
||||
__in_opt PVOID Context
|
||||
)
|
||||
|
@ -1771,6 +1774,7 @@ public:
|
|||
|
||||
static
|
||||
VOID
|
||||
STDCALL
|
||||
_InterfaceDereferenceNoOp(
|
||||
__in_opt PVOID Context
|
||||
)
|
||||
|
@ -1795,7 +1799,7 @@ public:
|
|||
VOID
|
||||
)
|
||||
{
|
||||
LogDeviceStartTelemetryEvent(GetDriverGlobals(), this);
|
||||
// LogDeviceStartTelemetryEvent(GetDriverGlobals(), this); __REACTOS__ : no-op
|
||||
}
|
||||
|
||||
virtual
|
||||
|
@ -2288,9 +2292,9 @@ public:
|
|||
};
|
||||
|
||||
#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
|
||||
#include "FxDeviceKm.hpp"
|
||||
#include "fxdevicekm.hpp"
|
||||
#else
|
||||
#include "FxDeviceUm.hpp"
|
||||
#include "fxdeviceum.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ struct FdoInit {
|
|||
|
||||
|
||||
|
||||
#include "FxDeviceInitShared.hpp"
|
||||
#include "fxdeviceinitshared.hpp"
|
||||
|
||||
struct ControlInit {
|
||||
ControlInit(
|
||||
|
@ -327,4 +327,4 @@ public:
|
|||
|
||||
};
|
||||
|
||||
#endif __FXDEVICEINIT_HPP__
|
||||
#endif // __FXDEVICEINIT_HPP__
|
||||
|
|
|
@ -49,6 +49,7 @@ struct FxDeviceText : public FxStump {
|
|||
}
|
||||
|
||||
static
|
||||
void
|
||||
_CleanupList(
|
||||
__inout PSINGLE_LIST_ENTRY Head
|
||||
)
|
||||
|
|
|
@ -25,7 +25,7 @@ Revision History:
|
|||
#ifndef _FXDRIVER_H_
|
||||
#define _FXDRIVER_H_
|
||||
|
||||
#include "FxDriverCallbacks.hpp"
|
||||
#include "fxdrivercallbacks.hpp"
|
||||
|
||||
|
||||
//
|
||||
|
@ -46,7 +46,7 @@ struct FxTraceInfo {
|
|||
// Unique value to retrieve the FxDriver* from the MdDriverObject. Use a value
|
||||
// that is not exposed to the driver writer through the dispatch table or WDM.
|
||||
//
|
||||
#define FX_DRIVER_ID (FxDriver::GetFxDriver)
|
||||
#define FX_DRIVER_ID ((PVOID)FxDriver::GetFxDriver)
|
||||
|
||||
//
|
||||
// The following are support classes for FxDriver
|
||||
|
@ -321,7 +321,7 @@ public:
|
|||
break;
|
||||
|
||||
default:
|
||||
return __super::QueryInterface(Params);
|
||||
return FxNonPagedObject::QueryInterface(Params); // __super call
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -340,7 +340,7 @@ public:
|
|||
//
|
||||
ASSERT(Mx::MxGetCurrentIrql() == PASSIVE_LEVEL);
|
||||
|
||||
__super::DeleteObject();
|
||||
FxNonPagedObject::DeleteObject(); // __super call
|
||||
}
|
||||
|
||||
virtual
|
||||
|
|
|
@ -117,9 +117,11 @@ class FxWorkItem;
|
|||
class IFxHasCallbacks;
|
||||
class IFxMemory;
|
||||
|
||||
enum FxObjectType;
|
||||
enum FxWmiInstanceAction;
|
||||
enum FxObjectType : UINT32;
|
||||
enum FxWmiInstanceAction : UINT32;
|
||||
enum FxDriverObjectUmFlags : USHORT;
|
||||
enum FxWakeInterruptEvents : UINT32;
|
||||
|
||||
|
||||
PVOID
|
||||
FxObjectHandleAlloc(
|
||||
|
@ -133,7 +135,7 @@ FxObjectHandleAlloc(
|
|||
);
|
||||
|
||||
#if (FX_CORE_MODE==FX_CORE_USER_MODE)
|
||||
#include "FxForwardUm.hpp"
|
||||
#include "fxforwardum.hpp"
|
||||
#endif
|
||||
|
||||
#endif // _FXFORWARD_HPP_
|
||||
|
|
|
@ -46,6 +46,11 @@ Revision History:
|
|||
#define _FXGLOBALS_H
|
||||
|
||||
#include "wdfglobals.h"
|
||||
#include <debug.h>
|
||||
|
||||
// REACTOS
|
||||
#define ROSWDFNOTIMPLEMENTED (DbgPrint("(%s:%d) ReactOS KMDF: %s not implemented\n", __RELFILE__, __LINE__, __FUNCTION__))
|
||||
// REACTOS
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -68,7 +73,7 @@ typedef enum FxTrackPowerOption : UCHAR {
|
|||
FxTrackPowerRefs,
|
||||
FxTrackPowerRefsAndStack,
|
||||
FxTrackPowerMaxValue
|
||||
};
|
||||
} FxTrackPowerOption;
|
||||
|
||||
typedef enum FxVerifierDownlevelOption {
|
||||
NotOkForDownLevel = 0,
|
||||
|
@ -847,13 +852,15 @@ struct FxLibraryGlobalsType {
|
|||
// tracing of WDF operations. The size member of this structure
|
||||
// allows versioning across multiple OS versions.
|
||||
//
|
||||
PWMI_WDF_NOTIFY_ROUTINES PerfTraceRoutines;
|
||||
//PWMI_WDF_NOTIFY_ROUTINES PerfTraceRoutines; __REACTOS__
|
||||
PVOID PerfTraceRoutines;
|
||||
|
||||
//
|
||||
// PerfTraceRoutines points here if the SystemTraceProvider failed
|
||||
// to provide trace routines.
|
||||
//
|
||||
WMI_WDF_NOTIFY_ROUTINES DummyPerfTraceRoutines;
|
||||
//WMI_WDF_NOTIFY_ROUTINES DummyPerfTraceRoutines; __REACTOS__
|
||||
PVOID DummyPerfTraceRoutines;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ Revision History:
|
|||
#ifndef _FXINTERRUPT_H_
|
||||
#define _FXINTERRUPT_H_
|
||||
|
||||
#include "FxWakeInterruptStateMachine.hpp"
|
||||
#include "fxwakeinterruptstatemachine.hpp"
|
||||
|
||||
//
|
||||
// We need two parameters for KeSynchronizeExecution when enabling
|
||||
|
@ -271,7 +271,7 @@ public:
|
|||
|
||||
_Must_inspect_result_
|
||||
NTSTATUS
|
||||
FxInterrupt::CreateWakeInterruptMachine(
|
||||
CreateWakeInterruptMachine(
|
||||
VOID
|
||||
);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ Revision History:
|
|||
#ifndef _FXIOQUEUE_H_
|
||||
#define _FXIOQUEUE_H_
|
||||
|
||||
#include "FxIoQueueCallbacks.hpp"
|
||||
#include "fxioqueuecallbacks.hpp"
|
||||
|
||||
extern "C" {
|
||||
#if defined(EVENT_TRACING)
|
||||
|
@ -1089,7 +1089,7 @@ public:
|
|||
break;
|
||||
|
||||
default:
|
||||
return __super::QueryInterface(Params);
|
||||
return FxNonPagedObject::QueryInterface(Params); // __super call
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -1230,7 +1230,7 @@ public:
|
|||
return CONTAINING_RECORD(Entry, FxIoQueue, m_PowerSListEntry);
|
||||
}
|
||||
|
||||
__declspec(noreturn)
|
||||
DECLSPEC_NORETURN
|
||||
VOID
|
||||
FatalError(
|
||||
__in NTSTATUS Status
|
||||
|
@ -1705,9 +1705,9 @@ protected:
|
|||
};
|
||||
|
||||
#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
|
||||
#include "FxIoQueueKm.hpp"
|
||||
#include "fxioqueuekm.hpp"
|
||||
#else
|
||||
#include "FxIoQueueUm.hpp"
|
||||
#include "fxioqueueum.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ struct FxInternalIoctlOthersContext : public FxRequestContext {
|
|||
}
|
||||
}
|
||||
|
||||
__super::ReleaseAndRestore(Request);
|
||||
FxRequestContext::ReleaseAndRestore(Request); // __super call
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -165,7 +165,7 @@ private:
|
|||
__in FxRequestBuffer* Buffer
|
||||
)
|
||||
{
|
||||
__super::StoreAndReferenceMemory(Buffer);
|
||||
FxRequestContext::StoreAndReferenceMemory(Buffer); // __super call
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -958,9 +958,9 @@ protected:
|
|||
|
||||
|
||||
#if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
|
||||
#include "FxIoTargetKm.hpp"
|
||||
#else if ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
|
||||
#include "FxIoTargetUm.hpp"
|
||||
#include "fxiotargetkm.hpp"
|
||||
#elif ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
|
||||
#include "fxiotargetum.hpp"
|
||||
#endif
|
||||
|
||||
#endif //_FXIOTARGET_H_
|
||||
|
|
|
@ -311,13 +311,13 @@ protected:
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
else {
|
||||
return __super::QueryInterface(Params);
|
||||
return FxIoTarget::QueryInterface(Params); // __super call
|
||||
}
|
||||
}
|
||||
|
||||
_Must_inspect_result_
|
||||
NTSTATUS
|
||||
FxIoTargetRemote::OpenLocalTargetByFile(
|
||||
OpenLocalTargetByFile(
|
||||
_In_ PWDF_IO_TARGET_OPEN_PARAMS OpenParams
|
||||
);
|
||||
|
||||
|
@ -432,9 +432,9 @@ protected:
|
|||
};
|
||||
|
||||
#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
|
||||
#include "FxIoTargetRemoteKm.hpp"
|
||||
#include "fxiotargetremotekm.hpp"
|
||||
#else
|
||||
#include "FxIoTargetRemoteUm.hpp"
|
||||
#include "fxiotargetremoteum.hpp"
|
||||
#endif
|
||||
|
||||
#endif // _FXIOTARGETREMOTE_H_
|
||||
|
|
|
@ -20,72 +20,33 @@ Environment:
|
|||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _FXIRP_HPP_
|
||||
#define _FXIRP_HPP_
|
||||
|
||||
class FxIrp {
|
||||
|
||||
friend struct FxAutoIrp;
|
||||
|
||||
private:
|
||||
MdIrp m_Irp;
|
||||
|
||||
public:
|
||||
|
||||
FxIrp() {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FxIrp(MdIrp irp) : m_Irp(irp)
|
||||
{
|
||||
}
|
||||
|
||||
// A function for when not assigning
|
||||
|
||||
MdIrp
|
||||
SetIrp(
|
||||
MdIrp irp
|
||||
);
|
||||
|
||||
MdIrp
|
||||
GetIrp(
|
||||
VOID
|
||||
|
@ -743,6 +704,7 @@ private:
|
|||
|
||||
static
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
_IrpSynchronousCompletion(
|
||||
__in MdDeviceObject DeviceObject,
|
||||
__in MdIrp OriginalIrp,
|
||||
|
@ -841,4 +803,4 @@ struct FxAutoIrp : public FxIrp {
|
|||
~FxAutoIrp();
|
||||
};
|
||||
|
||||
#endif // _FXIRP_H_
|
||||
#endif // _FXIRP_HPP_
|
||||
|
|
|
@ -31,9 +31,9 @@ Revision History:
|
|||
#define _FXIRPQUEUE_H_
|
||||
|
||||
#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
|
||||
#include "FxIrpKm.hpp"
|
||||
#include "fxirpkm.hpp"
|
||||
#else
|
||||
#include "FxIrpUm.hpp"
|
||||
#include "fxirpum.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -52,9 +52,9 @@ Revision History:
|
|||
#define FX_IRP_QUEUE_ENTRY_IDENTIFIER 1
|
||||
|
||||
#if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
|
||||
#include "FxIrpKm.hpp"
|
||||
#else if ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
|
||||
#include "FxIrpUm.hpp"
|
||||
#include "fxirpkm.hpp"
|
||||
#elif ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
|
||||
#include "fxirpum.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ WdfRegisterLibrary(
|
|||
#pragma alloc_text (PAGE, WdfVersionBind)
|
||||
#pragma alloc_text (PAGE, WdfVersionUnbind)
|
||||
#pragma alloc_text (PAGE, WdfRegisterLibrary)
|
||||
#pragma alloc_text (PAGE, WdfRegisterClassLibrary)
|
||||
// #pragma alloc_text (PAGE, WdfRegisterClassLibrary)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -246,4 +246,4 @@ WdfRegisterLibrary(
|
|||
TraceLoggingWideString(ClientImageName, "ClientImageName" ) \
|
||||
);
|
||||
|
||||
#endif __FXLDR_H__
|
||||
#endif // __FXLDR_H__
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
|
||||
|
||||
|
||||
#if defined(_M_ARM)
|
||||
#if defined(_M_ARM) || defined(__REACTOS__)
|
||||
#define FX_VF_PAGING
|
||||
#else
|
||||
#define FX_VF_PAGING __declspec(code_seg(FX_VF_SECTION_NAME_QUOTED(WDF_FX_VF_SECTION_NAME)))
|
||||
#endif
|
||||
|
||||
#define FX_VF_NAME_TO_IMP_NAME( fnName ) Vf_##fnName
|
||||
#define FX_VF_NAME_TO_SCOPED_IMP_NAME( classname, fnName ) classname##::Vf_##fnName
|
||||
#define FX_VF_NAME_TO_SCOPED_IMP_NAME( classname, fnName ) classname::Vf_##fnName
|
||||
#define FX_VF_QF_VOID
|
||||
#define FX_VF_QF_NTSTATUS _Must_inspect_result_
|
||||
#define FX_VF_DEFAULT_RT_VOID
|
||||
|
|
|
@ -88,4 +88,4 @@ FxIrpMdlFree(
|
|||
#define IoAllocateMdl use_FxMdlAllocate_instead
|
||||
#define IoFreeMdl use_FxMdlFree_instead
|
||||
|
||||
#endif __FXMDL_H__
|
||||
#endif // __FXMDL_H__
|
||||
|
|
|
@ -189,7 +189,7 @@ protected:
|
|||
return STATUS_SUCCESS;
|
||||
|
||||
default:
|
||||
return __super::QueryInterface(Params);
|
||||
return FxObject::QueryInterface(Params); // __super call
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ Revision History:
|
|||
extern "C" {
|
||||
#include "mx.h"
|
||||
}
|
||||
#include "FxMacros.hpp"
|
||||
#include "fxmacros.hpp"
|
||||
|
||||
#if (FX_CORE_MODE == FX_CORE_USER_MODE)
|
||||
//
|
||||
|
@ -81,15 +81,15 @@ extern const WDFFUNC *WdfFunctions;
|
|||
|
||||
#include "wdfcore.h"
|
||||
#include "wdfdevice.h"
|
||||
#include "wdfdevicepri.h"
|
||||
#include "wdfiotargetpri.h"
|
||||
// #include "wdfdevicepri.h"
|
||||
// #include "wdfiotargetpri.h"
|
||||
#include "wdfdriver.h"
|
||||
|
||||
#include "wdfmemory.h"
|
||||
|
||||
#include "wdfrequest.h"
|
||||
#include "wdfwmi.h"
|
||||
#include "wdfChildList.h"
|
||||
#include "wdfchildlist.h"
|
||||
#include "wdfpdo.h"
|
||||
#include "wdffdo.h"
|
||||
#include "wdfiotarget.h"
|
||||
|
@ -113,9 +113,9 @@ extern const WDFFUNC *WdfFunctions;
|
|||
#include "wdfhid.h"
|
||||
#endif
|
||||
|
||||
#pragma warning(disable:4200) // suppress nameless struct/union warning
|
||||
#pragma warning(disable:4201) // suppress nameless struct/union warning
|
||||
#pragma warning(disable:4214) // suppress bit field types other than int warning
|
||||
// #pragma warning(disable:4200) // suppress nameless struct/union warning
|
||||
// #pragma warning(disable:4201) // suppress nameless struct/union warning
|
||||
// #pragma warning(disable:4214) // suppress bit field types other than int warning
|
||||
#include <usb.h>
|
||||
#include <usbspec.h>
|
||||
#include "wdfusb.h"
|
||||
|
@ -160,7 +160,7 @@ typedef struct _WDF_OBJECT_CONTEXT_TYPE_INFO_V1_0 {
|
|||
|
||||
typedef struct _WDF_OBJECT_CONTEXT_TYPE_INFO_V1_0 *PWDF_OBJECT_CONTEXT_TYPE_INFO_V1_0;
|
||||
|
||||
#include "cobbled.hpp"
|
||||
// #include "cobbled.hpp"
|
||||
|
||||
} //extern "C"
|
||||
|
||||
|
@ -187,10 +187,10 @@ typedef enum _TRACE_INFORMATION_CLASS {
|
|||
#include <wmium.h>
|
||||
#endif // FX_CORE_MODE==FX_CORE_USER_MODE
|
||||
|
||||
#include "FxForward.hpp"
|
||||
#include "fxforward.hpp"
|
||||
|
||||
#if (FX_CORE_MODE == FX_CORE_USER_MODE)
|
||||
#include "HostFxUtil.h"
|
||||
#include "hostfxutil.h"
|
||||
#include "wdfplatform.h"
|
||||
#include "wdfplatformimpl.h"
|
||||
#include "debug.h"
|
||||
|
@ -198,187 +198,187 @@ typedef enum _TRACE_INFORMATION_CLASS {
|
|||
#include "wudfx_namespace_on.h"
|
||||
#include "wudfx.h"
|
||||
#include "wudfx_namespace_off.h"
|
||||
#include "DriverFrameworks-UserMode-UmEvents.h"
|
||||
#include "driverframeworks-usermode-umevents.h"
|
||||
#endif
|
||||
|
||||
#include "fxtypedefs.hpp"
|
||||
|
||||
#if defined(EVENT_TRACING)
|
||||
#include "fxwmicompat.h"
|
||||
#include "FxTrace.h"
|
||||
#include "fxtrace.h"
|
||||
#else
|
||||
#include "DbgTrace.h"
|
||||
#include "dbgtrace.h"
|
||||
#endif // EVENT_TRACING
|
||||
|
||||
#include "FxTypes.h"
|
||||
#include "fxtypes.h"
|
||||
#include "fxrequestcontexttypes.h"
|
||||
#include "FxPool.h"
|
||||
#include "fxpool.h"
|
||||
|
||||
#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
|
||||
#include "FxGlobalsKm.h"
|
||||
#include "FxPerfTraceKm.hpp"
|
||||
#include "DriverFrameworks-KernelMode-KmEvents.h"
|
||||
#include "fxglobalskm.h"
|
||||
#include "fxperftracekm.hpp"
|
||||
// #include "DriverFrameworks-KernelMode-KmEvents.h"
|
||||
#else
|
||||
#include "FxGlobalsUm.h"
|
||||
#include "fxglobalsum.h"
|
||||
#endif
|
||||
#include "FxPoolInlines.hpp"
|
||||
#include "fxpoolinlines.hpp"
|
||||
#include "fxverifier.h"
|
||||
#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
|
||||
#include "FxVerifierKm.h"
|
||||
#include "fxverifierkm.h"
|
||||
#else
|
||||
#include "FxVerifierUm.h"
|
||||
#include "fxverifierum.h"
|
||||
#include "device_common.h"
|
||||
#endif
|
||||
#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
|
||||
#include "FxMdl.h"
|
||||
#include "fxmdl.h"
|
||||
#endif
|
||||
|
||||
#include "FxProbeAndLock.h"
|
||||
#include "fxprobeandlock.h"
|
||||
//#include "FxPerfTraceKm.hpp"
|
||||
//#include <NtStrSafe.h>
|
||||
|
||||
#include "FxStump.hpp"
|
||||
#include "FxRequestBuffer.hpp"
|
||||
#include "FxTagTracker.hpp"
|
||||
#include "fxstump.hpp"
|
||||
#include "fxrequestbuffer.hpp"
|
||||
#include "fxtagtracker.hpp"
|
||||
|
||||
// internal locks
|
||||
#include "FxVerifierLock.hpp"
|
||||
#include "FxLock.hpp"
|
||||
#include "fxverifierlock.hpp"
|
||||
#include "fxlock.hpp"
|
||||
|
||||
// base objects
|
||||
#include "FxObject.hpp"
|
||||
#include "FxPagedObject.hpp"
|
||||
#include "FxNonPagedObject.hpp"
|
||||
#include "fxobject.hpp"
|
||||
#include "fxpagedobject.hpp"
|
||||
#include "fxnonpagedobject.hpp"
|
||||
|
||||
#include "fxhandle.h"
|
||||
|
||||
// external locks
|
||||
#include "FxWaitLock.hpp"
|
||||
#include "fxwaitlock.hpp"
|
||||
//#include "FxSpinLock.hpp"
|
||||
|
||||
// utitilty classes and functions
|
||||
#include "FxTransactionedList.hpp"
|
||||
#include "FxRelatedDeviceList.hpp"
|
||||
#include "FxDisposeList.hpp"
|
||||
#include "FxCollection.hpp"
|
||||
#include "StringUtil.hpp"
|
||||
#include "fxtransactionedlist.hpp"
|
||||
#include "fxrelateddevicelist.hpp"
|
||||
#include "fxdisposelist.hpp"
|
||||
#include "fxcollection.hpp"
|
||||
#include "stringutil.hpp"
|
||||
|
||||
// abstract classes
|
||||
#include "IFxHasCallbacks.hpp"
|
||||
#include "ifxhascallbacks.hpp"
|
||||
|
||||
// callback delegation and locking
|
||||
#include "FxSystemThread.hpp"
|
||||
#include "FxSystemWorkItem.hpp"
|
||||
#include "FxCallbackLock.hpp"
|
||||
#include "FxCallbackSpinLock.hpp"
|
||||
#include "FxCallbackMutexLock.hpp"
|
||||
#include "FxCallback.hpp"
|
||||
#include "FxSystemThread.hpp"
|
||||
#include "fxsystemthread.hpp"
|
||||
#include "fxsystemworkitem.hpp"
|
||||
#include "fxcallbacklock.hpp"
|
||||
#include "fxcallbackspinlock.hpp"
|
||||
#include "fxcallbackmutexlock.hpp"
|
||||
#include "fxcallback.hpp"
|
||||
#include "fxsystemthread.hpp"
|
||||
|
||||
#include "IFxMemory.hpp"
|
||||
#include "FxLookasideList.hpp"
|
||||
//#include "FxNPagedLookasideList.hpp"
|
||||
//#include "FxPagedLookasideList.hpp"
|
||||
#include "FxMemoryObject.hpp"
|
||||
#include "FxMemoryBuffer.hpp"
|
||||
#include "FxMemoryBufferFromPool.hpp"
|
||||
#include "FxMemoryBufferPreallocated.hpp"
|
||||
//#include "FxMemoryBufferFromLookaside.hpp"
|
||||
#include "FxRequestMemory.hpp"
|
||||
#include "FxRegKey.hpp"
|
||||
#include "FxAutoRegistry.hpp"
|
||||
#include "FxAutoString.hpp"
|
||||
#include "FxString.hpp"
|
||||
#include "ifxmemory.hpp"
|
||||
#include "fxlookasidelist.hpp"
|
||||
//#include "fxnpagedlookasidelist.hpp"
|
||||
//#include "fxpagedlookasidelist.hpp"
|
||||
#include "fxmemoryobject.hpp"
|
||||
#include "fxmemorybuffer.hpp"
|
||||
#include "fxmemorybufferfrompool.hpp"
|
||||
#include "fxmemorybufferpreallocated.hpp"
|
||||
//#include "fxmemorybufferfromlookaside.hpp"
|
||||
#include "fxrequestmemory.hpp"
|
||||
#include "fxregkey.hpp"
|
||||
#include "fxautoregistry.hpp"
|
||||
#include "fxautostring.hpp"
|
||||
#include "fxstring.hpp"
|
||||
|
||||
#include "FxValidateFunctions.hpp"
|
||||
#include "fxvalidatefunctions.hpp"
|
||||
|
||||
#include "FxResource.hpp"
|
||||
#include "FxRelatedDevice.hpp"
|
||||
#include "FxDeviceInterface.hpp"
|
||||
#include "FxQueryInterface.hpp"
|
||||
#include "FxDeviceText.hpp"
|
||||
#include "fxresource.hpp"
|
||||
#include "fxrelateddevice.hpp"
|
||||
#include "fxdeviceinterface.hpp"
|
||||
#include "fxqueryinterface.hpp"
|
||||
#include "fxdevicetext.hpp"
|
||||
|
||||
#if (FX_CORE_MODE == FX_CORE_USER_MODE)
|
||||
#include "FxIrpUm.hpp"
|
||||
#include "FxInterruptThreadpoolUm.hpp"
|
||||
#include "fxirpum.hpp"
|
||||
#include "fxinterruptthreadpoolum.hpp"
|
||||
#else
|
||||
#include "FxIrpKm.hpp"
|
||||
#include "fxirpkm.hpp"
|
||||
#endif
|
||||
#include "FxDriver.hpp"
|
||||
#include "fxdriver.hpp"
|
||||
|
||||
// generic package interface
|
||||
#include "FxPackage.hpp"
|
||||
#include "FxPkgGeneral.hpp"
|
||||
#include "FxDefaultIrpHandler.hpp"
|
||||
//#include "FxPoxKm.hpp"
|
||||
#include "FxPkgPnp.hpp"
|
||||
#include "FxWatchDog.hpp"
|
||||
#include "fxpackage.hpp"
|
||||
#include "fxpkggeneral.hpp"
|
||||
#include "fxdefaultirphandler.hpp"
|
||||
//#include "fxpoxkm.hpp"
|
||||
#include "fxpkgpnp.hpp"
|
||||
#include "fxwatchdog.hpp"
|
||||
|
||||
// Device supportfx
|
||||
#include "FxChildList.hpp"
|
||||
#include "FxCxDeviceInfo.hpp"
|
||||
#include "fxchildlist.hpp"
|
||||
#include "fxcxdeviceinfo.hpp"
|
||||
|
||||
#include "FxDevice.hpp"
|
||||
#include "fxdevice.hpp"
|
||||
|
||||
#include "FxPkgIo.hpp"
|
||||
#include "fxpkgio.hpp"
|
||||
|
||||
#include "FxDeviceToMxInterface.hpp"
|
||||
#include "fxdevicetomxinterface.hpp"
|
||||
|
||||
#include "FxIrpQueue.hpp"
|
||||
#include "FxRequestContext.hpp"
|
||||
#include "FxRequestCallbacks.hpp"
|
||||
#include "FxRequestBase.hpp"
|
||||
#include "FxRequest.hpp"
|
||||
#include "FxSyncRequest.hpp"
|
||||
#include "fxirpqueue.hpp"
|
||||
#include "fxrequestcontext.hpp"
|
||||
#include "fxrequestcallbacks.hpp"
|
||||
#include "fxrequestbase.hpp"
|
||||
#include "fxrequest.hpp"
|
||||
#include "fxsyncrequest.hpp"
|
||||
|
||||
#include "FxRequestValidateFunctions.hpp"
|
||||
#include "fxrequestvalidatefunctions.hpp"
|
||||
|
||||
// specialized irp handlers (ie packages)
|
||||
#include "FxPkgFdo.hpp"
|
||||
#include "FxPkgPdo.hpp"
|
||||
#include "fxpkgfdo.hpp"
|
||||
#include "fxpkgpdo.hpp"
|
||||
|
||||
//#include "FxWmiIrpHandler.hpp"
|
||||
//#include "FxWmiProvider.hpp"
|
||||
//#include "FxWmiInstance.hpp"
|
||||
//#include "fxwmiirphandler.hpp"
|
||||
//#include "fxwmiprovider.hpp"
|
||||
//#include "fxwmiinstance.hpp"
|
||||
|
||||
// queus for read, write, (internal) IOCTL
|
||||
#include "FxIoQueue.hpp"
|
||||
#include "FxFileObject.hpp"
|
||||
#include "FxIrpPreprocessInfo.hpp"
|
||||
#include "FxIrpDynamicDispatchInfo.hpp"
|
||||
#include "fxioqueue.hpp"
|
||||
#include "fxfileobject.hpp"
|
||||
#include "fxirppreprocessinfo.hpp"
|
||||
#include "fxirpdynamicdispatchinfo.hpp"
|
||||
|
||||
//#include "FxDpc.hpp"
|
||||
#include "FxWorkItem.hpp"
|
||||
#include "FxTimer.hpp"
|
||||
//#include "fxdpc.hpp"
|
||||
#include "fxworkitem.hpp"
|
||||
#include "fxtimer.hpp"
|
||||
#if FX_CORE_MODE==FX_CORE_USER_MODE
|
||||
#include "FxInterruptUm.hpp"
|
||||
#include "FxMessageDispatchUm.hpp"
|
||||
#include "fxinterruptum.hpp"
|
||||
#include "fxmessagedispatchum.hpp"
|
||||
#else
|
||||
#include "FxInterruptKm.hpp"
|
||||
#include "fxinterruptkm.hpp"
|
||||
#endif
|
||||
|
||||
// IO targets (device lower edge interface)
|
||||
#include "FxIoTarget.hpp"
|
||||
#include "FxIoTargetRemote.hpp"
|
||||
#include "FxIoTargetSelf.hpp"
|
||||
#include "fxiotarget.hpp"
|
||||
#include "fxiotargetremote.hpp"
|
||||
#include "fxiotargetself.hpp"
|
||||
|
||||
#include "FxUsbDevice.hpp"
|
||||
#include "FxUsbInterface.hpp"
|
||||
#include "FxUsbPipe.hpp"
|
||||
#include "fxusbdevice.hpp"
|
||||
#include "fxusbinterface.hpp"
|
||||
#include "fxusbpipe.hpp"
|
||||
|
||||
// DMA support
|
||||
//#include "FxDmaEnabler.hpp"
|
||||
//#include "FxDmaTransaction.hpp"
|
||||
//#include "FxCommonBuffer.hpp"
|
||||
//#include "fxdmaenabler.hpp"
|
||||
//#include "fxdmatransaction.hpp"
|
||||
//#include "fxcommonbuffer.hpp"
|
||||
|
||||
// Triage info.
|
||||
#include "wdftriage.h"
|
||||
// #include "wdftriage.h"
|
||||
|
||||
|
||||
#include "FxPkgIoShared.hpp"
|
||||
#include "fxpkgioshared.hpp"
|
||||
|
||||
#if FX_CORE_MODE==FX_CORE_USER_MODE
|
||||
#include "UfxVerifier.h"
|
||||
#include "ufxverifier.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ enum FxHandleFlags {
|
|||
// We cannot define FxHandleValueMask as an enumerant in FxHandleFlags because
|
||||
// an enum is limited to sizeof(ULONG), which doesn't work for us on a 64 bit OS
|
||||
//
|
||||
extern __declspec(selectany) const ULONG_PTR FxHandleValueMask = (~((ULONG_PTR) FxHandleFlagMask));
|
||||
extern DECLSPEC_SELECTANY const ULONG_PTR FxHandleValueMask = (~((ULONG_PTR) FxHandleFlagMask));
|
||||
|
||||
//
|
||||
// The type itself is aligned, but the pointer is not b/c those interested in the
|
||||
|
@ -114,7 +114,7 @@ struct FxQueryInterfaceParams {
|
|||
// 1) have its size rounded up to an alignment value
|
||||
// 2) extra size and context header appended to the allocation
|
||||
//
|
||||
enum FxObjectType {
|
||||
enum FxObjectType : UINT32 {
|
||||
FxObjectTypeInvalid = 0,
|
||||
FxObjectTypeInternal,
|
||||
FxObjectTypeExternal,
|
||||
|
|
|
@ -467,6 +467,7 @@ protected:
|
|||
_Must_inspect_result_
|
||||
static
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
_PnpFilteredStartDeviceCompletionRoutine(
|
||||
__in MdDeviceObject DeviceObject,
|
||||
__inout MdIrp Irp,
|
||||
|
@ -476,6 +477,7 @@ protected:
|
|||
_Must_inspect_result_
|
||||
static
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
_PnpStartDeviceCompletionRoutine(
|
||||
__in MdDeviceObject DeviceObject,
|
||||
__inout MdIrp Irp,
|
||||
|
|
|
@ -26,7 +26,7 @@ Revision History:
|
|||
#ifndef _FXPKGGENERAL_H_
|
||||
#define _FXPKGGENERAL_H_
|
||||
|
||||
#include "FxFileObjectCallbacks.hpp"
|
||||
#include "fxfileobjectcallbacks.hpp"
|
||||
|
||||
class FxShutDown : public FxCallback {
|
||||
|
||||
|
|
|
@ -28,10 +28,10 @@ Revision History:
|
|||
|
||||
|
||||
|
||||
#include "FxPkgIoShared.hpp"
|
||||
#include "FxIrpDynamicDispatchInfo.hpp"
|
||||
#include "FxDeviceCallbacks.hpp"
|
||||
#include "FxCxDeviceInfo.hpp"
|
||||
#include "fxpkgioshared.hpp"
|
||||
#include "fxirpdynamicdispatchinfo.hpp"
|
||||
#include "fxdevicecallbacks.hpp"
|
||||
#include "fxcxdeviceinfo.hpp"
|
||||
|
||||
//
|
||||
// This flag is or-ed with a pointer value that is ptr aligned, only lower 2 bits are available.
|
||||
|
|
|
@ -284,6 +284,7 @@ private:
|
|||
|
||||
static
|
||||
VOID
|
||||
STDCALL
|
||||
_QueryCapsWorkItem(
|
||||
__in MdDeviceObject DeviceObject,
|
||||
__in PVOID Context
|
||||
|
@ -574,6 +575,7 @@ private:
|
|||
|
||||
static
|
||||
VOID
|
||||
STDCALL
|
||||
_RemoveAndReenumerateSelf(
|
||||
__in PVOID Context
|
||||
);
|
||||
|
|
|
@ -76,9 +76,9 @@ enum FxStateMachineDeviceType {
|
|||
|
||||
// @@SMVERIFY_SPLIT_END
|
||||
|
||||
#include "FxPnpCallbacks.hpp"
|
||||
#include "fxpnpcallbacks.hpp"
|
||||
|
||||
#include "FxEventQueue.hpp"
|
||||
#include "fxeventqueue.hpp"
|
||||
|
||||
//
|
||||
// Bit-flags for tracking which callback is currently executing.
|
||||
|
@ -119,11 +119,11 @@ typedef struct _POWER_THREAD_INTERFACE {
|
|||
// be instantiated only in drivers which are the power policy owners
|
||||
// for their device stacks, which usually amounts to the being the FDO.
|
||||
//
|
||||
#include "FxPnpStateMachine.hpp"
|
||||
#include "FxPowerStateMachine.hpp"
|
||||
#include "FxPowerPolicyStateMachine.hpp"
|
||||
#include "fxpnpstatemachine.hpp"
|
||||
#include "fxpowerstatemachine.hpp"
|
||||
#include "fxpowerpolicystatemachine.hpp"
|
||||
|
||||
#include "FxSelfManagedIoStateMachine.hpp"
|
||||
#include "fxselfmanagediostatemachine.hpp"
|
||||
|
||||
//
|
||||
// Group these here instead of in the individual headers because, for some reason,
|
||||
|
@ -425,6 +425,11 @@ struct FxPowerCaps {
|
|||
ULONG D3Latency;
|
||||
};
|
||||
|
||||
enum FxWmiInstanceAction : UINT32 {
|
||||
AddInstance,
|
||||
RemoveInstance
|
||||
};
|
||||
|
||||
struct FxEnumerationInfo : public FxStump {
|
||||
public:
|
||||
FxEnumerationInfo(
|
||||
|
@ -1732,37 +1737,37 @@ protected:
|
|||
|
||||
static
|
||||
WDF_DEVICE_POWER_STATE
|
||||
FxPkgPnp::PowerUpFailedDerefParentNP(
|
||||
PowerUpFailedDerefParentNP(
|
||||
__inout FxPkgPnp* This
|
||||
);
|
||||
|
||||
static
|
||||
WDF_DEVICE_POWER_STATE
|
||||
FxPkgPnp::PowerUpFailedNP(
|
||||
PowerUpFailedNP(
|
||||
__inout FxPkgPnp* This
|
||||
);
|
||||
|
||||
static
|
||||
WDF_DEVICE_POWER_STATE
|
||||
FxPkgPnp::PowerNotifyingD0ExitToWakeInterrupts(
|
||||
PowerNotifyingD0ExitToWakeInterrupts(
|
||||
__inout FxPkgPnp* This
|
||||
);
|
||||
|
||||
static
|
||||
WDF_DEVICE_POWER_STATE
|
||||
FxPkgPnp::PowerNotifyingD0EntryToWakeInterrupts(
|
||||
PowerNotifyingD0EntryToWakeInterrupts(
|
||||
__inout FxPkgPnp* This
|
||||
);
|
||||
|
||||
static
|
||||
WDF_DEVICE_POWER_STATE
|
||||
FxPkgPnp::PowerNotifyingD0ExitToWakeInterruptsNP(
|
||||
PowerNotifyingD0ExitToWakeInterruptsNP(
|
||||
__inout FxPkgPnp* This
|
||||
);
|
||||
|
||||
static
|
||||
WDF_DEVICE_POWER_STATE
|
||||
FxPkgPnp::PowerNotifyingD0EntryToWakeInterruptsNP(
|
||||
PowerNotifyingD0EntryToWakeInterruptsNP(
|
||||
__inout FxPkgPnp* This
|
||||
);
|
||||
|
||||
|
@ -3953,12 +3958,14 @@ private:
|
|||
|
||||
static
|
||||
VOID
|
||||
STDCALL
|
||||
_PowerThreadInterfaceReference(
|
||||
__inout PVOID Context
|
||||
);
|
||||
|
||||
static
|
||||
VOID
|
||||
STDCALL
|
||||
_PowerThreadInterfaceDereference(
|
||||
__inout PVOID Context
|
||||
);
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#ifndef _FXPOWERPOLICYSTATEMACHINE_H_
|
||||
#define _FXPOWERPOLICYSTATEMACHINE_H_
|
||||
|
||||
#include "FxPowerIdleStateMachine.hpp"
|
||||
#include "FxPoxInterface.hpp"
|
||||
#include "fxpoweridlestatemachine.hpp"
|
||||
#include "fxpoxinterface.hpp"
|
||||
|
||||
// @@SMVERIFY_SPLIT_BEGIN
|
||||
//
|
||||
|
|
|
@ -44,7 +44,7 @@ enum FxPowerEvent {
|
|||
//
|
||||
PowerSingularEventMask = PowerParentToD0,
|
||||
|
||||
PowerEventMaximum = 0xFFFFFFFF,
|
||||
PowerEventMaximum = 0xFFFF,
|
||||
};
|
||||
|
||||
union FxPowerStateInfo {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#ifndef _FXPOXINTERFACE_H_
|
||||
#define _FXPOXINTERFACE_H_
|
||||
|
||||
#include "FxDevicePwrReqStateMachine.hpp"
|
||||
#include "fxdevicepwrreqstatemachine.hpp"
|
||||
|
||||
class FxPoxInterface {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
__in PFX_DRIVER_GLOBALS FxDriverGlobals
|
||||
)
|
||||
{
|
||||
__super::LockForEnum(FxDriverGlobals);
|
||||
FxSpinLockTransactionedList::LockForEnum(FxDriverGlobals); // __super call
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -27,7 +27,7 @@ public:
|
|||
__in PFX_DRIVER_GLOBALS FxDriverGlobals
|
||||
)
|
||||
{
|
||||
__super::UnlockFromEnum(FxDriverGlobals);
|
||||
FxSpinLockTransactionedList::UnlockFromEnum(FxDriverGlobals); // __super call
|
||||
}
|
||||
|
||||
_Must_inspect_result_
|
||||
|
@ -109,4 +109,4 @@ public:
|
|||
ULONG m_NeedReportMissing;
|
||||
};
|
||||
|
||||
#endif _FXRELATEDDEVICELIST_H_
|
||||
#endif // _FXRELATEDDEVICELIST_H_
|
||||
|
|
|
@ -639,7 +639,7 @@ protected:
|
|||
);
|
||||
|
||||
#if DBG
|
||||
FxRequest::~FxRequest(
|
||||
~FxRequest(
|
||||
VOID
|
||||
);
|
||||
#endif // DBG
|
||||
|
@ -1300,7 +1300,7 @@ public:
|
|||
|
||||
ASSERT(m_ForwardRequestToParent == FALSE);
|
||||
|
||||
__super::ClearFieldsForReuse();
|
||||
FxRequestBase::ClearFieldsForReuse(); // __super call
|
||||
}
|
||||
|
||||
virtual
|
||||
|
|
|
@ -30,7 +30,9 @@ Revision History:
|
|||
#ifndef _FXREQUESTBASE_H_
|
||||
#define _FXREQUESTBASE_H_
|
||||
|
||||
#include "FxRequestCallbacks.hpp"
|
||||
#include "fxrequestcallbacks.hpp"
|
||||
|
||||
#define WDF_REQUEST_REUSE_MUST_COMPLETE 2
|
||||
|
||||
|
||||
//
|
||||
|
@ -293,6 +295,7 @@ public:
|
|||
}
|
||||
|
||||
__inline
|
||||
BOOLEAN
|
||||
HasContext(
|
||||
VOID
|
||||
)
|
||||
|
@ -690,7 +693,7 @@ public:
|
|||
VOID
|
||||
);
|
||||
|
||||
__declspec(noreturn)
|
||||
DECLSPEC_NORETURN
|
||||
VOID
|
||||
FatalError(
|
||||
__in NTSTATUS Status
|
||||
|
@ -950,9 +953,9 @@ protected:
|
|||
};
|
||||
|
||||
#if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
|
||||
#include "FxRequestBaseKm.hpp"
|
||||
#else if ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
|
||||
#include "FxRequestBaseUm.hpp"
|
||||
#include "fxrequestbasekm.hpp"
|
||||
#elif ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
|
||||
#include "fxrequestbaseum.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -148,9 +148,9 @@ public:
|
|||
};
|
||||
|
||||
#if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
|
||||
#include "FxRequestBufferKm.hpp"
|
||||
#else if ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
|
||||
#include "FxRequestBufferUm.hpp"
|
||||
#include "fxrequestbufferkm.hpp"
|
||||
#elif ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
|
||||
#include "fxrequestbufferum.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ protected:
|
|||
ASSERTMSG("FxSyncRequest::operator new called, should only be"
|
||||
" declared on the stack\n", FALSE);
|
||||
|
||||
return NULL;
|
||||
return (PVOID)1;
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
VOID
|
||||
)
|
||||
{
|
||||
NTSTATUS status;
|
||||
NTSTATUS status = STATUS_SUCCESS;
|
||||
|
||||
#if (FX_CORE_MODE == FX_CORE_USER_MODE)
|
||||
//
|
||||
|
@ -118,4 +118,4 @@ public:
|
|||
BOOLEAN m_ClearContextOnDestroy;
|
||||
};
|
||||
|
||||
#endif _FXSYNCREQUEST_H_
|
||||
#endif // _FXSYNCREQUEST_H_
|
||||
|
|
|
@ -256,6 +256,7 @@ private:
|
|||
//
|
||||
static
|
||||
VOID
|
||||
STDCALL
|
||||
StaticThreadThunk(
|
||||
__inout PVOID Context
|
||||
);
|
||||
|
@ -281,6 +282,7 @@ private:
|
|||
//
|
||||
static
|
||||
VOID
|
||||
STDCALL
|
||||
StaticReaperThunk(
|
||||
__inout PVOID Context
|
||||
);
|
||||
|
|
|
@ -130,7 +130,7 @@ public:
|
|||
break;
|
||||
|
||||
default:
|
||||
return __super::QueryInterface(Params);
|
||||
return FxNonPagedObject::QueryInterface(Params); // __super call
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
|
|
@ -28,19 +28,19 @@ Notes:
|
|||
#pragma once
|
||||
|
||||
#include <strsafe.h>
|
||||
#include "FxTelemetryCommon.hpp"
|
||||
#include "fxtelemetrycommon.hpp"
|
||||
|
||||
#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
|
||||
#include "FxTelemetryKm.hpp"
|
||||
#include "fxtelemetrykm.hpp"
|
||||
#else
|
||||
#include "FxTelemetryUm.hpp"
|
||||
#include "fxtelemetryum.hpp"
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
TRACELOGGING_DECLARE_PROVIDER(g_TelemetryProvider);
|
||||
// TRACELOGGING_DECLARE_PROVIDER(g_TelemetryProvider); __REACTOS__
|
||||
|
||||
#define FX_TELEMETRY_ENABLED(TraceHandle, Globals) \
|
||||
(TraceHandle && IsDriverTelemetryContextInitialized(Globals)) \
|
||||
|
|
|
@ -33,8 +33,8 @@ Notes:
|
|||
// MmGetSystemRoutineAddress. This allows our code to be backwards compatible to Win7
|
||||
//
|
||||
#define TLG_HAVE_EVENT_SET_INFORMATION 2
|
||||
#include <traceloggingprovider.h>
|
||||
#include <telemetry\MicrosoftTelemetry.h>
|
||||
// #include <traceloggingprovider.h>
|
||||
// #include <telemetry\MicrosoftTelemetry.h>
|
||||
|
||||
// WDF01000.sys
|
||||
#define KMDF_FX_TRACE_LOGGING_PROVIDER_NAME "Microsoft.Wdf.KMDF.Fx"
|
||||
|
|
|
@ -274,7 +274,9 @@ public:
|
|||
|
||||
__inline
|
||||
NTSTATUS
|
||||
#ifdef _MSC_VER
|
||||
#pragma prefast(suppress:__WARNING_UNMATCHED_DEFN, "_Must_inspect_result_ not needed in kernel mode as the function always succeeds");
|
||||
#endif
|
||||
Initialize(
|
||||
VOID
|
||||
)
|
||||
|
|
|
@ -31,11 +31,11 @@ Revision History:
|
|||
|
||||
#if (FX_CORE_MODE==FX_CORE_KERNEL_MODE)
|
||||
|
||||
#include "fxtypedefsKm.hpp"
|
||||
#include "fxtypedefskm.hpp"
|
||||
|
||||
#else
|
||||
|
||||
#include "fxtypedefsUm.hpp"
|
||||
#include "fxtypedefsum.hpp"
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ Revision History:
|
|||
#ifndef _FXUSBDEVICE_H_
|
||||
#define _FXUSBDEVICE_H_
|
||||
|
||||
#include "FxUsbRequestContext.hpp"
|
||||
#include "fxusbrequestcontext.hpp"
|
||||
|
||||
typedef enum _FX_URB_TYPE : UCHAR {
|
||||
FxUrbTypeLegacy,
|
||||
|
@ -214,6 +214,7 @@ public:
|
|||
);
|
||||
|
||||
__inline
|
||||
VOID
|
||||
CopyDeviceDescriptor(
|
||||
__out PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor
|
||||
)
|
||||
|
@ -449,7 +450,9 @@ public:
|
|||
PURB* Urb
|
||||
);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:28285)
|
||||
#endif
|
||||
__checkReturn
|
||||
NTSTATUS
|
||||
CreateIsochUrb(
|
||||
|
|
|
@ -37,6 +37,7 @@ private:
|
|||
__drv_maxIRQL(PASSIVE_LEVEL)
|
||||
static
|
||||
VOID
|
||||
STDCALL
|
||||
_UsbIdleCallback(
|
||||
__in PVOID Context
|
||||
);
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
extern "C" {
|
||||
#include <usbdrivr.h>
|
||||
#include <WdfUsb.h>
|
||||
#include <wdfusb.h>
|
||||
}
|
||||
|
||||
#include "FxUsbRequestContext.hpp"
|
||||
#include "fxusbrequestcontext.hpp"
|
||||
|
||||
#define FX_USB_INTERFACE_TAG 'uItG' //using a random uniqure value
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#ifndef _FXUSBPIPE_H_
|
||||
#define _FXUSBPIPE_H_
|
||||
|
||||
#include "FxUsbRequestContext.hpp"
|
||||
#include "FxUsbInterface.hpp"
|
||||
#include "fxusbrequestcontext.hpp"
|
||||
#include "fxusbinterface.hpp"
|
||||
|
||||
//
|
||||
// Technically, EHCI can support 4MB, but the usb driver stack doesn't
|
||||
|
|
|
@ -48,7 +48,7 @@ struct FxUsbRequestContext : public FxRequestContext {
|
|||
)
|
||||
{
|
||||
m_UsbParameters.UsbdStatus = GetUsbdStatus();
|
||||
__super::CopyParameters(Request);
|
||||
FxRequestContext::CopyParameters(Request); // __super call
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
break;
|
||||
|
||||
default:
|
||||
return __super::QueryInterface(Params);
|
||||
return FxNonPagedObject::QueryInterface(Params); // __super call
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
|
|
@ -137,8 +137,8 @@ IsFxVerifierFunctionTableHooking(
|
|||
}
|
||||
}
|
||||
|
||||
DECLSPEC_NORETURN
|
||||
VOID
|
||||
__declspec(noreturn)
|
||||
FxVerifierBugCheckWorker(
|
||||
__in PFX_DRIVER_GLOBALS FxDriverGlobals,
|
||||
__in WDF_BUGCHECK_CODES WdfBugCheckCode,
|
||||
|
@ -146,8 +146,8 @@ FxVerifierBugCheckWorker(
|
|||
__in_opt ULONG_PTR BugCheckParameter3 = 0
|
||||
);
|
||||
|
||||
DECLSPEC_NORETURN
|
||||
VOID
|
||||
__declspec(noreturn)
|
||||
FxVerifierNullBugCheck(
|
||||
__in PFX_DRIVER_GLOBALS FxDriverGlobals,
|
||||
__in PVOID ReturnAddress
|
||||
|
|
|
@ -157,7 +157,7 @@ extern "C" {
|
|||
#define FX_CALLBACKLOCK_ORDER_PACKAGE 0x30
|
||||
#define FX_CALLBACKLOCK_ORDER_QUEUE 0x31
|
||||
|
||||
#define FX_VERIFIER_LOCK_ENTRY(FX_OBJECT_TYPE, FX_LOCK_ORDER) { ##FX_OBJECT_TYPE, ##FX_LOCK_ORDER }
|
||||
#define FX_VERIFIER_LOCK_ENTRY(FX_OBJECT_TYPE, FX_LOCK_ORDER) { FX_OBJECT_TYPE, FX_LOCK_ORDER }
|
||||
|
||||
// Internal FxLock spinlock entries
|
||||
#define FX_VERIFIER_LOCK_ENTRIES() \
|
||||
|
@ -303,7 +303,7 @@ private:
|
|||
);
|
||||
|
||||
void
|
||||
FxVerifierLock::FxVerifierLockDumpDetails(
|
||||
FxVerifierLockDumpDetails(
|
||||
__in FxVerifierLock* Lock,
|
||||
__in PVOID curThread,
|
||||
__in FxVerifierLock* PerThreadList
|
||||
|
|
|
@ -337,7 +337,7 @@ public:
|
|||
Initialize(
|
||||
)
|
||||
{
|
||||
return __super::Initialize();
|
||||
return FxWaitLockInternal::Initialize(); // __super call
|
||||
}
|
||||
|
||||
FxWaitLock(
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
//
|
||||
const UCHAR FxWakeInterruptEventQueueDepth = 8;
|
||||
|
||||
enum FxWakeInterruptEvents {
|
||||
enum FxWakeInterruptEvents : UINT32 {
|
||||
WakeInterruptEventInvalid = 0x00,
|
||||
WakeInterruptEventIsr = 0x01,
|
||||
WakeInterruptEventEnteringD0 = 0x02,
|
||||
|
|
|
@ -24,7 +24,7 @@ Revision History:
|
|||
#ifndef __FX_DMA_ENABLER_HPP__
|
||||
#define __FX_DMA_ENABLER_HPP__
|
||||
|
||||
#include "FxDmaEnablerCallbacks.hpp"
|
||||
#include "fxdmaenablercallbacks.hpp"
|
||||
|
||||
//
|
||||
// Dma Description structure
|
||||
|
|
|
@ -250,6 +250,7 @@ VOID
|
|||
);
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(*PFN_POX_ACTIVATE_COMPONENT) (
|
||||
__in POHANDLE Handle,
|
||||
__in ULONG Component,
|
||||
|
@ -257,6 +258,7 @@ typedef
|
|||
);
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(*PFN_POX_IDLE_COMPONENT) (
|
||||
__in POHANDLE Handle,
|
||||
__in ULONG Component,
|
||||
|
@ -456,7 +458,7 @@ private:
|
|||
} FX_DRIVER_TRACKER_CACHE_AWARE, *PFX_DRIVER_TRACKER_CACHE_AWARE;
|
||||
|
||||
|
||||
#include "FxGlobals.h"
|
||||
#include "fxglobals.h"
|
||||
|
||||
|
||||
//
|
||||
|
|
|
@ -27,7 +27,7 @@ Revision History:
|
|||
#ifndef _FXINTERRUPTKM_H_
|
||||
#define _FXINTERRUPTKM_H_
|
||||
|
||||
#include "FxInterrupt.hpp"
|
||||
#include "fxinterrupt.hpp"
|
||||
|
||||
__inline
|
||||
struct _KINTERRUPT*
|
||||
|
|
|
@ -127,7 +127,7 @@ FxIoContext::ReleaseAndRestore(
|
|||
//
|
||||
// Release the other buffer and all __super related fields
|
||||
//
|
||||
__super::ReleaseAndRestore(Request);
|
||||
FxRequestContext::ReleaseAndRestore(Request); // __super call
|
||||
}
|
||||
|
||||
__inline
|
||||
|
|
|
@ -53,7 +53,7 @@ VOID
|
|||
__in PVOID CancelContext
|
||||
);
|
||||
|
||||
#include "FxIrp.hpp"
|
||||
#include "fxirp.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -66,6 +66,17 @@ FxIrp::GetIrp(
|
|||
return m_Irp;
|
||||
}
|
||||
|
||||
__inline
|
||||
MdIrp
|
||||
FxIrp::SetIrp(
|
||||
MdIrp irp
|
||||
)
|
||||
{
|
||||
MdIrp old = m_Irp;
|
||||
m_Irp = irp;
|
||||
return old;
|
||||
}
|
||||
|
||||
__inline
|
||||
VOID
|
||||
FxIrp::CompleteRequest(
|
||||
|
@ -174,6 +185,7 @@ FxIrp::SetCancelRoutine(
|
|||
|
||||
__inline
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
FxIrp::_IrpSynchronousCompletion(
|
||||
__in MdDeviceObject DeviceObject,
|
||||
__in PIRP OriginalIrp,
|
||||
|
|
|
@ -33,29 +33,31 @@ Notes:
|
|||
#define WDF_INTERRUPT_EVENT_VERSION_2 2
|
||||
#define WDF_WORK_ITEM_EVENT_VERSION_2 2
|
||||
|
||||
// __REACTOS__ : functions are commented out
|
||||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
FxPerfTraceDpc(
|
||||
_In_ PVOID DriverCallback
|
||||
)
|
||||
{
|
||||
PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
|
||||
// PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
|
||||
|
||||
//
|
||||
// Trace driver's ISR using perf trace callback. If the perf trace callback
|
||||
// is NULL, it means either perf tracing is not enabled, or this OS
|
||||
// doesn't support perf tracing for WDF (note only win8+ supports WDF perf
|
||||
// trace callbacks).
|
||||
//
|
||||
perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->DpcNotifyRoutine;
|
||||
if (perfTraceCallback != NULL) {
|
||||
(perfTraceCallback) (DriverCallback, // event data
|
||||
sizeof(PVOID), // sizeof event
|
||||
PERF_WDF_DPC, // group mask
|
||||
PERFINFO_LOG_TYPE_WDF_DPC, // hook id
|
||||
WDF_DPC_EVENT_VERSION_2 // version
|
||||
);
|
||||
}
|
||||
// //
|
||||
// // Trace driver's ISR using perf trace callback. If the perf trace callback
|
||||
// // is NULL, it means either perf tracing is not enabled, or this OS
|
||||
// // doesn't support perf tracing for WDF (note only win8+ supports WDF perf
|
||||
// // trace callbacks).
|
||||
// //
|
||||
// perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->DpcNotifyRoutine;
|
||||
// if (perfTraceCallback != NULL) {
|
||||
// (perfTraceCallback) (DriverCallback, // event data
|
||||
// sizeof(PVOID), // sizeof event
|
||||
// PERF_WDF_DPC, // group mask
|
||||
// PERFINFO_LOG_TYPE_WDF_DPC, // hook id
|
||||
// WDF_DPC_EVENT_VERSION_2 // version
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
||||
FORCEINLINE
|
||||
|
@ -64,17 +66,17 @@ FxPerfTraceInterrupt(
|
|||
_In_ PVOID DriverCallback
|
||||
)
|
||||
{
|
||||
PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
|
||||
// PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
|
||||
|
||||
perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->InterruptNotifyRoutine;
|
||||
if (perfTraceCallback != NULL) {
|
||||
(perfTraceCallback) (DriverCallback, // event data
|
||||
sizeof(PVOID), // sizeof event
|
||||
PERF_WDF_INTERRUPT, // group mask
|
||||
PERFINFO_LOG_TYPE_WDF_INTERRUPT, // hook id
|
||||
WDF_INTERRUPT_EVENT_VERSION_2 // version
|
||||
);
|
||||
}
|
||||
// perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->InterruptNotifyRoutine;
|
||||
// if (perfTraceCallback != NULL) {
|
||||
// (perfTraceCallback) (DriverCallback, // event data
|
||||
// sizeof(PVOID), // sizeof event
|
||||
// PERF_WDF_INTERRUPT, // group mask
|
||||
// PERFINFO_LOG_TYPE_WDF_INTERRUPT, // hook id
|
||||
// WDF_INTERRUPT_EVENT_VERSION_2 // version
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
||||
FORCEINLINE
|
||||
|
@ -83,17 +85,17 @@ FxPerfTracePassiveInterrupt(
|
|||
_In_ PVOID DriverCallback
|
||||
)
|
||||
{
|
||||
PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
|
||||
// PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
|
||||
|
||||
perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->InterruptNotifyRoutine;
|
||||
if (perfTraceCallback != NULL) {
|
||||
(perfTraceCallback) (DriverCallback,
|
||||
sizeof(PVOID),
|
||||
PERF_WDF_INTERRUPT,
|
||||
PERFINFO_LOG_TYPE_WDF_PASSIVE_INTERRUPT,
|
||||
WDF_INTERRUPT_EVENT_VERSION_2
|
||||
);
|
||||
}
|
||||
// perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->InterruptNotifyRoutine;
|
||||
// if (perfTraceCallback != NULL) {
|
||||
// (perfTraceCallback) (DriverCallback,
|
||||
// sizeof(PVOID),
|
||||
// PERF_WDF_INTERRUPT,
|
||||
// PERFINFO_LOG_TYPE_WDF_PASSIVE_INTERRUPT,
|
||||
// WDF_INTERRUPT_EVENT_VERSION_2
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
||||
FORCEINLINE
|
||||
|
@ -102,16 +104,16 @@ FxPerfTraceWorkItem(
|
|||
_In_ PVOID DriverCallback
|
||||
)
|
||||
{
|
||||
PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
|
||||
// PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
|
||||
|
||||
perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->WorkItemNotifyRoutine;
|
||||
if (perfTraceCallback != NULL) {
|
||||
(perfTraceCallback) (DriverCallback,
|
||||
sizeof(PVOID),
|
||||
PERF_WORKER_THREAD,
|
||||
PERFINFO_LOG_TYPE_WDF_WORK_ITEM,
|
||||
WDF_WORK_ITEM_EVENT_VERSION_2
|
||||
);
|
||||
}
|
||||
// perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->WorkItemNotifyRoutine;
|
||||
// if (perfTraceCallback != NULL) {
|
||||
// (perfTraceCallback) (DriverCallback,
|
||||
// sizeof(PVOID),
|
||||
// PERF_WORKER_THREAD,
|
||||
// PERFINFO_LOG_TYPE_WDF_WORK_ITEM,
|
||||
// WDF_WORK_ITEM_EVENT_VERSION_2
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ FxIoContext::ReleaseAndRestore(
|
|||
//
|
||||
// Release the other buffer and all __super related fields
|
||||
//
|
||||
__super::ReleaseAndRestore(Request);
|
||||
FxRequestContext::ReleaseAndRestore(Request); // __super call
|
||||
}
|
||||
|
||||
__inline
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue