- Assign an instance path to the root device node and reports its arrival.

svn path=/trunk/; revision=13456
This commit is contained in:
Eric Kohl 2005-02-07 10:33:44 +00:00
parent e4e9497fb0
commit 30b7d49ae6
12 changed files with 159 additions and 141 deletions

View file

@ -207,32 +207,32 @@ IopCheckCdromDevices(PULONG DeviceNumber)
NULL,
NULL);
Status = NtOpenFile(&Handle,
Status = ZwOpenFile(&Handle,
FILE_ALL_ACCESS,
&ObjectAttributes,
&IoStatusBlock,
0,
0);
DPRINT("NtOpenFile() DeviceNumber %lu Status %lx\n", i, Status);
DPRINT("ZwOpenFile() DeviceNumber %lu Status %lx\n", i, Status);
if (NT_SUCCESS(Status))
{
Status = NtQueryVolumeInformationFile(Handle,
Status = ZwQueryVolumeInformationFile(Handle,
&IoStatusBlock,
FileFsVolume,
FS_VOLUME_BUFFER_SIZE,
FileFsVolumeInformation);
DPRINT("NtQueryVolumeInformationFile() Status %lx\n", Status);
DPRINT("ZwQueryVolumeInformationFile() Status %lx\n", Status);
if (NT_SUCCESS(Status))
{
DPRINT("VolumeLabel: '%S'\n", FileFsVolume->VolumeLabel);
if (_wcsicmp(FileFsVolume->VolumeLabel, L"REACTOS") == 0)
{
NtClose(Handle);
ZwClose(Handle);
*DeviceNumber = i;
return(STATUS_SUCCESS);
}
}
NtClose(Handle);
ZwClose(Handle);
}
#endif
@ -252,17 +252,17 @@ IopCheckCdromDevices(PULONG DeviceNumber)
NULL,
NULL);
Status = NtOpenFile(&Handle,
Status = ZwOpenFile(&Handle,
FILE_ALL_ACCESS,
&ObjectAttributes,
&IoStatusBlock,
0,
0);
DPRINT("NtOpenFile() DeviceNumber %lu Status %lx\n", i, Status);
DPRINT("ZwOpenFile() DeviceNumber %lu Status %lx\n", i, Status);
if (NT_SUCCESS(Status))
{
DPRINT("Found ntoskrnl.exe on Cdrom%lu\n", i);
NtClose(Handle);
ZwClose(Handle);
*DeviceNumber = i;
return(STATUS_SUCCESS);
}
@ -283,17 +283,17 @@ IopCheckCdromDevices(PULONG DeviceNumber)
NULL,
NULL);
Status = NtOpenFile(&Handle,
Status = ZwOpenFile(&Handle,
FILE_ALL_ACCESS,
&ObjectAttributes,
&IoStatusBlock,
0,
0);
DPRINT("NtOpenFile() DeviceNumber %lu Status %lx\n", i, Status);
DPRINT("ZwOpenFile() DeviceNumber %lu Status %lx\n", i, Status);
if (NT_SUCCESS(Status))
{
DPRINT("Found ntoskrnl.exe on Cdrom%lu\n", i);
NtClose(Handle);
ZwClose(Handle);
*DeviceNumber = i;
return(STATUS_SUCCESS);
}
@ -407,14 +407,14 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
NULL,
NULL);
Status = NtOpenSymbolicLinkObject(&Handle,
Status = ZwOpenSymbolicLinkObject(&Handle,
SYMBOLIC_LINK_ALL_ACCESS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
RtlFreeUnicodeString(&BootPath);
RtlFreeUnicodeString(&DeviceName);
CPRINT("NtOpenSymbolicLinkObject() '%wZ' failed (Status %x)\n",
CPRINT("ZwOpenSymbolicLinkObject() '%wZ' failed (Status %x)\n",
&ArcName,
Status);
RtlFreeUnicodeString(&ArcName);
@ -423,15 +423,15 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
}
RtlFreeUnicodeString(&ArcName);
Status = NtQuerySymbolicLinkObject(Handle,
Status = ZwQuerySymbolicLinkObject(Handle,
&DeviceName,
&Length);
NtClose (Handle);
ZwClose (Handle);
if (!NT_SUCCESS(Status))
{
RtlFreeUnicodeString(&BootPath);
RtlFreeUnicodeString(&DeviceName);
CPRINT("NtQuerySymbolicObject() failed (Status %x)\n",
CPRINT("ZwQuerySymbolicObject() failed (Status %x)\n",
Status);
return(Status);
@ -466,7 +466,7 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
NULL,
NULL);
Status = NtOpenFile(&Handle,
Status = ZwOpenFile(&Handle,
FILE_ALL_ACCESS,
&ObjectAttributes,
&IoStatusBlock,
@ -474,12 +474,12 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
0);
if (!NT_SUCCESS(Status))
{
CPRINT("NtOpenFile() failed to open '\\SystemRoot' (Status %x)\n",
CPRINT("ZwOpenFile() failed to open '\\SystemRoot' (Status %x)\n",
Status);
return(Status);
}
NtClose(Handle);
ZwClose(Handle);
return(STATUS_SUCCESS);
}

View file

@ -86,12 +86,12 @@ IopBootLog(PUNICODE_STRING DriverName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtOpenKey(&ControlSetKey,
Status = ZwOpenKey(&ControlSetKey,
KEY_ALL_ACCESS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
DPRINT1("ZwOpenKey() failed (Status %lx)\n", Status);
ExReleaseResourceLite(&IopBootLogResource);
return;
}
@ -102,7 +102,7 @@ IopBootLog(PUNICODE_STRING DriverName,
OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
ControlSetKey,
NULL);
Status = NtCreateKey(&BootLogKey,
Status = ZwCreateKey(&BootLogKey,
KEY_ALL_ACCESS,
&ObjectAttributes,
0,
@ -111,21 +111,21 @@ IopBootLog(PUNICODE_STRING DriverName,
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
NtClose(ControlSetKey);
DPRINT1("ZwCreateKey() failed (Status %lx)\n", Status);
ZwClose(ControlSetKey);
ExReleaseResourceLite(&IopBootLogResource);
return;
}
RtlInitUnicodeString(&ValueName, ValueNameBuffer);
Status = NtSetValueKey(BootLogKey,
Status = ZwSetValueKey(BootLogKey,
&ValueName,
0,
REG_SZ,
(PVOID)Buffer,
(wcslen(Buffer) + 1) * sizeof(WCHAR));
NtClose(BootLogKey);
NtClose(ControlSetKey);
ZwClose(BootLogKey);
ZwClose(ControlSetKey);
if (!NT_SUCCESS(Status))
{
@ -160,7 +160,7 @@ IopWriteLogFile(PWSTR LogText)
NULL,
NULL);
Status = NtCreateFile(&FileHandle,
Status = ZwCreateFile(&FileHandle,
FILE_APPEND_DATA,
&ObjectAttributes,
&IoStatusBlock,
@ -173,13 +173,13 @@ IopWriteLogFile(PWSTR LogText)
0);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtCreateFile() failed (Status %lx)\n", Status);
DPRINT1("ZwCreateFile() failed (Status %lx)\n", Status);
return Status;
}
if (LogText != NULL)
{
Status = NtWriteFile(FileHandle,
Status = ZwWriteFile(FileHandle,
NULL,
NULL,
NULL,
@ -190,14 +190,14 @@ IopWriteLogFile(PWSTR LogText)
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtWriteFile() failed (Status %lx)\n", Status);
NtClose(FileHandle);
DPRINT1("ZwWriteFile() failed (Status %lx)\n", Status);
ZwClose(FileHandle);
return Status;
}
}
/* L"\r\n" */
Status = NtWriteFile(FileHandle,
Status = ZwWriteFile(FileHandle,
NULL,
NULL,
NULL,
@ -207,11 +207,11 @@ IopWriteLogFile(PWSTR LogText)
NULL,
NULL);
NtClose(FileHandle);
ZwClose(FileHandle);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtWriteFile() failed (Status %lx)\n", Status);
DPRINT1("ZwWriteFile() failed (Status %lx)\n", Status);
}
return Status;
@ -241,7 +241,7 @@ IopCreateLogFile(VOID)
NULL,
NULL);
Status = NtCreateFile(&FileHandle,
Status = ZwCreateFile(&FileHandle,
FILE_ALL_ACCESS,
&ObjectAttributes,
&IoStatusBlock,
@ -254,14 +254,14 @@ IopCreateLogFile(VOID)
0);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtCreateFile() failed (Status %lx)\n", Status);
DPRINT1("ZwCreateFile() failed (Status %lx)\n", Status);
return Status;
}
ByteOffset.QuadPart = (LONGLONG)0;
Signature = 0xFEFF;
Status = NtWriteFile(FileHandle,
Status = ZwWriteFile(FileHandle,
NULL,
NULL,
NULL,
@ -272,10 +272,10 @@ IopCreateLogFile(VOID)
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtWriteKey() failed (Status %lx)\n", Status);
DPRINT1("ZwWriteKey() failed (Status %lx)\n", Status);
}
NtClose(FileHandle);
ZwClose(FileHandle);
return Status;
}
@ -344,7 +344,7 @@ IopSaveBootLogToFile(VOID)
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtOpenKey(&KeyHandle,
Status = ZwOpenKey(&KeyHandle,
KEY_ALL_ACCESS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
@ -363,7 +363,7 @@ IopSaveBootLogToFile(VOID)
RtlInitUnicodeString(&ValueName,
ValueNameBuffer);
Status = NtQueryValueKey(KeyHandle,
Status = ZwQueryValueKey(KeyHandle,
&ValueName,
KeyValuePartialInformation,
KeyInfo,
@ -377,7 +377,7 @@ IopSaveBootLogToFile(VOID)
if (!NT_SUCCESS(Status))
{
CHECKPOINT1;
NtClose(KeyHandle);
ZwClose(KeyHandle);
ExFreePool(KeyInfo);
ExReleaseResourceLite(&IopBootLogResource);
return;
@ -387,18 +387,18 @@ IopSaveBootLogToFile(VOID)
if (!NT_SUCCESS(Status))
{
CHECKPOINT1;
NtClose(KeyHandle);
ZwClose(KeyHandle);
ExFreePool(KeyInfo);
ExReleaseResourceLite(&IopBootLogResource);
return;
}
/* Delete keys */
NtDeleteValueKey(KeyHandle,
ZwDeleteValueKey(KeyHandle,
&ValueName);
}
NtClose(KeyHandle);
ZwClose(KeyHandle);
ExFreePool(KeyInfo);

View file

@ -339,7 +339,7 @@ IoGetDeviceObjectPointer(
NULL,
NULL);
Status = NtOpenFile(
Status = ZwOpenFile(
&FileHandle,
DesiredAccess,
&ObjectAttributes,
@ -364,7 +364,7 @@ IoGetDeviceObjectPointer(
*FileObject = LocalFileObject;
}
NtClose(FileHandle);
ZwClose(FileHandle);
return Status;
}

View file

@ -959,7 +959,7 @@ IoCreateDriverList(VOID)
NULL,
NULL);
Status = NtOpenKey(&KeyHandle,
Status = ZwOpenKey(&KeyHandle,
0x10001,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
@ -971,14 +971,14 @@ IoCreateDriverList(VOID)
KeyInfo = ExAllocatePool(NonPagedPool, KeyInfoLength);
if (KeyInfo == NULL)
{
NtClose(KeyHandle);
ZwClose(KeyHandle);
return(STATUS_INSUFFICIENT_RESOURCES);
}
Index = 0;
while (TRUE)
{
Status = NtEnumerateKey(KeyHandle,
Status = ZwEnumerateKey(KeyHandle,
Index,
KeyBasicInformation,
KeyInfo,
@ -1006,7 +1006,7 @@ IoCreateDriverList(VOID)
}
ExFreePool(KeyInfo);
NtClose(KeyHandle);
ZwClose(KeyHandle);
DPRINT("IoCreateDriverList() done\n");
@ -1270,7 +1270,7 @@ IopLoadDriver(PSERVICE Service)
NTSTATUS Status = STATUS_UNSUCCESSFUL;
IopDisplayLoadingMessage(Service->ServiceName.Buffer);
Status = NtLoadDriver(&Service->RegistryPath);
Status = ZwLoadDriver(&Service->RegistryPath);
IopBootLog(&Service->ImagePath, NT_SUCCESS(Status) ? TRUE : FALSE);
if (!NT_SUCCESS(Status))
{

View file

@ -135,7 +135,7 @@ IopConnectLogPort (VOID)
RtlInitUnicodeString (&PortName,
L"\\ErrorLogPort");
Status = NtConnectPort (&IopLogPort,
Status = ZwConnectPort (&IopLogPort,
&PortName,
NULL,
NULL,
@ -145,7 +145,7 @@ IopConnectLogPort (VOID)
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT ("NtConnectPort() failed (Status %lx)\n", Status);
DPRINT ("ZwConnectPort() failed (Status %lx)\n", Status);
return FALSE;
}
@ -290,7 +290,7 @@ IopLogWorker (PVOID Parameter)
Request->Header.DataSize + sizeof(LPC_MESSAGE);
/* Send the error message to the log port */
Status = NtRequestPort (IopLogPort,
Status = ZwRequestPort (IopLogPort,
&Request->Header);
/* Release request buffer */
@ -298,7 +298,7 @@ IopLogWorker (PVOID Parameter)
if (!NT_SUCCESS(Status))
{
DPRINT ("NtRequestPort() failed (Status %lx)\n", Status);
DPRINT ("ZwRequestPort() failed (Status %lx)\n", Status);
/* Requeue log message and restart the worker */
ExInterlockedInsertTailList (&IopLogListHead,

View file

@ -32,14 +32,14 @@ static GENERIC_MAPPING ExIoCompletionMapping =
NTSTATUS
STDCALL
NtpCreateIoCompletion(
IopCreateIoCompletion(
PVOID ObjectBody,
PVOID Parent,
PWSTR RemainingPath,
POBJECT_ATTRIBUTES ObjectAttributes
)
{
DPRINT("NtpCreateIoCompletion(ObjectBody %x, Parent %x, RemainingPath %S)\n",
DPRINT("IopCreateIoCompletion(ObjectBody %x, Parent %x, RemainingPath %S)\n",
ObjectBody, Parent, RemainingPath);
if (RemainingPath != NULL && wcschr(RemainingPath+1, '\\') != NULL)
@ -51,11 +51,11 @@ NtpCreateIoCompletion(
}
VOID STDCALL
NtpDeleteIoCompletion(PVOID ObjectBody)
IopDeleteIoCompletion(PVOID ObjectBody)
{
PKQUEUE Queue = ObjectBody;
DPRINT("NtpDeleteIoCompletion()\n");
DPRINT("IopDeleteIoCompletion()\n");
KeRundownQueue(Queue);
}
@ -132,12 +132,12 @@ IopInitIoCompletionImplementation(VOID)
ExIoCompletionType->Dump = NULL;
ExIoCompletionType->Open = NULL;
ExIoCompletionType->Close = NULL;
ExIoCompletionType->Delete = NtpDeleteIoCompletion;
ExIoCompletionType->Delete = IopDeleteIoCompletion;
ExIoCompletionType->Parse = NULL;
ExIoCompletionType->Security = NULL;
ExIoCompletionType->QueryName = NULL;
ExIoCompletionType->OkayToClose = NULL;
ExIoCompletionType->Create = NtpCreateIoCompletion;
ExIoCompletionType->Create = IopCreateIoCompletion;
ExIoCompletionType->DuplicationNotify = NULL;
ExInitializeNPagedLookasideList(&IoCompletionPacketLookaside,

View file

@ -465,7 +465,7 @@ IoInit (VOID)
0,
NULL,
NULL);
NtCreateDirectoryObject(&Handle,
ZwCreateDirectoryObject(&Handle,
0,
&ObjectAttributes);
@ -479,7 +479,7 @@ IoInit (VOID)
0,
NULL,
NULL);
NtCreateDirectoryObject(&Handle,
ZwCreateDirectoryObject(&Handle,
0,
&ObjectAttributes);

View file

@ -791,7 +791,7 @@ IopCreateDeviceKeyPath(PWSTR Path,
DPRINT("Create '%S'\n", KeyName.Buffer);
Status = NtCreateKey (&KeyHandle,
Status = ZwCreateKey (&KeyHandle,
KEY_ALL_ACCESS,
&ObjectAttributes,
0,
@ -800,7 +800,7 @@ IopCreateDeviceKeyPath(PWSTR Path,
NULL);
if (!NT_SUCCESS (Status))
{
DPRINT ("NtCreateKey() failed with status %x\n", Status);
DPRINT ("ZwCreateKey() failed with status %x\n", Status);
return Status;
}
@ -811,7 +811,7 @@ IopCreateDeviceKeyPath(PWSTR Path,
}
else
{
NtClose (KeyHandle);
ZwClose (KeyHandle);
*Next = L'\\';
}
@ -843,7 +843,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
OBJ_CASE_INSENSITIVE,
InstanceKey,
NULL);
Status = NtCreateKey(&LogConfKey,
Status = ZwCreateKey(&LogConfKey,
KEY_ALL_ACCESS,
&ObjectAttributes,
0,
@ -862,7 +862,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
RtlInitUnicodeString(&KeyName,
L"BootConfig");
Status = NtSetValueKey(LogConfKey,
Status = ZwSetValueKey(LogConfKey,
&KeyName,
0,
REG_RESOURCE_LIST,
@ -877,7 +877,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
{
RtlInitUnicodeString(&KeyName,
L"BasicConfigVector");
Status = NtSetValueKey(LogConfKey,
Status = ZwSetValueKey(LogConfKey,
&KeyName,
0,
REG_RESOURCE_REQUIREMENTS_LIST,
@ -885,7 +885,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
DeviceNode->ResourceRequirements->ListSize);
}
NtClose(LogConfKey);
ZwClose(LogConfKey);
}
DPRINT("IopSetDeviceInstanceData() done\n");
@ -1069,7 +1069,7 @@ IopActionInterrogateDeviceStack(
/* Set 'Capabilities' value */
RtlInitUnicodeString(&ValueName,
L"Capabilities");
Status = NtSetValueKey(InstanceKey,
Status = ZwSetValueKey(InstanceKey,
&ValueName,
0,
REG_DWORD,
@ -1081,7 +1081,7 @@ IopActionInterrogateDeviceStack(
{
RtlInitUnicodeString(&ValueName,
L"UINumber");
Status = NtSetValueKey(InstanceKey,
Status = ZwSetValueKey(InstanceKey,
&ValueName,
0,
REG_DWORD,
@ -1120,7 +1120,7 @@ IopActionInterrogateDeviceStack(
RtlInitUnicodeString(&ValueName,
L"HardwareID");
Status = NtSetValueKey(InstanceKey,
Status = ZwSetValueKey(InstanceKey,
&ValueName,
0,
REG_MULTI_SZ,
@ -1128,7 +1128,7 @@ IopActionInterrogateDeviceStack(
(TotalLength + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
DPRINT1("ZwSetValueKey() failed (Status %lx)\n", Status);
}
}
else
@ -1166,7 +1166,7 @@ IopActionInterrogateDeviceStack(
RtlInitUnicodeString(&ValueName,
L"CompatibleIDs");
Status = NtSetValueKey(InstanceKey,
Status = ZwSetValueKey(InstanceKey,
&ValueName,
0,
REG_MULTI_SZ,
@ -1174,7 +1174,7 @@ IopActionInterrogateDeviceStack(
(TotalLength + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
DPRINT1("ZwSetValueKey() failed (Status %lx)\n", Status);
}
}
else
@ -1196,7 +1196,7 @@ IopActionInterrogateDeviceStack(
{
RtlInitUnicodeString(&ValueName,
L"DeviceDesc");
Status = NtSetValueKey(InstanceKey,
Status = ZwSetValueKey(InstanceKey,
&ValueName,
0,
REG_SZ,
@ -1204,7 +1204,7 @@ IopActionInterrogateDeviceStack(
(wcslen((PWSTR)IoStatusBlock.Information) + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
DPRINT1("ZwSetValueKey() failed (Status %lx)\n", Status);
}
}
else
@ -1226,7 +1226,7 @@ IopActionInterrogateDeviceStack(
DPRINT("LocationInformation: %S\n", (PWSTR)IoStatusBlock.Information);
RtlInitUnicodeString(&ValueName,
L"LocationInformation");
Status = NtSetValueKey(InstanceKey,
Status = ZwSetValueKey(InstanceKey,
&ValueName,
0,
REG_SZ,
@ -1234,7 +1234,7 @@ IopActionInterrogateDeviceStack(
(wcslen((PWSTR)IoStatusBlock.Information) + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
DPRINT1("ZwSetValueKey() failed (Status %lx)\n", Status);
}
}
else
@ -1315,7 +1315,7 @@ IopActionInterrogateDeviceStack(
IopSetDeviceInstanceData(InstanceKey, DeviceNode);
}
NtClose(InstanceKey);
ZwClose(InstanceKey);
DeviceNode->Flags |= DNF_PROCESSED;
@ -1733,7 +1733,7 @@ IopInvalidateDeviceRelations(
NULL,
NULL);
Status = NtOpenFile(
Status = ZwOpenFile(
&Handle,
FILE_ALL_ACCESS,
&ObjectAttributes,
@ -1743,7 +1743,7 @@ IopInvalidateDeviceRelations(
BootDrivers = NT_SUCCESS(Status) ? FALSE : TRUE;
NtClose(Handle);
ZwClose(Handle);
/*
* Initialize services for discovered children. Only boot drivers will
@ -1805,6 +1805,18 @@ PnpInit(VOID)
KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
}
if (!IopCreateUnicodeString(&IopRootDeviceNode->InstancePath,
L"HTREE\\Root\\0",
PagedPool))
{
CPRINT("Failed to create the instance path!\n");
KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, STATUS_UNSUCCESSFUL, 0, 0, 0);
}
/* Report the device to the user-mode pnp manager */
IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
&IopRootDeviceNode->InstancePath);
IopRootDeviceNode->PhysicalDeviceObject->Flags |= DO_BUS_ENUMERATED_DEVICE;
PnpRootDriverEntry(IopRootDriverObject, NULL);
IopRootDriverObject->DriverExtension->AddDevice(

View file

@ -20,7 +20,8 @@
/* DATA **********************************************************************/
typedef struct _PNPROOT_DEVICE {
typedef struct _PNPROOT_DEVICE
{
// Entry on device list
LIST_ENTRY ListEntry;
// Physical Device Object of device
@ -35,7 +36,8 @@ typedef struct _PNPROOT_DEVICE {
UNICODE_STRING DeviceDescription;
} PNPROOT_DEVICE, *PPNPROOT_DEVICE;
typedef enum {
typedef enum
{
dsStopped,
dsStarted,
dsPaused,
@ -285,10 +287,6 @@ PdoQueryResourceRequirements(
}
NTSTATUS
PnpRootPdoPnpControl(
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
/*
* FUNCTION: Handle Plug and Play IRPs for the child device
* ARGUMENTS:
@ -297,6 +295,10 @@ PnpRootPdoPnpControl(
* RETURNS:
* Status
*/
NTSTATUS
PnpRootPdoPnpControl(
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
PIO_STACK_LOCATION IrpSp;
NTSTATUS Status;
@ -353,10 +355,7 @@ PnpRootPdoPnpControl(
return Status;
}
NTSTATUS
PnpRootPdoPowerControl(
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
/*
* FUNCTION: Handle power management IRPs for the child device
* ARGUMENTS:
@ -365,6 +364,10 @@ PnpRootPdoPowerControl(
* RETURNS:
* Status
*/
NTSTATUS
PnpRootPdoPowerControl(
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
PIO_STACK_LOCATION IrpSp;
NTSTATUS Status;
@ -484,10 +487,10 @@ PnpRootFdoEnumerateDevices(
NULL,
NULL);
Status = NtOpenKey(&KeyHandle, KEY_ALL_ACCESS, &ObjectAttributes);
Status = ZwOpenKey(&KeyHandle, KEY_ALL_ACCESS, &ObjectAttributes);
if (!NT_SUCCESS(Status))
{
DPRINT("NtOpenKey() failed (Status %x)\n", Status);
DPRINT("ZwOpenKey() failed (Status %x)\n", Status);
ExFreePool(KeyInfo);
return Status;
}
@ -570,7 +573,7 @@ PnpRootFdoEnumerateDevices(
DPRINT("Entries found: %d\n", Index);
NtClose(KeyHandle);
ZwClose(KeyHandle);
ExFreePool(KeyInfo);
@ -668,8 +671,8 @@ PnpRootQueryBusRelations(
/* FIXME: */
}
DPRINT("DeviceID: %S PDO %x\n",
PdoDeviceExtension->DeviceID.Buffer,
DPRINT1("DeviceID: %wZ PDO %p\n",
&PdoDeviceExtension->DeviceID,
Device->Pdo);
if (!IopCreateUnicodeString(
@ -681,6 +684,9 @@ PnpRootQueryBusRelations(
/* FIXME: */
}
DPRINT1("InstanceID: %wZ PDO %p\n",
&PdoDeviceExtension->InstanceID,
Device->Pdo);
}
/* Reference the physical device object. The PnP manager
@ -730,11 +736,6 @@ PnpRootQueryDeviceRelations(
}
NTSTATUS
STDCALL
PnpRootFdoPnpControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
/*
* FUNCTION: Handle Plug and Play IRPs for the root bus device object
* ARGUMENTS:
@ -743,6 +744,11 @@ PnpRootFdoPnpControl(
* RETURNS:
* Status
*/
NTSTATUS
STDCALL
PnpRootFdoPnpControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension;
PIO_STACK_LOCATION IrpSp;
@ -788,11 +794,6 @@ PnpRootFdoPnpControl(
}
NTSTATUS
STDCALL
PnpRootFdoPowerControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
/*
* FUNCTION: Handle power management IRPs for the root bus device object
* ARGUMENTS:
@ -801,6 +802,11 @@ PnpRootFdoPowerControl(
* RETURNS:
* Status
*/
NTSTATUS
STDCALL
PnpRootFdoPowerControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PIO_STACK_LOCATION IrpSp;
NTSTATUS Status;
@ -827,11 +833,6 @@ PnpRootFdoPowerControl(
}
NTSTATUS
STDCALL
PnpRootPnpControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
/*
* FUNCTION: Handle Plug and Play IRPs
* ARGUMENTS:
@ -840,6 +841,11 @@ PnpRootPnpControl(
* RETURNS:
* Status
*/
NTSTATUS
STDCALL
PnpRootPnpControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PPNPROOT_COMMON_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
@ -861,11 +867,6 @@ PnpRootPnpControl(
}
NTSTATUS
STDCALL
PnpRootPowerControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
/*
* FUNCTION: Handle power management IRPs
* ARGUMENTS:
@ -874,6 +875,11 @@ PnpRootPowerControl(
* RETURNS:
* Status
*/
NTSTATUS
STDCALL
PnpRootPowerControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PPNPROOT_COMMON_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;

View file

@ -836,7 +836,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
0,
NULL);
Status = NtCreateKey(&ResourcemapKey,
Status = ZwCreateKey(&ResourcemapKey,
KEY_ALL_ACCESS,
&ObjectAttributes,
0,
@ -854,14 +854,14 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
ResourcemapKey,
NULL);
Status = NtCreateKey(&HalKey,
Status = ZwCreateKey(&HalKey,
KEY_ALL_ACCESS,
&ObjectAttributes,
0,
NULL,
REG_OPTION_VOLATILE,
&Disposition);
NtClose(ResourcemapKey);
ZwClose(ResourcemapKey);
if (!NT_SUCCESS(Status))
return(Status);
@ -871,21 +871,21 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
OBJ_CASE_INSENSITIVE,
HalKey,
NULL);
Status = NtCreateKey(&DescriptionKey,
Status = ZwCreateKey(&DescriptionKey,
KEY_ALL_ACCESS,
&ObjectAttributes,
0,
NULL,
REG_OPTION_VOLATILE,
&Disposition);
NtClose(HalKey);
ZwClose(HalKey);
if (!NT_SUCCESS(Status))
return(Status);
/* Add '.Raw' value. */
RtlRosInitUnicodeStringFromLiteral(&Name,
L".Raw");
Status = NtSetValueKey(DescriptionKey,
Status = ZwSetValueKey(DescriptionKey,
&Name,
0,
REG_RESOURCE_LIST,
@ -893,20 +893,20 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
ListSize);
if (!NT_SUCCESS(Status))
{
NtClose(DescriptionKey);
ZwClose(DescriptionKey);
return(Status);
}
/* Add '.Translated' value. */
RtlRosInitUnicodeStringFromLiteral(&Name,
L".Translated");
Status = NtSetValueKey(DescriptionKey,
Status = ZwSetValueKey(DescriptionKey,
&Name,
0,
REG_RESOURCE_LIST,
TranslatedList,
ListSize);
NtClose(DescriptionKey);
ZwClose(DescriptionKey);
return(Status);
}

View file

@ -51,17 +51,17 @@ IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName,
NULL,
SePublicDefaultSd);
Status = NtCreateSymbolicLinkObject(&Handle,
Status = ZwCreateSymbolicLinkObject(&Handle,
SYMBOLIC_LINK_ALL_ACCESS,
&ObjectAttributes,
DeviceName);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtCreateSymbolicLinkObject() failed (Status %lx)\n", Status);
DPRINT1("ZwCreateSymbolicLinkObject() failed (Status %lx)\n", Status);
return(Status);
}
NtClose(Handle);
ZwClose(Handle);
return(STATUS_SUCCESS);
}
@ -120,17 +120,17 @@ IoCreateUnprotectedSymbolicLink(PUNICODE_STRING SymbolicLinkName,
NULL,
&SecurityDescriptor);
Status = NtCreateSymbolicLinkObject(&Handle,
Status = ZwCreateSymbolicLinkObject(&Handle,
SYMBOLIC_LINK_ALL_ACCESS,
&ObjectAttributes,
DeviceName);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtCreateSymbolicLinkObject() failed (Status %lx)\n", Status);
DPRINT1("ZwCreateSymbolicLinkObject() failed (Status %lx)\n", Status);
return(Status);
}
NtClose(Handle);
ZwClose(Handle);
return(STATUS_SUCCESS);
}
@ -168,14 +168,14 @@ IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName)
NULL,
NULL);
Status = NtOpenSymbolicLinkObject(&Handle,
Status = ZwOpenSymbolicLinkObject(&Handle,
SYMBOLIC_LINK_ALL_ACCESS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
return(Status);
Status = NtMakeTemporaryObject(Handle);
NtClose(Handle);
Status = ZwMakeTemporaryObject(Handle);
ZwClose(Handle);
return(Status);
}

View file

@ -446,7 +446,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
NULL,
NULL);
Status = NtOpenFile(&FileHandle,
Status = ZwOpenFile(&FileHandle,
0x10001,
&ObjectAttributes,
&StatusBlock,
@ -454,7 +454,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
FILE_SYNCHRONOUS_IO_NONALERT);
if (NT_SUCCESS(Status))
{
NtClose(FileHandle);
ZwClose(FileHandle);
swprintf(Buffer2,
L"\\??\\PhysicalDrive%d",