mirror of
https://github.com/reactos/reactos.git
synced 2025-07-03 23:41:22 +00:00
parent
1701ae1191
commit
8948ac5248
1 changed files with 11 additions and 9 deletions
|
@ -63,8 +63,8 @@ NtCreateKey(OUT PHANDLE KeyHandle,
|
||||||
PKEY_OBJECT KeyObject;
|
PKEY_OBJECT KeyObject;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PVOID Object;
|
PVOID Object;
|
||||||
PWSTR End;
|
|
||||||
PWSTR Start;
|
PWSTR Start;
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
DPRINT("NtCreateKey (Name %wZ KeyHandle %x Root %x)\n",
|
DPRINT("NtCreateKey (Name %wZ KeyHandle %x Root %x)\n",
|
||||||
ObjectAttributes->ObjectName,
|
ObjectAttributes->ObjectName,
|
||||||
|
@ -83,7 +83,7 @@ NtCreateKey(OUT PHANDLE KeyHandle,
|
||||||
|
|
||||||
DPRINT("RemainingPath %wZ\n", &RemainingPath);
|
DPRINT("RemainingPath %wZ\n", &RemainingPath);
|
||||||
|
|
||||||
if ((RemainingPath.Buffer == NULL) || (RemainingPath.Buffer[0] == 0))
|
if (RemainingPath.Length == 0)
|
||||||
{
|
{
|
||||||
/* Fail if the key has been deleted */
|
/* Fail if the key has been deleted */
|
||||||
if (((PKEY_OBJECT) Object)->Flags & KO_MARKED_FOR_DELETE)
|
if (((PKEY_OBJECT) Object)->Flags & KO_MARKED_FOR_DELETE)
|
||||||
|
@ -110,19 +110,21 @@ NtCreateKey(OUT PHANDLE KeyHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If RemainingPath contains \ we must return error
|
/* If RemainingPath contains \ we must return error
|
||||||
because NtCreateKey don't create trees */
|
because NtCreateKey doesn't create trees */
|
||||||
Start = RemainingPath.Buffer;
|
Start = RemainingPath.Buffer;
|
||||||
if (*Start == L'\\')
|
if (*Start == L'\\')
|
||||||
Start++;
|
Start++;
|
||||||
|
|
||||||
End = wcschr(Start, L'\\');
|
for (i = 1; i < RemainingPath.Length / sizeof(WCHAR); i++)
|
||||||
if (End != NULL)
|
{
|
||||||
|
if (L'\\' == RemainingPath.Buffer[i])
|
||||||
{
|
{
|
||||||
ObDereferenceObject(Object);
|
ObDereferenceObject(Object);
|
||||||
DPRINT1("NtCreateKey() can't create trees! (found \'\\\' in remaining path: \"%wZ\"!)\n", &RemainingPath);
|
DPRINT1("NtCreateKey() doesn't create trees! (found \'\\\' in remaining path: \"%wZ\"!)\n", &RemainingPath);
|
||||||
RtlFreeUnicodeString(&RemainingPath);
|
RtlFreeUnicodeString(&RemainingPath);
|
||||||
return STATUS_OBJECT_NAME_NOT_FOUND;
|
return STATUS_OBJECT_NAME_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DPRINT("RemainingPath %S ParentObject %x\n", RemainingPath.Buffer, Object);
|
DPRINT("RemainingPath %S ParentObject %x\n", RemainingPath.Buffer, Object);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue