108 PWSTR pszPrefix =
L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum";
111 L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
127 L"ProcessorNameString");
136 DPRINT1(
"ZwQueryValueKey() failed (Status 0x%08lx)\n",
Status);
144 DPRINT1(
"ExAllocatePool() failed\n");
156 DPRINT1(
"ZwQueryValueKey() failed (Status 0x%08lx)\n",
Status);
174 DPRINT(
"DeviceId: %S\n", DeviceId);
190 if (KeyNameBuffer ==
NULL)
192 DPRINT1(
"ExAllocatePool() failed\n");
223 DPRINT1(
"ZwSetValueKey() failed (Status 0x%08lx)\n",
Status);
231 if (KeyNameBuffer !=
NULL)
237 if (DeviceId !=
NULL)
252 DPRINT(
"ProcessorStartDevice()\n");
271 DPRINT(
"ProcessorPnp()\n");
278 DPRINT(
" IRP_MN_START_DEVICE received\n");
297 DPRINT(
" IRP_MN_QUERY_REMOVE_DEVICE\n");
301 DPRINT(
" IRP_MN_REMOVE_DEVICE received\n");
305 DPRINT(
" IRP_MN_CANCEL_REMOVE_DEVICE\n");
309 DPRINT(
" IRP_MN_STOP_DEVICE received\n");
313 DPRINT(
" IRP_MN_QUERY_STOP_DEVICE received\n");
317 DPRINT(
" IRP_MN_CANCEL_STOP_DEVICE\n");
321 DPRINT(
" IRP_MN_QUERY_DEVICE_RELATIONS\n");
326 DPRINT(
" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
331 DPRINT(
" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
335 DPRINT(
" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
342 DPRINT(
" IRP_MN_SURPRISE_REMOVAL received\n");
346 DPRINT(
" IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
372 DPRINT(
"ProcessorAddDevice()\n");
390 DeviceExtension->DeviceObject =
Fdo;
395 DPRINT1(
"IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n",
Status);
403 Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
#define FILE_DEVICE_SECURE_OPEN
_In_ BUS_QUERY_ID_TYPE IdType
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
struct _BEEP_DEVICE_EXTENSION * PDEVICE_EXTENSION
_In_ PIO_STACK_LOCATION IrpSp
NTSTATUS NTAPI ProcessorAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo)
static NTSTATUS ProcessorStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PCM_RESOURCE_LIST ResourceList, IN PCM_RESOURCE_LIST ResourceListTranslated)
NTSTATUS NTAPI ProcessorPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
static NTSTATUS GetDeviceId(PDEVICE_OBJECT DeviceObject, BUS_QUERY_ID_TYPE IdType, PWSTR *DeviceId)
static VOID ProcessorSetFriendlyName(PDEVICE_OBJECT DeviceObject)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define ExAllocatePool(type, size)
_Must_inspect_result_ _In_opt_ PVOID _In_opt_ PVOID InstanceId
DRIVER_DISPATCH ForwardIrpAndForget
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
#define InitializeObjectAttributes(p, n, a, r, s)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
@ KeyValuePartialInformation
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define IRP_MN_SURPRISE_REMOVAL
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice, IN OUT PDEVICE_OBJECT *AttachedToDeviceObject)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
PIRP NTAPI IoBuildSynchronousFsdRequest(IN ULONG MajorFunction, IN PDEVICE_OBJECT DeviceObject, IN PVOID Buffer, IN ULONG Length, IN PLARGE_INTEGER StartingOffset, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
#define IoCompleteRequest
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define STATUS_NOT_SUPPORTED
#define FILE_DEVICE_UNKNOWN
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
struct _IO_STACK_LOCATION::@3974::@4011 StartDevice
struct _IO_STACK_LOCATION::@3974::@4005 QueryId
struct _IO_STACK_LOCATION::@3974::@3999 QueryDeviceRelations
union _IO_STACK_LOCATION::@1575 Parameters
#define RtlZeroMemory(Destination, Length)
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ WDFDEVICE Fdo
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
#define IRP_MN_CANCEL_STOP_DEVICE
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
#define IRP_MN_START_DEVICE
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_STOP_DEVICE
#define IRP_MN_QUERY_REMOVE_DEVICE
#define ObDereferenceObject