Skip to content

Commit

Permalink
Windows Release win-10.0.22621.1
Browse files Browse the repository at this point in the history
22621 is Windows 11, version 22H2
  • Loading branch information
wm1 committed Nov 10, 2022
1 parent 8bb5020 commit 3b9780e
Show file tree
Hide file tree
Showing 117 changed files with 1,077 additions and 1,525 deletions.
14 changes: 7 additions & 7 deletions src/framework/kmdf/inc/private/fxdynamics.h
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ WDFEXPORT(WdfDeviceGetDeviceState)(
PWDF_DRIVER_GLOBALS DriverGlobals,
_In_
WDFDEVICE Device,
_Out_
_Inout_
PWDF_DEVICE_STATE DeviceState
);

Expand Down Expand Up @@ -3452,7 +3452,7 @@ WDFEXPORT(WdfInterruptGetInfo)(
PWDF_DRIVER_GLOBALS DriverGlobals,
_In_
WDFINTERRUPT Interrupt,
_Out_
_Inout_
PWDF_INTERRUPT_INFO Info
);

Expand Down Expand Up @@ -5388,7 +5388,7 @@ WDFEXPORT(WdfRequestGetCompletionParams)(
PWDF_DRIVER_GLOBALS DriverGlobals,
_In_
WDFREQUEST Request,
_Out_
_Inout_
PWDF_REQUEST_COMPLETION_PARAMS Params
);

Expand Down Expand Up @@ -5456,7 +5456,7 @@ WDFEXPORT(WdfRequestGetParameters)(
PWDF_DRIVER_GLOBALS DriverGlobals,
_In_
WDFREQUEST Request,
_Out_
_Inout_
PWDF_REQUEST_PARAMETERS Parameters
);

Expand Down Expand Up @@ -6299,7 +6299,7 @@ WDFEXPORT(WdfUsbTargetDeviceRetrieveInformation)(
PWDF_DRIVER_GLOBALS DriverGlobals,
_In_
WDFUSBDEVICE UsbDevice,
_Out_
_Inout_
PWDF_USB_DEVICE_INFORMATION Information
);

Expand Down Expand Up @@ -6963,7 +6963,7 @@ WDFEXPORT(WdfUsbInterfaceGetEndpointInformation)(
UCHAR SettingIndex,
_In_
UCHAR EndpointIndex,
_Out_
_Inout_
PWDF_USB_PIPE_INFORMATION EndpointInfo
);

Expand Down Expand Up @@ -7013,7 +7013,7 @@ WDFEXPORT(WdfUsbInterfaceGetConfiguredPipe)(
WDFUSBINTERFACE UsbInterface,
_In_
UCHAR PipeIndex,
_Out_opt_
_Inout_opt_
PWDF_USB_PIPE_INFORMATION PipeInfo
);

Expand Down
6 changes: 0 additions & 6 deletions src/framework/kmdf/inc/private/fxlibrarycommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ extern RTL_OSVERSIONINFOW gOsVersion;

#define WDF_ENHANCED_VERIFIER_OPTIONS_VALUE_NAME L"EnhancedVerifierOptions"

typedef
NTSTATUS
(*PFN_RTL_GET_VERSION)(
__out PRTL_OSVERSIONINFOW VersionInformation
);

