From 72d89647379509d73590ca2630c4648b8c634fa0 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Thu, 25 Sep 2003 18:29:45 +0000 Subject: [PATCH] Fixed line endings. svn path=/trunk/; revision=6139 --- reactos/ntoskrnl/io/driver.c | 1390 ++++++++++----------- reactos/ntoskrnl/io/pnpdma.c | 564 ++++----- reactos/ntoskrnl/io/pnproot.c | 1932 ++++++++++++++--------------- reactos/ntoskrnl/io/wdm.c | 46 +- reactos/ntoskrnl/ntoskrnl.def | 2144 ++++++++++++++++----------------- 5 files changed, 3038 insertions(+), 3038 deletions(-) diff --git a/reactos/ntoskrnl/io/driver.c b/reactos/ntoskrnl/io/driver.c index e0378fd8dc2..e714eb7f636 100644 --- a/reactos/ntoskrnl/io/driver.c +++ b/reactos/ntoskrnl/io/driver.c @@ -1,695 +1,695 @@ -/* $Id: driver.c,v 1.16 2003/09/25 15:54:42 navaraf Exp $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/driver.c - * PURPOSE: Manage devices - * PROGRAMMER: David Welch (welch@cwcom.net) - * UPDATE HISTORY: - * 15/05/98: Created - */ - -/* INCLUDES ****************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define NDEBUG -#include - - -typedef struct _SERVICE_GROUP -{ - LIST_ENTRY GroupListEntry; - UNICODE_STRING GroupName; - - BOOLEAN ServicesRunning; - -} SERVICE_GROUP, *PSERVICE_GROUP; - - -typedef struct _SERVICE -{ - LIST_ENTRY ServiceListEntry; - UNICODE_STRING ServiceName; - UNICODE_STRING RegistryPath; - UNICODE_STRING ServiceGroup; - UNICODE_STRING ImagePath; - - ULONG Start; - ULONG Type; - ULONG ErrorControl; - ULONG Tag; - - BOOLEAN ServiceRunning; // needed ?? - -} SERVICE, *PSERVICE; - - -/* GLOBALS *******************************************************************/ - -static LIST_ENTRY GroupListHead = {NULL, NULL}; -static LIST_ENTRY ServiceListHead = {NULL, NULL}; - -POBJECT_TYPE EXPORTED IoDriverObjectType = NULL; - -#define TAG_DRIVER TAG('D', 'R', 'V', 'R') -#define TAG_DRIVER_EXTENSION TAG('D', 'R', 'V', 'E') - - -/* FUNCTIONS ***************************************************************/ - -NTSTATUS STDCALL -IopCreateDriver(PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - POBJECT_ATTRIBUTES ObjectAttributes) -{ - DPRINT("LdrCreateModule(ObjectBody %x, Parent %x, RemainingPath %S)\n", - ObjectBody, - Parent, - RemainingPath); - if (RemainingPath != NULL && wcschr(RemainingPath + 1, '\\') != NULL) - { - return(STATUS_UNSUCCESSFUL); - } - - return(STATUS_SUCCESS); -} - - -VOID -IopInitDriverImplementation(VOID) -{ - /* Register the process object type */ - IoDriverObjectType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE)); - IoDriverObjectType->Tag = TAG('D', 'R', 'V', 'R'); - IoDriverObjectType->TotalObjects = 0; - IoDriverObjectType->TotalHandles = 0; - IoDriverObjectType->MaxObjects = ULONG_MAX; - IoDriverObjectType->MaxHandles = ULONG_MAX; - IoDriverObjectType->PagedPoolCharge = 0; - IoDriverObjectType->NonpagedPoolCharge = sizeof(DRIVER_OBJECT); - IoDriverObjectType->Dump = NULL; - IoDriverObjectType->Open = NULL; - IoDriverObjectType->Close = NULL; - IoDriverObjectType->Delete = NULL; - IoDriverObjectType->Parse = NULL; - IoDriverObjectType->Security = NULL; - IoDriverObjectType->QueryName = NULL; - IoDriverObjectType->OkayToClose = NULL; - IoDriverObjectType->Create = IopCreateDriver; - IoDriverObjectType->DuplicationNotify = NULL; - RtlInitUnicodeStringFromLiteral(&IoDriverObjectType->TypeName, L"Driver"); -} - -/********************************************************************** - * NAME EXPORTED - * NtLoadDriver - * - * DESCRIPTION - * Loads a device driver. - * - * ARGUMENTS - * DriverServiceName - * Name of the service to load (registry key). - * - * RETURN VALUE - * Status. - * - * REVISIONS - */ -NTSTATUS STDCALL -NtLoadDriver(IN PUNICODE_STRING DriverServiceName) -{ - RTL_QUERY_REGISTRY_TABLE QueryTable[3]; - WCHAR FullImagePathBuffer[MAX_PATH]; - UNICODE_STRING ImagePath; - UNICODE_STRING FullImagePath; - NTSTATUS Status; - ULONG Type; - PDEVICE_NODE DeviceNode; - PMODULE_OBJECT ModuleObject; - LPWSTR Start; - - DPRINT("NtLoadDriver(%wZ) called\n", DriverServiceName); - - RtlInitUnicodeString(&ImagePath, NULL); - - /* Get service data */ - RtlZeroMemory(&QueryTable, - sizeof(QueryTable)); - - QueryTable[0].Name = L"Type"; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[0].EntryContext = &Type; - - QueryTable[1].Name = L"ImagePath"; - QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[1].EntryContext = &ImagePath; - - Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, - DriverServiceName->Buffer, - QueryTable, - NULL, - NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT1("RtlQueryRegistryValues() failed (Status %lx)\n", Status); - RtlFreeUnicodeString(&ImagePath); - return(Status); - } - - if (ImagePath.Length == 0) - { - wcscpy(FullImagePathBuffer, L"\\SystemRoot\\system32\\drivers"); - wcscat(FullImagePathBuffer, wcsrchr(DriverServiceName->Buffer, L'\\')); - wcscat(FullImagePathBuffer, L".sys"); - } - else if (ImagePath.Buffer[0] != L'\\') - { - wcscpy(FullImagePathBuffer, L"\\SystemRoot\\"); - wcscat(FullImagePathBuffer, ImagePath.Buffer); - } - else - { - wcscpy(FullImagePathBuffer, ImagePath.Buffer); - } - - RtlFreeUnicodeString(&ImagePath); - RtlInitUnicodeString(&FullImagePath, FullImagePathBuffer); - - DPRINT("FullImagePath: '%S'\n", FullImagePathBuffer); - DPRINT("Type %lx\n", Type); - - /* Use IopRootDeviceNode for now */ - Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &DeviceNode); - if (!NT_SUCCESS(Status)) - { - DPRINT1("IopCreateDeviceNode() failed (Status %lx)\n", Status); - return(Status); - } - - ModuleObject = LdrGetModuleObject(DriverServiceName); - if (ModuleObject != NULL) - { - return(STATUS_IMAGE_ALREADY_LOADED); - } - - Status = LdrLoadModule(&FullImagePath, &ModuleObject); - if (!NT_SUCCESS(Status)) - { - DPRINT1("LdrLoadModule() failed (Status %lx)\n", Status); - IopFreeDeviceNode(DeviceNode); - return(Status); - } - - /* Set a service name for the device node */ - Start = wcsrchr(DriverServiceName->Buffer, L'\\'); - if (Start == NULL) - Start = DriverServiceName->Buffer; - else - Start++; - RtlCreateUnicodeString(&DeviceNode->ServiceName, Start); - - Status = IopInitializeDriver(ModuleObject->EntryPoint, - DeviceNode, - (Type == 2 || Type == 8), - ModuleObject->Base, - ModuleObject->Length); - if (!NT_SUCCESS(Status)) - { - DPRINT1("IopInitializeDriver() failed (Status %lx)\n", Status); - LdrUnloadModule(ModuleObject); - IopFreeDeviceNode(DeviceNode); - } - - return(Status); -} - - -NTSTATUS STDCALL -NtUnloadDriver(IN PUNICODE_STRING DriverServiceName) -{ - RTL_QUERY_REGISTRY_TABLE QueryTable[2]; - WCHAR FullImagePathBuffer[MAX_PATH]; - UNICODE_STRING ImagePath; - UNICODE_STRING FullImagePath; - UNICODE_STRING ObjectName; - PDRIVER_OBJECT DriverObject; - NTSTATUS Status; - PMODULE_OBJECT ModuleObject; - LPWSTR Start; - - DPRINT("DriverServiceName: '%wZ'\n", DriverServiceName); - - /* Get the service name from the module name */ - Start = wcsrchr(DriverServiceName->Buffer, L'\\'); - if (Start == NULL) - Start = DriverServiceName->Buffer; - else - Start++; - - ObjectName.Length = wcslen(Start) + 8; - ObjectName.Buffer = ExAllocatePool(NonPagedPool, - ObjectName.Length * sizeof(WCHAR)); - wcscpy(ObjectName.Buffer, L"\\Driver\\"); - memcpy(ObjectName.Buffer + 8, Start, (ObjectName.Length - 8) * sizeof(WCHAR)); - - /* Find the driver object */ - Status = ObReferenceObjectByName(&ObjectName, 0, 0, 0, IoDriverObjectType, - KernelMode, 0, (PVOID*)&DriverObject); - if (!NT_SUCCESS(Status)) - { - DPRINT("Can't locate driver object for %wZ\n", ObjectName); - return Status; - } - ObDereferenceObject(DriverObject); - - RtlInitUnicodeString(&ImagePath, NULL); - - /* Get service data */ - RtlZeroMemory(&QueryTable, - sizeof(QueryTable)); - - QueryTable[0].Name = L"ImagePath"; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[0].EntryContext = &ImagePath; - - Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, - DriverServiceName->Buffer, - QueryTable, - NULL, - NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT1("RtlQueryRegistryValues() failed (Status %lx)\n", Status); - RtlFreeUnicodeString(&ImagePath); - return(Status); - } - - if (ImagePath.Length == 0) - { - wcscpy(FullImagePathBuffer, L"\\SystemRoot\\system32\\drivers"); - wcscat(FullImagePathBuffer, wcsrchr(DriverServiceName->Buffer, L'\\')); - wcscat(FullImagePathBuffer, L".sys"); - } - else if (ImagePath.Buffer[0] != L'\\') - { - wcscpy(FullImagePathBuffer, L"\\SystemRoot\\"); - wcscat(FullImagePathBuffer, ImagePath.Buffer); - } - else - { - wcscpy(FullImagePathBuffer, ImagePath.Buffer); - } - - RtlFreeUnicodeString(&ImagePath); - RtlInitUnicodeString(&FullImagePath, FullImagePathBuffer); - - ModuleObject = LdrGetModuleObject(DriverServiceName); - if (ModuleObject == NULL) - { - return STATUS_UNSUCCESSFUL; - } - - /* Unload the module and release the references to the device object */ - - if (DriverObject->DriverUnload) - (*DriverObject->DriverUnload)(DriverObject); - ObDereferenceObject(DriverObject); - ObDereferenceObject(DriverObject); - LdrUnloadModule(ModuleObject); - - return STATUS_SUCCESS; -} - - -static NTSTATUS STDCALL -IopCreateGroupListEntry(PWSTR ValueName, - ULONG ValueType, - PVOID ValueData, - ULONG ValueLength, - PVOID Context, - PVOID EntryContext) -{ - PSERVICE_GROUP Group; - - if (ValueType == REG_SZ) - { - DPRINT("GroupName: '%S'\n", (PWCHAR)ValueData); - - Group = ExAllocatePool(NonPagedPool, - sizeof(SERVICE_GROUP)); - if (Group == NULL) - { - return(STATUS_INSUFFICIENT_RESOURCES); - } - - RtlZeroMemory(Group, sizeof(SERVICE_GROUP)); - - if (!RtlCreateUnicodeString(&Group->GroupName, - (PWSTR)ValueData)) - { - return(STATUS_INSUFFICIENT_RESOURCES); - } - - - InsertTailList(&GroupListHead, - &Group->GroupListEntry); - } - - return(STATUS_SUCCESS); -} - - -static NTSTATUS STDCALL -IopCreateServiceListEntry(PUNICODE_STRING ServiceName) -{ - RTL_QUERY_REGISTRY_TABLE QueryTable[6]; - PSERVICE Service; - NTSTATUS Status; - - DPRINT("ServiceName: '%wZ'\n", ServiceName); - - /* Allocate service entry */ - Service = (PSERVICE)ExAllocatePool(NonPagedPool, sizeof(SERVICE)); - if (Service == NULL) - { - DPRINT1("ExAllocatePool() failed\n"); - return(STATUS_INSUFFICIENT_RESOURCES); - } - RtlZeroMemory(Service, sizeof(SERVICE)); - - /* Get service data */ - RtlZeroMemory(&QueryTable, - sizeof(QueryTable)); - - QueryTable[0].Name = L"Start"; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[0].EntryContext = &Service->Start; - - QueryTable[1].Name = L"Type"; - QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[1].EntryContext = &Service->Type; - - QueryTable[2].Name = L"ErrorControl"; - QueryTable[2].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[2].EntryContext = &Service->ErrorControl; - - QueryTable[3].Name = L"Group"; - QueryTable[3].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[3].EntryContext = &Service->ServiceGroup; - - QueryTable[4].Name = L"ImagePath"; - QueryTable[4].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[4].EntryContext = &Service->ImagePath; - - Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES, - ServiceName->Buffer, - QueryTable, - NULL, - NULL); - if (!NT_SUCCESS(Status) || Service->Start > 1) - { - RtlFreeUnicodeString(&Service->ServiceGroup); - RtlFreeUnicodeString(&Service->ImagePath); - ExFreePool(Service); - return(Status); - } - - /* Copy service name */ - Service->ServiceName.Length = ServiceName->Length; - Service->ServiceName.MaximumLength = ServiceName->Length + sizeof(WCHAR); - Service->ServiceName.Buffer = ExAllocatePool(NonPagedPool, - Service->ServiceName.MaximumLength); - RtlCopyMemory(Service->ServiceName.Buffer, - ServiceName->Buffer, - ServiceName->Length); - Service->ServiceName.Buffer[ServiceName->Length / sizeof(WCHAR)] = 0; - - /* Build registry path */ - Service->RegistryPath.MaximumLength = MAX_PATH * sizeof(WCHAR); - Service->RegistryPath.Buffer = ExAllocatePool(NonPagedPool, - MAX_PATH * sizeof(WCHAR)); - wcscpy(Service->RegistryPath.Buffer, - L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"); - wcscat(Service->RegistryPath.Buffer, - Service->ServiceName.Buffer); - Service->RegistryPath.Length = wcslen(Service->RegistryPath.Buffer) * sizeof(WCHAR); - - DPRINT("ServiceName: '%wZ'\n", &Service->ServiceName); - DPRINT("RegistryPath: '%wZ'\n", &Service->RegistryPath); - DPRINT("ServiceGroup: '%wZ'\n", &Service->ServiceGroup); - DPRINT("ImagePath: '%wZ'\n", &Service->ImagePath); - DPRINT("Start %lx Type %lx ErrorControl %lx\n", - Service->Start, Service->Type, Service->ErrorControl); - - /* Append service entry */ - InsertTailList(&ServiceListHead, - &Service->ServiceListEntry); - - return(STATUS_SUCCESS); -} - - -NTSTATUS -IoCreateDriverList(VOID) -{ - RTL_QUERY_REGISTRY_TABLE QueryTable[2]; - PKEY_BASIC_INFORMATION KeyInfo = NULL; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING ServicesKeyName; - UNICODE_STRING SubKeyName; - HANDLE KeyHandle; - NTSTATUS Status; - ULONG Index; - - ULONG KeyInfoLength = 0; - ULONG ReturnedLength; - - DPRINT("IoCreateDriverList() called\n"); - - /* Initialize basic variables */ - InitializeListHead(&GroupListHead); - InitializeListHead(&ServiceListHead); - - /* Build group order list */ - RtlZeroMemory(&QueryTable, - sizeof(QueryTable)); - - QueryTable[0].Name = L"List"; - QueryTable[0].QueryRoutine = IopCreateGroupListEntry; - - Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, - L"ServiceGroupOrder", - QueryTable, - NULL, - NULL); - if (!NT_SUCCESS(Status)) - return(Status); - - /* Enumerate services and create the service list */ - RtlInitUnicodeStringFromLiteral(&ServicesKeyName, - L"\\Registry\\Machine\\System\\CurrentControlSet\\Services"); - - InitializeObjectAttributes(&ObjectAttributes, - &ServicesKeyName, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - Status = NtOpenKey(&KeyHandle, - 0x10001, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - return(Status); - } - - KeyInfoLength = sizeof(KEY_BASIC_INFORMATION) + MAX_PATH * sizeof(WCHAR); - KeyInfo = ExAllocatePool(NonPagedPool, KeyInfoLength); - if (KeyInfo == NULL) - { - NtClose(KeyHandle); - return(STATUS_INSUFFICIENT_RESOURCES); - } - - Index = 0; - while (TRUE) - { - Status = NtEnumerateKey(KeyHandle, - Index, - KeyBasicInformation, - KeyInfo, - KeyInfoLength, - &ReturnedLength); - if (NT_SUCCESS(Status)) - { - if (KeyInfo->NameLength < MAX_PATH * sizeof(WCHAR)) - { - - SubKeyName.Length = KeyInfo->NameLength; - SubKeyName.MaximumLength = KeyInfo->NameLength + sizeof(WCHAR); - SubKeyName.Buffer = KeyInfo->Name; - SubKeyName.Buffer[SubKeyName.Length / sizeof(WCHAR)] = 0; - - DPRINT("KeyName: '%wZ'\n", &SubKeyName); - IopCreateServiceListEntry(&SubKeyName); - } - } - - if (!NT_SUCCESS(Status)) - break; - - Index++; - } - - ExFreePool(KeyInfo); - NtClose(KeyHandle); - - DPRINT("IoCreateDriverList() done\n"); - - return(STATUS_SUCCESS); -} - - -VOID -LdrLoadAutoConfigDrivers(VOID) -{ - PLIST_ENTRY GroupEntry; - PLIST_ENTRY ServiceEntry; - PSERVICE_GROUP CurrentGroup; - PSERVICE CurrentService; - NTSTATUS Status; - - CHAR TextBuffer [256]; - ULONG x, y, cx, cy; - - DPRINT("LdrLoadAutoConfigDrivers() called\n"); - - GroupEntry = GroupListHead.Flink; - while (GroupEntry != &GroupListHead) - { - CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); - - DPRINT("Group: %wZ\n", &CurrentGroup->GroupName); - - ServiceEntry = ServiceListHead.Flink; - while (ServiceEntry != &ServiceListHead) - { - CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); - - if ((RtlCompareUnicodeString(&CurrentGroup->GroupName, &CurrentService->ServiceGroup, TRUE) == 0) && - (CurrentService->Start == 1 /*SERVICE_SYSTEM_START*/)) - { - - HalQueryDisplayParameters(&x, &y, &cx, &cy); - RtlFillMemory(TextBuffer, x, ' '); - TextBuffer[x] = '\0'; - HalSetDisplayParameters(0, y-1); - HalDisplayString(TextBuffer); - - sprintf(TextBuffer, "Loading %S...\n", CurrentService->ServiceName.Buffer); - HalSetDisplayParameters(0, y-1); - HalDisplayString(TextBuffer); - HalSetDisplayParameters(cx, cy); - - DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath); - Status = NtLoadDriver(&CurrentService->RegistryPath); - if (!NT_SUCCESS(Status)) - { - DPRINT("NtLoadDriver() failed (Status %lx)\n", Status); -#if 0 - if (CurrentService->ErrorControl == 1) - { - /* Log error */ - - } - else if (CurrentService->ErrorControl == 2) - { - if (IsLastKnownGood == FALSE) - { - /* Boot last known good configuration */ - - } - } - else if (CurrentService->ErrorControl == 3) - { - if (IsLastKnownGood == FALSE) - { - /* Boot last known good configuration */ - - } - else - { - /* BSOD! */ - - } - } -#endif - } - } - ServiceEntry = ServiceEntry->Flink; - } - - GroupEntry = GroupEntry->Flink; - } - - DPRINT("LdrLoadAutoConfigDrivers() done\n"); -} - - -NTSTATUS -IoDestroyDriverList(VOID) -{ - PLIST_ENTRY GroupEntry; - PLIST_ENTRY ServiceEntry; - PSERVICE_GROUP CurrentGroup; - PSERVICE CurrentService; - - DPRINT("IoDestroyDriverList() called\n"); - - /* Destroy group list */ - GroupEntry = GroupListHead.Flink; - while (GroupEntry != &GroupListHead) - { - CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); - - RtlFreeUnicodeString(&CurrentGroup->GroupName); - RemoveEntryList(GroupEntry); - ExFreePool(CurrentGroup); - - GroupEntry = GroupListHead.Flink; - } - - /* Destroy service list */ - ServiceEntry = ServiceListHead.Flink; - while (ServiceEntry != &ServiceListHead) - { - CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); - - RtlFreeUnicodeString(&CurrentService->ServiceName); - RtlFreeUnicodeString(&CurrentService->RegistryPath); - RtlFreeUnicodeString(&CurrentService->ServiceGroup); - RtlFreeUnicodeString(&CurrentService->ImagePath); - RemoveEntryList(ServiceEntry); - ExFreePool(CurrentService); - - ServiceEntry = ServiceListHead.Flink; - } - - DPRINT("IoDestroyDriverList() done\n"); - - return(STATUS_SUCCESS); -} - -/* EOF */ +/* $Id: driver.c,v 1.17 2003/09/25 18:29:44 navaraf Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/io/driver.c + * PURPOSE: Manage devices + * PROGRAMMER: David Welch (welch@cwcom.net) + * UPDATE HISTORY: + * 15/05/98: Created + */ + +/* INCLUDES ****************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define NDEBUG +#include + + +typedef struct _SERVICE_GROUP +{ + LIST_ENTRY GroupListEntry; + UNICODE_STRING GroupName; + + BOOLEAN ServicesRunning; + +} SERVICE_GROUP, *PSERVICE_GROUP; + + +typedef struct _SERVICE +{ + LIST_ENTRY ServiceListEntry; + UNICODE_STRING ServiceName; + UNICODE_STRING RegistryPath; + UNICODE_STRING ServiceGroup; + UNICODE_STRING ImagePath; + + ULONG Start; + ULONG Type; + ULONG ErrorControl; + ULONG Tag; + + BOOLEAN ServiceRunning; // needed ?? + +} SERVICE, *PSERVICE; + + +/* GLOBALS *******************************************************************/ + +static LIST_ENTRY GroupListHead = {NULL, NULL}; +static LIST_ENTRY ServiceListHead = {NULL, NULL}; + +POBJECT_TYPE EXPORTED IoDriverObjectType = NULL; + +#define TAG_DRIVER TAG('D', 'R', 'V', 'R') +#define TAG_DRIVER_EXTENSION TAG('D', 'R', 'V', 'E') + + +/* FUNCTIONS ***************************************************************/ + +NTSTATUS STDCALL +IopCreateDriver(PVOID ObjectBody, + PVOID Parent, + PWSTR RemainingPath, + POBJECT_ATTRIBUTES ObjectAttributes) +{ + DPRINT("LdrCreateModule(ObjectBody %x, Parent %x, RemainingPath %S)\n", + ObjectBody, + Parent, + RemainingPath); + if (RemainingPath != NULL && wcschr(RemainingPath + 1, '\\') != NULL) + { + return(STATUS_UNSUCCESSFUL); + } + + return(STATUS_SUCCESS); +} + + +VOID +IopInitDriverImplementation(VOID) +{ + /* Register the process object type */ + IoDriverObjectType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE)); + IoDriverObjectType->Tag = TAG('D', 'R', 'V', 'R'); + IoDriverObjectType->TotalObjects = 0; + IoDriverObjectType->TotalHandles = 0; + IoDriverObjectType->MaxObjects = ULONG_MAX; + IoDriverObjectType->MaxHandles = ULONG_MAX; + IoDriverObjectType->PagedPoolCharge = 0; + IoDriverObjectType->NonpagedPoolCharge = sizeof(DRIVER_OBJECT); + IoDriverObjectType->Dump = NULL; + IoDriverObjectType->Open = NULL; + IoDriverObjectType->Close = NULL; + IoDriverObjectType->Delete = NULL; + IoDriverObjectType->Parse = NULL; + IoDriverObjectType->Security = NULL; + IoDriverObjectType->QueryName = NULL; + IoDriverObjectType->OkayToClose = NULL; + IoDriverObjectType->Create = IopCreateDriver; + IoDriverObjectType->DuplicationNotify = NULL; + RtlInitUnicodeStringFromLiteral(&IoDriverObjectType->TypeName, L"Driver"); +} + +/********************************************************************** + * NAME EXPORTED + * NtLoadDriver + * + * DESCRIPTION + * Loads a device driver. + * + * ARGUMENTS + * DriverServiceName + * Name of the service to load (registry key). + * + * RETURN VALUE + * Status. + * + * REVISIONS + */ +NTSTATUS STDCALL +NtLoadDriver(IN PUNICODE_STRING DriverServiceName) +{ + RTL_QUERY_REGISTRY_TABLE QueryTable[3]; + WCHAR FullImagePathBuffer[MAX_PATH]; + UNICODE_STRING ImagePath; + UNICODE_STRING FullImagePath; + NTSTATUS Status; + ULONG Type; + PDEVICE_NODE DeviceNode; + PMODULE_OBJECT ModuleObject; + LPWSTR Start; + + DPRINT("NtLoadDriver(%wZ) called\n", DriverServiceName); + + RtlInitUnicodeString(&ImagePath, NULL); + + /* Get service data */ + RtlZeroMemory(&QueryTable, + sizeof(QueryTable)); + + QueryTable[0].Name = L"Type"; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[0].EntryContext = &Type; + + QueryTable[1].Name = L"ImagePath"; + QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[1].EntryContext = &ImagePath; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, + DriverServiceName->Buffer, + QueryTable, + NULL, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlQueryRegistryValues() failed (Status %lx)\n", Status); + RtlFreeUnicodeString(&ImagePath); + return(Status); + } + + if (ImagePath.Length == 0) + { + wcscpy(FullImagePathBuffer, L"\\SystemRoot\\system32\\drivers"); + wcscat(FullImagePathBuffer, wcsrchr(DriverServiceName->Buffer, L'\\')); + wcscat(FullImagePathBuffer, L".sys"); + } + else if (ImagePath.Buffer[0] != L'\\') + { + wcscpy(FullImagePathBuffer, L"\\SystemRoot\\"); + wcscat(FullImagePathBuffer, ImagePath.Buffer); + } + else + { + wcscpy(FullImagePathBuffer, ImagePath.Buffer); + } + + RtlFreeUnicodeString(&ImagePath); + RtlInitUnicodeString(&FullImagePath, FullImagePathBuffer); + + DPRINT("FullImagePath: '%S'\n", FullImagePathBuffer); + DPRINT("Type %lx\n", Type); + + /* Use IopRootDeviceNode for now */ + Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &DeviceNode); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IopCreateDeviceNode() failed (Status %lx)\n", Status); + return(Status); + } + + ModuleObject = LdrGetModuleObject(DriverServiceName); + if (ModuleObject != NULL) + { + return(STATUS_IMAGE_ALREADY_LOADED); + } + + Status = LdrLoadModule(&FullImagePath, &ModuleObject); + if (!NT_SUCCESS(Status)) + { + DPRINT1("LdrLoadModule() failed (Status %lx)\n", Status); + IopFreeDeviceNode(DeviceNode); + return(Status); + } + + /* Set a service name for the device node */ + Start = wcsrchr(DriverServiceName->Buffer, L'\\'); + if (Start == NULL) + Start = DriverServiceName->Buffer; + else + Start++; + RtlCreateUnicodeString(&DeviceNode->ServiceName, Start); + + Status = IopInitializeDriver(ModuleObject->EntryPoint, + DeviceNode, + (Type == 2 || Type == 8), + ModuleObject->Base, + ModuleObject->Length); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IopInitializeDriver() failed (Status %lx)\n", Status); + LdrUnloadModule(ModuleObject); + IopFreeDeviceNode(DeviceNode); + } + + return(Status); +} + + +NTSTATUS STDCALL +NtUnloadDriver(IN PUNICODE_STRING DriverServiceName) +{ + RTL_QUERY_REGISTRY_TABLE QueryTable[2]; + WCHAR FullImagePathBuffer[MAX_PATH]; + UNICODE_STRING ImagePath; + UNICODE_STRING FullImagePath; + UNICODE_STRING ObjectName; + PDRIVER_OBJECT DriverObject; + NTSTATUS Status; + PMODULE_OBJECT ModuleObject; + LPWSTR Start; + + DPRINT("DriverServiceName: '%wZ'\n", DriverServiceName); + + /* Get the service name from the module name */ + Start = wcsrchr(DriverServiceName->Buffer, L'\\'); + if (Start == NULL) + Start = DriverServiceName->Buffer; + else + Start++; + + ObjectName.Length = wcslen(Start) + 8; + ObjectName.Buffer = ExAllocatePool(NonPagedPool, + ObjectName.Length * sizeof(WCHAR)); + wcscpy(ObjectName.Buffer, L"\\Driver\\"); + memcpy(ObjectName.Buffer + 8, Start, (ObjectName.Length - 8) * sizeof(WCHAR)); + + /* Find the driver object */ + Status = ObReferenceObjectByName(&ObjectName, 0, 0, 0, IoDriverObjectType, + KernelMode, 0, (PVOID*)&DriverObject); + if (!NT_SUCCESS(Status)) + { + DPRINT("Can't locate driver object for %wZ\n", ObjectName); + return Status; + } + ObDereferenceObject(DriverObject); + + RtlInitUnicodeString(&ImagePath, NULL); + + /* Get service data */ + RtlZeroMemory(&QueryTable, + sizeof(QueryTable)); + + QueryTable[0].Name = L"ImagePath"; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[0].EntryContext = &ImagePath; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, + DriverServiceName->Buffer, + QueryTable, + NULL, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlQueryRegistryValues() failed (Status %lx)\n", Status); + RtlFreeUnicodeString(&ImagePath); + return(Status); + } + + if (ImagePath.Length == 0) + { + wcscpy(FullImagePathBuffer, L"\\SystemRoot\\system32\\drivers"); + wcscat(FullImagePathBuffer, wcsrchr(DriverServiceName->Buffer, L'\\')); + wcscat(FullImagePathBuffer, L".sys"); + } + else if (ImagePath.Buffer[0] != L'\\') + { + wcscpy(FullImagePathBuffer, L"\\SystemRoot\\"); + wcscat(FullImagePathBuffer, ImagePath.Buffer); + } + else + { + wcscpy(FullImagePathBuffer, ImagePath.Buffer); + } + + RtlFreeUnicodeString(&ImagePath); + RtlInitUnicodeString(&FullImagePath, FullImagePathBuffer); + + ModuleObject = LdrGetModuleObject(DriverServiceName); + if (ModuleObject == NULL) + { + return STATUS_UNSUCCESSFUL; + } + + /* Unload the module and release the references to the device object */ + + if (DriverObject->DriverUnload) + (*DriverObject->DriverUnload)(DriverObject); + ObDereferenceObject(DriverObject); + ObDereferenceObject(DriverObject); + LdrUnloadModule(ModuleObject); + + return STATUS_SUCCESS; +} + + +static NTSTATUS STDCALL +IopCreateGroupListEntry(PWSTR ValueName, + ULONG ValueType, + PVOID ValueData, + ULONG ValueLength, + PVOID Context, + PVOID EntryContext) +{ + PSERVICE_GROUP Group; + + if (ValueType == REG_SZ) + { + DPRINT("GroupName: '%S'\n", (PWCHAR)ValueData); + + Group = ExAllocatePool(NonPagedPool, + sizeof(SERVICE_GROUP)); + if (Group == NULL) + { + return(STATUS_INSUFFICIENT_RESOURCES); + } + + RtlZeroMemory(Group, sizeof(SERVICE_GROUP)); + + if (!RtlCreateUnicodeString(&Group->GroupName, + (PWSTR)ValueData)) + { + return(STATUS_INSUFFICIENT_RESOURCES); + } + + + InsertTailList(&GroupListHead, + &Group->GroupListEntry); + } + + return(STATUS_SUCCESS); +} + + +static NTSTATUS STDCALL +IopCreateServiceListEntry(PUNICODE_STRING ServiceName) +{ + RTL_QUERY_REGISTRY_TABLE QueryTable[6]; + PSERVICE Service; + NTSTATUS Status; + + DPRINT("ServiceName: '%wZ'\n", ServiceName); + + /* Allocate service entry */ + Service = (PSERVICE)ExAllocatePool(NonPagedPool, sizeof(SERVICE)); + if (Service == NULL) + { + DPRINT1("ExAllocatePool() failed\n"); + return(STATUS_INSUFFICIENT_RESOURCES); + } + RtlZeroMemory(Service, sizeof(SERVICE)); + + /* Get service data */ + RtlZeroMemory(&QueryTable, + sizeof(QueryTable)); + + QueryTable[0].Name = L"Start"; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[0].EntryContext = &Service->Start; + + QueryTable[1].Name = L"Type"; + QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[1].EntryContext = &Service->Type; + + QueryTable[2].Name = L"ErrorControl"; + QueryTable[2].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[2].EntryContext = &Service->ErrorControl; + + QueryTable[3].Name = L"Group"; + QueryTable[3].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[3].EntryContext = &Service->ServiceGroup; + + QueryTable[4].Name = L"ImagePath"; + QueryTable[4].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[4].EntryContext = &Service->ImagePath; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES, + ServiceName->Buffer, + QueryTable, + NULL, + NULL); + if (!NT_SUCCESS(Status) || Service->Start > 1) + { + RtlFreeUnicodeString(&Service->ServiceGroup); + RtlFreeUnicodeString(&Service->ImagePath); + ExFreePool(Service); + return(Status); + } + + /* Copy service name */ + Service->ServiceName.Length = ServiceName->Length; + Service->ServiceName.MaximumLength = ServiceName->Length + sizeof(WCHAR); + Service->ServiceName.Buffer = ExAllocatePool(NonPagedPool, + Service->ServiceName.MaximumLength); + RtlCopyMemory(Service->ServiceName.Buffer, + ServiceName->Buffer, + ServiceName->Length); + Service->ServiceName.Buffer[ServiceName->Length / sizeof(WCHAR)] = 0; + + /* Build registry path */ + Service->RegistryPath.MaximumLength = MAX_PATH * sizeof(WCHAR); + Service->RegistryPath.Buffer = ExAllocatePool(NonPagedPool, + MAX_PATH * sizeof(WCHAR)); + wcscpy(Service->RegistryPath.Buffer, + L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"); + wcscat(Service->RegistryPath.Buffer, + Service->ServiceName.Buffer); + Service->RegistryPath.Length = wcslen(Service->RegistryPath.Buffer) * sizeof(WCHAR); + + DPRINT("ServiceName: '%wZ'\n", &Service->ServiceName); + DPRINT("RegistryPath: '%wZ'\n", &Service->RegistryPath); + DPRINT("ServiceGroup: '%wZ'\n", &Service->ServiceGroup); + DPRINT("ImagePath: '%wZ'\n", &Service->ImagePath); + DPRINT("Start %lx Type %lx ErrorControl %lx\n", + Service->Start, Service->Type, Service->ErrorControl); + + /* Append service entry */ + InsertTailList(&ServiceListHead, + &Service->ServiceListEntry); + + return(STATUS_SUCCESS); +} + + +NTSTATUS +IoCreateDriverList(VOID) +{ + RTL_QUERY_REGISTRY_TABLE QueryTable[2]; + PKEY_BASIC_INFORMATION KeyInfo = NULL; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING ServicesKeyName; + UNICODE_STRING SubKeyName; + HANDLE KeyHandle; + NTSTATUS Status; + ULONG Index; + + ULONG KeyInfoLength = 0; + ULONG ReturnedLength; + + DPRINT("IoCreateDriverList() called\n"); + + /* Initialize basic variables */ + InitializeListHead(&GroupListHead); + InitializeListHead(&ServiceListHead); + + /* Build group order list */ + RtlZeroMemory(&QueryTable, + sizeof(QueryTable)); + + QueryTable[0].Name = L"List"; + QueryTable[0].QueryRoutine = IopCreateGroupListEntry; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, + L"ServiceGroupOrder", + QueryTable, + NULL, + NULL); + if (!NT_SUCCESS(Status)) + return(Status); + + /* Enumerate services and create the service list */ + RtlInitUnicodeStringFromLiteral(&ServicesKeyName, + L"\\Registry\\Machine\\System\\CurrentControlSet\\Services"); + + InitializeObjectAttributes(&ObjectAttributes, + &ServicesKeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + Status = NtOpenKey(&KeyHandle, + 0x10001, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + + KeyInfoLength = sizeof(KEY_BASIC_INFORMATION) + MAX_PATH * sizeof(WCHAR); + KeyInfo = ExAllocatePool(NonPagedPool, KeyInfoLength); + if (KeyInfo == NULL) + { + NtClose(KeyHandle); + return(STATUS_INSUFFICIENT_RESOURCES); + } + + Index = 0; + while (TRUE) + { + Status = NtEnumerateKey(KeyHandle, + Index, + KeyBasicInformation, + KeyInfo, + KeyInfoLength, + &ReturnedLength); + if (NT_SUCCESS(Status)) + { + if (KeyInfo->NameLength < MAX_PATH * sizeof(WCHAR)) + { + + SubKeyName.Length = KeyInfo->NameLength; + SubKeyName.MaximumLength = KeyInfo->NameLength + sizeof(WCHAR); + SubKeyName.Buffer = KeyInfo->Name; + SubKeyName.Buffer[SubKeyName.Length / sizeof(WCHAR)] = 0; + + DPRINT("KeyName: '%wZ'\n", &SubKeyName); + IopCreateServiceListEntry(&SubKeyName); + } + } + + if (!NT_SUCCESS(Status)) + break; + + Index++; + } + + ExFreePool(KeyInfo); + NtClose(KeyHandle); + + DPRINT("IoCreateDriverList() done\n"); + + return(STATUS_SUCCESS); +} + + +VOID +LdrLoadAutoConfigDrivers(VOID) +{ + PLIST_ENTRY GroupEntry; + PLIST_ENTRY ServiceEntry; + PSERVICE_GROUP CurrentGroup; + PSERVICE CurrentService; + NTSTATUS Status; + + CHAR TextBuffer [256]; + ULONG x, y, cx, cy; + + DPRINT("LdrLoadAutoConfigDrivers() called\n"); + + GroupEntry = GroupListHead.Flink; + while (GroupEntry != &GroupListHead) + { + CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); + + DPRINT("Group: %wZ\n", &CurrentGroup->GroupName); + + ServiceEntry = ServiceListHead.Flink; + while (ServiceEntry != &ServiceListHead) + { + CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); + + if ((RtlCompareUnicodeString(&CurrentGroup->GroupName, &CurrentService->ServiceGroup, TRUE) == 0) && + (CurrentService->Start == 1 /*SERVICE_SYSTEM_START*/)) + { + + HalQueryDisplayParameters(&x, &y, &cx, &cy); + RtlFillMemory(TextBuffer, x, ' '); + TextBuffer[x] = '\0'; + HalSetDisplayParameters(0, y-1); + HalDisplayString(TextBuffer); + + sprintf(TextBuffer, "Loading %S...\n", CurrentService->ServiceName.Buffer); + HalSetDisplayParameters(0, y-1); + HalDisplayString(TextBuffer); + HalSetDisplayParameters(cx, cy); + + DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath); + Status = NtLoadDriver(&CurrentService->RegistryPath); + if (!NT_SUCCESS(Status)) + { + DPRINT("NtLoadDriver() failed (Status %lx)\n", Status); +#if 0 + if (CurrentService->ErrorControl == 1) + { + /* Log error */ + + } + else if (CurrentService->ErrorControl == 2) + { + if (IsLastKnownGood == FALSE) + { + /* Boot last known good configuration */ + + } + } + else if (CurrentService->ErrorControl == 3) + { + if (IsLastKnownGood == FALSE) + { + /* Boot last known good configuration */ + + } + else + { + /* BSOD! */ + + } + } +#endif + } + } + ServiceEntry = ServiceEntry->Flink; + } + + GroupEntry = GroupEntry->Flink; + } + + DPRINT("LdrLoadAutoConfigDrivers() done\n"); +} + + +NTSTATUS +IoDestroyDriverList(VOID) +{ + PLIST_ENTRY GroupEntry; + PLIST_ENTRY ServiceEntry; + PSERVICE_GROUP CurrentGroup; + PSERVICE CurrentService; + + DPRINT("IoDestroyDriverList() called\n"); + + /* Destroy group list */ + GroupEntry = GroupListHead.Flink; + while (GroupEntry != &GroupListHead) + { + CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); + + RtlFreeUnicodeString(&CurrentGroup->GroupName); + RemoveEntryList(GroupEntry); + ExFreePool(CurrentGroup); + + GroupEntry = GroupListHead.Flink; + } + + /* Destroy service list */ + ServiceEntry = ServiceListHead.Flink; + while (ServiceEntry != &ServiceListHead) + { + CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); + + RtlFreeUnicodeString(&CurrentService->ServiceName); + RtlFreeUnicodeString(&CurrentService->RegistryPath); + RtlFreeUnicodeString(&CurrentService->ServiceGroup); + RtlFreeUnicodeString(&CurrentService->ImagePath); + RemoveEntryList(ServiceEntry); + ExFreePool(CurrentService); + + ServiceEntry = ServiceListHead.Flink; + } + + DPRINT("IoDestroyDriverList() done\n"); + + return(STATUS_SUCCESS); +} + +/* EOF */ diff --git a/reactos/ntoskrnl/io/pnpdma.c b/reactos/ntoskrnl/io/pnpdma.c index 97394ce178f..a567e221600 100644 --- a/reactos/ntoskrnl/io/pnpdma.c +++ b/reactos/ntoskrnl/io/pnpdma.c @@ -1,282 +1,282 @@ -/* $Id: pnpdma.c,v 1.1 2003/09/25 15:54:42 navaraf Exp $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/pnpmgr.c - * PURPOSE: PnP manager DMA routines - * PROGRAMMER: Filip Navara (xnavara@volny.cz) - * UPDATE HISTORY: - * 22/09/2003 FiN Created - */ - -/* INCLUDES ******************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//#define NDEBUG -#include - -#ifdef __USE_W32API -#include -#else -#include -#endif -DEFINE_GUID(GUID_BUS_INTERFACE_STANDARD, 0x496B8280L, 0x6F25, 0x11D0, 0xBE, 0xAF, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F); - -typedef struct _DMA_ADAPTER_INTERNAL { - USHORT Version; - USHORT Size; - PDMA_OPERATIONS DmaOperations; - PADAPTER_OBJECT HalAdapter; -} DMA_ADAPTER_INTERNAL, *PDMA_ADAPTER_INTERNAL; - -/* FUNCTIONS *****************************************************************/ - -VOID -IopPutDmaAdapter( - PDMA_ADAPTER DmaAdapter) -{ - ExFreePool(DmaAdapter); -} - - -PVOID -IopAllocateCommonBuffer( - IN PDMA_ADAPTER DmaAdapter, - IN ULONG Length, - OUT PPHYSICAL_ADDRESS LogicalAddress, - IN BOOLEAN CacheEnabled) -{ - return HalAllocateCommonBuffer( - ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, - Length, LogicalAddress, CacheEnabled); -} - - -VOID -IopFreeCommonBuffer( - IN PDMA_ADAPTER DmaAdapter, - IN ULONG Length, - IN PHYSICAL_ADDRESS LogicalAddress, - IN PVOID VirtualAddress, - IN BOOLEAN CacheEnabled) -{ - HalFreeCommonBuffer( - ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, - Length, LogicalAddress, VirtualAddress, CacheEnabled); -} - - -NTSTATUS -IopAllocateAdapterChannel( - IN PDMA_ADAPTER DmaAdapter, - IN PDEVICE_OBJECT DeviceObject, - IN ULONG NumberOfMapRegisters, - IN PDRIVER_CONTROL ExecutionRoutine, - IN PVOID Context) -{ - return HalAllocateAdapterChannel( - ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, - DeviceObject, NumberOfMapRegisters, ExecutionRoutine, Context); -} - - -BOOLEAN -IopFlushAdapterBuffers( - IN PDMA_ADAPTER DmaAdapter, - IN PMDL Mdl, - IN PVOID MapRegisterBase, - IN PVOID CurrentVa, - IN ULONG Length, - IN BOOLEAN WriteToDevice) -{ - return IoFlushAdapterBuffers( - ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, - Mdl, MapRegisterBase, CurrentVa, Length, WriteToDevice); -} - - -VOID -IopFreeAdapterChannel( - IN PDMA_ADAPTER DmaAdapter) -{ - IoFreeAdapterChannel(((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter); -} - - -VOID -IopFreeMapRegisters( - IN PDMA_ADAPTER DmaAdapter, - PVOID MapRegisterBase, - ULONG NumberOfMapRegisters) -{ - IoFreeMapRegisters( - ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, - MapRegisterBase, NumberOfMapRegisters); -} - - -PHYSICAL_ADDRESS -IopMapTransfer( - IN PDMA_ADAPTER DmaAdapter, - IN PMDL Mdl, - IN PVOID MapRegisterBase, - IN PVOID CurrentVa, - IN OUT PULONG Length, - IN BOOLEAN WriteToDevice) -{ - return IoMapTransfer( - ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, - Mdl, MapRegisterBase, CurrentVa, Length, WriteToDevice); -} - - -ULONG -IopGetDmaAlignment( - IN PDMA_ADAPTER DmaAdapter) -{ - /* FIXME: This is actually true only on i386 and Amd64 */ - return 1L; -} - - -ULONG -IopReadDmaCounter( - IN PDMA_ADAPTER DmaAdapter) -{ - return HalReadDmaCounter(((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter); -} - - -NTSTATUS -IopGetScatterGatherList( - IN PDMA_ADAPTER DmaAdapter, - IN PDEVICE_OBJECT DeviceObject, - IN PMDL Mdl, - IN PVOID CurrentVa, - IN ULONG Length, - IN PDRIVER_LIST_CONTROL ExecutionRoutine, - IN PVOID Context, - IN BOOLEAN WriteToDevice) -{ - /* FIXME */ - return STATUS_UNSUCCESSFUL; -} - - -VOID -IopPutScatterGatherList( - IN PDMA_ADAPTER DmaAdapter, - IN PSCATTER_GATHER_LIST ScatterGather, - IN BOOLEAN WriteToDevice) -{ - /* FIXME */ -} - - -/* - * @implemented - */ -PDMA_ADAPTER -STDCALL -IoGetDmaAdapter( - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PDEVICE_DESCRIPTION DeviceDescription, - IN OUT PULONG NumberOfMapRegisters) -{ - NTSTATUS Status; - ULONG ResultLength; - BUS_INTERFACE_STANDARD BusInterface; - IO_STATUS_BLOCK IoStatusBlock; - IO_STACK_LOCATION Stack; - DEVICE_DESCRIPTION PrivateDeviceDescription; - PDMA_ADAPTER Result = NULL; - PDMA_ADAPTER_INTERNAL ResultInternal = NULL; - PADAPTER_OBJECT HalAdapter; - - DPRINT("IoGetDmaAdapter called\n"); - - /* - * Try to create DMA adapter through bus driver - */ - if (PhysicalDeviceObject != NULL) - { - if (DeviceDescription->InterfaceType == 0x0F /*PNPBus*/ || - DeviceDescription->InterfaceType == 0xFFFFFFFF) - { - memcpy(&PrivateDeviceDescription, DeviceDescription, - sizeof(DEVICE_DESCRIPTION)); - Status = IoGetDeviceProperty(PhysicalDeviceObject, - DevicePropertyLegacyBusType, sizeof(INTERFACE_TYPE), - &PrivateDeviceDescription.InterfaceType, &ResultLength); - if (!NT_SUCCESS(Status)) - { - PrivateDeviceDescription.InterfaceType = Internal; - } - DeviceDescription = &PrivateDeviceDescription; - } - - Stack.Parameters.QueryInterface.Size = sizeof(BUS_INTERFACE_STANDARD); - Stack.Parameters.QueryInterface.Version = 1; - Stack.Parameters.QueryInterface.Interface = (PINTERFACE)&BusInterface; - Stack.Parameters.QueryInterface.InterfaceType = - &GUID_BUS_INTERFACE_STANDARD; - Status = IopInitiatePnpIrp(PhysicalDeviceObject, &IoStatusBlock, - IRP_MN_QUERY_BUS_INFORMATION, &Stack); - if (!NT_SUCCESS(Status)) - { - Result = BusInterface.GetDmaAdapter(BusInterface.Context, - DeviceDescription, NumberOfMapRegisters); - BusInterface.InterfaceDereference(BusInterface.Context); - if (Result != NULL) - return Result; - } - } - - /* - * Fallback to HAL - */ - - HalAdapter = HalGetAdapter(DeviceDescription, NumberOfMapRegisters); - if (HalAdapter == NULL) - { - return NULL; - } - - ResultInternal = ExAllocatePool(PagedPool, sizeof(DMA_ADAPTER_INTERNAL) + - sizeof(DMA_OPERATIONS)); - if (Result == NULL) - { - return NULL; - } - - ResultInternal->Version = DEVICE_DESCRIPTION_VERSION; - ResultInternal->Size = sizeof(DMA_ADAPTER); - ResultInternal->DmaOperations = (PDMA_OPERATIONS)(ResultInternal + 1); - ResultInternal->DmaOperations->Size = sizeof(DMA_OPERATIONS); - ResultInternal->DmaOperations->PutDmaAdapter = IopPutDmaAdapter; - ResultInternal->DmaOperations->AllocateCommonBuffer = IopAllocateCommonBuffer; - ResultInternal->DmaOperations->FreeCommonBuffer = IopFreeCommonBuffer; - ResultInternal->DmaOperations->AllocateAdapterChannel = IopAllocateAdapterChannel; - ResultInternal->DmaOperations->FlushAdapterBuffers = IopFlushAdapterBuffers; - ResultInternal->DmaOperations->FreeAdapterChannel = IopFreeAdapterChannel; - ResultInternal->DmaOperations->FreeMapRegisters = IopFreeMapRegisters; - ResultInternal->DmaOperations->MapTransfer = IopMapTransfer; - ResultInternal->DmaOperations->GetDmaAlignment = IopGetDmaAlignment; - ResultInternal->DmaOperations->ReadDmaCounter = IopReadDmaCounter; - ResultInternal->DmaOperations->GetScatterGatherList = IopGetScatterGatherList; - ResultInternal->DmaOperations->PutScatterGatherList = IopPutScatterGatherList; - ResultInternal->HalAdapter = HalAdapter; - - return (PDMA_ADAPTER)ResultInternal; -} - -/* EOF */ +/* $Id: pnpdma.c,v 1.2 2003/09/25 18:29:44 navaraf Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/io/pnpmgr.c + * PURPOSE: PnP manager DMA routines + * PROGRAMMER: Filip Navara (xnavara@volny.cz) + * UPDATE HISTORY: + * 22/09/2003 FiN Created + */ + +/* INCLUDES ******************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//#define NDEBUG +#include + +#ifdef __USE_W32API +#include +#else +#include +#endif +DEFINE_GUID(GUID_BUS_INTERFACE_STANDARD, 0x496B8280L, 0x6F25, 0x11D0, 0xBE, 0xAF, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F); + +typedef struct _DMA_ADAPTER_INTERNAL { + USHORT Version; + USHORT Size; + PDMA_OPERATIONS DmaOperations; + PADAPTER_OBJECT HalAdapter; +} DMA_ADAPTER_INTERNAL, *PDMA_ADAPTER_INTERNAL; + +/* FUNCTIONS *****************************************************************/ + +VOID +IopPutDmaAdapter( + PDMA_ADAPTER DmaAdapter) +{ + ExFreePool(DmaAdapter); +} + + +PVOID +IopAllocateCommonBuffer( + IN PDMA_ADAPTER DmaAdapter, + IN ULONG Length, + OUT PPHYSICAL_ADDRESS LogicalAddress, + IN BOOLEAN CacheEnabled) +{ + return HalAllocateCommonBuffer( + ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, + Length, LogicalAddress, CacheEnabled); +} + + +VOID +IopFreeCommonBuffer( + IN PDMA_ADAPTER DmaAdapter, + IN ULONG Length, + IN PHYSICAL_ADDRESS LogicalAddress, + IN PVOID VirtualAddress, + IN BOOLEAN CacheEnabled) +{ + HalFreeCommonBuffer( + ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, + Length, LogicalAddress, VirtualAddress, CacheEnabled); +} + + +NTSTATUS +IopAllocateAdapterChannel( + IN PDMA_ADAPTER DmaAdapter, + IN PDEVICE_OBJECT DeviceObject, + IN ULONG NumberOfMapRegisters, + IN PDRIVER_CONTROL ExecutionRoutine, + IN PVOID Context) +{ + return HalAllocateAdapterChannel( + ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, + DeviceObject, NumberOfMapRegisters, ExecutionRoutine, Context); +} + + +BOOLEAN +IopFlushAdapterBuffers( + IN PDMA_ADAPTER DmaAdapter, + IN PMDL Mdl, + IN PVOID MapRegisterBase, + IN PVOID CurrentVa, + IN ULONG Length, + IN BOOLEAN WriteToDevice) +{ + return IoFlushAdapterBuffers( + ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, + Mdl, MapRegisterBase, CurrentVa, Length, WriteToDevice); +} + + +VOID +IopFreeAdapterChannel( + IN PDMA_ADAPTER DmaAdapter) +{ + IoFreeAdapterChannel(((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter); +} + + +VOID +IopFreeMapRegisters( + IN PDMA_ADAPTER DmaAdapter, + PVOID MapRegisterBase, + ULONG NumberOfMapRegisters) +{ + IoFreeMapRegisters( + ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, + MapRegisterBase, NumberOfMapRegisters); +} + + +PHYSICAL_ADDRESS +IopMapTransfer( + IN PDMA_ADAPTER DmaAdapter, + IN PMDL Mdl, + IN PVOID MapRegisterBase, + IN PVOID CurrentVa, + IN OUT PULONG Length, + IN BOOLEAN WriteToDevice) +{ + return IoMapTransfer( + ((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter, + Mdl, MapRegisterBase, CurrentVa, Length, WriteToDevice); +} + + +ULONG +IopGetDmaAlignment( + IN PDMA_ADAPTER DmaAdapter) +{ + /* FIXME: This is actually true only on i386 and Amd64 */ + return 1L; +} + + +ULONG +IopReadDmaCounter( + IN PDMA_ADAPTER DmaAdapter) +{ + return HalReadDmaCounter(((PDMA_ADAPTER_INTERNAL)DmaAdapter)->HalAdapter); +} + + +NTSTATUS +IopGetScatterGatherList( + IN PDMA_ADAPTER DmaAdapter, + IN PDEVICE_OBJECT DeviceObject, + IN PMDL Mdl, + IN PVOID CurrentVa, + IN ULONG Length, + IN PDRIVER_LIST_CONTROL ExecutionRoutine, + IN PVOID Context, + IN BOOLEAN WriteToDevice) +{ + /* FIXME */ + return STATUS_UNSUCCESSFUL; +} + + +VOID +IopPutScatterGatherList( + IN PDMA_ADAPTER DmaAdapter, + IN PSCATTER_GATHER_LIST ScatterGather, + IN BOOLEAN WriteToDevice) +{ + /* FIXME */ +} + + +/* + * @implemented + */ +PDMA_ADAPTER +STDCALL +IoGetDmaAdapter( + IN PDEVICE_OBJECT PhysicalDeviceObject, + IN PDEVICE_DESCRIPTION DeviceDescription, + IN OUT PULONG NumberOfMapRegisters) +{ + NTSTATUS Status; + ULONG ResultLength; + BUS_INTERFACE_STANDARD BusInterface; + IO_STATUS_BLOCK IoStatusBlock; + IO_STACK_LOCATION Stack; + DEVICE_DESCRIPTION PrivateDeviceDescription; + PDMA_ADAPTER Result = NULL; + PDMA_ADAPTER_INTERNAL ResultInternal = NULL; + PADAPTER_OBJECT HalAdapter; + + DPRINT("IoGetDmaAdapter called\n"); + + /* + * Try to create DMA adapter through bus driver + */ + if (PhysicalDeviceObject != NULL) + { + if (DeviceDescription->InterfaceType == 0x0F /*PNPBus*/ || + DeviceDescription->InterfaceType == 0xFFFFFFFF) + { + memcpy(&PrivateDeviceDescription, DeviceDescription, + sizeof(DEVICE_DESCRIPTION)); + Status = IoGetDeviceProperty(PhysicalDeviceObject, + DevicePropertyLegacyBusType, sizeof(INTERFACE_TYPE), + &PrivateDeviceDescription.InterfaceType, &ResultLength); + if (!NT_SUCCESS(Status)) + { + PrivateDeviceDescription.InterfaceType = Internal; + } + DeviceDescription = &PrivateDeviceDescription; + } + + Stack.Parameters.QueryInterface.Size = sizeof(BUS_INTERFACE_STANDARD); + Stack.Parameters.QueryInterface.Version = 1; + Stack.Parameters.QueryInterface.Interface = (PINTERFACE)&BusInterface; + Stack.Parameters.QueryInterface.InterfaceType = + &GUID_BUS_INTERFACE_STANDARD; + Status = IopInitiatePnpIrp(PhysicalDeviceObject, &IoStatusBlock, + IRP_MN_QUERY_BUS_INFORMATION, &Stack); + if (!NT_SUCCESS(Status)) + { + Result = BusInterface.GetDmaAdapter(BusInterface.Context, + DeviceDescription, NumberOfMapRegisters); + BusInterface.InterfaceDereference(BusInterface.Context); + if (Result != NULL) + return Result; + } + } + + /* + * Fallback to HAL + */ + + HalAdapter = HalGetAdapter(DeviceDescription, NumberOfMapRegisters); + if (HalAdapter == NULL) + { + return NULL; + } + + ResultInternal = ExAllocatePool(PagedPool, sizeof(DMA_ADAPTER_INTERNAL) + + sizeof(DMA_OPERATIONS)); + if (Result == NULL) + { + return NULL; + } + + ResultInternal->Version = DEVICE_DESCRIPTION_VERSION; + ResultInternal->Size = sizeof(DMA_ADAPTER); + ResultInternal->DmaOperations = (PDMA_OPERATIONS)(ResultInternal + 1); + ResultInternal->DmaOperations->Size = sizeof(DMA_OPERATIONS); + ResultInternal->DmaOperations->PutDmaAdapter = IopPutDmaAdapter; + ResultInternal->DmaOperations->AllocateCommonBuffer = IopAllocateCommonBuffer; + ResultInternal->DmaOperations->FreeCommonBuffer = IopFreeCommonBuffer; + ResultInternal->DmaOperations->AllocateAdapterChannel = IopAllocateAdapterChannel; + ResultInternal->DmaOperations->FlushAdapterBuffers = IopFlushAdapterBuffers; + ResultInternal->DmaOperations->FreeAdapterChannel = IopFreeAdapterChannel; + ResultInternal->DmaOperations->FreeMapRegisters = IopFreeMapRegisters; + ResultInternal->DmaOperations->MapTransfer = IopMapTransfer; + ResultInternal->DmaOperations->GetDmaAlignment = IopGetDmaAlignment; + ResultInternal->DmaOperations->ReadDmaCounter = IopReadDmaCounter; + ResultInternal->DmaOperations->GetScatterGatherList = IopGetScatterGatherList; + ResultInternal->DmaOperations->PutScatterGatherList = IopPutScatterGatherList; + ResultInternal->HalAdapter = HalAdapter; + + return (PDMA_ADAPTER)ResultInternal; +} + +/* EOF */ diff --git a/reactos/ntoskrnl/io/pnproot.c b/reactos/ntoskrnl/io/pnproot.c index c5cc77c616c..289ee1d7acf 100644 --- a/reactos/ntoskrnl/io/pnproot.c +++ b/reactos/ntoskrnl/io/pnproot.c @@ -1,966 +1,966 @@ -/* $Id: pnproot.c,v 1.15 2003/09/25 15:54:42 navaraf Exp $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/pnpmgr/pnproot.c - * PURPOSE: PnP manager root device - * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net) - * UPDATE HISTORY: - * 16/04/2001 CSH Created - */ - -/* INCLUDES ******************************************************************/ - -#include -#include -#include -#include - -#define NDEBUG -#include - -/* GLOBALS *******************************************************************/ - -#define ENUM_NAME_ROOT L"Root" - -/* DATA **********************************************************************/ - -typedef struct _PNPROOT_DEVICE { - // Entry on device list - LIST_ENTRY ListEntry; - // Physical Device Object of device - PDEVICE_OBJECT Pdo; - // Service name - UNICODE_STRING ServiceName; - // Device ID - UNICODE_STRING DeviceID; - // Instance ID - UNICODE_STRING InstanceID; - // Device description - UNICODE_STRING DeviceDescription; -} PNPROOT_DEVICE, *PPNPROOT_DEVICE; - -typedef enum { - dsStopped, - dsStarted, - dsPaused, - dsRemoved, - dsSurpriseRemoved -} PNPROOT_DEVICE_STATE; - - -typedef struct _PNPROOT_COMMON_DEVICE_EXTENSION -{ - // Pointer to device object, this device extension is associated with - PDEVICE_OBJECT DeviceObject; - // Wether this device extension is for an FDO or PDO - BOOLEAN IsFDO; - // Wether the device is removed - BOOLEAN Removed; - // Current device power state for the device - DEVICE_POWER_STATE DevicePowerState; -} __attribute((packed)) PNPROOT_COMMON_DEVICE_EXTENSION, *PPNPROOT_COMMON_DEVICE_EXTENSION; - -/* Physical Device Object device extension for a child device */ -typedef struct _PNPROOT_PDO_DEVICE_EXTENSION -{ - // Common device data - PNPROOT_COMMON_DEVICE_EXTENSION Common; - // Device ID - UNICODE_STRING DeviceID; - // Instance ID - UNICODE_STRING InstanceID; -} __attribute((packed)) PNPROOT_PDO_DEVICE_EXTENSION, *PPNPROOT_PDO_DEVICE_EXTENSION; - -/* Functional Device Object device extension for the PCI driver device object */ -typedef struct _PNPROOT_FDO_DEVICE_EXTENSION -{ - // Common device data - PNPROOT_COMMON_DEVICE_EXTENSION Common; - // Physical Device Object - PDEVICE_OBJECT Pdo; - // Lower device object - PDEVICE_OBJECT Ldo; - // Current state of the driver - PNPROOT_DEVICE_STATE State; - // Namespace device list - LIST_ENTRY DeviceListHead; - // Number of (not removed) devices in device list - ULONG DeviceListCount; - // Lock for namespace device list - // FIXME: Use fast mutex instead? - KSPIN_LOCK DeviceListLock; -} __attribute((packed)) PNPROOT_FDO_DEVICE_EXTENSION, *PPNPROOT_FDO_DEVICE_EXTENSION; - - -PDEVICE_OBJECT PnpRootDeviceObject; - - -/* FUNCTIONS *****************************************************************/ - -/* Physical Device Object routines */ - -NTSTATUS -PnpRootCreateDevice( - PDEVICE_OBJECT *PhysicalDeviceObject) -{ - PPNPROOT_PDO_DEVICE_EXTENSION PdoDeviceExtension; - PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; - PPNPROOT_DEVICE Device; - NTSTATUS Status; - - /* This function should be obsoleted soon */ - - DPRINT("Called\n"); - - DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)PnpRootDeviceObject->DeviceExtension; - - Device = (PPNPROOT_DEVICE)ExAllocatePool(PagedPool, sizeof(PNPROOT_DEVICE)); - if (!Device) - return STATUS_INSUFFICIENT_RESOURCES; - - RtlZeroMemory(Device, sizeof(PNPROOT_DEVICE)); - - Status = IoCreateDevice( - PnpRootDeviceObject->DriverObject, - sizeof(PNPROOT_PDO_DEVICE_EXTENSION), - NULL, - FILE_DEVICE_CONTROLLER, - 0, - FALSE, - &Device->Pdo); - if (!NT_SUCCESS(Status)) { - DPRINT("IoCreateDevice() failed with status 0x%X\n", Status); - ExFreePool(Device); - return Status; - } - - Device->Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE; - - Device->Pdo->Flags &= ~DO_DEVICE_INITIALIZING; - - //Device->Pdo->Flags |= DO_POWER_PAGABLE; - - PdoDeviceExtension = (PPNPROOT_PDO_DEVICE_EXTENSION)Device->Pdo->DeviceExtension; - - RtlZeroMemory(PdoDeviceExtension, sizeof(PNPROOT_PDO_DEVICE_EXTENSION)); - - PdoDeviceExtension->Common.IsFDO = FALSE; - - PdoDeviceExtension->Common.DeviceObject = Device->Pdo; - - PdoDeviceExtension->Common.DevicePowerState = PowerDeviceD0; - - if (!IopCreateUnicodeString( - &PdoDeviceExtension->DeviceID, - ENUM_NAME_ROOT \ - L"\\LEGACY_UNKNOWN", - PagedPool)) - { - /* FIXME: */ - DPRINT("IopCreateUnicodeString() failed\n"); - } - - if (!IopCreateUnicodeString( - &PdoDeviceExtension->InstanceID, - L"0000", - PagedPool)) - { - /* FIXME: */ - DPRINT("IopCreateUnicodeString() failed\n"); - } - - ExInterlockedInsertTailList( - &DeviceExtension->DeviceListHead, - &Device->ListEntry, - &DeviceExtension->DeviceListLock); - - DeviceExtension->DeviceListCount++; - - *PhysicalDeviceObject = Device->Pdo; - - return STATUS_SUCCESS; -} - - -NTSTATUS -PdoQueryId( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - PIO_STACK_LOCATION IrpSp) -{ - PPNPROOT_PDO_DEVICE_EXTENSION DeviceExtension; - UNICODE_STRING String; - NTSTATUS Status; - - DPRINT("Called\n"); - - DeviceExtension = (PPNPROOT_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - -// Irp->IoStatus.Information = 0; - - Status = STATUS_SUCCESS; - - RtlInitUnicodeString(&String, NULL); - - switch (IrpSp->Parameters.QueryId.IdType) { - case BusQueryDeviceID: - Status = IopCreateUnicodeString( - &String, - DeviceExtension->DeviceID.Buffer, - PagedPool); - - DPRINT("DeviceID: %S\n", String.Buffer); - - Irp->IoStatus.Information = (ULONG_PTR)String.Buffer; - break; - - case BusQueryHardwareIDs: - case BusQueryCompatibleIDs: - Status = STATUS_NOT_IMPLEMENTED; - break; - - case BusQueryInstanceID: - Status = IopCreateUnicodeString( - &String, - DeviceExtension->InstanceID.Buffer, - PagedPool); - - DPRINT("InstanceID: %S\n", String.Buffer); - - Irp->IoStatus.Information = (ULONG_PTR)String.Buffer; - break; - - case BusQueryDeviceSerialNumber: - default: - Status = STATUS_NOT_IMPLEMENTED; - } - - return Status; -} - - -NTSTATUS -PnpRootPdoPnpControl( - PDEVICE_OBJECT DeviceObject, - PIRP Irp) -/* - * FUNCTION: Handle Plug and Play IRPs for the child device - * ARGUMENTS: - * DeviceObject = Pointer to physical device object of the child device - * Irp = Pointer to IRP that should be handled - * RETURNS: - * Status - */ -{ - PIO_STACK_LOCATION IrpSp; - NTSTATUS Status; - - DPRINT("Called\n"); - - Status = Irp->IoStatus.Status; - - IrpSp = IoGetCurrentIrpStackLocation(Irp); - - switch (IrpSp->MinorFunction) { -#if 0 - case IRP_MN_CANCEL_REMOVE_DEVICE: - break; - - case IRP_MN_CANCEL_STOP_DEVICE: - break; - - case IRP_MN_DEVICE_USAGE_NOTIFICATION: - break; - - case IRP_MN_EJECT: - break; - - case IRP_MN_QUERY_BUS_INFORMATION: - break; - - case IRP_MN_QUERY_CAPABILITIES: - break; - - case IRP_MN_QUERY_DEVICE_RELATIONS: - /* FIXME: Possibly handle for RemovalRelations */ - break; - - case IRP_MN_QUERY_DEVICE_TEXT: - break; -#endif - case IRP_MN_QUERY_ID: - Status = PdoQueryId(DeviceObject, Irp, IrpSp); - break; -#if 0 - case IRP_MN_QUERY_PNP_DEVICE_STATE: - break; - - case IRP_MN_QUERY_REMOVE_DEVICE: - break; - - case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: - break; - - case IRP_MN_QUERY_RESOURCES: - break; - - case IRP_MN_QUERY_STOP_DEVICE: - break; - - case IRP_MN_REMOVE_DEVICE: - break; - - case IRP_MN_SET_LOCK: - break; - - case IRP_MN_START_DEVICE: - break; - - case IRP_MN_STOP_DEVICE: - break; - - case IRP_MN_SURPRISE_REMOVAL: - break; -#endif - default: - DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction); - break; - } - - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - DPRINT("Leaving. Status 0x%X\n", Status); - - return Status; -} - -NTSTATUS -PnpRootPdoPowerControl( - PDEVICE_OBJECT DeviceObject, - PIRP Irp) -/* - * FUNCTION: Handle power management IRPs for the child device - * ARGUMENTS: - * DeviceObject = Pointer to physical device object of the child device - * Irp = Pointer to IRP that should be handled - * RETURNS: - * Status - */ -{ - PIO_STACK_LOCATION IrpSp; - NTSTATUS Status; - - DPRINT("Called\n"); - - Status = Irp->IoStatus.Status; - - IrpSp = IoGetCurrentIrpStackLocation(Irp); - - switch (IrpSp->MinorFunction) { - default: - DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction); - break; - } - - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - DPRINT("Leaving. Status 0x%X\n", Status); - - return Status; -} - - -/* Functional Device Object routines */ - -NTSTATUS -PnpRootFdoReadDeviceInfo( - PPNPROOT_DEVICE Device) -{ - RTL_QUERY_REGISTRY_TABLE QueryTable[2]; - PUNICODE_STRING DeviceDesc; - WCHAR KeyName[MAX_PATH]; - HANDLE KeyHandle; - NTSTATUS Status; - - DPRINT("Called\n"); - - /* Retrieve configuration from Enum key */ - - DeviceDesc = &Device->DeviceDescription; - - wcscpy(KeyName, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); - wcscat(KeyName, ENUM_NAME_ROOT); - wcscat(KeyName, L"\\"); - wcscat(KeyName, Device->ServiceName.Buffer); - wcscat(KeyName, L"\\"); - wcscat(KeyName, Device->InstanceID.Buffer); - - DPRINT("KeyName %S\n", KeyName); - - Status = RtlpGetRegistryHandle( - RTL_REGISTRY_ABSOLUTE, - KeyName, - FALSE, - &KeyHandle); - if (!NT_SUCCESS(Status)) - { - DPRINT("RtlpGetRegistryHandle() failed (Status %x)\n", Status); - return Status; - } - - RtlZeroMemory(QueryTable, sizeof(QueryTable)); - - RtlInitUnicodeString(DeviceDesc, NULL); - - QueryTable[0].Name = L"DeviceDesc"; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[0].EntryContext = DeviceDesc; - - Status = RtlQueryRegistryValues( - RTL_REGISTRY_HANDLE, - (PWSTR)KeyHandle, - QueryTable, - NULL, - NULL); - - NtClose(KeyHandle); - - DPRINT("RtlQueryRegistryValues() returned status %x\n", Status); - - if (!NT_SUCCESS(Status)) - { - /* FIXME: */ - } - - DPRINT("Got device description: %S\n", DeviceDesc->Buffer); - - return STATUS_SUCCESS; -} - - -NTSTATUS -PnpRootFdoEnumerateDevices( - PDEVICE_OBJECT DeviceObject) -{ - PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; - OBJECT_ATTRIBUTES ObjectAttributes; - PKEY_BASIC_INFORMATION KeyInfo; - UNICODE_STRING KeyName; - PPNPROOT_DEVICE Device; - WCHAR Buffer[MAX_PATH]; - HANDLE KeyHandle; - ULONG BufferSize; - ULONG ResultSize; - NTSTATUS Status; - ULONG Index; - - DPRINT("Called\n"); - - DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - - BufferSize = sizeof(KEY_BASIC_INFORMATION) + (MAX_PATH+1) * sizeof(WCHAR); - KeyInfo = ExAllocatePool(PagedPool, BufferSize); - if (!KeyInfo) - { - return STATUS_INSUFFICIENT_RESOURCES; - } - - RtlInitUnicodeStringFromLiteral( - &KeyName, - L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\" \ - ENUM_NAME_ROOT); - - InitializeObjectAttributes( - &ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - Status = NtOpenKey(&KeyHandle, KEY_ALL_ACCESS, &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - DPRINT("NtOpenKey() failed (Status %x)\n", Status); - ExFreePool(KeyInfo); - return Status; - } - - /* FIXME: Disabled due to still using the old method of auto loading drivers e.g. - there are more entries in the list than found in the registry as some - drivers are passed on the command line */ -// DeviceExtension->DeviceListCount = 0; - - Index = 0; - do { - Status = ZwEnumerateKey( - KeyHandle, - Index, - KeyBasicInformation, - KeyInfo, - BufferSize, - &ResultSize); - if (!NT_SUCCESS(Status)) - { - DPRINT("ZwEnumerateKey() (Status %x)\n", Status); - break; - } - - /* Terminate the string */ - KeyInfo->Name[KeyInfo->NameLength / sizeof(WCHAR)] = 0; - - Device = (PPNPROOT_DEVICE)ExAllocatePool(PagedPool, sizeof(PNPROOT_DEVICE)); - if (!Device) - { - /* FIXME: */ - break; - } - - RtlZeroMemory(Device, sizeof(PNPROOT_DEVICE)); - - if (!IopCreateUnicodeString(&Device->ServiceName, KeyInfo->Name, PagedPool)) - { - /* FIXME: */ - DPRINT("IopCreateUnicodeString() failed\n"); - } - - wcscpy(Buffer, ENUM_NAME_ROOT); - wcscat(Buffer, L"\\"); - wcscat(Buffer, KeyInfo->Name); - - if (!IopCreateUnicodeString(&Device->DeviceID, Buffer, PagedPool)) - { - /* FIXME: */ - DPRINT("IopCreateUnicodeString() failed\n"); - } - - DPRINT("Got entry: %S\n", Device->DeviceID.Buffer); - - if (!IopCreateUnicodeString( - &Device->InstanceID, - L"0000", - PagedPool)) - { - /* FIXME: */ - DPRINT("IopCreateUnicodeString() failed\n"); - } - - Status = PnpRootFdoReadDeviceInfo(Device); - if (!NT_SUCCESS(Status)) - { - DPRINT("PnpRootFdoReadDeviceInfo() failed with status %x\n", Status); - /* FIXME: */ - } - - ExInterlockedInsertTailList( - &DeviceExtension->DeviceListHead, - &Device->ListEntry, - &DeviceExtension->DeviceListLock); - - DeviceExtension->DeviceListCount++; - - Index++; - } while (TRUE); - - DPRINT("Entries found: %d\n", Index); - - NtClose(KeyHandle); - - ExFreePool(KeyInfo); - - return STATUS_SUCCESS; -} - - -NTSTATUS -PnpRootQueryBusRelations( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PIO_STACK_LOCATION IrpSp) -{ - PPNPROOT_PDO_DEVICE_EXTENSION PdoDeviceExtension; - PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; - PDEVICE_RELATIONS Relations; - PLIST_ENTRY CurrentEntry; - PPNPROOT_DEVICE Device; - NTSTATUS Status; - ULONG Size; - ULONG i; - - DPRINT("Called\n"); - - Status = PnpRootFdoEnumerateDevices(DeviceObject); - if (!NT_SUCCESS(Status)) - return Status; - - DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - - if (Irp->IoStatus.Information) - { - /* FIXME: Another bus driver has already created a DEVICE_RELATIONS - structure so we must merge this structure with our own */ - } - - Size = sizeof(DEVICE_RELATIONS) + sizeof(Relations->Objects) * - (DeviceExtension->DeviceListCount - 1); - - Relations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, Size); - if (!Relations) - return STATUS_INSUFFICIENT_RESOURCES; - - Relations->Count = DeviceExtension->DeviceListCount; - - i = 0; - CurrentEntry = DeviceExtension->DeviceListHead.Flink; - while (CurrentEntry != &DeviceExtension->DeviceListHead) - { - Device = CONTAINING_RECORD(CurrentEntry, PNPROOT_DEVICE, ListEntry); - - if (!Device->Pdo) - { - /* Create a physical device object for the - device as it does not already have one */ - Status = IoCreateDevice( - DeviceObject->DriverObject, - sizeof(PNPROOT_PDO_DEVICE_EXTENSION), - NULL, - FILE_DEVICE_CONTROLLER, - 0, - FALSE, - &Device->Pdo); - if (!NT_SUCCESS(Status)) - { - DPRINT("IoCreateDevice() failed with status 0x%X\n", Status); - ExFreePool(Relations); - return Status; - } - - DPRINT("Created PDO %x\n", Device->Pdo); - - Device->Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE; - - Device->Pdo->Flags &= ~DO_DEVICE_INITIALIZING; - - //Device->Pdo->Flags |= DO_POWER_PAGABLE; - - PdoDeviceExtension = (PPNPROOT_PDO_DEVICE_EXTENSION)Device->Pdo->DeviceExtension; - - RtlZeroMemory(PdoDeviceExtension, sizeof(PNPROOT_PDO_DEVICE_EXTENSION)); - - PdoDeviceExtension->Common.IsFDO = FALSE; - - PdoDeviceExtension->Common.DeviceObject = Device->Pdo; - - PdoDeviceExtension->Common.DevicePowerState = PowerDeviceD0; - - if (!IopCreateUnicodeString( - &PdoDeviceExtension->DeviceID, - Device->DeviceID.Buffer, - PagedPool)) - { - DPRINT("Insufficient resources\n"); - /* FIXME: */ - } - - DPRINT("DeviceID: %S PDO %x\n", - PdoDeviceExtension->DeviceID.Buffer, - Device->Pdo); - - if (!IopCreateUnicodeString( - &PdoDeviceExtension->InstanceID, - Device->InstanceID.Buffer, - PagedPool)) - { - DPRINT("Insufficient resources\n"); - /* FIXME: */ - } - - } - - /* Reference the physical device object. The PnP manager - will dereference it again when it is no longer needed */ - ObReferenceObject(Device->Pdo); - - Relations->Objects[i] = Device->Pdo; - - i++; - - CurrentEntry = CurrentEntry->Flink; - } - - if (NT_SUCCESS(Status)) - { - Irp->IoStatus.Information = (ULONG_PTR)Relations; - } - else - { - Irp->IoStatus.Information = 0; - } - - return Status; -} - - -NTSTATUS -PnpRootQueryDeviceRelations( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PIO_STACK_LOCATION IrpSp) -{ - NTSTATUS Status; - - DPRINT("Called\n"); - - switch (IrpSp->Parameters.QueryDeviceRelations.Type) { - case BusRelations: - Status = PnpRootQueryBusRelations(DeviceObject, Irp, IrpSp); - break; - - default: - Status = STATUS_NOT_IMPLEMENTED; - } - - return Status; -} - - -NTSTATUS -STDCALL -PnpRootFdoPnpControl( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) -/* - * FUNCTION: Handle Plug and Play IRPs for the root bus device object - * ARGUMENTS: - * DeviceObject = Pointer to functional device object of the root bus driver - * Irp = Pointer to IRP that should be handled - * RETURNS: - * Status - */ -{ - PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; - PIO_STACK_LOCATION IrpSp; - NTSTATUS Status; - - DPRINT("Called\n"); - - DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - - Status = Irp->IoStatus.Status; - - IrpSp = IoGetCurrentIrpStackLocation(Irp); - - switch (IrpSp->MinorFunction) { - case IRP_MN_QUERY_DEVICE_RELATIONS: - Status = PnpRootQueryDeviceRelations(DeviceObject, Irp, IrpSp); - break; - - case IRP_MN_START_DEVICE: - DeviceExtension->State = dsStarted; - Status = STATUS_SUCCESS; - break; - - case IRP_MN_STOP_DEVICE: - /* Root device cannot be stopped */ - Status = STATUS_UNSUCCESSFUL; - break; - - default: - DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction); - Status = STATUS_NOT_IMPLEMENTED; - break; - } - - if (Status != STATUS_PENDING) { - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - } - - DPRINT("Leaving. Status 0x%X\n", Status); - - return Status; -} - - -NTSTATUS -STDCALL -PnpRootFdoPowerControl( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) -/* - * FUNCTION: Handle power management IRPs for the root bus device object - * ARGUMENTS: - * DeviceObject = Pointer to functional device object of the root bus driver - * Irp = Pointer to IRP that should be handled - * RETURNS: - * Status - */ -{ - PIO_STACK_LOCATION IrpSp; - NTSTATUS Status; - - DPRINT("Called\n"); - - IrpSp = IoGetCurrentIrpStackLocation(Irp); - - switch (IrpSp->MinorFunction) { - default: - DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction); - Status = STATUS_NOT_IMPLEMENTED; - break; - } - - if (Status != STATUS_PENDING) { - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - } - - DPRINT("Leaving. Status 0x%X\n", Status); - - return Status; -} - - -NTSTATUS -STDCALL -PnpRootPnpControl( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) -/* - * FUNCTION: Handle Plug and Play IRPs - * ARGUMENTS: - * DeviceObject = Pointer to PDO or FDO - * Irp = Pointer to IRP that should be handled - * RETURNS: - * Status - */ -{ - PPNPROOT_COMMON_DEVICE_EXTENSION DeviceExtension; - NTSTATUS Status; - - DeviceExtension = (PPNPROOT_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - - DPRINT("DeviceObject %x DeviceExtension %x IsFDO %d\n", - DeviceObject, - DeviceExtension, - DeviceExtension->IsFDO); - - if (DeviceExtension->IsFDO) { - Status = PnpRootFdoPnpControl(DeviceObject, Irp); - } else { - Status = PnpRootPdoPnpControl(DeviceObject, Irp); - } - - return Status; -} - - -NTSTATUS -STDCALL -PnpRootPowerControl( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) -/* - * FUNCTION: Handle power management IRPs - * ARGUMENTS: - * DeviceObject = Pointer to PDO or FDO - * Irp = Pointer to IRP that should be handled - * RETURNS: - * Status - */ -{ - PPNPROOT_COMMON_DEVICE_EXTENSION DeviceExtension; - NTSTATUS Status; - - DeviceExtension = (PPNPROOT_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - - if (DeviceExtension->IsFDO) { - Status = PnpRootFdoPowerControl(DeviceObject, Irp); - } else { - Status = PnpRootPdoPowerControl(DeviceObject, Irp); - } - - return Status; -} - - -NTSTATUS -STDCALL -PnpRootAddDevice( - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT PhysicalDeviceObject) -{ - PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; - NTSTATUS Status; - - DPRINT("Called\n"); - - Status = IoCreateDevice( - DriverObject, - sizeof(PNPROOT_FDO_DEVICE_EXTENSION), - NULL, - FILE_DEVICE_BUS_EXTENDER, - FILE_DEVICE_SECURE_OPEN, - TRUE, - &PnpRootDeviceObject); - if (!NT_SUCCESS(Status)) { - CPRINT("IoCreateDevice() failed with status 0x%X\n", Status); - KEBUGCHECK(PHASE1_INITIALIZATION_FAILED); - } - - DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)PnpRootDeviceObject->DeviceExtension; - - RtlZeroMemory(DeviceExtension, sizeof(PNPROOT_FDO_DEVICE_EXTENSION)); - - DeviceExtension->Common.IsFDO = TRUE; - - DeviceExtension->State = dsStopped; - - DeviceExtension->Ldo = IoAttachDeviceToDeviceStack( - PnpRootDeviceObject, - PhysicalDeviceObject); - - if (!PnpRootDeviceObject) { - CPRINT("PnpRootDeviceObject 0x%X\n", PnpRootDeviceObject); - KEBUGCHECK(PHASE1_INITIALIZATION_FAILED); - } - - if (!PhysicalDeviceObject) { - CPRINT("PhysicalDeviceObject 0x%X\n", PhysicalDeviceObject); - KEBUGCHECK(PHASE1_INITIALIZATION_FAILED); - } - - InitializeListHead(&DeviceExtension->DeviceListHead); - - DeviceExtension->DeviceListCount = 0; - - KeInitializeSpinLock(&DeviceExtension->DeviceListLock); - - PnpRootDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; - - //PnpRootDeviceObject->Flags |= DO_POWER_PAGABLE; - - DPRINT("Done AddDevice()\n"); - - return STATUS_SUCCESS; -} - - -NTSTATUS -STDCALL -PnpRootDriverEntry( - IN PDRIVER_OBJECT DriverObject, - IN PUNICODE_STRING RegistryPath) -{ - DPRINT("Called\n"); - - DriverObject->MajorFunction[IRP_MJ_PNP] = (PDRIVER_DISPATCH) PnpRootPnpControl; - DriverObject->MajorFunction[IRP_MJ_POWER] = (PDRIVER_DISPATCH) PnpRootPowerControl; - DriverObject->DriverExtension->AddDevice = PnpRootAddDevice; - - return STATUS_SUCCESS; -} - -/* EOF */ +/* $Id: pnproot.c,v 1.16 2003/09/25 18:29:44 navaraf Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/io/pnpmgr/pnproot.c + * PURPOSE: PnP manager root device + * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net) + * UPDATE HISTORY: + * 16/04/2001 CSH Created + */ + +/* INCLUDES ******************************************************************/ + +#include +#include +#include +#include + +#define NDEBUG +#include + +/* GLOBALS *******************************************************************/ + +#define ENUM_NAME_ROOT L"Root" + +/* DATA **********************************************************************/ + +typedef struct _PNPROOT_DEVICE { + // Entry on device list + LIST_ENTRY ListEntry; + // Physical Device Object of device + PDEVICE_OBJECT Pdo; + // Service name + UNICODE_STRING ServiceName; + // Device ID + UNICODE_STRING DeviceID; + // Instance ID + UNICODE_STRING InstanceID; + // Device description + UNICODE_STRING DeviceDescription; +} PNPROOT_DEVICE, *PPNPROOT_DEVICE; + +typedef enum { + dsStopped, + dsStarted, + dsPaused, + dsRemoved, + dsSurpriseRemoved +} PNPROOT_DEVICE_STATE; + + +typedef struct _PNPROOT_COMMON_DEVICE_EXTENSION +{ + // Pointer to device object, this device extension is associated with + PDEVICE_OBJECT DeviceObject; + // Wether this device extension is for an FDO or PDO + BOOLEAN IsFDO; + // Wether the device is removed + BOOLEAN Removed; + // Current device power state for the device + DEVICE_POWER_STATE DevicePowerState; +} __attribute((packed)) PNPROOT_COMMON_DEVICE_EXTENSION, *PPNPROOT_COMMON_DEVICE_EXTENSION; + +/* Physical Device Object device extension for a child device */ +typedef struct _PNPROOT_PDO_DEVICE_EXTENSION +{ + // Common device data + PNPROOT_COMMON_DEVICE_EXTENSION Common; + // Device ID + UNICODE_STRING DeviceID; + // Instance ID + UNICODE_STRING InstanceID; +} __attribute((packed)) PNPROOT_PDO_DEVICE_EXTENSION, *PPNPROOT_PDO_DEVICE_EXTENSION; + +/* Functional Device Object device extension for the PCI driver device object */ +typedef struct _PNPROOT_FDO_DEVICE_EXTENSION +{ + // Common device data + PNPROOT_COMMON_DEVICE_EXTENSION Common; + // Physical Device Object + PDEVICE_OBJECT Pdo; + // Lower device object + PDEVICE_OBJECT Ldo; + // Current state of the driver + PNPROOT_DEVICE_STATE State; + // Namespace device list + LIST_ENTRY DeviceListHead; + // Number of (not removed) devices in device list + ULONG DeviceListCount; + // Lock for namespace device list + // FIXME: Use fast mutex instead? + KSPIN_LOCK DeviceListLock; +} __attribute((packed)) PNPROOT_FDO_DEVICE_EXTENSION, *PPNPROOT_FDO_DEVICE_EXTENSION; + + +PDEVICE_OBJECT PnpRootDeviceObject; + + +/* FUNCTIONS *****************************************************************/ + +/* Physical Device Object routines */ + +NTSTATUS +PnpRootCreateDevice( + PDEVICE_OBJECT *PhysicalDeviceObject) +{ + PPNPROOT_PDO_DEVICE_EXTENSION PdoDeviceExtension; + PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; + PPNPROOT_DEVICE Device; + NTSTATUS Status; + + /* This function should be obsoleted soon */ + + DPRINT("Called\n"); + + DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)PnpRootDeviceObject->DeviceExtension; + + Device = (PPNPROOT_DEVICE)ExAllocatePool(PagedPool, sizeof(PNPROOT_DEVICE)); + if (!Device) + return STATUS_INSUFFICIENT_RESOURCES; + + RtlZeroMemory(Device, sizeof(PNPROOT_DEVICE)); + + Status = IoCreateDevice( + PnpRootDeviceObject->DriverObject, + sizeof(PNPROOT_PDO_DEVICE_EXTENSION), + NULL, + FILE_DEVICE_CONTROLLER, + 0, + FALSE, + &Device->Pdo); + if (!NT_SUCCESS(Status)) { + DPRINT("IoCreateDevice() failed with status 0x%X\n", Status); + ExFreePool(Device); + return Status; + } + + Device->Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE; + + Device->Pdo->Flags &= ~DO_DEVICE_INITIALIZING; + + //Device->Pdo->Flags |= DO_POWER_PAGABLE; + + PdoDeviceExtension = (PPNPROOT_PDO_DEVICE_EXTENSION)Device->Pdo->DeviceExtension; + + RtlZeroMemory(PdoDeviceExtension, sizeof(PNPROOT_PDO_DEVICE_EXTENSION)); + + PdoDeviceExtension->Common.IsFDO = FALSE; + + PdoDeviceExtension->Common.DeviceObject = Device->Pdo; + + PdoDeviceExtension->Common.DevicePowerState = PowerDeviceD0; + + if (!IopCreateUnicodeString( + &PdoDeviceExtension->DeviceID, + ENUM_NAME_ROOT \ + L"\\LEGACY_UNKNOWN", + PagedPool)) + { + /* FIXME: */ + DPRINT("IopCreateUnicodeString() failed\n"); + } + + if (!IopCreateUnicodeString( + &PdoDeviceExtension->InstanceID, + L"0000", + PagedPool)) + { + /* FIXME: */ + DPRINT("IopCreateUnicodeString() failed\n"); + } + + ExInterlockedInsertTailList( + &DeviceExtension->DeviceListHead, + &Device->ListEntry, + &DeviceExtension->DeviceListLock); + + DeviceExtension->DeviceListCount++; + + *PhysicalDeviceObject = Device->Pdo; + + return STATUS_SUCCESS; +} + + +NTSTATUS +PdoQueryId( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + PIO_STACK_LOCATION IrpSp) +{ + PPNPROOT_PDO_DEVICE_EXTENSION DeviceExtension; + UNICODE_STRING String; + NTSTATUS Status; + + DPRINT("Called\n"); + + DeviceExtension = (PPNPROOT_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + +// Irp->IoStatus.Information = 0; + + Status = STATUS_SUCCESS; + + RtlInitUnicodeString(&String, NULL); + + switch (IrpSp->Parameters.QueryId.IdType) { + case BusQueryDeviceID: + Status = IopCreateUnicodeString( + &String, + DeviceExtension->DeviceID.Buffer, + PagedPool); + + DPRINT("DeviceID: %S\n", String.Buffer); + + Irp->IoStatus.Information = (ULONG_PTR)String.Buffer; + break; + + case BusQueryHardwareIDs: + case BusQueryCompatibleIDs: + Status = STATUS_NOT_IMPLEMENTED; + break; + + case BusQueryInstanceID: + Status = IopCreateUnicodeString( + &String, + DeviceExtension->InstanceID.Buffer, + PagedPool); + + DPRINT("InstanceID: %S\n", String.Buffer); + + Irp->IoStatus.Information = (ULONG_PTR)String.Buffer; + break; + + case BusQueryDeviceSerialNumber: + default: + Status = STATUS_NOT_IMPLEMENTED; + } + + return Status; +} + + +NTSTATUS +PnpRootPdoPnpControl( + PDEVICE_OBJECT DeviceObject, + PIRP Irp) +/* + * FUNCTION: Handle Plug and Play IRPs for the child device + * ARGUMENTS: + * DeviceObject = Pointer to physical device object of the child device + * Irp = Pointer to IRP that should be handled + * RETURNS: + * Status + */ +{ + PIO_STACK_LOCATION IrpSp; + NTSTATUS Status; + + DPRINT("Called\n"); + + Status = Irp->IoStatus.Status; + + IrpSp = IoGetCurrentIrpStackLocation(Irp); + + switch (IrpSp->MinorFunction) { +#if 0 + case IRP_MN_CANCEL_REMOVE_DEVICE: + break; + + case IRP_MN_CANCEL_STOP_DEVICE: + break; + + case IRP_MN_DEVICE_USAGE_NOTIFICATION: + break; + + case IRP_MN_EJECT: + break; + + case IRP_MN_QUERY_BUS_INFORMATION: + break; + + case IRP_MN_QUERY_CAPABILITIES: + break; + + case IRP_MN_QUERY_DEVICE_RELATIONS: + /* FIXME: Possibly handle for RemovalRelations */ + break; + + case IRP_MN_QUERY_DEVICE_TEXT: + break; +#endif + case IRP_MN_QUERY_ID: + Status = PdoQueryId(DeviceObject, Irp, IrpSp); + break; +#if 0 + case IRP_MN_QUERY_PNP_DEVICE_STATE: + break; + + case IRP_MN_QUERY_REMOVE_DEVICE: + break; + + case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: + break; + + case IRP_MN_QUERY_RESOURCES: + break; + + case IRP_MN_QUERY_STOP_DEVICE: + break; + + case IRP_MN_REMOVE_DEVICE: + break; + + case IRP_MN_SET_LOCK: + break; + + case IRP_MN_START_DEVICE: + break; + + case IRP_MN_STOP_DEVICE: + break; + + case IRP_MN_SURPRISE_REMOVAL: + break; +#endif + default: + DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction); + break; + } + + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + DPRINT("Leaving. Status 0x%X\n", Status); + + return Status; +} + +NTSTATUS +PnpRootPdoPowerControl( + PDEVICE_OBJECT DeviceObject, + PIRP Irp) +/* + * FUNCTION: Handle power management IRPs for the child device + * ARGUMENTS: + * DeviceObject = Pointer to physical device object of the child device + * Irp = Pointer to IRP that should be handled + * RETURNS: + * Status + */ +{ + PIO_STACK_LOCATION IrpSp; + NTSTATUS Status; + + DPRINT("Called\n"); + + Status = Irp->IoStatus.Status; + + IrpSp = IoGetCurrentIrpStackLocation(Irp); + + switch (IrpSp->MinorFunction) { + default: + DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction); + break; + } + + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + DPRINT("Leaving. Status 0x%X\n", Status); + + return Status; +} + + +/* Functional Device Object routines */ + +NTSTATUS +PnpRootFdoReadDeviceInfo( + PPNPROOT_DEVICE Device) +{ + RTL_QUERY_REGISTRY_TABLE QueryTable[2]; + PUNICODE_STRING DeviceDesc; + WCHAR KeyName[MAX_PATH]; + HANDLE KeyHandle; + NTSTATUS Status; + + DPRINT("Called\n"); + + /* Retrieve configuration from Enum key */ + + DeviceDesc = &Device->DeviceDescription; + + wcscpy(KeyName, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); + wcscat(KeyName, ENUM_NAME_ROOT); + wcscat(KeyName, L"\\"); + wcscat(KeyName, Device->ServiceName.Buffer); + wcscat(KeyName, L"\\"); + wcscat(KeyName, Device->InstanceID.Buffer); + + DPRINT("KeyName %S\n", KeyName); + + Status = RtlpGetRegistryHandle( + RTL_REGISTRY_ABSOLUTE, + KeyName, + FALSE, + &KeyHandle); + if (!NT_SUCCESS(Status)) + { + DPRINT("RtlpGetRegistryHandle() failed (Status %x)\n", Status); + return Status; + } + + RtlZeroMemory(QueryTable, sizeof(QueryTable)); + + RtlInitUnicodeString(DeviceDesc, NULL); + + QueryTable[0].Name = L"DeviceDesc"; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[0].EntryContext = DeviceDesc; + + Status = RtlQueryRegistryValues( + RTL_REGISTRY_HANDLE, + (PWSTR)KeyHandle, + QueryTable, + NULL, + NULL); + + NtClose(KeyHandle); + + DPRINT("RtlQueryRegistryValues() returned status %x\n", Status); + + if (!NT_SUCCESS(Status)) + { + /* FIXME: */ + } + + DPRINT("Got device description: %S\n", DeviceDesc->Buffer); + + return STATUS_SUCCESS; +} + + +NTSTATUS +PnpRootFdoEnumerateDevices( + PDEVICE_OBJECT DeviceObject) +{ + PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; + OBJECT_ATTRIBUTES ObjectAttributes; + PKEY_BASIC_INFORMATION KeyInfo; + UNICODE_STRING KeyName; + PPNPROOT_DEVICE Device; + WCHAR Buffer[MAX_PATH]; + HANDLE KeyHandle; + ULONG BufferSize; + ULONG ResultSize; + NTSTATUS Status; + ULONG Index; + + DPRINT("Called\n"); + + DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + BufferSize = sizeof(KEY_BASIC_INFORMATION) + (MAX_PATH+1) * sizeof(WCHAR); + KeyInfo = ExAllocatePool(PagedPool, BufferSize); + if (!KeyInfo) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlInitUnicodeStringFromLiteral( + &KeyName, + L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\" \ + ENUM_NAME_ROOT); + + InitializeObjectAttributes( + &ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + Status = NtOpenKey(&KeyHandle, KEY_ALL_ACCESS, &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT("NtOpenKey() failed (Status %x)\n", Status); + ExFreePool(KeyInfo); + return Status; + } + + /* FIXME: Disabled due to still using the old method of auto loading drivers e.g. + there are more entries in the list than found in the registry as some + drivers are passed on the command line */ +// DeviceExtension->DeviceListCount = 0; + + Index = 0; + do { + Status = ZwEnumerateKey( + KeyHandle, + Index, + KeyBasicInformation, + KeyInfo, + BufferSize, + &ResultSize); + if (!NT_SUCCESS(Status)) + { + DPRINT("ZwEnumerateKey() (Status %x)\n", Status); + break; + } + + /* Terminate the string */ + KeyInfo->Name[KeyInfo->NameLength / sizeof(WCHAR)] = 0; + + Device = (PPNPROOT_DEVICE)ExAllocatePool(PagedPool, sizeof(PNPROOT_DEVICE)); + if (!Device) + { + /* FIXME: */ + break; + } + + RtlZeroMemory(Device, sizeof(PNPROOT_DEVICE)); + + if (!IopCreateUnicodeString(&Device->ServiceName, KeyInfo->Name, PagedPool)) + { + /* FIXME: */ + DPRINT("IopCreateUnicodeString() failed\n"); + } + + wcscpy(Buffer, ENUM_NAME_ROOT); + wcscat(Buffer, L"\\"); + wcscat(Buffer, KeyInfo->Name); + + if (!IopCreateUnicodeString(&Device->DeviceID, Buffer, PagedPool)) + { + /* FIXME: */ + DPRINT("IopCreateUnicodeString() failed\n"); + } + + DPRINT("Got entry: %S\n", Device->DeviceID.Buffer); + + if (!IopCreateUnicodeString( + &Device->InstanceID, + L"0000", + PagedPool)) + { + /* FIXME: */ + DPRINT("IopCreateUnicodeString() failed\n"); + } + + Status = PnpRootFdoReadDeviceInfo(Device); + if (!NT_SUCCESS(Status)) + { + DPRINT("PnpRootFdoReadDeviceInfo() failed with status %x\n", Status); + /* FIXME: */ + } + + ExInterlockedInsertTailList( + &DeviceExtension->DeviceListHead, + &Device->ListEntry, + &DeviceExtension->DeviceListLock); + + DeviceExtension->DeviceListCount++; + + Index++; + } while (TRUE); + + DPRINT("Entries found: %d\n", Index); + + NtClose(KeyHandle); + + ExFreePool(KeyInfo); + + return STATUS_SUCCESS; +} + + +NTSTATUS +PnpRootQueryBusRelations( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PIO_STACK_LOCATION IrpSp) +{ + PPNPROOT_PDO_DEVICE_EXTENSION PdoDeviceExtension; + PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; + PDEVICE_RELATIONS Relations; + PLIST_ENTRY CurrentEntry; + PPNPROOT_DEVICE Device; + NTSTATUS Status; + ULONG Size; + ULONG i; + + DPRINT("Called\n"); + + Status = PnpRootFdoEnumerateDevices(DeviceObject); + if (!NT_SUCCESS(Status)) + return Status; + + DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + if (Irp->IoStatus.Information) + { + /* FIXME: Another bus driver has already created a DEVICE_RELATIONS + structure so we must merge this structure with our own */ + } + + Size = sizeof(DEVICE_RELATIONS) + sizeof(Relations->Objects) * + (DeviceExtension->DeviceListCount - 1); + + Relations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, Size); + if (!Relations) + return STATUS_INSUFFICIENT_RESOURCES; + + Relations->Count = DeviceExtension->DeviceListCount; + + i = 0; + CurrentEntry = DeviceExtension->DeviceListHead.Flink; + while (CurrentEntry != &DeviceExtension->DeviceListHead) + { + Device = CONTAINING_RECORD(CurrentEntry, PNPROOT_DEVICE, ListEntry); + + if (!Device->Pdo) + { + /* Create a physical device object for the + device as it does not already have one */ + Status = IoCreateDevice( + DeviceObject->DriverObject, + sizeof(PNPROOT_PDO_DEVICE_EXTENSION), + NULL, + FILE_DEVICE_CONTROLLER, + 0, + FALSE, + &Device->Pdo); + if (!NT_SUCCESS(Status)) + { + DPRINT("IoCreateDevice() failed with status 0x%X\n", Status); + ExFreePool(Relations); + return Status; + } + + DPRINT("Created PDO %x\n", Device->Pdo); + + Device->Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE; + + Device->Pdo->Flags &= ~DO_DEVICE_INITIALIZING; + + //Device->Pdo->Flags |= DO_POWER_PAGABLE; + + PdoDeviceExtension = (PPNPROOT_PDO_DEVICE_EXTENSION)Device->Pdo->DeviceExtension; + + RtlZeroMemory(PdoDeviceExtension, sizeof(PNPROOT_PDO_DEVICE_EXTENSION)); + + PdoDeviceExtension->Common.IsFDO = FALSE; + + PdoDeviceExtension->Common.DeviceObject = Device->Pdo; + + PdoDeviceExtension->Common.DevicePowerState = PowerDeviceD0; + + if (!IopCreateUnicodeString( + &PdoDeviceExtension->DeviceID, + Device->DeviceID.Buffer, + PagedPool)) + { + DPRINT("Insufficient resources\n"); + /* FIXME: */ + } + + DPRINT("DeviceID: %S PDO %x\n", + PdoDeviceExtension->DeviceID.Buffer, + Device->Pdo); + + if (!IopCreateUnicodeString( + &PdoDeviceExtension->InstanceID, + Device->InstanceID.Buffer, + PagedPool)) + { + DPRINT("Insufficient resources\n"); + /* FIXME: */ + } + + } + + /* Reference the physical device object. The PnP manager + will dereference it again when it is no longer needed */ + ObReferenceObject(Device->Pdo); + + Relations->Objects[i] = Device->Pdo; + + i++; + + CurrentEntry = CurrentEntry->Flink; + } + + if (NT_SUCCESS(Status)) + { + Irp->IoStatus.Information = (ULONG_PTR)Relations; + } + else + { + Irp->IoStatus.Information = 0; + } + + return Status; +} + + +NTSTATUS +PnpRootQueryDeviceRelations( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PIO_STACK_LOCATION IrpSp) +{ + NTSTATUS Status; + + DPRINT("Called\n"); + + switch (IrpSp->Parameters.QueryDeviceRelations.Type) { + case BusRelations: + Status = PnpRootQueryBusRelations(DeviceObject, Irp, IrpSp); + break; + + default: + Status = STATUS_NOT_IMPLEMENTED; + } + + return Status; +} + + +NTSTATUS +STDCALL +PnpRootFdoPnpControl( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +/* + * FUNCTION: Handle Plug and Play IRPs for the root bus device object + * ARGUMENTS: + * DeviceObject = Pointer to functional device object of the root bus driver + * Irp = Pointer to IRP that should be handled + * RETURNS: + * Status + */ +{ + PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; + PIO_STACK_LOCATION IrpSp; + NTSTATUS Status; + + DPRINT("Called\n"); + + DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + Status = Irp->IoStatus.Status; + + IrpSp = IoGetCurrentIrpStackLocation(Irp); + + switch (IrpSp->MinorFunction) { + case IRP_MN_QUERY_DEVICE_RELATIONS: + Status = PnpRootQueryDeviceRelations(DeviceObject, Irp, IrpSp); + break; + + case IRP_MN_START_DEVICE: + DeviceExtension->State = dsStarted; + Status = STATUS_SUCCESS; + break; + + case IRP_MN_STOP_DEVICE: + /* Root device cannot be stopped */ + Status = STATUS_UNSUCCESSFUL; + break; + + default: + DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction); + Status = STATUS_NOT_IMPLEMENTED; + break; + } + + if (Status != STATUS_PENDING) { + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + } + + DPRINT("Leaving. Status 0x%X\n", Status); + + return Status; +} + + +NTSTATUS +STDCALL +PnpRootFdoPowerControl( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +/* + * FUNCTION: Handle power management IRPs for the root bus device object + * ARGUMENTS: + * DeviceObject = Pointer to functional device object of the root bus driver + * Irp = Pointer to IRP that should be handled + * RETURNS: + * Status + */ +{ + PIO_STACK_LOCATION IrpSp; + NTSTATUS Status; + + DPRINT("Called\n"); + + IrpSp = IoGetCurrentIrpStackLocation(Irp); + + switch (IrpSp->MinorFunction) { + default: + DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction); + Status = STATUS_NOT_IMPLEMENTED; + break; + } + + if (Status != STATUS_PENDING) { + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + } + + DPRINT("Leaving. Status 0x%X\n", Status); + + return Status; +} + + +NTSTATUS +STDCALL +PnpRootPnpControl( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +/* + * FUNCTION: Handle Plug and Play IRPs + * ARGUMENTS: + * DeviceObject = Pointer to PDO or FDO + * Irp = Pointer to IRP that should be handled + * RETURNS: + * Status + */ +{ + PPNPROOT_COMMON_DEVICE_EXTENSION DeviceExtension; + NTSTATUS Status; + + DeviceExtension = (PPNPROOT_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + DPRINT("DeviceObject %x DeviceExtension %x IsFDO %d\n", + DeviceObject, + DeviceExtension, + DeviceExtension->IsFDO); + + if (DeviceExtension->IsFDO) { + Status = PnpRootFdoPnpControl(DeviceObject, Irp); + } else { + Status = PnpRootPdoPnpControl(DeviceObject, Irp); + } + + return Status; +} + + +NTSTATUS +STDCALL +PnpRootPowerControl( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +/* + * FUNCTION: Handle power management IRPs + * ARGUMENTS: + * DeviceObject = Pointer to PDO or FDO + * Irp = Pointer to IRP that should be handled + * RETURNS: + * Status + */ +{ + PPNPROOT_COMMON_DEVICE_EXTENSION DeviceExtension; + NTSTATUS Status; + + DeviceExtension = (PPNPROOT_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + if (DeviceExtension->IsFDO) { + Status = PnpRootFdoPowerControl(DeviceObject, Irp); + } else { + Status = PnpRootPdoPowerControl(DeviceObject, Irp); + } + + return Status; +} + + +NTSTATUS +STDCALL +PnpRootAddDevice( + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT PhysicalDeviceObject) +{ + PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; + NTSTATUS Status; + + DPRINT("Called\n"); + + Status = IoCreateDevice( + DriverObject, + sizeof(PNPROOT_FDO_DEVICE_EXTENSION), + NULL, + FILE_DEVICE_BUS_EXTENDER, + FILE_DEVICE_SECURE_OPEN, + TRUE, + &PnpRootDeviceObject); + if (!NT_SUCCESS(Status)) { + CPRINT("IoCreateDevice() failed with status 0x%X\n", Status); + KEBUGCHECK(PHASE1_INITIALIZATION_FAILED); + } + + DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)PnpRootDeviceObject->DeviceExtension; + + RtlZeroMemory(DeviceExtension, sizeof(PNPROOT_FDO_DEVICE_EXTENSION)); + + DeviceExtension->Common.IsFDO = TRUE; + + DeviceExtension->State = dsStopped; + + DeviceExtension->Ldo = IoAttachDeviceToDeviceStack( + PnpRootDeviceObject, + PhysicalDeviceObject); + + if (!PnpRootDeviceObject) { + CPRINT("PnpRootDeviceObject 0x%X\n", PnpRootDeviceObject); + KEBUGCHECK(PHASE1_INITIALIZATION_FAILED); + } + + if (!PhysicalDeviceObject) { + CPRINT("PhysicalDeviceObject 0x%X\n", PhysicalDeviceObject); + KEBUGCHECK(PHASE1_INITIALIZATION_FAILED); + } + + InitializeListHead(&DeviceExtension->DeviceListHead); + + DeviceExtension->DeviceListCount = 0; + + KeInitializeSpinLock(&DeviceExtension->DeviceListLock); + + PnpRootDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; + + //PnpRootDeviceObject->Flags |= DO_POWER_PAGABLE; + + DPRINT("Done AddDevice()\n"); + + return STATUS_SUCCESS; +} + + +NTSTATUS +STDCALL +PnpRootDriverEntry( + IN PDRIVER_OBJECT DriverObject, + IN PUNICODE_STRING RegistryPath) +{ + DPRINT("Called\n"); + + DriverObject->MajorFunction[IRP_MJ_PNP] = (PDRIVER_DISPATCH) PnpRootPnpControl; + DriverObject->MajorFunction[IRP_MJ_POWER] = (PDRIVER_DISPATCH) PnpRootPowerControl; + DriverObject->DriverExtension->AddDevice = PnpRootAddDevice; + + return STATUS_SUCCESS; +} + +/* EOF */ diff --git a/reactos/ntoskrnl/io/wdm.c b/reactos/ntoskrnl/io/wdm.c index 059b97f5e53..51bbacd9f99 100644 --- a/reactos/ntoskrnl/io/wdm.c +++ b/reactos/ntoskrnl/io/wdm.c @@ -1,23 +1,23 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/wdm.c - * PURPOSE: Various Windows Driver Model routines - * PROGRAMMER: Filip Navara (xnavara@volny.cz) - */ - -#include - -/* - * @implemented - */ -BOOLEAN STDCALL -IoIsWdmVersionAvailable( - IN UCHAR MajorVersion, - IN UCHAR MinorVersion - ) -{ - if (MajorVersion <= 1 && MinorVersion <= 10) - return TRUE; - return FALSE; -} +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/io/wdm.c + * PURPOSE: Various Windows Driver Model routines + * PROGRAMMER: Filip Navara (xnavara@volny.cz) + */ + +#include + +/* + * @implemented + */ +BOOLEAN STDCALL +IoIsWdmVersionAvailable( + IN UCHAR MajorVersion, + IN UCHAR MinorVersion + ) +{ + if (MajorVersion <= 1 && MinorVersion <= 10) + return TRUE; + return FALSE; +} diff --git a/reactos/ntoskrnl/ntoskrnl.def b/reactos/ntoskrnl/ntoskrnl.def index 54887fb1474..0396be01c04 100644 --- a/reactos/ntoskrnl/ntoskrnl.def +++ b/reactos/ntoskrnl/ntoskrnl.def @@ -1,1072 +1,1072 @@ -; $Id: ntoskrnl.def,v 1.165 2003/09/25 15:54:42 navaraf Exp $ -; -; reactos/ntoskrnl/ntoskrnl.def -; -; ReactOS Operating System -; -EXPORTS -CcRosInitializeFileCache@8 -CcRosReleaseFileCache@4 -CcCopyRead@24 -CcCopyWrite@20 -CcFlushCache@16 -CcGetFileObjectFromSectionPtrs@4 -CcMapData@24 -CcMdlReadComplete@8 -CcSetDirtyPinnedData@8 -CcSetFileSizes@8 -CcUnpinData@4 -CcZeroData@16 -DbgBreakPoint@0 -DbgBreakPointWithStatus@4 -;DbgLoadImageSymbols@12 -DbgPrint -DbgPrompt@12 -DpcQueueSize DATA -@ExAcquireFastMutexUnsafe@4 -ExAcquireResourceExclusive@8 -ExAcquireResourceExclusiveLite@8 -ExAcquireResourceSharedLite@8 -ExAcquireSharedStarveExclusive@8 -ExAcquireSharedWaitForExclusive@8 -@ExAllocateFromPagedLookasideList@4 -ExAllocatePool@8 -ExAllocatePoolWithQuota@8 -ExAllocatePoolWithQuotaTag@12 -ExAllocatePoolWithTag@12 -ExConvertExclusiveToSharedLite@4 -ExCreateCallback@16 -ExDeleteNPagedLookasideList@4 -ExDeletePagedLookasideList@4 -ExDeleteResource@4 -ExDeleteResourceLite@4 -ExDesktopObjectType DATA -ExDisableResourceBoostLite@4 -ExEventObjectType DATA -ExExtendZone@12 -ExFreePool@4 -ExFreePoolWithTag@8 -ExFreeToPagedLookasideList@8 -ExGetExclusiveWaiterCount@4 -ExGetPreviousMode@0 -ExGetSharedWaiterCount@4 -ExInitializeNPagedLookasideList@28 -ExInitializePagedLookasideList@28 -ExInitializeResource@4 -ExInitializeResourceLite@4 -ExInitializeZone@16 -ExInterlockedAddLargeInteger@16 -@ExInterlockedAddLargeStatistic@8 -@ExInterlockedAddUlong@12 -@ExInterlockedCompareExchange64@16 -ExInterlockedDecrementLong@8 -ExInterlockedExchangeUlong@12 -ExInterlockedExtendZone@16 -ExInterlockedIncrementLong@8 -@ExInterlockedInsertHeadList@12 -@ExInterlockedInsertTailList@12 -@ExInterlockedPopEntryList@8 -@ExInterlockedPopEntrySList@8 -@ExInterlockedPushEntryList@12 -@ExInterlockedPushEntrySList@12 -@ExInterlockedRemoveHeadList@8 -ExIsProcessorFeaturePresent@4 -ExIsResourceAcquiredExclusiveLite@4 -ExIsResourceAcquiredSharedLite@4 -ExLocalTimeToSystemTime@8 -ExNotifyCallback@12 -ExPostSystemEvent@12 -;ExQueryPoolBlockSize -ExQueueWorkItem@8 -ExRaiseAccessViolation@0 -ExRaiseDatatypeMisalignment@0 -;ExRaiseException -;ExRaiseHardError -ExRaiseStatus@4 -ExRegisterCallback@12 -ExReinitializeResourceLite@4 -@ExReleaseFastMutexUnsafe@4 -ExReleaseResourceForThread@8 -ExReleaseResourceForThreadLite@8 -@ExReleaseResourceLite@4 -ExSetResourceOwnerPointer@8 -;ExSystemExceptionFilter -ExSystemTimeToLocalTime@8 -ExTryToAcquireResourceExclusiveLite@4 -ExUnregisterCallback@4 -ExWindowStationObjectType DATA -ExInitializeBinaryTree@12 -ExDeleteBinaryTree@4 -ExInsertBinaryTree@12 -ExSearchBinaryTree@12 -ExRemoveBinaryTree@12 -ExTraverseBinaryTree@16 -ExInitializeSplayTree@16 -ExDeleteSplayTree@4 -ExInsertSplayTree@12 -ExSearchSplayTree@12 -ExRemoveSplayTree@12 -ExWeightOfSplayTree@8 -ExTraverseSplayTree@16 -ExInitializeHashTable@16 -ExDeleteHashTable@4 -ExInsertHashTable@16 -ExSearchHashTable@16 -ExRemoveHashTable@16 -@ExfInterlockedAddUlong@12 -@ExfInterlockedInsertHeadList@12 -@ExfInterlockedInsertTailList@12 -@ExfInterlockedPopEntryList@8 -@ExfInterlockedPushEntryList@12 -@ExfInterlockedRemoveHeadList@8 -@Exfi386InterlockedDecrementLong@4 -@Exfi386InterlockedExchangeUlong@8 -@Exfi386InterlockedIncrementLong@4 -Exi386InterlockedDecrementLong@4 -Exi386InterlockedExchangeUlong@8 -Exi386InterlockedIncrementLong@4 -FsRtlAddLargeMcbEntry@28 -FsRtlAddMcbEntry@16 -FsRtlAddToTunnelCache@32 -FsRtlAllocateFileLock@8 -FsRtlAllocatePool@8 -FsRtlAllocatePoolWithQuota@8 -FsRtlAllocatePoolWithQuotaTag@12 -FsRtlAllocatePoolWithTag@12 -FsRtlAllocateResource@0 -FsRtlAreNamesEqual@16 -FsRtlBalanceReads@4 -FsRtlCheckLockForReadAccess@8 -FsRtlCheckLockForWriteAccess@8 -FsRtlCheckOplock@20 -FsRtlCopyRead@32 -FsRtlCopyWrite@32 -FsRtlCurrentBatchOplock@4 -FsRtlDeleteKeyFromTunnelCache@12 -FsRtlDeleteTunnelCache@4 -FsRtlDeregisterUncProvider@4 -FsRtlDissectDbcs@16 -FsRtlDissectName@16 -FsRtlDoesDbcsContainWildCards@4 -FsRtlDoesNameContainWildCards@4 -FsRtlFastCheckLockForRead@24 -FsRtlFastCheckLockForWrite@24 -FsRtlFastUnlockAll@16 -FsRtlFastUnlockAllByKey@20 -FsRtlFastUnlockSingle@32 -FsRtlFindInTunnelCache@32 -FsRtlGetFileSize@8 -FsRtlGetNextFileLock@8 -FsRtlGetNextLargeMcbEntry@20 -FsRtlGetNextMcbEntry@20 -FsRtlInitializeFileLock@12 -FsRtlInitializeLargeMcb@8 -FsRtlInitializeMcb@8 -FsRtlInitializeOplock@4 -FsRtlInitializeTunnelCache@4 -FsRtlIsDbcsInExpression@8 -FsRtlIsFatDbcsLegal@20 -FsRtlIsHpfsDbcsLegal@20 -FsRtlIsNameInExpression@16 -FsRtlIsNtstatusExpected@4 -FsRtlIsTotalDeviceFailure@4 -FsRtlLegalAnsiCharacterArray DATA -FsRtlLookupLargeMcbEntry@32 -FsRtlLookupLastLargeMcbEntry@12 -FsRtlLookupLastMcbEntry@12 -FsRtlLookupMcbEntry@20 -FsRtlMdlRead@24 -FsRtlMdlReadComplete@8 -FsRtlMdlReadCompleteDev@12 -FsRtlMdlReadDev@28 -FsRtlMdlWriteComplete@12 -FsRtlMdlWriteCompleteDev@16 -FsRtlNormalizeNtstatus@8 -FsRtlNotifyChangeDirectory@28 -FsRtlNotifyCleanup@12 -FsRtlNotifyFullChangeDirectory@40 -FsRtlNotifyFullReportChange@36 -FsRtlNotifyInitializeSync@4 -FsRtlNotifyReportChange@20 -FsRtlNotifyUninitializeSync@4 -FsRtlNotifyVolumeEvent@8 -FsRtlNumberOfRunsInLargeMcb@4 -FsRtlNumberOfRunsInMcb@4 -FsRtlOplockFsctrl@12 -FsRtlOplockIsFastIoPossible@4 -FsRtlPostPagingFileStackOverflow@12 -FsRtlPostStackOverflow@12 -FsRtlPrepareMdlWrite@24 -FsRtlPrepareMdlWriteDev@28 -FsRtlPrivateLock@48 -FsRtlProcessFileLock@12 -FsRtlRegisterUncProvider@12 -FsRtlRemoveLargeMcbEntry@20 -FsRtlRemoveMcbEntry@12 -FsRtlSplitLargeMcb@20 -FsRtlSyncVolumes@12 -FsRtlTruncateLargeMcb@12 -FsRtlTruncateMcb@8 -FsRtlUninitializeFileLock@4 -FsRtlUninitializeLargeMcb@4 -FsRtlUninitializeMcb@4 -FsRtlUninitializeOplock@4 -HalDispatchTable DATA -HalPrivateDispatchTable DATA -InbvAcquireDisplayOwnership@0 -InbvCheckDisplayOwnership@0 -InbvDisplayString@4 -InbvEnableBootDriver@4 -InbvEnableDisplayString@4 -InbvInstallDisplayStringFilter@4 -InbvIsBootDriverInstalled@0 -InbvNotifyDisplayOwnershipLost@4 -InbvResetDisplay@0 -InbvSetScrollRegion@16 -InbvSetTextColor@4 -InbvSolidColorFill@20 -@InterlockedCompareExchange@12 -@InterlockedDecrement@4 -@InterlockedExchange@8 -@InterlockedExchangeAdd@8 -@InterlockedIncrement@4 -@InterlockedPopEntrySList@4 -@InterlockedPushEntrySList@8 -IoAcquireCancelSpinLock@4 -IoAcquireRemoveLockEx@20 -IoAcquireVpbSpinLock@4 -IoAdapterObjectType DATA -IoAllocateAdapterChannel@20 -IoAllocateController@16 -IoAllocateErrorLogEntry@8 -IoAllocateIrp@8 -IoAllocateMdl@20 -IoAssignResources@24 -IoAttachDevice@12 -IoAttachDeviceByPointer@8 -IoAttachDeviceToDeviceStack@8 -IoBuildAsynchronousFsdRequest@24 -IoBuildDeviceIoControlRequest@36 -IoBuildPartialMdl@16 -IoBuildSynchronousFsdRequest@28 -IoCallDriver@8 -IoCancelIrp@4 -IoCheckDesiredAccess@8 -IoCheckEaBufferValidity@12 -IoCheckFunctionAccess@24 -IoCheckShareAccess@20 -IoCompleteRequest@8 -IoConnectInterrupt@44 -IoCreateController@4 -IoCreateDevice@28 -IoCreateFile@56 -IoCreateNotificationEvent@8 -IoCreateStreamFileObject@8 -IoCreateSymbolicLink@8 -IoCreateSynchronizationEvent@8 -IoCreateUnprotectedSymbolicLink@8 -IoDeleteController@4 -IoDeleteDevice@4 -IoDeleteSymbolicLink@4 -IoDetachDevice@4 -IoDeviceHandlerObjectSize DATA -IoDeviceHandlerObjectType DATA -IoDisconnectInterrupt@4 -IoDeviceObjectType DATA -IoDriverObjectType DATA -IoEnqueueIrp@4 -IoFastQueryNetworkAttributes@20 -IoFileObjectType DATA -IoFreeController@4 -IoFreeIrp@4 -IoFreeMdl@4 -IoGetAttachedDevice@4 -IoGetAttachedDeviceReference@4 -IoGetBaseFileSystemDeviceObject@4 -IoGetConfigurationInformation@0 -IoGetCurrentProcess@0 -IoGetDeviceObjectPointer@16 -IoGetDeviceToVerify@4 -IoGetFileObjectGenericMapping@0 -IoGetInitialStack@0 -IoGetRelatedDeviceObject@4 -IoGetRequestorProcess@4 -IoGetStackLimits@8 -IoGetTopLevelIrp@0 -IoInitializeIrp@12 -IoInvalidateDeviceState@4 -IoInitializeRemoveLockEx@20 -IoInitializeTimer@12 -IoIsOperationSynchronous@4 -IoMakeAssociatedIrp@8 -IoOpenDeviceInstanceKey@20 -IoPageRead@20 -IoQueryDeviceDescription@32 -IoQueryDeviceEnumInfo@8 -IoQueryFileInformation@20 -IoQueryVolumeInformation@20 -IoQueueThreadIrp@4 -IoRaiseHardError@12 -IoRaiseInformationalHardError@12 -IoReadOperationCount DATA -IoReadPartitionTable@16 -IoReadTransferCount DATA - -IoFreeWorkItem@4 -IoAllocateWorkItem@4 -IoQueueWorkItem@16 -IoRegisterDeviceInterface@16 -IoSetDeviceInterfaceState@8 -IoGetDeviceProperty@20 -IoOpenDeviceRegistryKey@16 -IoInvalidateDeviceRelations@8 - -IoRegisterDriverReinitialization@12 -IoRegisterFileSystem@4 -IoRegisterFsRegistrationChange@8 -IoRegisterShutdownNotification@4 -IoReleaseCancelSpinLock@4 -IoReleaseRemoveLockAndWaitEx@12 -IoReleaseRemoveLockEx@12 -IoReleaseVpbSpinLock@4 -IoRemoveShareAccess@8 -IoReportHalResourceUsage@16 -IoReportResourceUsage@36 -IoSetDeviceToVerify@8 -IoSetHardErrorOrVerifyDevice@8 -IoSetInformation@16 -IoSetPartitionInformation@16 -IoSetShareAccess@16 -IoSetThreadHardErrorMode@4 -IoSetTopLevelIrp@4 -IoStartNextPacket@8 -IoStartNextPacketByKey@12 -IoStartPacket@16 -IoStartTimer@4 -IoStatisticsLock DATA -IoStopTimer@4 -IoSynchronousPageWrite@20 -IoThreadToProcess@4 -IoUnregisterFileSystem@4 -IoUnregisterFsRegistrationChange@8 -IoUnregisterShutdownNotification@4 -IoUpdateShareAccess@8 -IoVerifyVolume@8 -IoWriteErrorLogEntry@4 -IoWriteOperationCount DATA -IoWritePartitionTable@20 -IoWriteTransferCount DATA -@IofCallDriver@8 -@IofCompleteRequest@8 -KdDebuggerEnabled DATA -KdDebuggerNotPresent DATA -KdPollBreakIn@0 -KdSystemDebugControl@4 -Ke386CallBios@8 -Ke386IoSetAccessProcess@8 -Ke386QueryIoAccessMap@8 -Ke386SetIoAccessMap@8 -KeAcquireSpinLockAtDpcLevel@4 -KeAddSystemServiceTable@20 -KeAttachProcess@4 -;KeBoostCurrentThread -KeBugCheck@4 -KeBugCheckEx@20 -KeCancelTimer@4 -KeClearEvent@4 -KeConnectInterrupt@4 -KeDcacheFlushCount DATA -KeDelayExecutionThread@12 -KeDeregisterBugCheckCallback@4 -KeDetachProcess@0 -KeDisconnectInterrupt@4 -KeEnterCriticalRegion@0 -KeEnterKernelDebugger@0 -;KeFindConfigurationEntry -;KeFindConfigurationNextEntry -;KeFlushEntireTb -KeGetCurrentThread@0 -KeGetPreviousMode@0 -;KeI386AbiosCall -;KeI386AllocateGdtSelectors -;KeI386Call16BitCStyleFunction -;KeI386Call16BitFunction -;KeI386FlatToGdtSelector -;KeI386GetLid -;KeI386MachineType DATA -;KeI386ReleaseGdtSelectors -;KeI386ReleaseLid -;KeI386SetGdtSelector -KeIcacheFlushCount DATA -KeInitializeApc@32 -KeInitializeDeviceQueue@4 -KeInitializeDpc@12 -KeInitializeEvent@12 -KeInitializeInterrupt@44 -KeInitializeMutant@8 -KeInitializeMutex@8 -KeInitializeQueue@8 -KeInitializeSemaphore@12 -KeInitializeSpinLock@4 -KeInitializeTimer@4 -KeInitializeTimerEx@8 -KeInsertByKeyDeviceQueue@12 -KeInsertDeviceQueue@8 -KeInsertHeadQueue@8 -KeInsertQueue@8 -KeInsertQueueApc@16 -KeInsertQueueDpc@12 -;KeIsExecutingDpc -KeLeaveCriticalRegion@0 -KeLoaderBlock DATA -KeNumberProcessors DATA -;KeProfileInterrupt -;KeProfileInterruptWithSource -KePulseEvent@12 -KeQuerySystemTime@4 -KeQueryTickCount@4 -KeQueryTimeIncrement@0 -;KeRaiseUserException -KeRescheduleThread@0 -KeReadStateEvent@4 -KeReadStateMutant@4 -KeReadStateMutex@4 -KeReadStateQueue@4 -KeReadStateSemaphore@4 -KeReadStateTimer@4 -KeRegisterBugCheckCallback@20 -KeReleaseMutant@16 -KeReleaseMutex@8 -KeReleaseSemaphore@16 -KeReleaseSpinLockFromDpcLevel@4 -KeRemoveByKeyDeviceQueue@8 -KeRemoveDeviceQueue@4 -KeRemoveEntryDeviceQueue@8 -KeRemoveQueue@12 -KeRemoveQueueDpc@4 -KeResetEvent@4 -KeRestoreFloatingPointState@4 -KeRundownQueue@4 -KeSaveFloatingPointState@4 -KeServiceDescriptorTable DATA -KeSetAffinityThread@8 -KeSetBasePriorityThread@8 -;KeSetDmaIoCoherency -KeSetEvent@12 -;KeSetEventBoostPriority -;KeSetIdealProcessorThread -KeSetImportanceDpc@8 -;KeSetKernelStackSwapEnable -KeSetPriorityThread@8 -;KeSetProfileIrql -;@KeSetSwapContextNotifyRoutine -KeSetTargetProcessorDpc@8 -;@KeSetThreadSelectNotifyRoutine -;KeSetTimeIncrement -KeSetTimer@16 -KeSetTimerEx@20 -;@KeSetTimeUpdateNotifyRoutine -KeSynchronizeExecution@12 -;KeTerminateThread -KeTickCount DATA -;KeUpdateRunTime -;KeUserModeCallback -KeWaitForMultipleObjects@32 -KeWaitForMutexObject@20 -KeWaitForSingleObject@20 -;@KefAcquireSpinLockAtDpcLevel -;@KefReleaseSpinLockFromDpcLevel -;Kei386EoiHelper -;@KiAcquireSpinLock@4 -;KiBugCheckData DATA -;KiCoprocessorError@0 -KiDeliverApc@12 -KiDispatchInterrupt@0 -KiInterruptDispatch2@8 -;KiIpiServiceRoutine@8 -;@KiReleaseSpinLock@4 -;KiUnexpectedInterrupt -;Kii386SpinOnSpinLock -KiRawTicks DATA -LdrAccessResource@16 -;LdrEnumResources@20 -;LdrFindResourceDirectory_U@16 -LdrFindResource_U@16 -;LpcRequestPort@8 -LsaCallAuthenticationPackage@28 -LsaDeregisterLogonProcess@8 -LsaFreeReturnBuffer@4 -LsaLogonUser@56 -LsaLookupAuthenticationPackage@12 -LsaRegisterLogonProcess@12 -MmAdjustWorkingSetSize@12 -MmAllocateContiguousAlignedMemory@16 -MmAllocateContiguousMemory@12 -MmAllocateNonCachedMemory@4 -MmBuildMdlForNonPagedPool@4 -MmCanFileBeTruncated@8 -MmCopyFromCaller@12 -MmCopyToCaller@12 -MmCreateMdl@12 -MmCreateSection@32 -MmDbgTranslatePhysicalAddress@8 -MmDisableModifiedWriteOfSection@4 -MmFlushImageSection@8 -MmForceSectionClosed@8 -MmFreeContiguousMemory@4 -MmFreeNonCachedMemory@8 -MmGetPhysicalAddress@4 -MmGrowKernelStack@4 -MmHighestUserAddress DATA -MmIsAddressValid@4 -MmIsNonPagedSystemAddressValid@4 -MmIsRecursiveIoFault@0 -MmIsThisAnNtAsSystem@0 -MmLockPagableDataSection@4 -MmLockPagableImageSection@4=MmLockPagableDataSection@4 -MmLockPagableSectionByHandle@4 -MmMapIoSpace@16 -MmMapLockedPages@8 -MmMapMemoryDumpMdl@4 -MmMapVideoDisplay@16 -MmMapViewInSystemSpace@12 -MmMapViewOfSection@40 -MmPageEntireDriver@4 -MmProbeAndLockPages@12 -MmQuerySystemSize@0 -MmResetDriverPaging@4 -MmSectionObjectType DATA -MmSecureVirtualMemory@12 -MmSetAddressRangeModified@8 -MmSetBankedSection@24 -MmSizeOfMdl@8 -MmUnlockPagableImageSection@4 -MmUnlockPages@4 -MmUnmapIoSpace@8 -MmUnmapLockedPages@8 -MmUnmapVideoDisplay@8 -MmUnmapViewInSystemSpace@4 -MmUnmapViewOfSection@8 -MmUnsecureVirtualMemory@4 -MmUserProbeAddress DATA -NlsAnsiCodePage DATA -NlsLeadByteInfo DATA -NlsMbCodePageTag DATA -NlsMbOemCodePageTag DATA -NlsOemLeadByteInfo DATA -NtAddAtom@8 -NtAdjustPrivilegesToken@24 -NtAlertThread@4 -NtAllocateLocallyUniqueId@4 -NtAllocateUuids@12 -NtAllocateVirtualMemory@24 -NtBuildNumber DATA -NtClose@4 -NtConnectPort@32 -NtCreateEvent@20 -NtCreateTimer@16 -NtOpenEvent@12 -NtCreateFile@44 -NtCreateSection@28 -NtDeleteAtom@4 -NtDeleteFile@4 -NtDeviceIoControlFile@40 -NtDuplicateObject@28 -NtDuplicateToken@24 -NtFindAtom@8 -NtFreeVirtualMemory@16 -NtFsControlFile@40 -NtGlobalFlag DATA -NtLockFile@40 -NtMapViewOfSection@40 -NtNotifyChangeDirectoryFile@36 -NtOpenFile@24 -NtOpenProcess@16 -NtOpenProcessToken@12 -NtQueryDirectoryFile@44 -NtQueryEaFile@36 -NtQueryInformationAtom@20 -NtQueryInformationFile@20 -NtQueryInformationProcess@20 -NtQueryInformationToken@20 -;NtQueryOleDirectoryFile@ <--- ? -NtQuerySecurityObject@20 -NtQuerySystemTime@4 -NtQueryVolumeInformationFile@20 -NtReadFile@36 -NtRequestPort@20 -NtRequestWaitReplyPort@12 -NtSetEvent@8 -NtSetInformationFile@20 -NtSetInformationProcess@16 -NtSetInformationThread@16 -NtSetSecurityObject@12 -NtSetSystemTime@8 -NtUnlockFile@20 -NtVdmControl@8 -NtW32Call@20 -NtWaitForSingleObject@12 -NtWriteFile@36 -ObAssignSecurity@16 -;ObCheckCreateObjectAccess@28 -;ObCheckObjectAccess@20 -ObCreateObject@36 -ObRosCreateObject@20 -;ObFindHandleForObject@20 -ObGetObjectPointerCount@4 -ObGetObjectSecurity@12 -;ObInsertObject@24 -ObMakeTemporaryObject@4 -ObOpenObjectByName@28 -ObOpenObjectByPointer@28 -ObQueryNameString@16 -;ObQueryObjectAuditingByHandle@8 -@ObfDereferenceObject@4 -@ObfReferenceObject@4 -ObReferenceObjectByHandle@24 -ObReferenceObjectByName@32 -ObReferenceObjectByPointer@16 -ObReleaseObjectSecurity@8 -;ObSetSecurityDescriptorInfo@24 -;PfxFindPrefix -;PfxInitialize -;PfxInsertPrefix -;PfxRemovePrefix -PoCallDriver@8 -PoRegisterDeviceForIdleDetection@16 -PoRegisterSystemState@8 -PoRequestPowerIrp@24 -PoSetDeviceBusy@4 -PoSetPowerState@12 -PoSetSystemState@4 -PoStartNextPowerIrp@4 -PoUnregisterSystemState@4 -ProbeForRead@12 -ProbeForWrite@12 -PsAssignImpersonationToken@8 -;PsChargePoolQuota@12 -PsCreateSystemProcess@12 -PsCreateSystemThread@28 -PsCreateWin32Process@4 -PsEstablishWin32Callouts@24 -PsGetCurrentProcessId@0 -PsGetCurrentThreadId@0 -PsGetProcessExitTime@0 -PsGetVersion@16 -PsGetWin32Thread@0 -PsGetWin32Process@0 -PsImpersonateClient@20 -PsInitialSystemProcess DATA -PsIsThreadTerminating@4 -PsLookupProcessByProcessId@8 -PsLookupProcessThreadByCid@12 -PsLookupThreadByThreadId@8 -PsProcessType DATA -PsReferenceImpersonationToken@16 -PsReferencePrimaryToken@4 -;PsReturnPoolQuota@12 -PsRevertToSelf@0 -PsSetCreateProcessNotifyRoutine@8 -PsSetCreateThreadNotifyRoutine@4 -;PsSetLegoNotifyRoutine@4 -;PsSetProcessPriorityByClass@8 -PsTerminateSystemThread@4 -PsThreadType DATA -READ_REGISTER_UCHAR@4 -READ_REGISTER_ULONG@4 -READ_REGISTER_USHORT@4 -READ_REGISTER_BUFFER_UCHAR@12 -READ_REGISTER_BUFFER_ULONG@12 -READ_REGISTER_BUFFER_USHORT@12 -RtlAbsoluteToSelfRelativeSD@12 -RtlAddAccessAllowedAce@16 -RtlAddAce@20 -RtlAddAtomToAtomTable@12 -;RtlAllocateAndInitializeSid -;RtlAllocateHeap -RtlAnsiCharToUnicodeChar@4 -RtlAnsiStringToUnicodeSize@4 -RtlAnsiStringToUnicodeString@12 -RtlAppendAsciizToString@8 -RtlAppendStringToString@8 -RtlAppendUnicodeStringToString@8 -RtlAppendUnicodeToString@8 -RtlAreAllAccessesGranted@8 -RtlAreAnyAccessesGranted@8 -RtlAreBitsClear@12 -RtlAreBitsSet@12 -RtlAssert@16 -;RtlCaptureStackBackTrace -RtlCharToInteger@12 -RtlCheckRegistryKey@8 -RtlClearAllBits@4 -RtlClearBits@12 -RtlCompareMemory@12 -RtlCompareMemoryUlong@12 -RtlCompareString@12 -RtlCompareUnicodeString@12 -RtlCompressBuffer@32 -RtlCompressChunks@28 -RtlConvertLongToLargeInteger@4 -RtlConvertSidToUnicodeString@12 -RtlConvertUlongToLargeInteger@4 -RtlCopyLuid@8 -RtlCopySid@12 -RtlCopyString@8 -RtlCopyUnicodeString@8 -RtlCreateAcl@12 -RtlCreateAtomTable@8 -;RtlCreateHeap -RtlCreateRegistryKey@8 -RtlCreateSecurityDescriptor@8 -RtlCreateUnicodeString@8 -RtlCustomCPToUnicodeN@24 -RtlDecompressBuffer@24 -RtlDecompressChunks@28 -RtlDecompressFragment@32 -;RtlDelete -RtlDeleteAtomFromAtomTable@8 -;RtlDeleteElementGenericTable -;RtlDeleteNoSplay -RtlDeleteRegistryValue@12 -RtlDescribeChunk@20 -RtlDestroyAtomTable@4 -;RtlDestroyHeap -RtlDowncaseUnicodeString@12 -RtlEmptyAtomTable@8 -RtlEnlargedIntegerMultiply@8 -RtlEnlargedUnsignedDivide@16 -RtlEnlargedUnsignedMultiply@8 -;RtlEnumerateGenericTable -;RtlEnumerateGenericTableWithoutSplaying -RtlEqualLuid@8 -RtlEqualSid@8 -RtlEqualString@12 -RtlEqualUnicodeString@12 -RtlExtendedIntegerMultiply@12 -RtlExtendedLargeIntegerDivide@16 -RtlExtendedMagicDivide@20 -RtlFillMemory@12 -RtlFillMemoryUlong@12 -RtlFindClearBits@12 -RtlFindClearBitsAndSet@12 -RtlFindFirstRunClear@8 -RtlFindFirstRunSet@8 -RtlFindLongestRunClear@8 -RtlFindLongestRunSet@8 -RtlFindMessage@20 -RtlFindSetBits@12 -RtlFindSetBitsAndClear@12 -;RtlFindUnicodePrefix -RtlFormatCurrentUserKeyPath@4 -RtlFreeAnsiString@4 -;RtlFreeHeap -RtlFreeOemString@4 -RtlFreeUnicodeString@4 -RtlGenerate8dot3Name@16 -;RtlGetCallersAddress -RtlGetCompressionWorkSpaceSize@12 -RtlGetDaclSecurityDescriptor@16 -RtlGetDefaultCodePage@8 -;RtlGetElementGenericTable -RtlGetGroupSecurityDescriptor@12 -RtlGetOwnerSecurityDescriptor@12 -RtlImageNtHeader@4 -RtlImageDirectoryEntryToData@16 -RtlInitAnsiString@8 -RtlInitCodePageTable@8 -RtlInitString@8 -RtlInitUnicodeString@8 -RtlInitializeBitMap@12 -;RtlInitializeGenericTable -RtlInitializeSid@12 -;RtlInitializeUnicodePrefix -;RtlInsertElementGenericTable -;RtlInsertUnicodePrefix -RtlIntegerToChar@16 -RtlIntegerToUnicodeString@12 -RtlIsNameLegalDOS8Dot3@12 -RtlLargeIntegerAdd@16 -RtlLargeIntegerArithmeticShift@12 -RtlLargeIntegerDivide@20 -RtlLargeIntegerNegate@8 -RtlLargeIntegerShiftLeft@12 -RtlLargeIntegerShiftRight@12 -RtlLargeIntegerSubtract@16 -RtlLengthRequiredSid@4 -RtlLengthSecurityDescriptor@4 -RtlLengthSid@4 -RtlLookupAtomInAtomTable@12 -;RtlLookupElementGenericTable -RtlMapGenericMask@8 -RtlMoveMemory@12 -RtlMultiByteToUnicodeN@20 -RtlMultiByteToUnicodeSize@12 -;RtlNextUnicodePrefix -RtlNtStatusToDosError@4 -RtlNtStatusToDosErrorNoTeb@4 -;RtlNumberGenericTableElements -RtlNumberOfClearBits@4 -RtlNumberOfSetBits@4 -RtlOemStringToCountedUnicodeString@12 -RtlOemStringToUnicodeSize@4 -RtlOemStringToUnicodeString@12 -RtlOemToUnicodeN@20 -RtlPinAtomInAtomTable@8 -RtlPrefixString@12 -RtlPrefixUnicodeString@12 -RtlQueryAtomInAtomTable@24 -RtlQueryRegistryValues@20 -RtlQueryTimeZoneInformation@4 -RtlRaiseException@4 -RtlRandom@4 -;RtlRemoveUnicodePrefix -RtlReserveChunk@20 -RtlSecondsSince1970ToTime@8 -RtlSecondsSince1980ToTime@8 -RtlSetAllBits@4 -RtlSetBits@12 -RtlSetDaclSecurityDescriptor@16 -RtlSetGroupSecurityDescriptor@12 -RtlSetOwnerSecurityDescriptor@12 -RtlSetSaclSecurityDescriptor@16 -RtlSetTimeZoneInformation@4 -;RtlSplay -RtlSubAuthorityCountSid@4 -RtlSubAuthoritySid@8 -RtlTimeFieldsToTime@8 -RtlTimeToSecondsSince1970@8 -RtlTimeToSecondsSince1980@8 -RtlTimeToTimeFields@8 -RtlUnicodeStringToAnsiSize@4 -RtlUnicodeStringToAnsiString@12 -RtlUnicodeStringToCountedOemString@12 -RtlUnicodeStringToInteger@12 -RtlUnicodeStringToOemSize@4 -RtlUnicodeStringToOemString@12 -RtlUnicodeToCustomCPN@24 -RtlUnicodeToMultiByteN@20 -RtlUnicodeToMultiByteSize@12 -RtlUnicodeToOemN@20 -RtlUnwind@16 -RtlUpcaseUnicodeChar@4 -RtlUpcaseUnicodeString@12 -RtlUpcaseUnicodeStringToAnsiString@12 -RtlUpcaseUnicodeStringToCountedOemString@12 -RtlUpcaseUnicodeStringToOemString@12 -RtlUpcaseUnicodeToCustomCPN@24 -RtlUpcaseUnicodeToMultiByteN@20 -RtlUpcaseUnicodeToOemN@20 -RtlUpperChar@4 -RtlUpperString@8 -RtlValidSecurityDescriptor@4 -RtlValidSid@4 -RtlWriteRegistryValue@24 -;RtlZeroHeap -RtlZeroMemory@8 -RtlxAnsiStringToUnicodeSize@4 -RtlxOemStringToUnicodeSize@4 -RtlxUnicodeStringToAnsiSize@4 -RtlxUnicodeStringToOemSize@4 -SeAccessCheck@40 -;SeAppendPrivileges@8 -SeAssignSecurity@28 -;SeAuditingFileEvents@8 -;SeAuditingFileOrGlobalEvents@18 -;SeCaptureSecurityDescriptor@20 -SeCaptureSubjectContext@4 -;SeCloseObjectAuditAlarm@12 -;SeCreateAccessState@16 -SeCreateClientSecurity@16 -SeDeassignSecurity@4 -;SeDeleteAccessState@4 -;SeDeleteObjectAuditAlarm@8 -SeExports DATA -;SeFreePrivileges@4 -SeImpersonateClient@8 -;SeLockSubjectContext@4 -;SeMarkLogonSessionForTerminationNotification@4 -;SeOpenObjectAuditAlarm@36 -;SeOpenObjectForDeleteAuditAlarm@36 -SePrivilegeCheck@12 -;SePrivilegeObjectAuditAlarm@24 -SePublicDefaultDacl DATA -;SeQueryAuthenticationIdToken@8 -;SeQuerySecurityDescriptorInfo@16 -;SeRegisterLogonSessionTerminatedRoutine@4 -;SeReleaseSecurityDescriptor@12 -SeReleaseSubjectContext@4 -;SeSetAccessStateGenericMapping@8 -;SeSetSecurityDescriptorInfo@24 -SeSinglePrivilegeCheck@12 -SeSystemDefaultDacl DATA -SeTokenImpersonationLevel@4 -SeTokenType@4 -;SeUnlockSubjectContext@4 -;SeUnregisterLogonSessionTerminatedRoutine@4 -;SeValidSecurityDescriptor@8 -WRITE_REGISTER_UCHAR@8 -WRITE_REGISTER_ULONG@8 -WRITE_REGISTER_USHORT@8 -WRITE_REGISTER_BUFFER_UCHAR@12 -WRITE_REGISTER_BUFFER_ULONG@12 -WRITE_REGISTER_BUFFER_USHORT@12 -ZwAccessCheckAndAuditAlarm@44 -ZwAlertThread@4 -ZwAllocateVirtualMemory@24 -ZwClearEvent@4 -ZwClose@4 -ZwCloseObjectAuditAlarm@12 -ZwConnectPort@32 -ZwCreateDirectoryObject@12 -ZwCreateEvent@20 -ZwCreateFile@44 -ZwCreateKey@28 -ZwCreateSection@28 -ZwCreateSymbolicLinkObject@16 -ZwDeleteFile@4 -ZwDeleteKey@4 -ZwDeleteValueKey@8 -ZwDeviceIoControlFile@40 -ZwDisplayString@4 -ZwDuplicateObject@28 -ZwDuplicateToken@24 -ZwEnumerateKey@24 -ZwEnumerateValueKey@24 -ZwFlushInstructionCache@12 -ZwFlushKey@4 -ZwFreeVirtualMemory@16 -ZwFsControlFile@40 -ZwLoadDriver@4 -ZwLoadKey@8 -ZwMakeTemporaryObject@4 -ZwMapViewOfSection@40 -ZwNotifyChangeKey@40 -ZwOpenDirectoryObject@12 -ZwOpenEvent@12 -ZwOpenFile@24 -ZwOpenKey@12 -ZwOpenProcess@16 -ZwOpenProcessToken@12 -ZwOpenSection@12 -ZwOpenSymbolicLinkObject@12 -ZwOpenThread@16 -ZwOpenThreadToken@16 -ZwPulseEvent@8 -ZwQueryDefaultLocale@8 -ZwQueryDirectoryFile@44 -ZwQueryInformationAtom@20 -ZwQueryInformationFile@20 -ZwQueryInformationProcess@20 -ZwQueryInformationToken@20 -ZwQueryKey@20 -ZwQueryObject@20 -ZwQuerySection@20 -ZwQuerySecurityObject@20 -ZwQuerySymbolicLinkObject@12 -ZwQuerySystemInformation@16 -ZwQuerySystemTime@4 -ZwQueryValueKey@24 -ZwQueryVolumeInformationFile@20 -ZwReadFile@36 -ZwReplaceKey@12 -ZwRequestWaitReplyPort@12 -ZwResetEvent@8 -ZwSaveKey@8 -ZwSetDefaultLocale@8 -ZwSetEvent@8 -ZwSetInformationFile@20 -ZwSetInformationObject@16 -ZwSetInformationProcess@16 -ZwSetInformationThread@16 -ZwSetSystemInformation@12 -ZwSetSystemTime@8 -ZwSetValueKey@24 -ZwTerminateProcess@8 -ZwUnloadDriver@4 -ZwUnloadKey@4 -ZwUnmapViewOfSection@8 -ZwWaitForMultipleObjects@20 -ZwWaitForSingleObject@12 -ZwWriteFile@36 -ZwYieldExecution@0 -_abnormal_termination -_alldiv -_allmul -_allrem -_allshl -_allshr -_aulldiv -_aullrem -_aullshr -_except_handler2 -_except_handler3 -_global_unwind2 -_itoa -_local_unwind2 -_purecall -_snprintf -_snwprintf -_stricmp -_strlwr -_strnicmp -_strnset -_strrev -_strset -_strupr -_vsnprintf -_wcsicmp -_wcslwr -_wcsnicmp -_wcsnset -_wcsrev -_wcsupr -atoi -atol -isdigit -islower -isprint -isspace -isupper -isxdigit -mbstowcs -mbtowc -memchr -memcpy -memmove -memset -qsort -rand -sprintf -srand -strcat -strchr -strcmp -strcpy -strlen -strncat -strncmp -strncpy -strrchr -strspn -strstr -swprintf -tolower -toupper -towlower -towupper -vsprintf -wcscat -wcschr -wcscmp -wcscpy -wcscspn -wcslen -wcsncat -wcsncmp -wcsncpy -wcsrchr -wcsspn -wcsstr -wcstombs -wctomb +; $Id: ntoskrnl.def,v 1.166 2003/09/25 18:29:45 navaraf Exp $ +; +; reactos/ntoskrnl/ntoskrnl.def +; +; ReactOS Operating System +; +EXPORTS +CcRosInitializeFileCache@8 +CcRosReleaseFileCache@4 +CcCopyRead@24 +CcCopyWrite@20 +CcFlushCache@16 +CcGetFileObjectFromSectionPtrs@4 +CcMapData@24 +CcMdlReadComplete@8 +CcSetDirtyPinnedData@8 +CcSetFileSizes@8 +CcUnpinData@4 +CcZeroData@16 +DbgBreakPoint@0 +DbgBreakPointWithStatus@4 +;DbgLoadImageSymbols@12 +DbgPrint +DbgPrompt@12 +DpcQueueSize DATA +@ExAcquireFastMutexUnsafe@4 +ExAcquireResourceExclusive@8 +ExAcquireResourceExclusiveLite@8 +ExAcquireResourceSharedLite@8 +ExAcquireSharedStarveExclusive@8 +ExAcquireSharedWaitForExclusive@8 +@ExAllocateFromPagedLookasideList@4 +ExAllocatePool@8 +ExAllocatePoolWithQuota@8 +ExAllocatePoolWithQuotaTag@12 +ExAllocatePoolWithTag@12 +ExConvertExclusiveToSharedLite@4 +ExCreateCallback@16 +ExDeleteNPagedLookasideList@4 +ExDeletePagedLookasideList@4 +ExDeleteResource@4 +ExDeleteResourceLite@4 +ExDesktopObjectType DATA +ExDisableResourceBoostLite@4 +ExEventObjectType DATA +ExExtendZone@12 +ExFreePool@4 +ExFreePoolWithTag@8 +ExFreeToPagedLookasideList@8 +ExGetExclusiveWaiterCount@4 +ExGetPreviousMode@0 +ExGetSharedWaiterCount@4 +ExInitializeNPagedLookasideList@28 +ExInitializePagedLookasideList@28 +ExInitializeResource@4 +ExInitializeResourceLite@4 +ExInitializeZone@16 +ExInterlockedAddLargeInteger@16 +@ExInterlockedAddLargeStatistic@8 +@ExInterlockedAddUlong@12 +@ExInterlockedCompareExchange64@16 +ExInterlockedDecrementLong@8 +ExInterlockedExchangeUlong@12 +ExInterlockedExtendZone@16 +ExInterlockedIncrementLong@8 +@ExInterlockedInsertHeadList@12 +@ExInterlockedInsertTailList@12 +@ExInterlockedPopEntryList@8 +@ExInterlockedPopEntrySList@8 +@ExInterlockedPushEntryList@12 +@ExInterlockedPushEntrySList@12 +@ExInterlockedRemoveHeadList@8 +ExIsProcessorFeaturePresent@4 +ExIsResourceAcquiredExclusiveLite@4 +ExIsResourceAcquiredSharedLite@4 +ExLocalTimeToSystemTime@8 +ExNotifyCallback@12 +ExPostSystemEvent@12 +;ExQueryPoolBlockSize +ExQueueWorkItem@8 +ExRaiseAccessViolation@0 +ExRaiseDatatypeMisalignment@0 +;ExRaiseException +;ExRaiseHardError +ExRaiseStatus@4 +ExRegisterCallback@12 +ExReinitializeResourceLite@4 +@ExReleaseFastMutexUnsafe@4 +ExReleaseResourceForThread@8 +ExReleaseResourceForThreadLite@8 +@ExReleaseResourceLite@4 +ExSetResourceOwnerPointer@8 +;ExSystemExceptionFilter +ExSystemTimeToLocalTime@8 +ExTryToAcquireResourceExclusiveLite@4 +ExUnregisterCallback@4 +ExWindowStationObjectType DATA +ExInitializeBinaryTree@12 +ExDeleteBinaryTree@4 +ExInsertBinaryTree@12 +ExSearchBinaryTree@12 +ExRemoveBinaryTree@12 +ExTraverseBinaryTree@16 +ExInitializeSplayTree@16 +ExDeleteSplayTree@4 +ExInsertSplayTree@12 +ExSearchSplayTree@12 +ExRemoveSplayTree@12 +ExWeightOfSplayTree@8 +ExTraverseSplayTree@16 +ExInitializeHashTable@16 +ExDeleteHashTable@4 +ExInsertHashTable@16 +ExSearchHashTable@16 +ExRemoveHashTable@16 +@ExfInterlockedAddUlong@12 +@ExfInterlockedInsertHeadList@12 +@ExfInterlockedInsertTailList@12 +@ExfInterlockedPopEntryList@8 +@ExfInterlockedPushEntryList@12 +@ExfInterlockedRemoveHeadList@8 +@Exfi386InterlockedDecrementLong@4 +@Exfi386InterlockedExchangeUlong@8 +@Exfi386InterlockedIncrementLong@4 +Exi386InterlockedDecrementLong@4 +Exi386InterlockedExchangeUlong@8 +Exi386InterlockedIncrementLong@4 +FsRtlAddLargeMcbEntry@28 +FsRtlAddMcbEntry@16 +FsRtlAddToTunnelCache@32 +FsRtlAllocateFileLock@8 +FsRtlAllocatePool@8 +FsRtlAllocatePoolWithQuota@8 +FsRtlAllocatePoolWithQuotaTag@12 +FsRtlAllocatePoolWithTag@12 +FsRtlAllocateResource@0 +FsRtlAreNamesEqual@16 +FsRtlBalanceReads@4 +FsRtlCheckLockForReadAccess@8 +FsRtlCheckLockForWriteAccess@8 +FsRtlCheckOplock@20 +FsRtlCopyRead@32 +FsRtlCopyWrite@32 +FsRtlCurrentBatchOplock@4 +FsRtlDeleteKeyFromTunnelCache@12 +FsRtlDeleteTunnelCache@4 +FsRtlDeregisterUncProvider@4 +FsRtlDissectDbcs@16 +FsRtlDissectName@16 +FsRtlDoesDbcsContainWildCards@4 +FsRtlDoesNameContainWildCards@4 +FsRtlFastCheckLockForRead@24 +FsRtlFastCheckLockForWrite@24 +FsRtlFastUnlockAll@16 +FsRtlFastUnlockAllByKey@20 +FsRtlFastUnlockSingle@32 +FsRtlFindInTunnelCache@32 +FsRtlGetFileSize@8 +FsRtlGetNextFileLock@8 +FsRtlGetNextLargeMcbEntry@20 +FsRtlGetNextMcbEntry@20 +FsRtlInitializeFileLock@12 +FsRtlInitializeLargeMcb@8 +FsRtlInitializeMcb@8 +FsRtlInitializeOplock@4 +FsRtlInitializeTunnelCache@4 +FsRtlIsDbcsInExpression@8 +FsRtlIsFatDbcsLegal@20 +FsRtlIsHpfsDbcsLegal@20 +FsRtlIsNameInExpression@16 +FsRtlIsNtstatusExpected@4 +FsRtlIsTotalDeviceFailure@4 +FsRtlLegalAnsiCharacterArray DATA +FsRtlLookupLargeMcbEntry@32 +FsRtlLookupLastLargeMcbEntry@12 +FsRtlLookupLastMcbEntry@12 +FsRtlLookupMcbEntry@20 +FsRtlMdlRead@24 +FsRtlMdlReadComplete@8 +FsRtlMdlReadCompleteDev@12 +FsRtlMdlReadDev@28 +FsRtlMdlWriteComplete@12 +FsRtlMdlWriteCompleteDev@16 +FsRtlNormalizeNtstatus@8 +FsRtlNotifyChangeDirectory@28 +FsRtlNotifyCleanup@12 +FsRtlNotifyFullChangeDirectory@40 +FsRtlNotifyFullReportChange@36 +FsRtlNotifyInitializeSync@4 +FsRtlNotifyReportChange@20 +FsRtlNotifyUninitializeSync@4 +FsRtlNotifyVolumeEvent@8 +FsRtlNumberOfRunsInLargeMcb@4 +FsRtlNumberOfRunsInMcb@4 +FsRtlOplockFsctrl@12 +FsRtlOplockIsFastIoPossible@4 +FsRtlPostPagingFileStackOverflow@12 +FsRtlPostStackOverflow@12 +FsRtlPrepareMdlWrite@24 +FsRtlPrepareMdlWriteDev@28 +FsRtlPrivateLock@48 +FsRtlProcessFileLock@12 +FsRtlRegisterUncProvider@12 +FsRtlRemoveLargeMcbEntry@20 +FsRtlRemoveMcbEntry@12 +FsRtlSplitLargeMcb@20 +FsRtlSyncVolumes@12 +FsRtlTruncateLargeMcb@12 +FsRtlTruncateMcb@8 +FsRtlUninitializeFileLock@4 +FsRtlUninitializeLargeMcb@4 +FsRtlUninitializeMcb@4 +FsRtlUninitializeOplock@4 +HalDispatchTable DATA +HalPrivateDispatchTable DATA +InbvAcquireDisplayOwnership@0 +InbvCheckDisplayOwnership@0 +InbvDisplayString@4 +InbvEnableBootDriver@4 +InbvEnableDisplayString@4 +InbvInstallDisplayStringFilter@4 +InbvIsBootDriverInstalled@0 +InbvNotifyDisplayOwnershipLost@4 +InbvResetDisplay@0 +InbvSetScrollRegion@16 +InbvSetTextColor@4 +InbvSolidColorFill@20 +@InterlockedCompareExchange@12 +@InterlockedDecrement@4 +@InterlockedExchange@8 +@InterlockedExchangeAdd@8 +@InterlockedIncrement@4 +@InterlockedPopEntrySList@4 +@InterlockedPushEntrySList@8 +IoAcquireCancelSpinLock@4 +IoAcquireRemoveLockEx@20 +IoAcquireVpbSpinLock@4 +IoAdapterObjectType DATA +IoAllocateAdapterChannel@20 +IoAllocateController@16 +IoAllocateErrorLogEntry@8 +IoAllocateIrp@8 +IoAllocateMdl@20 +IoAssignResources@24 +IoAttachDevice@12 +IoAttachDeviceByPointer@8 +IoAttachDeviceToDeviceStack@8 +IoBuildAsynchronousFsdRequest@24 +IoBuildDeviceIoControlRequest@36 +IoBuildPartialMdl@16 +IoBuildSynchronousFsdRequest@28 +IoCallDriver@8 +IoCancelIrp@4 +IoCheckDesiredAccess@8 +IoCheckEaBufferValidity@12 +IoCheckFunctionAccess@24 +IoCheckShareAccess@20 +IoCompleteRequest@8 +IoConnectInterrupt@44 +IoCreateController@4 +IoCreateDevice@28 +IoCreateFile@56 +IoCreateNotificationEvent@8 +IoCreateStreamFileObject@8 +IoCreateSymbolicLink@8 +IoCreateSynchronizationEvent@8 +IoCreateUnprotectedSymbolicLink@8 +IoDeleteController@4 +IoDeleteDevice@4 +IoDeleteSymbolicLink@4 +IoDetachDevice@4 +IoDeviceHandlerObjectSize DATA +IoDeviceHandlerObjectType DATA +IoDisconnectInterrupt@4 +IoDeviceObjectType DATA +IoDriverObjectType DATA +IoEnqueueIrp@4 +IoFastQueryNetworkAttributes@20 +IoFileObjectType DATA +IoFreeController@4 +IoFreeIrp@4 +IoFreeMdl@4 +IoGetAttachedDevice@4 +IoGetAttachedDeviceReference@4 +IoGetBaseFileSystemDeviceObject@4 +IoGetConfigurationInformation@0 +IoGetCurrentProcess@0 +IoGetDeviceObjectPointer@16 +IoGetDeviceToVerify@4 +IoGetFileObjectGenericMapping@0 +IoGetInitialStack@0 +IoGetRelatedDeviceObject@4 +IoGetRequestorProcess@4 +IoGetStackLimits@8 +IoGetTopLevelIrp@0 +IoInitializeIrp@12 +IoInvalidateDeviceState@4 +IoInitializeRemoveLockEx@20 +IoInitializeTimer@12 +IoIsOperationSynchronous@4 +IoMakeAssociatedIrp@8 +IoOpenDeviceInstanceKey@20 +IoPageRead@20 +IoQueryDeviceDescription@32 +IoQueryDeviceEnumInfo@8 +IoQueryFileInformation@20 +IoQueryVolumeInformation@20 +IoQueueThreadIrp@4 +IoRaiseHardError@12 +IoRaiseInformationalHardError@12 +IoReadOperationCount DATA +IoReadPartitionTable@16 +IoReadTransferCount DATA + +IoFreeWorkItem@4 +IoAllocateWorkItem@4 +IoQueueWorkItem@16 +IoRegisterDeviceInterface@16 +IoSetDeviceInterfaceState@8 +IoGetDeviceProperty@20 +IoOpenDeviceRegistryKey@16 +IoInvalidateDeviceRelations@8 + +IoRegisterDriverReinitialization@12 +IoRegisterFileSystem@4 +IoRegisterFsRegistrationChange@8 +IoRegisterShutdownNotification@4 +IoReleaseCancelSpinLock@4 +IoReleaseRemoveLockAndWaitEx@12 +IoReleaseRemoveLockEx@12 +IoReleaseVpbSpinLock@4 +IoRemoveShareAccess@8 +IoReportHalResourceUsage@16 +IoReportResourceUsage@36 +IoSetDeviceToVerify@8 +IoSetHardErrorOrVerifyDevice@8 +IoSetInformation@16 +IoSetPartitionInformation@16 +IoSetShareAccess@16 +IoSetThreadHardErrorMode@4 +IoSetTopLevelIrp@4 +IoStartNextPacket@8 +IoStartNextPacketByKey@12 +IoStartPacket@16 +IoStartTimer@4 +IoStatisticsLock DATA +IoStopTimer@4 +IoSynchronousPageWrite@20 +IoThreadToProcess@4 +IoUnregisterFileSystem@4 +IoUnregisterFsRegistrationChange@8 +IoUnregisterShutdownNotification@4 +IoUpdateShareAccess@8 +IoVerifyVolume@8 +IoWriteErrorLogEntry@4 +IoWriteOperationCount DATA +IoWritePartitionTable@20 +IoWriteTransferCount DATA +@IofCallDriver@8 +@IofCompleteRequest@8 +KdDebuggerEnabled DATA +KdDebuggerNotPresent DATA +KdPollBreakIn@0 +KdSystemDebugControl@4 +Ke386CallBios@8 +Ke386IoSetAccessProcess@8 +Ke386QueryIoAccessMap@8 +Ke386SetIoAccessMap@8 +KeAcquireSpinLockAtDpcLevel@4 +KeAddSystemServiceTable@20 +KeAttachProcess@4 +;KeBoostCurrentThread +KeBugCheck@4 +KeBugCheckEx@20 +KeCancelTimer@4 +KeClearEvent@4 +KeConnectInterrupt@4 +KeDcacheFlushCount DATA +KeDelayExecutionThread@12 +KeDeregisterBugCheckCallback@4 +KeDetachProcess@0 +KeDisconnectInterrupt@4 +KeEnterCriticalRegion@0 +KeEnterKernelDebugger@0 +;KeFindConfigurationEntry +;KeFindConfigurationNextEntry +;KeFlushEntireTb +KeGetCurrentThread@0 +KeGetPreviousMode@0 +;KeI386AbiosCall +;KeI386AllocateGdtSelectors +;KeI386Call16BitCStyleFunction +;KeI386Call16BitFunction +;KeI386FlatToGdtSelector +;KeI386GetLid +;KeI386MachineType DATA +;KeI386ReleaseGdtSelectors +;KeI386ReleaseLid +;KeI386SetGdtSelector +KeIcacheFlushCount DATA +KeInitializeApc@32 +KeInitializeDeviceQueue@4 +KeInitializeDpc@12 +KeInitializeEvent@12 +KeInitializeInterrupt@44 +KeInitializeMutant@8 +KeInitializeMutex@8 +KeInitializeQueue@8 +KeInitializeSemaphore@12 +KeInitializeSpinLock@4 +KeInitializeTimer@4 +KeInitializeTimerEx@8 +KeInsertByKeyDeviceQueue@12 +KeInsertDeviceQueue@8 +KeInsertHeadQueue@8 +KeInsertQueue@8 +KeInsertQueueApc@16 +KeInsertQueueDpc@12 +;KeIsExecutingDpc +KeLeaveCriticalRegion@0 +KeLoaderBlock DATA +KeNumberProcessors DATA +;KeProfileInterrupt +;KeProfileInterruptWithSource +KePulseEvent@12 +KeQuerySystemTime@4 +KeQueryTickCount@4 +KeQueryTimeIncrement@0 +;KeRaiseUserException +KeRescheduleThread@0 +KeReadStateEvent@4 +KeReadStateMutant@4 +KeReadStateMutex@4 +KeReadStateQueue@4 +KeReadStateSemaphore@4 +KeReadStateTimer@4 +KeRegisterBugCheckCallback@20 +KeReleaseMutant@16 +KeReleaseMutex@8 +KeReleaseSemaphore@16 +KeReleaseSpinLockFromDpcLevel@4 +KeRemoveByKeyDeviceQueue@8 +KeRemoveDeviceQueue@4 +KeRemoveEntryDeviceQueue@8 +KeRemoveQueue@12 +KeRemoveQueueDpc@4 +KeResetEvent@4 +KeRestoreFloatingPointState@4 +KeRundownQueue@4 +KeSaveFloatingPointState@4 +KeServiceDescriptorTable DATA +KeSetAffinityThread@8 +KeSetBasePriorityThread@8 +;KeSetDmaIoCoherency +KeSetEvent@12 +;KeSetEventBoostPriority +;KeSetIdealProcessorThread +KeSetImportanceDpc@8 +;KeSetKernelStackSwapEnable +KeSetPriorityThread@8 +;KeSetProfileIrql +;@KeSetSwapContextNotifyRoutine +KeSetTargetProcessorDpc@8 +;@KeSetThreadSelectNotifyRoutine +;KeSetTimeIncrement +KeSetTimer@16 +KeSetTimerEx@20 +;@KeSetTimeUpdateNotifyRoutine +KeSynchronizeExecution@12 +;KeTerminateThread +KeTickCount DATA +;KeUpdateRunTime +;KeUserModeCallback +KeWaitForMultipleObjects@32 +KeWaitForMutexObject@20 +KeWaitForSingleObject@20 +;@KefAcquireSpinLockAtDpcLevel +;@KefReleaseSpinLockFromDpcLevel +;Kei386EoiHelper +;@KiAcquireSpinLock@4 +;KiBugCheckData DATA +;KiCoprocessorError@0 +KiDeliverApc@12 +KiDispatchInterrupt@0 +KiInterruptDispatch2@8 +;KiIpiServiceRoutine@8 +;@KiReleaseSpinLock@4 +;KiUnexpectedInterrupt +;Kii386SpinOnSpinLock +KiRawTicks DATA +LdrAccessResource@16 +;LdrEnumResources@20 +;LdrFindResourceDirectory_U@16 +LdrFindResource_U@16 +;LpcRequestPort@8 +LsaCallAuthenticationPackage@28 +LsaDeregisterLogonProcess@8 +LsaFreeReturnBuffer@4 +LsaLogonUser@56 +LsaLookupAuthenticationPackage@12 +LsaRegisterLogonProcess@12 +MmAdjustWorkingSetSize@12 +MmAllocateContiguousAlignedMemory@16 +MmAllocateContiguousMemory@12 +MmAllocateNonCachedMemory@4 +MmBuildMdlForNonPagedPool@4 +MmCanFileBeTruncated@8 +MmCopyFromCaller@12 +MmCopyToCaller@12 +MmCreateMdl@12 +MmCreateSection@32 +MmDbgTranslatePhysicalAddress@8 +MmDisableModifiedWriteOfSection@4 +MmFlushImageSection@8 +MmForceSectionClosed@8 +MmFreeContiguousMemory@4 +MmFreeNonCachedMemory@8 +MmGetPhysicalAddress@4 +MmGrowKernelStack@4 +MmHighestUserAddress DATA +MmIsAddressValid@4 +MmIsNonPagedSystemAddressValid@4 +MmIsRecursiveIoFault@0 +MmIsThisAnNtAsSystem@0 +MmLockPagableDataSection@4 +MmLockPagableImageSection@4=MmLockPagableDataSection@4 +MmLockPagableSectionByHandle@4 +MmMapIoSpace@16 +MmMapLockedPages@8 +MmMapMemoryDumpMdl@4 +MmMapVideoDisplay@16 +MmMapViewInSystemSpace@12 +MmMapViewOfSection@40 +MmPageEntireDriver@4 +MmProbeAndLockPages@12 +MmQuerySystemSize@0 +MmResetDriverPaging@4 +MmSectionObjectType DATA +MmSecureVirtualMemory@12 +MmSetAddressRangeModified@8 +MmSetBankedSection@24 +MmSizeOfMdl@8 +MmUnlockPagableImageSection@4 +MmUnlockPages@4 +MmUnmapIoSpace@8 +MmUnmapLockedPages@8 +MmUnmapVideoDisplay@8 +MmUnmapViewInSystemSpace@4 +MmUnmapViewOfSection@8 +MmUnsecureVirtualMemory@4 +MmUserProbeAddress DATA +NlsAnsiCodePage DATA +NlsLeadByteInfo DATA +NlsMbCodePageTag DATA +NlsMbOemCodePageTag DATA +NlsOemLeadByteInfo DATA +NtAddAtom@8 +NtAdjustPrivilegesToken@24 +NtAlertThread@4 +NtAllocateLocallyUniqueId@4 +NtAllocateUuids@12 +NtAllocateVirtualMemory@24 +NtBuildNumber DATA +NtClose@4 +NtConnectPort@32 +NtCreateEvent@20 +NtCreateTimer@16 +NtOpenEvent@12 +NtCreateFile@44 +NtCreateSection@28 +NtDeleteAtom@4 +NtDeleteFile@4 +NtDeviceIoControlFile@40 +NtDuplicateObject@28 +NtDuplicateToken@24 +NtFindAtom@8 +NtFreeVirtualMemory@16 +NtFsControlFile@40 +NtGlobalFlag DATA +NtLockFile@40 +NtMapViewOfSection@40 +NtNotifyChangeDirectoryFile@36 +NtOpenFile@24 +NtOpenProcess@16 +NtOpenProcessToken@12 +NtQueryDirectoryFile@44 +NtQueryEaFile@36 +NtQueryInformationAtom@20 +NtQueryInformationFile@20 +NtQueryInformationProcess@20 +NtQueryInformationToken@20 +;NtQueryOleDirectoryFile@ <--- ? +NtQuerySecurityObject@20 +NtQuerySystemTime@4 +NtQueryVolumeInformationFile@20 +NtReadFile@36 +NtRequestPort@20 +NtRequestWaitReplyPort@12 +NtSetEvent@8 +NtSetInformationFile@20 +NtSetInformationProcess@16 +NtSetInformationThread@16 +NtSetSecurityObject@12 +NtSetSystemTime@8 +NtUnlockFile@20 +NtVdmControl@8 +NtW32Call@20 +NtWaitForSingleObject@12 +NtWriteFile@36 +ObAssignSecurity@16 +;ObCheckCreateObjectAccess@28 +;ObCheckObjectAccess@20 +ObCreateObject@36 +ObRosCreateObject@20 +;ObFindHandleForObject@20 +ObGetObjectPointerCount@4 +ObGetObjectSecurity@12 +;ObInsertObject@24 +ObMakeTemporaryObject@4 +ObOpenObjectByName@28 +ObOpenObjectByPointer@28 +ObQueryNameString@16 +;ObQueryObjectAuditingByHandle@8 +@ObfDereferenceObject@4 +@ObfReferenceObject@4 +ObReferenceObjectByHandle@24 +ObReferenceObjectByName@32 +ObReferenceObjectByPointer@16 +ObReleaseObjectSecurity@8 +;ObSetSecurityDescriptorInfo@24 +;PfxFindPrefix +;PfxInitialize +;PfxInsertPrefix +;PfxRemovePrefix +PoCallDriver@8 +PoRegisterDeviceForIdleDetection@16 +PoRegisterSystemState@8 +PoRequestPowerIrp@24 +PoSetDeviceBusy@4 +PoSetPowerState@12 +PoSetSystemState@4 +PoStartNextPowerIrp@4 +PoUnregisterSystemState@4 +ProbeForRead@12 +ProbeForWrite@12 +PsAssignImpersonationToken@8 +;PsChargePoolQuota@12 +PsCreateSystemProcess@12 +PsCreateSystemThread@28 +PsCreateWin32Process@4 +PsEstablishWin32Callouts@24 +PsGetCurrentProcessId@0 +PsGetCurrentThreadId@0 +PsGetProcessExitTime@0 +PsGetVersion@16 +PsGetWin32Thread@0 +PsGetWin32Process@0 +PsImpersonateClient@20 +PsInitialSystemProcess DATA +PsIsThreadTerminating@4 +PsLookupProcessByProcessId@8 +PsLookupProcessThreadByCid@12 +PsLookupThreadByThreadId@8 +PsProcessType DATA +PsReferenceImpersonationToken@16 +PsReferencePrimaryToken@4 +;PsReturnPoolQuota@12 +PsRevertToSelf@0 +PsSetCreateProcessNotifyRoutine@8 +PsSetCreateThreadNotifyRoutine@4 +;PsSetLegoNotifyRoutine@4 +;PsSetProcessPriorityByClass@8 +PsTerminateSystemThread@4 +PsThreadType DATA +READ_REGISTER_UCHAR@4 +READ_REGISTER_ULONG@4 +READ_REGISTER_USHORT@4 +READ_REGISTER_BUFFER_UCHAR@12 +READ_REGISTER_BUFFER_ULONG@12 +READ_REGISTER_BUFFER_USHORT@12 +RtlAbsoluteToSelfRelativeSD@12 +RtlAddAccessAllowedAce@16 +RtlAddAce@20 +RtlAddAtomToAtomTable@12 +;RtlAllocateAndInitializeSid +;RtlAllocateHeap +RtlAnsiCharToUnicodeChar@4 +RtlAnsiStringToUnicodeSize@4 +RtlAnsiStringToUnicodeString@12 +RtlAppendAsciizToString@8 +RtlAppendStringToString@8 +RtlAppendUnicodeStringToString@8 +RtlAppendUnicodeToString@8 +RtlAreAllAccessesGranted@8 +RtlAreAnyAccessesGranted@8 +RtlAreBitsClear@12 +RtlAreBitsSet@12 +RtlAssert@16 +;RtlCaptureStackBackTrace +RtlCharToInteger@12 +RtlCheckRegistryKey@8 +RtlClearAllBits@4 +RtlClearBits@12 +RtlCompareMemory@12 +RtlCompareMemoryUlong@12 +RtlCompareString@12 +RtlCompareUnicodeString@12 +RtlCompressBuffer@32 +RtlCompressChunks@28 +RtlConvertLongToLargeInteger@4 +RtlConvertSidToUnicodeString@12 +RtlConvertUlongToLargeInteger@4 +RtlCopyLuid@8 +RtlCopySid@12 +RtlCopyString@8 +RtlCopyUnicodeString@8 +RtlCreateAcl@12 +RtlCreateAtomTable@8 +;RtlCreateHeap +RtlCreateRegistryKey@8 +RtlCreateSecurityDescriptor@8 +RtlCreateUnicodeString@8 +RtlCustomCPToUnicodeN@24 +RtlDecompressBuffer@24 +RtlDecompressChunks@28 +RtlDecompressFragment@32 +;RtlDelete +RtlDeleteAtomFromAtomTable@8 +;RtlDeleteElementGenericTable +;RtlDeleteNoSplay +RtlDeleteRegistryValue@12 +RtlDescribeChunk@20 +RtlDestroyAtomTable@4 +;RtlDestroyHeap +RtlDowncaseUnicodeString@12 +RtlEmptyAtomTable@8 +RtlEnlargedIntegerMultiply@8 +RtlEnlargedUnsignedDivide@16 +RtlEnlargedUnsignedMultiply@8 +;RtlEnumerateGenericTable +;RtlEnumerateGenericTableWithoutSplaying +RtlEqualLuid@8 +RtlEqualSid@8 +RtlEqualString@12 +RtlEqualUnicodeString@12 +RtlExtendedIntegerMultiply@12 +RtlExtendedLargeIntegerDivide@16 +RtlExtendedMagicDivide@20 +RtlFillMemory@12 +RtlFillMemoryUlong@12 +RtlFindClearBits@12 +RtlFindClearBitsAndSet@12 +RtlFindFirstRunClear@8 +RtlFindFirstRunSet@8 +RtlFindLongestRunClear@8 +RtlFindLongestRunSet@8 +RtlFindMessage@20 +RtlFindSetBits@12 +RtlFindSetBitsAndClear@12 +;RtlFindUnicodePrefix +RtlFormatCurrentUserKeyPath@4 +RtlFreeAnsiString@4 +;RtlFreeHeap +RtlFreeOemString@4 +RtlFreeUnicodeString@4 +RtlGenerate8dot3Name@16 +;RtlGetCallersAddress +RtlGetCompressionWorkSpaceSize@12 +RtlGetDaclSecurityDescriptor@16 +RtlGetDefaultCodePage@8 +;RtlGetElementGenericTable +RtlGetGroupSecurityDescriptor@12 +RtlGetOwnerSecurityDescriptor@12 +RtlImageNtHeader@4 +RtlImageDirectoryEntryToData@16 +RtlInitAnsiString@8 +RtlInitCodePageTable@8 +RtlInitString@8 +RtlInitUnicodeString@8 +RtlInitializeBitMap@12 +;RtlInitializeGenericTable +RtlInitializeSid@12 +;RtlInitializeUnicodePrefix +;RtlInsertElementGenericTable +;RtlInsertUnicodePrefix +RtlIntegerToChar@16 +RtlIntegerToUnicodeString@12 +RtlIsNameLegalDOS8Dot3@12 +RtlLargeIntegerAdd@16 +RtlLargeIntegerArithmeticShift@12 +RtlLargeIntegerDivide@20 +RtlLargeIntegerNegate@8 +RtlLargeIntegerShiftLeft@12 +RtlLargeIntegerShiftRight@12 +RtlLargeIntegerSubtract@16 +RtlLengthRequiredSid@4 +RtlLengthSecurityDescriptor@4 +RtlLengthSid@4 +RtlLookupAtomInAtomTable@12 +;RtlLookupElementGenericTable +RtlMapGenericMask@8 +RtlMoveMemory@12 +RtlMultiByteToUnicodeN@20 +RtlMultiByteToUnicodeSize@12 +;RtlNextUnicodePrefix +RtlNtStatusToDosError@4 +RtlNtStatusToDosErrorNoTeb@4 +;RtlNumberGenericTableElements +RtlNumberOfClearBits@4 +RtlNumberOfSetBits@4 +RtlOemStringToCountedUnicodeString@12 +RtlOemStringToUnicodeSize@4 +RtlOemStringToUnicodeString@12 +RtlOemToUnicodeN@20 +RtlPinAtomInAtomTable@8 +RtlPrefixString@12 +RtlPrefixUnicodeString@12 +RtlQueryAtomInAtomTable@24 +RtlQueryRegistryValues@20 +RtlQueryTimeZoneInformation@4 +RtlRaiseException@4 +RtlRandom@4 +;RtlRemoveUnicodePrefix +RtlReserveChunk@20 +RtlSecondsSince1970ToTime@8 +RtlSecondsSince1980ToTime@8 +RtlSetAllBits@4 +RtlSetBits@12 +RtlSetDaclSecurityDescriptor@16 +RtlSetGroupSecurityDescriptor@12 +RtlSetOwnerSecurityDescriptor@12 +RtlSetSaclSecurityDescriptor@16 +RtlSetTimeZoneInformation@4 +;RtlSplay +RtlSubAuthorityCountSid@4 +RtlSubAuthoritySid@8 +RtlTimeFieldsToTime@8 +RtlTimeToSecondsSince1970@8 +RtlTimeToSecondsSince1980@8 +RtlTimeToTimeFields@8 +RtlUnicodeStringToAnsiSize@4 +RtlUnicodeStringToAnsiString@12 +RtlUnicodeStringToCountedOemString@12 +RtlUnicodeStringToInteger@12 +RtlUnicodeStringToOemSize@4 +RtlUnicodeStringToOemString@12 +RtlUnicodeToCustomCPN@24 +RtlUnicodeToMultiByteN@20 +RtlUnicodeToMultiByteSize@12 +RtlUnicodeToOemN@20 +RtlUnwind@16 +RtlUpcaseUnicodeChar@4 +RtlUpcaseUnicodeString@12 +RtlUpcaseUnicodeStringToAnsiString@12 +RtlUpcaseUnicodeStringToCountedOemString@12 +RtlUpcaseUnicodeStringToOemString@12 +RtlUpcaseUnicodeToCustomCPN@24 +RtlUpcaseUnicodeToMultiByteN@20 +RtlUpcaseUnicodeToOemN@20 +RtlUpperChar@4 +RtlUpperString@8 +RtlValidSecurityDescriptor@4 +RtlValidSid@4 +RtlWriteRegistryValue@24 +;RtlZeroHeap +RtlZeroMemory@8 +RtlxAnsiStringToUnicodeSize@4 +RtlxOemStringToUnicodeSize@4 +RtlxUnicodeStringToAnsiSize@4 +RtlxUnicodeStringToOemSize@4 +SeAccessCheck@40 +;SeAppendPrivileges@8 +SeAssignSecurity@28 +;SeAuditingFileEvents@8 +;SeAuditingFileOrGlobalEvents@18 +;SeCaptureSecurityDescriptor@20 +SeCaptureSubjectContext@4 +;SeCloseObjectAuditAlarm@12 +;SeCreateAccessState@16 +SeCreateClientSecurity@16 +SeDeassignSecurity@4 +;SeDeleteAccessState@4 +;SeDeleteObjectAuditAlarm@8 +SeExports DATA +;SeFreePrivileges@4 +SeImpersonateClient@8 +;SeLockSubjectContext@4 +;SeMarkLogonSessionForTerminationNotification@4 +;SeOpenObjectAuditAlarm@36 +;SeOpenObjectForDeleteAuditAlarm@36 +SePrivilegeCheck@12 +;SePrivilegeObjectAuditAlarm@24 +SePublicDefaultDacl DATA +;SeQueryAuthenticationIdToken@8 +;SeQuerySecurityDescriptorInfo@16 +;SeRegisterLogonSessionTerminatedRoutine@4 +;SeReleaseSecurityDescriptor@12 +SeReleaseSubjectContext@4 +;SeSetAccessStateGenericMapping@8 +;SeSetSecurityDescriptorInfo@24 +SeSinglePrivilegeCheck@12 +SeSystemDefaultDacl DATA +SeTokenImpersonationLevel@4 +SeTokenType@4 +;SeUnlockSubjectContext@4 +;SeUnregisterLogonSessionTerminatedRoutine@4 +;SeValidSecurityDescriptor@8 +WRITE_REGISTER_UCHAR@8 +WRITE_REGISTER_ULONG@8 +WRITE_REGISTER_USHORT@8 +WRITE_REGISTER_BUFFER_UCHAR@12 +WRITE_REGISTER_BUFFER_ULONG@12 +WRITE_REGISTER_BUFFER_USHORT@12 +ZwAccessCheckAndAuditAlarm@44 +ZwAlertThread@4 +ZwAllocateVirtualMemory@24 +ZwClearEvent@4 +ZwClose@4 +ZwCloseObjectAuditAlarm@12 +ZwConnectPort@32 +ZwCreateDirectoryObject@12 +ZwCreateEvent@20 +ZwCreateFile@44 +ZwCreateKey@28 +ZwCreateSection@28 +ZwCreateSymbolicLinkObject@16 +ZwDeleteFile@4 +ZwDeleteKey@4 +ZwDeleteValueKey@8 +ZwDeviceIoControlFile@40 +ZwDisplayString@4 +ZwDuplicateObject@28 +ZwDuplicateToken@24 +ZwEnumerateKey@24 +ZwEnumerateValueKey@24 +ZwFlushInstructionCache@12 +ZwFlushKey@4 +ZwFreeVirtualMemory@16 +ZwFsControlFile@40 +ZwLoadDriver@4 +ZwLoadKey@8 +ZwMakeTemporaryObject@4 +ZwMapViewOfSection@40 +ZwNotifyChangeKey@40 +ZwOpenDirectoryObject@12 +ZwOpenEvent@12 +ZwOpenFile@24 +ZwOpenKey@12 +ZwOpenProcess@16 +ZwOpenProcessToken@12 +ZwOpenSection@12 +ZwOpenSymbolicLinkObject@12 +ZwOpenThread@16 +ZwOpenThreadToken@16 +ZwPulseEvent@8 +ZwQueryDefaultLocale@8 +ZwQueryDirectoryFile@44 +ZwQueryInformationAtom@20 +ZwQueryInformationFile@20 +ZwQueryInformationProcess@20 +ZwQueryInformationToken@20 +ZwQueryKey@20 +ZwQueryObject@20 +ZwQuerySection@20 +ZwQuerySecurityObject@20 +ZwQuerySymbolicLinkObject@12 +ZwQuerySystemInformation@16 +ZwQuerySystemTime@4 +ZwQueryValueKey@24 +ZwQueryVolumeInformationFile@20 +ZwReadFile@36 +ZwReplaceKey@12 +ZwRequestWaitReplyPort@12 +ZwResetEvent@8 +ZwSaveKey@8 +ZwSetDefaultLocale@8 +ZwSetEvent@8 +ZwSetInformationFile@20 +ZwSetInformationObject@16 +ZwSetInformationProcess@16 +ZwSetInformationThread@16 +ZwSetSystemInformation@12 +ZwSetSystemTime@8 +ZwSetValueKey@24 +ZwTerminateProcess@8 +ZwUnloadDriver@4 +ZwUnloadKey@4 +ZwUnmapViewOfSection@8 +ZwWaitForMultipleObjects@20 +ZwWaitForSingleObject@12 +ZwWriteFile@36 +ZwYieldExecution@0 +_abnormal_termination +_alldiv +_allmul +_allrem +_allshl +_allshr +_aulldiv +_aullrem +_aullshr +_except_handler2 +_except_handler3 +_global_unwind2 +_itoa +_local_unwind2 +_purecall +_snprintf +_snwprintf +_stricmp +_strlwr +_strnicmp +_strnset +_strrev +_strset +_strupr +_vsnprintf +_wcsicmp +_wcslwr +_wcsnicmp +_wcsnset +_wcsrev +_wcsupr +atoi +atol +isdigit +islower +isprint +isspace +isupper +isxdigit +mbstowcs +mbtowc +memchr +memcpy +memmove +memset +qsort +rand +sprintf +srand +strcat +strchr +strcmp +strcpy +strlen +strncat +strncmp +strncpy +strrchr +strspn +strstr +swprintf +tolower +toupper +towlower +towupper +vsprintf +wcscat +wcschr +wcscmp +wcscpy +wcscspn +wcslen +wcsncat +wcsncmp +wcsncpy +wcsrchr +wcsspn +wcsstr +wcstombs +wctomb