mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Add support for FILE_AUTOGENERATED_DEVICE_NAME to IoCreateDevice.
svn path=/trunk/; revision=11664
This commit is contained in:
parent
3b5c8f81f3
commit
d0da55a427
1 changed files with 15 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: device.c,v 1.83 2004/11/06 04:12:59 ion Exp $
|
||||
/* $Id: device.c,v 1.84 2004/11/15 11:41:33 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -19,6 +19,8 @@
|
|||
|
||||
#define TAG_DEVICE_EXTENSION TAG('D', 'E', 'X', 'T')
|
||||
|
||||
static ULONG IopDeviceObjectNumber = 0;
|
||||
|
||||
/* PRIVATE FUNCTIONS **********************************************************/
|
||||
|
||||
NTSTATUS FASTCALL
|
||||
|
@ -532,6 +534,8 @@ IoCreateDevice(
|
|||
BOOLEAN Exclusive,
|
||||
PDEVICE_OBJECT *DeviceObject)
|
||||
{
|
||||
WCHAR AutoNameBuffer[20];
|
||||
UNICODE_STRING AutoName;
|
||||
PDEVICE_OBJECT CreatedDeviceObject;
|
||||
PDEVOBJ_EXTENSION DeviceObjectExtension;
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
|
@ -549,6 +553,16 @@ IoCreateDevice(
|
|||
DPRINT("IoCreateDevice(DriverObject %x)\n",DriverObject);
|
||||
}
|
||||
|
||||
if (DeviceCharacteristics & FILE_AUTOGENERATED_DEVICE_NAME)
|
||||
{
|
||||
swprintf(AutoNameBuffer,
|
||||
L"\\Device\\%08lx",
|
||||
InterlockedIncrement(&IopDeviceObjectNumber));
|
||||
RtlInitUnicodeString(&AutoName,
|
||||
AutoNameBuffer);
|
||||
DeviceName = &AutoName;
|
||||
}
|
||||
|
||||
if (DeviceName != NULL)
|
||||
{
|
||||
InitializeObjectAttributes(&ObjectAttributes, DeviceName, 0, NULL, NULL);
|
||||
|
|
Loading…
Reference in a new issue