_Must_inspect_result_
NTSTATUS
FxLibraryCommonCommission(
Expand Down
14 changes: 7 additions & 7 deletions src/framework/kmdf/inc/private/vffxdynamics.h
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ VFWDFEXPORT(WdfDeviceGetDeviceState)(
PWDF_DRIVER_GLOBALS DriverGlobals,
_In_
WDFDEVICE Device,
_Out_
_Inout_
PWDF_DEVICE_STATE DeviceState
);

Expand Down Expand Up @@ -2887,7 +2887,7 @@ VFWDFEXPORT(WdfInterruptGetInfo)(
PWDF_DRIVER_GLOBALS DriverGlobals,
_In_
WDFINTERRUPT Interrupt,
_Out_
_Inout_
PWDF_INTERRUPT_INFO Info
);

Expand Down Expand Up @@ -4823,7 +4823,7 @@ VFWDFEXPORT(WdfRequestGetCompletionParams)(
PWDF_DRIVER_GLOBALS DriverGlobals,
_In_
WDFREQUEST Request,
_Out_
_Inout_
PWDF_REQUEST_COMPLETION_PARAMS Params
);

Expand Down Expand Up @@ -4891,7 +4891,7 @@ VFWDFEXPORT(WdfRequestGetParameters)(
PWDF_DRIVER_GLOBALS DriverGlobals,
_In_
WDFREQUEST Request,
_Out_
_Inout_
PWDF_REQUEST_PARAMETERS Parameters
);

Expand Down Expand Up @@ -5734,7 +5734,7 @@ VFWDFEXPORT(WdfUsbTargetDeviceRetrieveInformation)(
PWDF_DRIVER_GLOBALS DriverGlobals,
_In_
WDFUSBDEVICE UsbDevice,
_Out_
_Inout_
PWDF_USB_DEVICE_INFORMATION Information
);

Expand Down Expand Up @@ -6398,7 +6398,7 @@ VFWDFEXPORT(WdfUsbInterfaceGetEndpointInformation)(
UCHAR SettingIndex,
_In_
UCHAR EndpointIndex,
_Out_
_Inout_
PWDF_USB_PIPE_INFORMATION EndpointInfo
);

Expand Down Expand Up @@ -6448,7 +6448,7 @@ VFWDFEXPORT(WdfUsbInterfaceGetConfiguredPipe)(
WDFUSBINTERFACE UsbInterface,
_In_
UCHAR PipeIndex,
_Out_opt_
_Inout_opt_
PWDF_USB_PIPE_INFORMATION PipeInfo
);

Expand Down
128 changes: 7 additions & 121 deletions src/framework/kmdf/src/core/fxbugcheckcallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,7 @@ FxRegisterBugCheckCallback(
__in PDRIVER_OBJECT DriverObject
)
{
UNICODE_STRING funcName;
PKBUGCHECK_REASON_CALLBACK_RECORD callbackRecord;
PFN_KE_REGISTER_BUGCHECK_REASON_CALLBACK funcPtr;
BOOLEAN enableDriverTracking;

//
Expand Down Expand Up @@ -485,19 +483,6 @@ FxRegisterBugCheckCallback(



//
// The KeRegisterBugCheckReasonCallback exists for xp sp1 and above. So
// check whether this function is defined on the current OS and register
// for the bugcheck callback only if this function is defined.
//
RtlInitUnicodeString(&funcName, L"KeRegisterBugCheckReasonCallback");
funcPtr = (PFN_KE_REGISTER_BUGCHECK_REASON_CALLBACK)
MmGetSystemRoutineAddress(&funcName);

if (NULL == funcPtr) {
goto Done;
}

//
// Register this driver with driver tracker.
//
Expand All @@ -516,7 +501,7 @@ FxRegisterBugCheckCallback(
//
// Register the bugcheck callback.
//
funcPtr(callbackRecord,
KeRegisterBugCheckReasonCallback(callbackRecord,
FxpBugCheckCallback,
KbCallbackSecondaryDumpData,
(PUCHAR)FxDriverGlobals->Public.DriverName);
Expand All @@ -531,29 +516,14 @@ FxUnregisterBugCheckCallback(
__inout PFX_DRIVER_GLOBALS FxDriverGlobals
)
{
UNICODE_STRING funcName;
PKBUGCHECK_REASON_CALLBACK_RECORD callbackRecord;
PFN_KE_DEREGISTER_BUGCHECK_REASON_CALLBACK funcPtr;

callbackRecord = &FxDriverGlobals->BugCheckCallbackRecord;
if (NULL == callbackRecord->CallbackRoutine) {
goto Done;
}

//
// The KeDeregisterBugCheckReasonCallback exists for xp sp1 and above. So
// check whether this function is defined on the current OS and deregister
// from the bugcheck callback only if this function is defined.
//
RtlInitUnicodeString(&funcName, L"KeDeregisterBugCheckReasonCallback");
funcPtr = (PFN_KE_DEREGISTER_BUGCHECK_REASON_CALLBACK)
MmGetSystemRoutineAddress(&funcName);

if (NULL == funcPtr) {
goto Done;
}

funcPtr(callbackRecord);
KeDeregisterBugCheckReasonCallback(callbackRecord);
callbackRecord->CallbackRoutine = NULL;

//
Expand Down Expand Up @@ -640,9 +610,7 @@ VOID
FxInitializeBugCheckDriverInfo()
{
NTSTATUS status;
UNICODE_STRING funcName;
PKBUGCHECK_REASON_CALLBACK_RECORD callbackRecord;
PFN_KE_REGISTER_BUGCHECK_REASON_CALLBACK funcPtr;
SIZE_T arraySize;
ULONG arrayCount;

Expand All @@ -663,19 +631,6 @@ FxInitializeBugCheckDriverInfo()



//
// The KeRegisterBugCheckReasonCallback exists for xp sp1 and above. So
// check whether this function is defined on the current OS and register
// for the bugcheck callback only if this function is defined.
//
RtlInitUnicodeString(&funcName, L"KeRegisterBugCheckReasonCallback");
funcPtr = (PFN_KE_REGISTER_BUGCHECK_REASON_CALLBACK)
MmGetSystemRoutineAddress(&funcName);

if (NULL == funcPtr) {
goto Done;
}

arraySize = sizeof(FX_DUMP_DRIVER_INFO_ENTRY) * FX_DUMP_DRIVER_INFO_INCREMENT;
arrayCount = FX_DUMP_DRIVER_INFO_INCREMENT;

Expand Down Expand Up @@ -719,7 +674,7 @@ FxInitializeBugCheckDriverInfo()
//
// Register the bugcheck callback.
//
funcPtr(callbackRecord,
KeRegisterBugCheckReasonCallback(callbackRecord,
FxpLibraryBugCheckCallback,
KbCallbackSecondaryDumpData,
(PUCHAR)WdfLdrType);
Expand All @@ -732,9 +687,7 @@ Done:;
VOID
FxUninitializeBugCheckDriverInfo()
{
UNICODE_STRING funcName;
PKBUGCHECK_REASON_CALLBACK_RECORD callbackRecord;
PFN_KE_DEREGISTER_BUGCHECK_REASON_CALLBACK funcPtr;

//
// Deregister callback.
Expand All @@ -751,20 +704,7 @@ FxUninitializeBugCheckDriverInfo()
goto Done;
}

//
// The KeDeregisterBugCheckReasonCallback exists for xp sp1 and above. So
// check whether this function is defined on the current OS and deregister
// from the bugcheck callback only if this function is defined.
//
RtlInitUnicodeString(&funcName, L"KeDeregisterBugCheckReasonCallback");
funcPtr = (PFN_KE_DEREGISTER_BUGCHECK_REASON_CALLBACK)
MmGetSystemRoutineAddress(&funcName);

if (NULL == funcPtr) {
goto Done;
}

funcPtr(callbackRecord);
KeDeregisterBugCheckReasonCallback(callbackRecord);
callbackRecord->CallbackRoutine = NULL;

//
Expand Down Expand Up @@ -1027,8 +967,6 @@ FX_DRIVER_TRACKER_CACHE_AWARE::Register(
ULONG index = 0;
PFX_DRIVER_TRACKER_ENTRY pool = NULL;
PFX_DRIVER_TRACKER_ENTRY driverUsage = NULL;
UNICODE_STRING funcName;
PVOID funcPtr = NULL;

//
// Nothing to do if tracker is already initialized. No need for a lock
Expand All @@ -1048,44 +986,7 @@ FX_DRIVER_TRACKER_CACHE_AWARE::Register(
//
// Capture maximum number of processors.
//
RtlInitUnicodeString(&funcName, L"KeQueryMaximumProcessorCountEx");
funcPtr = MmGetSystemRoutineAddress(&funcName);
if (funcPtr != NULL) {
//
// Win 7 and forward.
//
m_Number = ((PFN_KE_QUERY_MAXIMUM_PROCESSOR_COUNT_EX)funcPtr)(
ALL_PROCESSOR_GROUPS);
}
else {
RtlInitUnicodeString(&funcName, L"KeQueryMaximumProcessorCount");
funcPtr = MmGetSystemRoutineAddress(&funcName);
if (funcPtr != NULL) {
//
// Windows Server 2008.
//
m_Number = ((PFN_KE_QUERY_MAXIMUM_PROCESSOR_COUNT)funcPtr)();
}
else {
if ((5 == FxLibraryGlobals.OsVersionInfo.dwMajorVersion &&
0 < FxLibraryGlobals.OsVersionInfo.dwMinorVersion) ||
(6 == FxLibraryGlobals.OsVersionInfo.dwMajorVersion &&
0 == FxLibraryGlobals.OsVersionInfo.dwMinorVersion)){
//
// XP (Major=5, Minor>0) and Vista (Major=6, Minor=0).
//
m_Number = (ULONG)(*((CCHAR *)&KeNumberProcessors));
}
else {
//
// This feature is not supported for Windows 2000.
//
ASSERT(FALSE);
status = STATUS_NOT_SUPPORTED;
goto Done;
}
}
}
m_Number = KeQueryMaximumProcessorCountEx(ALL_PROCESSOR_GROUPS);

//
// Validate upper bound.
Expand All @@ -1099,23 +1000,8 @@ FX_DRIVER_TRACKER_CACHE_AWARE::Register(
// Determine padded size of each tracking entry structure.
//
if (m_Number > 1 ) {
RtlInitUnicodeString(&funcName, L"KeGetRecommendedSharedDataAlignment");
funcPtr = MmGetSystemRoutineAddress(&funcName);

if (funcPtr != NULL) {
//
//XP and forward
//
paddedSize = ((PFN_KE_GET_RECOMMENDED_SHARED_DATA_ALIGNMENT)funcPtr)();
ASSERT ((paddedSize & (paddedSize - 1)) == 0);
}
else {
//
// This feature is not supported for Windows 2000.
//
status = STATUS_NOT_SUPPORTED;
goto Done;
}
paddedSize = KeGetRecommendedSharedDataAlignment();
ASSERT ((paddedSize & (paddedSize - 1)) == 0);
}
else {
paddedSize = sizeof(FX_DRIVER_TRACKER_ENTRY);
Expand Down
Loading

0 comments on commit 3b9780e

Please sign in to comment.