[PROCESSR]
authorEric Kohl <eric.kohl@reactos.org>
Sun, 26 Feb 2017 18:57:28 +0000 (18:57 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 26 Feb 2017 18:57:28 +0000 (18:57 +0000)
Add a generic processor driver that does nothing but provide a proper CPU device name (FriendlyName) to the registry.
CORE-5960 #resolve

svn path=/trunk/; revision=73967

reactos/drivers/CMakeLists.txt
reactos/drivers/processor/CMakeLists.txt [new file with mode: 0644]
reactos/drivers/processor/processr/CMakeLists.txt [new file with mode: 0644]
reactos/drivers/processor/processr/misc.c [new file with mode: 0644]
reactos/drivers/processor/processr/pnp.c [new file with mode: 0644]
reactos/drivers/processor/processr/processr.c [new file with mode: 0644]
reactos/drivers/processor/processr/processr.h [new file with mode: 0644]
reactos/drivers/processor/processr/processr.rc [new file with mode: 0644]
reactos/media/inf/cpu.inf

index 8b417a6..24f7841 100644 (file)
@@ -14,6 +14,7 @@ add_subdirectory(input)
 add_subdirectory(ksfilter)
 add_subdirectory(network)
 add_subdirectory(parallel)
+add_subdirectory(processor)
 add_subdirectory(sac)
 add_subdirectory(serial)
 add_subdirectory(setup)
diff --git a/reactos/drivers/processor/CMakeLists.txt b/reactos/drivers/processor/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f435ef2
--- /dev/null
@@ -0,0 +1,2 @@
+
+add_subdirectory(processr)
diff --git a/reactos/drivers/processor/processr/CMakeLists.txt b/reactos/drivers/processor/processr/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e034231
--- /dev/null
@@ -0,0 +1,12 @@
+
+list(APPEND SOURCE
+    processr.c
+    misc.c
+    pnp.c
+    processr.h)
+
+add_library(processr SHARED ${SOURCE} processr.rc)
+set_module_type(processr kernelmodedriver)
+add_importlibs(processr hal ntoskrnl)
+add_pch(processr processr.h SOURCE)
+add_cd_file(TARGET processr DESTINATION reactos/system32/drivers FOR all)
diff --git a/reactos/drivers/processor/processr/misc.c b/reactos/drivers/processor/processr/misc.c
new file mode 100644 (file)
index 0000000..39aa1d6
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * PROJECT:        ReactOS Generic CPU Driver
+ * LICENSE:        GNU GPLv2 only as published by the Free Software Foundation
+ * FILE:           drivers/processor/processr/misc.c
+ * PURPOSE:        Misc routines
+ * PROGRAMMERS:    Eric Kohl <eric.kohl@reactos.org>
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include "processr.h"
+
+#define NDEBUG
+#include <debug.h>
+
+/* FUNCTIONS ******************************************************************/
+
+static IO_COMPLETION_ROUTINE ForwardIrpAndWaitCompletion;
+
+static
+NTSTATUS
+NTAPI
+ForwardIrpAndWaitCompletion(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN PIRP Irp,
+    IN PVOID Context)
+{
+    if (Irp->PendingReturned)
+        KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE);
+
+    return STATUS_MORE_PROCESSING_REQUIRED;
+}
+
+
+NTSTATUS
+NTAPI
+ForwardIrpAndWait(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN PIRP Irp)
+{
+    PDEVICE_OBJECT LowerDevice;
+    KEVENT Event;
+    NTSTATUS Status;
+
+    LowerDevice = ((PDEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
+    ASSERT(LowerDevice);
+
+    KeInitializeEvent(&Event, NotificationEvent, FALSE);
+    IoCopyCurrentIrpStackLocationToNext(Irp);
+
+    DPRINT("Calling lower device %p\n", LowerDevice);
+    IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
+
+    Status = IoCallDriver(LowerDevice, Irp);
+    if (Status == STATUS_PENDING)
+    {
+        Status = KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
+        if (NT_SUCCESS(Status))
+            Status = Irp->IoStatus.Status;
+    }
+
+    return Status;
+}
+
+
+NTSTATUS
+NTAPI
+ForwardIrpAndForget(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN PIRP Irp)
+{
+    PDEVICE_OBJECT LowerDevice;
+
+    LowerDevice = ((PDEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
+    ASSERT(LowerDevice);
+
+    IoSkipCurrentIrpStackLocation(Irp);
+    return IoCallDriver(LowerDevice, Irp);
+}
+
+/* EOF */
diff --git a/reactos/drivers/processor/processr/pnp.c b/reactos/drivers/processor/processr/pnp.c
new file mode 100644 (file)
index 0000000..c7ff13f
--- /dev/null
@@ -0,0 +1,402 @@
+/*
+ * PROJECT:        ReactOS Generic CPU Driver
+ * LICENSE:        GNU GPLv2 only as published by the Free Software Foundation
+ * FILE:           drivers/processor/processr/pnp.c
+ * PURPOSE:        Plug N Play routines
+ * PROGRAMMERS:    Eric Kohl <eric.kohl@reactos.org>
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include "processr.h"
+
+#include <stdio.h>
+#define NDEBUG
+#include <debug.h>
+
+/* FUNCTIONS ******************************************************************/
+
+static
+NTSTATUS
+GetDeviceId(
+    PDEVICE_OBJECT DeviceObject,
+    BUS_QUERY_ID_TYPE IdType,
+    PWSTR *DeviceId)
+{
+    PIO_STACK_LOCATION IrpStack;
+    IO_STATUS_BLOCK IoStatus;
+    PDEVICE_OBJECT TargetObject;
+    KEVENT Event;
+    PIRP Irp;
+    NTSTATUS Status;
+
+    PAGED_CODE();
+
+    /* Initialize the event */
+    KeInitializeEvent(&Event, NotificationEvent, FALSE);
+
+    TargetObject = IoGetAttachedDeviceReference(DeviceObject);
+
+    /* Build the IRP */
+    Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP,
+                                       TargetObject,
+                                       NULL,
+                                       0,
+                                       NULL,
+                                       &Event,
+                                       &IoStatus);
+    if (Irp == NULL)
+    {
+        Status = STATUS_INSUFFICIENT_RESOURCES;
+        goto done;
+    }
+
+    /* PNP IRPs all begin life as STATUS_NOT_SUPPORTED */
+    Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
+
+    /* Get the top of stack */
+    IrpStack = IoGetNextIrpStackLocation(Irp);
+
+    /* Set the top of stack */
+    RtlZeroMemory(IrpStack, sizeof(IO_STACK_LOCATION));
+    IrpStack->MajorFunction = IRP_MJ_PNP;
+    IrpStack->MinorFunction = IRP_MN_QUERY_ID;
+    IrpStack->Parameters.QueryId.IdType = IdType;
+
+    /* Call the driver */
+    Status = IoCallDriver(TargetObject, Irp);
+    if (Status == STATUS_PENDING)
+    {
+        KeWaitForSingleObject(&Event,
+                              Executive,
+                              KernelMode,
+                              FALSE,
+                              NULL);
+
+        Status = IoStatus.Status;
+    }
+
+    if (NT_SUCCESS(Status))
+    {
+        *DeviceId = (PWSTR)IoStatus.Information;
+    }
+
+done:
+    /* Dereference the target device object */
+    ObDereferenceObject(TargetObject);
+
+    return Status;
+}
+
+
+
+static
+VOID
+ProcessorSetFriendlyName(
+    PDEVICE_OBJECT DeviceObject)
+{
+    KEY_VALUE_PARTIAL_INFORMATION *Buffer = NULL;
+    OBJECT_ATTRIBUTES ObjectAttributes;
+    UNICODE_STRING HardwareKeyName, ValueName, EnumKeyName;
+    HANDLE KeyHandle = NULL;
+    ULONG DataLength = 0;
+    ULONG BufferLength = 0;
+    NTSTATUS Status;
+    PWSTR KeyNameBuffer = NULL;
+    PWSTR DeviceId = NULL;
+    PWSTR InstanceId = NULL;
+    PWSTR pszPrefix = L"\\Registry\\Machine\\System\\CurrentcontrolSet\\Enum";
+
+    RtlInitUnicodeString(&HardwareKeyName,
+                         L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
+    InitializeObjectAttributes(&ObjectAttributes,
+                               &HardwareKeyName,
+                               OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
+                               NULL,
+                               NULL);
+    Status = ZwOpenKey(&KeyHandle,
+                       KEY_READ,
+                       &ObjectAttributes);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("ZwOpenKey() failed (Status 0x%08lx)\n", Status);
+        return;
+    }
+
+    RtlInitUnicodeString(&ValueName,
+                         L"ProcessorNameString");
+    Status = ZwQueryValueKey(KeyHandle,
+                             &ValueName,
+                             KeyValuePartialInformation,
+                             NULL,
+                             0,
+                             &DataLength);
+    if (Status != STATUS_BUFFER_OVERFLOW && Status != STATUS_BUFFER_TOO_SMALL && Status != STATUS_SUCCESS)
+    {
+        DPRINT1("ZwQueryValueKey() failed (Status 0x%08lx)\n", Status);
+        goto done;
+    }
+
+    Buffer = ExAllocatePool(PagedPool,
+                            DataLength + sizeof(KEY_VALUE_PARTIAL_INFORMATION));
+    if (Buffer == NULL)
+    {
+        DPRINT1("ExAllocatePool() failed\n");
+        goto done;
+    }
+
+    Status = ZwQueryValueKey(KeyHandle,
+                             &ValueName,
+                             KeyValuePartialInformation,
+                             Buffer,
+                             DataLength + sizeof(KEY_VALUE_PARTIAL_INFORMATION),
+                             &DataLength);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("ZwQueryValueKey() failed (Status 0x%08lx)\n", Status);
+        goto done;
+    }
+
+    DPRINT("ProcessorNameString: %S\n", (PWSTR)&Buffer->Data[0]);
+
+    ZwClose(KeyHandle);
+    KeyHandle = NULL;
+
+    Status = GetDeviceId(DeviceObject,
+                         BusQueryDeviceID,
+                         &DeviceId);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("GetDeviceId() failed (Status 0x%08lx)\n", Status);
+        goto done;
+    }
+
+    DPRINT("DeviceId: %S\n", DeviceId);
+
+    Status = GetDeviceId(DeviceObject,
+                         BusQueryInstanceID,
+                         &InstanceId);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("GetDeviceId() failed (Status 0x%08lx)\n", Status);
+        goto done;
+    }
+
+    DPRINT("InstanceId: %S\n", InstanceId);
+
+    BufferLength = wcslen(pszPrefix) + 1 + wcslen(DeviceId) + 1 + wcslen(InstanceId) + 1;
+
+    KeyNameBuffer = ExAllocatePool(PagedPool, BufferLength * sizeof(WCHAR));
+    if (KeyNameBuffer == NULL)
+    {
+        DPRINT1("ExAllocatePool() failed\n");
+        goto done;
+    }
+
+    swprintf(KeyNameBuffer, L"%s\\%s\\%s", pszPrefix, DeviceId, InstanceId);
+
+    RtlInitUnicodeString(&EnumKeyName, KeyNameBuffer);
+    InitializeObjectAttributes(&ObjectAttributes,
+                               &EnumKeyName,
+                               OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
+                               NULL,
+                               NULL);
+    Status = ZwOpenKey(&KeyHandle,
+                       KEY_WRITE,
+                       &ObjectAttributes);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("ZwOpenKey() failed (Status 0x%08lx)\n", Status);
+        goto done;
+    }
+
+    RtlInitUnicodeString(&ValueName,
+                         L"FriendlyName");
+    Status = ZwSetValueKey(KeyHandle,
+                           &ValueName,
+                           0,
+                           REG_SZ,
+                           (PVOID)&Buffer->Data[0],
+                           Buffer->DataLength);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("ZwSetValueKey() failed (Status 0x%08lx)\n", Status);
+        goto done;
+    }
+
+done:
+    if (KeyHandle != NULL)
+        ZwClose(KeyHandle);
+
+    if (KeyNameBuffer != NULL)
+        ExFreePool(KeyNameBuffer);
+
+    if (InstanceId != NULL)
+        ExFreePool(InstanceId);
+
+    if (DeviceId != NULL)
+        ExFreePool(DeviceId);
+
+    if (Buffer != NULL)
+        ExFreePool(Buffer);
+}
+
+
+static
+NTSTATUS
+ProcessorStartDevice(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN PCM_RESOURCE_LIST ResourceList,
+    IN PCM_RESOURCE_LIST ResourceListTranslated)
+{
+    DPRINT("ProcessorStartDevice()\n");
+
+    ProcessorSetFriendlyName(DeviceObject);
+
+    return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+NTAPI
+ProcessorPnp(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN PIRP Irp)
+{
+    PIO_STACK_LOCATION IrpSp;
+    ULONG_PTR Information = 0;
+    NTSTATUS Status = STATUS_NOT_SUPPORTED;
+
+    DPRINT("ProcessorPnp()\n");
+
+    IrpSp = IoGetCurrentIrpStackLocation(Irp);
+
+    switch (IrpSp->MinorFunction)
+    {
+        case IRP_MN_START_DEVICE:
+            DPRINT("  IRP_MN_START_DEVICE received\n");
+
+            /* Call lower driver */
+            Status = ForwardIrpAndWait(DeviceObject, Irp);
+            if (NT_SUCCESS(Status))
+            {
+                Status = ProcessorStartDevice(DeviceObject,
+                                              IrpSp->Parameters.StartDevice.AllocatedResources,
+                                              IrpSp->Parameters.StartDevice.AllocatedResourcesTranslated);
+            }
+            break;
+
+        case IRP_MN_QUERY_REMOVE_DEVICE:
+            DPRINT("  IRP_MN_QUERY_REMOVE_DEVICE\n");
+            return ForwardIrpAndForget(DeviceObject, Irp);
+
+        case IRP_MN_REMOVE_DEVICE:
+            DPRINT("  IRP_MN_REMOVE_DEVICE received\n");
+            return ForwardIrpAndForget(DeviceObject, Irp);
+
+        case IRP_MN_CANCEL_REMOVE_DEVICE:
+            DPRINT("  IRP_MN_CANCEL_REMOVE_DEVICE\n");
+            return ForwardIrpAndForget(DeviceObject, Irp);
+
+        case IRP_MN_STOP_DEVICE:
+            DPRINT("  IRP_MN_STOP_DEVICE received\n");
+            return ForwardIrpAndForget(DeviceObject, Irp);
+
+        case IRP_MN_QUERY_STOP_DEVICE:
+            DPRINT("  IRP_MN_QUERY_STOP_DEVICE received\n");
+            return ForwardIrpAndForget(DeviceObject, Irp);
+
+        case IRP_MN_CANCEL_STOP_DEVICE:
+            DPRINT("  IRP_MN_CANCEL_STOP_DEVICE\n");
+            return ForwardIrpAndForget(DeviceObject, Irp);
+
+        case IRP_MN_QUERY_DEVICE_RELATIONS:
+            DPRINT("  IRP_MN_QUERY_DEVICE_RELATIONS\n");
+
+            switch (IrpSp->Parameters.QueryDeviceRelations.Type)
+            {
+                case BusRelations:
+                    DPRINT("    IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
+                    return ForwardIrpAndForget(DeviceObject, Irp);
+                    break;
+
+                case RemovalRelations:
+                    DPRINT("    IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
+                    return ForwardIrpAndForget(DeviceObject, Irp);
+
+                default:
+                    DPRINT("    IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
+                            IrpSp->Parameters.QueryDeviceRelations.Type);
+                    return ForwardIrpAndForget(DeviceObject, Irp);
+            }
+            break;
+
+        case IRP_MN_SURPRISE_REMOVAL:
+            DPRINT("  IRP_MN_SURPRISE_REMOVAL received\n");
+            return ForwardIrpAndForget(DeviceObject, Irp);
+
+        case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* (optional) 0xd */
+            DPRINT("  IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
+            return ForwardIrpAndForget(DeviceObject, Irp);
+
+        default:
+            DPRINT("  Unknown IOCTL 0x%lx\n", IrpSp->MinorFunction);
+            return ForwardIrpAndForget(DeviceObject, Irp);
+    }
+
+    Irp->IoStatus.Information = Information;
+    Irp->IoStatus.Status = Status;
+    IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+    return Status;
+}
+
+
+NTSTATUS
+NTAPI
+ProcessorAddDevice(
+    IN PDRIVER_OBJECT DriverObject,
+    IN PDEVICE_OBJECT Pdo)
+{
+    PDEVICE_EXTENSION DeviceExtension = NULL;
+    PDEVICE_OBJECT Fdo = NULL;
+    NTSTATUS Status;
+
+    DPRINT("ProcessorAddDevice()\n");
+
+    ASSERT(DriverObject);
+    ASSERT(Pdo);
+
+    /* Create functional device object */
+    Status = IoCreateDevice(DriverObject,
+                            sizeof(DEVICE_EXTENSION),
+                            NULL,
+                            FILE_DEVICE_UNKNOWN,
+                            FILE_DEVICE_SECURE_OPEN,
+                            FALSE,
+                            &Fdo);
+    if (NT_SUCCESS(Status))
+    {
+        DeviceExtension = (PDEVICE_EXTENSION)Fdo->DeviceExtension;
+        RtlZeroMemory(DeviceExtension, sizeof(DEVICE_EXTENSION));
+
+        DeviceExtension->DeviceObject = Fdo;
+
+        Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
+        if (!NT_SUCCESS(Status))
+        {
+            DPRINT1("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
+            IoDeleteDevice(Fdo);
+            return Status;
+        }
+
+        Fdo->Flags |= DO_DIRECT_IO;
+        Fdo->Flags |= DO_POWER_PAGABLE;
+
+        Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
+    }
+
+    return Status;
+}
+
+/* EOF */
diff --git a/reactos/drivers/processor/processr/processr.c b/reactos/drivers/processor/processr/processr.c
new file mode 100644 (file)
index 0000000..9c2a028
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * PROJECT:        ReactOS Generic CPU Driver
+ * LICENSE:        GNU GPLv2 only as published by the Free Software Foundation
+ * FILE:           drivers/processor/processr/processr.c
+ * PURPOSE:        Main Driver Routines
+ * PROGRAMMERS:    Eric Kohl <eric.kohl@reactos.org>
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include "processr.h"
+
+#define NDEBUG
+#include <debug.h>
+
+
+/* FUNCTIONS ******************************************************************/
+
+static
+VOID
+NTAPI
+ProcessorUnload(
+    IN PDRIVER_OBJECT DriverObject)
+{
+    DPRINT("ProcessorUnload()\n");
+}
+
+
+static
+NTSTATUS
+NTAPI
+ProcessorPower(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN PIRP Irp)
+{
+//    PIO_STACK_LOCATION IrpSp;
+//    NTSTATUS Status = Irp->IoStatus.Status;
+    PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
+
+    DPRINT("ProcessorPower()\n");
+
+//    IrpSp = IoGetCurrentIrpStackLocation(Irp);
+
+    PoStartNextPowerIrp(Irp);
+    IoSkipCurrentIrpStackLocation(Irp);
+    return PoCallDriver(DeviceExtension->LowerDevice, Irp);
+}
+
+
+NTSTATUS
+NTAPI
+DriverEntry(
+    IN PDRIVER_OBJECT DriverObject,
+    IN PUNICODE_STRING RegistryPath)
+{
+    DPRINT("Processr: DriverEntry()\n");
+
+    DriverObject->MajorFunction[IRP_MJ_PNP] = ProcessorPnp;
+    DriverObject->MajorFunction[IRP_MJ_POWER] = ProcessorPower;
+
+    DriverObject->DriverExtension->AddDevice = ProcessorAddDevice;
+    DriverObject->DriverUnload = ProcessorUnload;
+
+    return STATUS_SUCCESS;
+}
diff --git a/reactos/drivers/processor/processr/processr.h b/reactos/drivers/processor/processr/processr.h
new file mode 100644 (file)
index 0000000..3e513bb
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * PROJECT:        ReactOS Generic CPU Driver
+ * LICENSE:        GNU GPLv2 only as published by the Free Software Foundation
+ * FILE:           drivers/processor/processr/processr.h
+ * PURPOSE:        Common header file
+ * PROGRAMMERS:    Eric Kohl <eric.kohl@reactos.org>
+ */
+
+#ifndef _PROCESSR_PCH_
+#define _PROCESSR_PCH_
+
+#include <ntddk.h>
+
+typedef struct _DEVICE_EXTENSION
+{
+    PDEVICE_OBJECT DeviceObject;
+    PDEVICE_OBJECT LowerDevice;
+
+} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
+
+
+/* misc.c */
+
+NTSTATUS
+NTAPI
+ForwardIrpAndWait(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN PIRP Irp);
+
+NTSTATUS
+NTAPI
+ForwardIrpAndForget(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN PIRP Irp);
+
+
+/* pnp.c */
+
+NTSTATUS
+NTAPI
+ProcessorPnp(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN PIRP Irp);
+
+NTSTATUS
+NTAPI
+ProcessorAddDevice(
+    IN PDRIVER_OBJECT DriverObject,
+    IN PDEVICE_OBJECT Pdo);
+
+#endif /* _PROCESSR_PCH_ */
diff --git a/reactos/drivers/processor/processr/processr.rc b/reactos/drivers/processor/processr/processr.rc
new file mode 100644 (file)
index 0000000..881ecff
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * PROJECT:        ReactOS Generic CPU Driver
+ * LICENSE:        GNU GPLv2 only as published by the Free Software Foundation
+ * FILE:           drivers/processor/processr/processr.rc
+ * PURPOSE:        Resource definition file
+ * PROGRAMMERS:    Eric Kohl <eric.kohl@reactos.org>
+ */
+
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION   "Processor Device Driver\0"
+#define REACTOS_STR_INTERNAL_NAME      "processr\0"
+#define REACTOS_STR_ORIGINAL_FILENAME  "processr.sys\0"
+#include <reactos/version.rc>
index 0a63a9a..1e83841 100644 (file)
@@ -29,74 +29,84 @@ HKR, , Icon,           0, "-28"
 %VIAMfg%=VIA\r
 \r
 [Standard]\r
-%Processor.DeviceDesc% = NO_DRV,ACPI\Processor\r
+%Processor.DeviceDesc% = Processr_Inst,ACPI\Processor\r
 \r
 [Cyrix]\r
-%CyrixProcessor.DeviceDesc% = NO_DRV,ACPI\CyrixInstead_-_x86\r
+%CyrixProcessor.DeviceDesc% = Processr_Inst,ACPI\CyrixInstead_-_x86\r
 \r
 [Intel]\r
-%IntelProcessor.DeviceDesc%       = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_1\r
-%IntelProcessor.DeviceDesc%       = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_2\r
-%IntelProcessor.DeviceDesc%       = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_3\r
-%IntelMMXProcessor.DeviceDesc%    = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_4\r
-%IntelMMXProcessor.DeviceDesc%    = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_7\r
-%IntelMMXProcessor.DeviceDesc%    = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_8\r
-%IntelPROProcessor.DeviceDesc%    = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_1\r
-%IntelP2Processor.DeviceDesc%     = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_3\r
-%IntelP2Processor.DeviceDesc%     = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_5\r
-%IntelP2Processor.DeviceDesc%     = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_6\r
-%IntelP3Processor.DeviceDesc%     = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_7\r
-%IntelP3Processor.DeviceDesc%     = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_8\r
-%IntelMProcessor.DeviceDesc%      = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_9\r
-%IntelP3Processor.DeviceDesc%     = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_10\r
-%IntelP3Processor.DeviceDesc%     = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_11\r
-%IntelMProcessor.DeviceDesc%      = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_13\r
-%IntelCoreProcessor.DeviceDesc%   = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_14\r
-%IntelCoreProcessor.DeviceDesc%   = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_15\r
-%IntelCoreProcessor.DeviceDesc%   = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_22\r
-%IntelCoreProcessor.DeviceDesc%   = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_23\r
-%IntelCoreiXProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_26\r
-%IntelAtomProcessor.DeviceDesc%   = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_28\r
-%IntelCoreiXProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_30\r
-%IntelCoreiXProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_37\r
-%IntelP4Processor.DeviceDesc%     = NO_DRV,ACPI\GenuineIntel_-_x86_Family_15\r
-%IntelProcessor.DeviceDesc%       = NO_DRV,ACPI\GenuineIntel_-_x86\r
+%IntelProcessor.DeviceDesc%       = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_1\r
+%IntelProcessor.DeviceDesc%       = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_2\r
+%IntelProcessor.DeviceDesc%       = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_3\r
+%IntelMMXProcessor.DeviceDesc%    = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_4\r
+%IntelMMXProcessor.DeviceDesc%    = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_7\r
+%IntelMMXProcessor.DeviceDesc%    = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_8\r
+%IntelPROProcessor.DeviceDesc%    = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_1\r
+%IntelP2Processor.DeviceDesc%     = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_3\r
+%IntelP2Processor.DeviceDesc%     = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_5\r
+%IntelP2Processor.DeviceDesc%     = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_6\r
+%IntelP3Processor.DeviceDesc%     = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_7\r
+%IntelP3Processor.DeviceDesc%     = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_8\r
+%IntelMProcessor.DeviceDesc%      = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_9\r
+%IntelP3Processor.DeviceDesc%     = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_10\r
+%IntelP3Processor.DeviceDesc%     = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_11\r
+%IntelMProcessor.DeviceDesc%      = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_13\r
+%IntelCoreProcessor.DeviceDesc%   = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_14\r
+%IntelCoreProcessor.DeviceDesc%   = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_15\r
+%IntelCoreProcessor.DeviceDesc%   = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_22\r
+%IntelCoreProcessor.DeviceDesc%   = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_23\r
+%IntelCoreiXProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_26\r
+%IntelAtomProcessor.DeviceDesc%   = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_28\r
+%IntelCoreiXProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_30\r
+%IntelCoreiXProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_37\r
+%IntelP4Processor.DeviceDesc%     = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_15\r
+%IntelProcessor.DeviceDesc%       = Processr_Inst,ACPI\GenuineIntel_-_x86\r
 \r
 [AMD]\r
-%AMDK6Processor.DeviceDesc%   = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_5_Model_7\r
-%AMDK62Processor.DeviceDesc%  = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_5_Model_8\r
-%AMDK63Processor.DeviceDesc%  = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_5_Model_9\r
-%AMDK63Processor.DeviceDesc%  = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_5_Model_10\r
-%AMDK63Processor.DeviceDesc%  = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_5_Model_13\r
-%AMDK7Processor.DeviceDesc%   = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_6\r
-%AMDK8Processor.DeviceDesc%   = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_15\r
-%AMDPHENProcessor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_16\r
-%AMDQProcessor.DeviceDesc%    = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_17\r
-%AMDProcessor.DeviceDesc%     = NO_DRV,ACPI\AuthenticAMD_-_x86\r
+%AMDK6Processor.DeviceDesc%   = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_7\r
+%AMDK62Processor.DeviceDesc%  = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_8\r
+%AMDK63Processor.DeviceDesc%  = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_9\r
+%AMDK63Processor.DeviceDesc%  = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_10\r
+%AMDK63Processor.DeviceDesc%  = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_13\r
+%AMDK7Processor.DeviceDesc%   = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_6\r
+%AMDK8Processor.DeviceDesc%   = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_15\r
+%AMDPHENProcessor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_16\r
+%AMDQProcessor.DeviceDesc%    = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_17\r
+%AMDProcessor.DeviceDesc%     = Processr_Inst,ACPI\AuthenticAMD_-_x86\r
 \r
 [Transmeta]\r
-%TransmetaProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineTMx86_-_x86\r
+%TransmetaProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineTMx86_-_x86\r
 \r
 [VIA]\r
-%ViaNEHProcessor.DeviceDesc%  = NO_DRV,ACPI\CentaurHauls_-_x86_Family_6_Model_9\r
-%ViaESTProcessor.DeviceDesc%  = NO_DRV,ACPI\CentaurHauls_-_x86_Family_6_Model_10\r
-%ViaC7Processor.DeviceDesc%   = NO_DRV,ACPI\CentaurHauls_-_x86_Family_6_Model_13\r
-%ViaNANOProcessor.DeviceDesc% = NO_DRV,ACPI\CentaurHauls_-_x86_Family_6_Model_15\r
-%ViaProcessor.DeviceDesc%     = NO_DRV,ACPI\CentaurHauls_-_x86\r
+%ViaNEHProcessor.DeviceDesc%  = Processr_Inst,ACPI\CentaurHauls_-_x86_Family_6_Model_9\r
+%ViaESTProcessor.DeviceDesc%  = Processr_Inst,ACPI\CentaurHauls_-_x86_Family_6_Model_10\r
+%ViaC7Processor.DeviceDesc%   = Processr_Inst,ACPI\CentaurHauls_-_x86_Family_6_Model_13\r
+%ViaNANOProcessor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_x86_Family_6_Model_15\r
+%ViaProcessor.DeviceDesc%     = Processr_Inst,ACPI\CentaurHauls_-_x86\r
 \r
-;---------------------------- NO DRIVER REQ -----------------------------\r
+;---------------------------- Processr Driver ---------------------------\r
 \r
-[NO_DRV]\r
-AddReg=NO_DRV.AddReg\r
+[Processr_Inst.NT]\r
+CopyFiles = Processr_Inst.CopyFiles.NT\r
+AddReg = Processr_Inst.AddReg.NT\r
 \r
-[NO_DRV.Services]\r
-AddService = , 0x00000002\r
+[Processr_Inst.CopyFiles.NT]\r
+processr.sys\r
 \r
-[NO_DRV.HW]\r
-\r
-[NO_DRV.AddReg]\r
+[Processr_Inst.AddReg.NT]\r
 HKR,,EnumPropPages32,,"devcpux.dll,PropSheetExtProc"\r
 \r
+[Processr_Inst.NT.Services]\r
+AddService = Processor, 0x00000002, Processr_Service_Inst\r
+\r
+[Processr_Service_Inst]\r
+DisplayName    = %Processor.ServiceDesc%\r
+ServiceType    = 1\r
+StartType      = 1\r
+ErrorControl   = 1\r
+ServiceBinary  = %12%\processr.sys\r
+LoadOrderGroup = Extended Base\r
+\r
 ;-------------------------------- STRINGS -------------------------------\r
 \r
 [Strings]\r
@@ -110,6 +120,7 @@ AMDMfg = "Advanced Micro Devices"
 TransmetaMfg = "Transmeta"\r
 VIAMfg = "VIA"\r
 Processor.DeviceDesc = "Processor"\r
+Processor.ServiceDesc = "Processor driver"\r
 CyrixProcessor.DeviceDesc = "Cyrix 6x86 Processor"\r
 IntelProcessor.DeviceDesc = "Intel Pentium Processor"\r
 IntelMMXProcessor.DeviceDesc = "Intel Pentium MMX Processor"\r
@@ -139,6 +150,7 @@ ViaProcessor.DeviceDesc = "VIA Processor"
 \r
 [Strings.0405]\r
 Processor.DeviceDesc = "Procesor"\r
+Processor.ServiceDesc = "Processor driver"\r
 CyrixProcessor.DeviceDesc = "Procesor Cyrix 6x86"\r
 IntelProcessor.DeviceDesc = "Procesor Intel Pentium"\r
 IntelMMXProcessor.DeviceDesc = "Procesor Intel Pentium MMX"\r
@@ -169,6 +181,7 @@ ViaProcessor.DeviceDesc = "Procesor VIA"
 [Strings.0407]\r
 ProcessorClassName = "Prozessoren"\r
 Processor.DeviceDesc = "Prozessor"\r
+Processor.ServiceDesc = "Prozessortreiber"\r
 CyrixProcessor.DeviceDesc = "Cyrix 6x86 Prozessor"\r
 IntelProcessor.DeviceDesc = "Intel Pentium Prozessor"\r
 IntelMMXProcessor.DeviceDesc = "Intel Pentium MMX Prozessor"\r
@@ -198,23 +211,27 @@ ViaProcessor.DeviceDesc = "VIA Prozessor"
 \r
 [Strings.0408]\r
 Processor.DeviceDesc = "Επεξεργαστής"\r
+Processor.ServiceDesc = "Processor driver"\r
 IntelProcessor.DeviceDesc = "Επεξεργαστής Intel"\r
 Standard = "Πρότυπος επεξεργαστής"\r
 \r
 [Strings.0a]\r
 ReactOS = "Equipo de ReactOS"\r
 Processor.DeviceDesc = "Procesador"\r
+Processor.ServiceDesc = "Processor driver"\r
 IntelProcessor.DeviceDesc = "Procesador Intel"\r
 AMDProcessor.DeviceDesc = "Procesador AMD"\r
 Standard = "Procesador estándar"\r
 \r
 [Strings.040C]\r
 Processor.DeviceDesc = "Processeur"\r
+Processor.ServiceDesc = "Processor driver"\r
 IntelProcessor.DeviceDesc = "Processeur Intel"\r
 Standard = "Processeur standard"\r
 \r
 [Strings.0411]\r
 Processor.DeviceDesc = "プロセッサ"\r
+Processor.ServiceDesc = "Processor driver"\r
 IntelProcessor.DeviceDesc = "Intel プロセッサ"\r
 Standard = "スタンダードプロセッサ"\r
 \r
@@ -228,6 +245,7 @@ AMDMfg = "Advanced Micro Devices"
 TransmetaMfg = "Transmeta"\r
 VIAMfg = "VIA"\r
 Processor.DeviceDesc = "Procesor"\r
+Processor.ServiceDesc = "Processor driver"\r
 CyrixProcessor.DeviceDesc = "Procesor Cyrix 6x86"\r
 IntelProcessor.DeviceDesc = "Procesor Intel Pentium"\r
 IntelMMXProcessor.DeviceDesc = "Procesor Intel Pentium MMX"\r
@@ -257,6 +275,7 @@ ViaProcessor.DeviceDesc = "Procesor VIA"
 \r
 [Strings.0416]\r
 Processor.DeviceDesc = "Processadores"\r
+Processor.ServiceDesc = "Processor driver"\r
 IntelProcessor.DeviceDesc = "Procesador Intel"\r
 Standard = "Processador padrão"\r
 \r
@@ -264,6 +283,7 @@ Standard = "Processador padrão"
 ReactOS = "Fundația ReactOS"\r
 ProcessorClassName = "Procesoare"\r
 Processor.DeviceDesc = "Procesor"\r
+Processor.ServiceDesc = "Processor driver"\r
 CyrixProcessor.DeviceDesc = "Procesor Cyrix 6x86"\r
 IntelProcessor.DeviceDesc = "Procesor Intel Pentium"\r
 IntelMMXProcessor.DeviceDesc = "Procesor Intel Pentium MMX"\r
@@ -297,6 +317,7 @@ ReactOS = "Фонд ReactOS"
 ProcessorClassName = "Процессоры"\r
 \r
 Processor.DeviceDesc = "Процессор"\r
+Processor.ServiceDesc = "Processor driver"\r
 CyrixProcessor.DeviceDesc = "Cyrix 6x86 процессор"\r
 IntelProcessor.DeviceDesc = "Intel Pentium процессор"\r
 IntelMMXProcessor.DeviceDesc = "Intel Pentium MMX процессор"\r
@@ -326,6 +347,7 @@ ViaProcessor.DeviceDesc = "VIA процессор"
 \r
 [Strings.041B]\r
 Processor.DeviceDesc = "Procesor"\r
+Processor.ServiceDesc = "Processor driver"\r
 IntelProcessor.DeviceDesc = "Intel procesor"\r
 Standard = "Štandardný procesor"\r
 \r
@@ -339,6 +361,7 @@ AMDMfg = "Advanced Micro Devices"
 TransmetaMfg = "Transmeta"\r
 VIAMfg = "VIA"\r
 Processor.DeviceDesc = "İşlemci"\r
+Processor.ServiceDesc = "Processor driver"\r
 CyrixProcessor.DeviceDesc = "Cyrix 6x86 İşlemci"\r
 IntelProcessor.DeviceDesc = "Intel Pentium İşlemci"\r
 IntelMMXProcessor.DeviceDesc = "Intel Pentium MMX İşlemci"\r
@@ -370,6 +393,7 @@ ViaProcessor.DeviceDesc = "VIA İşlemci"
 ReactOS = "Фонд ReactOS"\r
 ProcessorClassName = "Процесори"\r
 Processor.DeviceDesc = "Процесор"\r
+Processor.ServiceDesc = "Processor driver"\r
 CyrixProcessor.DeviceDesc = "Процесор Cyrix 6x86"\r
 IntelProcessor.DeviceDesc = "Процесор Intel Pentium"\r
 IntelMMXProcessor.DeviceDesc = "Процесор Intel Pentium MMX"\r
@@ -399,5 +423,6 @@ ViaProcessor.DeviceDesc = "Процесор VIA"
 \r
 [Strings.0427]\r
 Processor.DeviceDesc = "Procesorius"\r
+Processor.ServiceDesc = "Processor driver"\r
 IntelProcessor.DeviceDesc = "Intel procesorius"\r
 Standard = "Standartinis procesorius"\r