3 * initdosdev.c - Define symbolic links to kernel devices (MS-DOS names).
5 * ReactOS Operating System
7 * --------------------------------------------------------------------
9 * This software is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
14 * This software is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this software; see the file COPYING.LIB. If not, write
21 * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
24 * --------------------------------------------------------------------
32 static NTSTATUS STDCALL
33 SmpDosDevicesQueryRoutine(PWSTR ValueName
,
40 OBJECT_ATTRIBUTES ObjectAttributes
;
41 UNICODE_STRING DeviceName
;
42 UNICODE_STRING LinkName
;
47 DPRINT("ValueName '%S' Type %lu Length %lu\n", ValueName
, ValueType
, ValueLength
);
48 DPRINT("ValueData '%S'\n", (PWSTR
)ValueData
);
50 if (ValueType
!= REG_SZ
)
52 return(STATUS_SUCCESS
);
58 RtlInitUnicodeString(&LinkName
,
60 RtlInitUnicodeString(&DeviceName
,
63 DPRINT("SM: Linking %wZ --> %wZ\n",
67 /* create symbolic link */
68 InitializeObjectAttributes(&ObjectAttributes
,
70 OBJ_PERMANENT
|OBJ_CASE_INSENSITIVE
,
73 Status
= NtCreateSymbolicLinkObject(&LinkHandle
,
74 SYMBOLIC_LINK_ALL_ACCESS
,
77 if (!NT_SUCCESS(Status
))
79 DPRINT1("%s: NtCreateSymbolicLink( %wZ --> %wZ ) failed!\n",
91 SmInitDosDevices(VOID
)
93 RTL_QUERY_REGISTRY_TABLE QueryTable
[2];
96 RtlZeroMemory(&QueryTable
,
99 QueryTable
[0].QueryRoutine
= SmpDosDevicesQueryRoutine
;
101 Status
= RtlQueryRegistryValues(RTL_REGISTRY_CONTROL
,
102 L
"\\Session Manager\\DOS Devices",