mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 18:24:24 +00:00
- Get rid of the intriguing idea that exported/public APIs should have prototypes with inversed parameters (fix ObOpenObjectByName and all its callers).
- Isolate ObFindObject into CmFindObject for the registry routines. Because of their well-known abuse of Ob, it's better to give them their internal routine so that when/if Ob ever gets fixed to parse properly, it won't force a re-write of Cm's object routines. svn path=/trunk/; revision=22047
This commit is contained in:
parent
facb8f26f0
commit
340a5ed71a
|
@ -9535,10 +9535,10 @@ DDKAPI
|
||||||
ObOpenObjectByName(
|
ObOpenObjectByName(
|
||||||
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
IN POBJECT_TYPE ObjectType,
|
IN POBJECT_TYPE ObjectType,
|
||||||
IN OUT PVOID ParseContext OPTIONAL,
|
|
||||||
IN KPROCESSOR_MODE AccessMode,
|
IN KPROCESSOR_MODE AccessMode,
|
||||||
IN ACCESS_MASK DesiredAccess,
|
|
||||||
IN PACCESS_STATE PassedAccessState,
|
IN PACCESS_STATE PassedAccessState,
|
||||||
|
IN ACCESS_MASK DesiredAccess,
|
||||||
|
IN OUT PVOID ParseContext OPTIONAL,
|
||||||
OUT PHANDLE Handle);
|
OUT PHANDLE Handle);
|
||||||
|
|
||||||
NTOSAPI
|
NTOSAPI
|
||||||
|
|
|
@ -708,4 +708,15 @@ NTSTATUS
|
||||||
CmiSaveTempHive (PREGISTRY_HIVE Hive,
|
CmiSaveTempHive (PREGISTRY_HIVE Hive,
|
||||||
HANDLE FileHandle);
|
HANDLE FileHandle);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
CmFindObject(
|
||||||
|
POBJECT_CREATE_INFORMATION ObjectCreateInfo,
|
||||||
|
PUNICODE_STRING ObjectName,
|
||||||
|
PVOID* ReturnedObject,
|
||||||
|
PUNICODE_STRING RemainingPath,
|
||||||
|
POBJECT_TYPE ObjectType,
|
||||||
|
IN PACCESS_STATE AccessState,
|
||||||
|
IN PVOID ParseContext
|
||||||
|
);
|
||||||
#endif /*__INCLUDE_CM_H*/
|
#endif /*__INCLUDE_CM_H*/
|
||||||
|
|
|
@ -199,7 +199,6 @@ NtCreateKey(OUT PHANDLE KeyHandle,
|
||||||
KPROCESSOR_MODE PreviousMode;
|
KPROCESSOR_MODE PreviousMode;
|
||||||
UNICODE_STRING CapturedClass = {0};
|
UNICODE_STRING CapturedClass = {0};
|
||||||
HANDLE hKey;
|
HANDLE hKey;
|
||||||
OBP_LOOKUP_CONTEXT Context;
|
|
||||||
|
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
@ -259,12 +258,11 @@ NtCreateKey(OUT PHANDLE KeyHandle,
|
||||||
goto Cleanup;
|
goto Cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = ObFindObject(&ObjectCreateInfo,
|
Status = CmFindObject(&ObjectCreateInfo,
|
||||||
&ObjectName,
|
&ObjectName,
|
||||||
(PVOID*)&Object,
|
(PVOID*)&Object,
|
||||||
&RemainingPath,
|
&RemainingPath,
|
||||||
CmiKeyType,
|
CmiKeyType,
|
||||||
&Context,
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -1266,7 +1264,6 @@ NtOpenKey(OUT PHANDLE KeyHandle,
|
||||||
OBJECT_CREATE_INFORMATION ObjectCreateInfo;
|
OBJECT_CREATE_INFORMATION ObjectCreateInfo;
|
||||||
REG_PRE_OPEN_KEY_INFORMATION PreOpenKeyInfo;
|
REG_PRE_OPEN_KEY_INFORMATION PreOpenKeyInfo;
|
||||||
REG_POST_OPEN_KEY_INFORMATION PostOpenKeyInfo;
|
REG_POST_OPEN_KEY_INFORMATION PostOpenKeyInfo;
|
||||||
OBP_LOOKUP_CONTEXT Context;
|
|
||||||
|
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
@ -1330,12 +1327,11 @@ NtOpenKey(OUT PHANDLE KeyHandle,
|
||||||
|
|
||||||
RemainingPath.Buffer = NULL;
|
RemainingPath.Buffer = NULL;
|
||||||
|
|
||||||
Status = ObFindObject(&ObjectCreateInfo,
|
Status = CmFindObject(&ObjectCreateInfo,
|
||||||
&ObjectName,
|
&ObjectName,
|
||||||
(PVOID*)&Object,
|
(PVOID*)&Object,
|
||||||
&RemainingPath,
|
&RemainingPath,
|
||||||
CmiKeyType,
|
CmiKeyType,
|
||||||
&Context,
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
|
|
@ -704,7 +704,6 @@ CmiConnectHive(IN POBJECT_ATTRIBUTES KeyObjectAttributes,
|
||||||
PWSTR SubName;
|
PWSTR SubName;
|
||||||
UNICODE_STRING ObjectName;
|
UNICODE_STRING ObjectName;
|
||||||
OBJECT_CREATE_INFORMATION ObjectCreateInfo;
|
OBJECT_CREATE_INFORMATION ObjectCreateInfo;
|
||||||
OBP_LOOKUP_CONTEXT Context;
|
|
||||||
|
|
||||||
DPRINT("CmiConnectHive(%p, %p) called.\n",
|
DPRINT("CmiConnectHive(%p, %p) called.\n",
|
||||||
KeyObjectAttributes, RegistryHive);
|
KeyObjectAttributes, RegistryHive);
|
||||||
|
@ -722,12 +721,11 @@ CmiConnectHive(IN POBJECT_ATTRIBUTES KeyObjectAttributes,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = ObFindObject(&ObjectCreateInfo,
|
Status = CmFindObject(&ObjectCreateInfo,
|
||||||
&ObjectName,
|
&ObjectName,
|
||||||
(PVOID*)&ParentKey,
|
(PVOID*)&ParentKey,
|
||||||
&RemainingPath,
|
&RemainingPath,
|
||||||
CmiKeyType,
|
CmiKeyType,
|
||||||
&Context,
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
ObpReleaseCapturedAttributes(&ObjectCreateInfo);
|
ObpReleaseCapturedAttributes(&ObjectCreateInfo);
|
||||||
|
@ -857,8 +855,8 @@ CmiDisconnectHive (IN POBJECT_ATTRIBUTES KeyObjectAttributes,
|
||||||
|
|
||||||
Status = ObOpenObjectByName (KeyObjectAttributes,
|
Status = ObOpenObjectByName (KeyObjectAttributes,
|
||||||
CmiKeyType,
|
CmiKeyType,
|
||||||
NULL,
|
|
||||||
KernelMode,
|
KernelMode,
|
||||||
|
NULL,
|
||||||
STANDARD_RIGHTS_REQUIRED,
|
STANDARD_RIGHTS_REQUIRED,
|
||||||
NULL,
|
NULL,
|
||||||
&KeyHandle);
|
&KeyHandle);
|
||||||
|
|
|
@ -23,7 +23,202 @@ CmiGetLinkTarget(PREGISTRY_HIVE RegistryHive,
|
||||||
PUNICODE_STRING TargetPath);
|
PUNICODE_STRING TargetPath);
|
||||||
|
|
||||||
/* FUNCTONS *****************************************************************/
|
/* FUNCTONS *****************************************************************/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
CmFindObject(POBJECT_CREATE_INFORMATION ObjectCreateInfo,
|
||||||
|
PUNICODE_STRING ObjectName,
|
||||||
|
PVOID* ReturnedObject,
|
||||||
|
PUNICODE_STRING RemainingPath,
|
||||||
|
POBJECT_TYPE ObjectType,
|
||||||
|
IN PACCESS_STATE AccessState,
|
||||||
|
IN PVOID ParseContext)
|
||||||
|
{
|
||||||
|
PVOID NextObject;
|
||||||
|
PVOID CurrentObject;
|
||||||
|
PVOID RootObject;
|
||||||
|
POBJECT_HEADER CurrentHeader;
|
||||||
|
NTSTATUS Status;
|
||||||
|
PWSTR current;
|
||||||
|
UNICODE_STRING PathString;
|
||||||
|
ULONG Attributes;
|
||||||
|
UNICODE_STRING CurrentUs;
|
||||||
|
OBP_LOOKUP_CONTEXT Context;
|
||||||
|
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
DPRINT("CmindObject(ObjectCreateInfo %x, ReturnedObject %x, "
|
||||||
|
"RemainingPath %x)\n",ObjectCreateInfo,ReturnedObject,RemainingPath);
|
||||||
|
|
||||||
|
RtlInitUnicodeString (RemainingPath, NULL);
|
||||||
|
|
||||||
|
if (ObjectCreateInfo->RootDirectory == NULL)
|
||||||
|
{
|
||||||
|
ObReferenceObjectByPointer(NameSpaceRoot,
|
||||||
|
DIRECTORY_TRAVERSE,
|
||||||
|
NULL,
|
||||||
|
ObjectCreateInfo->ProbeMode);
|
||||||
|
CurrentObject = NameSpaceRoot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status = ObReferenceObjectByHandle(ObjectCreateInfo->RootDirectory,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
ObjectCreateInfo->ProbeMode,
|
||||||
|
&CurrentObject,
|
||||||
|
NULL);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectName->Length == 0 ||
|
||||||
|
ObjectName->Buffer[0] == UNICODE_NULL)
|
||||||
|
{
|
||||||
|
*ReturnedObject = CurrentObject;
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectCreateInfo->RootDirectory == NULL &&
|
||||||
|
ObjectName->Buffer[0] != L'\\')
|
||||||
|
{
|
||||||
|
ObDereferenceObject (CurrentObject);
|
||||||
|
DPRINT1("failed\n");
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create a zero-terminated copy of the object name */
|
||||||
|
PathString.Length = ObjectName->Length;
|
||||||
|
PathString.MaximumLength = ObjectName->Length + sizeof(WCHAR);
|
||||||
|
PathString.Buffer = ExAllocatePool (NonPagedPool,
|
||||||
|
PathString.MaximumLength);
|
||||||
|
if (PathString.Buffer == NULL)
|
||||||
|
{
|
||||||
|
ObDereferenceObject (CurrentObject);
|
||||||
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
|
RtlCopyMemory (PathString.Buffer,
|
||||||
|
ObjectName->Buffer,
|
||||||
|
ObjectName->Length);
|
||||||
|
PathString.Buffer[PathString.Length / sizeof(WCHAR)] = UNICODE_NULL;
|
||||||
|
|
||||||
|
current = PathString.Buffer;
|
||||||
|
|
||||||
|
RootObject = CurrentObject;
|
||||||
|
Attributes = ObjectCreateInfo->Attributes;
|
||||||
|
if (ObjectType == ObSymbolicLinkType)
|
||||||
|
Attributes |= OBJ_OPENLINK;
|
||||||
|
|
||||||
|
while (TRUE)
|
||||||
|
{
|
||||||
|
CurrentHeader = OBJECT_TO_OBJECT_HEADER(CurrentObject);
|
||||||
|
|
||||||
|
/* Loop as long as we're dealing with a directory */
|
||||||
|
while (CurrentHeader->Type == ObDirectoryType)
|
||||||
|
{
|
||||||
|
PWSTR Start, End;
|
||||||
|
PVOID FoundObject;
|
||||||
|
UNICODE_STRING StartUs;
|
||||||
|
NextObject = NULL;
|
||||||
|
|
||||||
|
if (!current) goto Next;
|
||||||
|
|
||||||
|
Start = current;
|
||||||
|
if (*Start == L'\\') Start++;
|
||||||
|
|
||||||
|
End = wcschr(Start, L'\\');
|
||||||
|
if (End != NULL) *End = 0;
|
||||||
|
|
||||||
|
RtlInitUnicodeString(&StartUs, Start);
|
||||||
|
Context.DirectoryLocked = TRUE;
|
||||||
|
Context.Directory = CurrentObject;
|
||||||
|
FoundObject = ObpLookupEntryDirectory(CurrentObject, &StartUs, Attributes, FALSE, &Context);
|
||||||
|
if (FoundObject == NULL)
|
||||||
|
{
|
||||||
|
if (End != NULL)
|
||||||
|
{
|
||||||
|
*End = L'\\';
|
||||||
|
}
|
||||||
|
goto Next;
|
||||||
|
}
|
||||||
|
|
||||||
|
ObReferenceObjectByPointer(FoundObject,
|
||||||
|
STANDARD_RIGHTS_REQUIRED,
|
||||||
|
NULL,
|
||||||
|
UserMode);
|
||||||
|
if (End != NULL)
|
||||||
|
{
|
||||||
|
*End = L'\\';
|
||||||
|
current = End;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
current = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
NextObject = FoundObject;
|
||||||
|
|
||||||
|
Next:
|
||||||
|
if (NextObject == NULL)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ObDereferenceObject(CurrentObject);
|
||||||
|
CurrentObject = NextObject;
|
||||||
|
CurrentHeader = OBJECT_TO_OBJECT_HEADER(CurrentObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CurrentHeader->Type->TypeInfo.ParseProcedure == NULL)
|
||||||
|
{
|
||||||
|
DPRINT("Current object can't parse\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
RtlInitUnicodeString(&CurrentUs, current);
|
||||||
|
Status = CurrentHeader->Type->TypeInfo.ParseProcedure(CurrentObject,
|
||||||
|
CurrentHeader->Type,
|
||||||
|
AccessState,
|
||||||
|
ExGetPreviousMode(), // fixme: should be a parameter, since caller decides.
|
||||||
|
Attributes,
|
||||||
|
&PathString,
|
||||||
|
&CurrentUs,
|
||||||
|
ParseContext,
|
||||||
|
NULL, // fixme: where do we get this from? captured OBP?
|
||||||
|
&NextObject);
|
||||||
|
current = CurrentUs.Buffer;
|
||||||
|
if (Status == STATUS_REPARSE)
|
||||||
|
{
|
||||||
|
/* reparse the object path */
|
||||||
|
NextObject = NameSpaceRoot;
|
||||||
|
current = PathString.Buffer;
|
||||||
|
|
||||||
|
ObReferenceObjectByPointer(NextObject,
|
||||||
|
DIRECTORY_TRAVERSE,
|
||||||
|
NULL,
|
||||||
|
ObjectCreateInfo->ProbeMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (NextObject == NULL)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ObDereferenceObject(CurrentObject);
|
||||||
|
CurrentObject = NextObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current)
|
||||||
|
{
|
||||||
|
RtlpCreateUnicodeString (RemainingPath, current, NonPagedPool);
|
||||||
|
}
|
||||||
|
|
||||||
|
RtlFreeUnicodeString (&PathString);
|
||||||
|
*ReturnedObject = CurrentObject;
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CmiObjectParse(IN PVOID ParsedObject,
|
CmiObjectParse(IN PVOID ParsedObject,
|
||||||
|
|
|
@ -205,8 +205,8 @@ ExCreateCallback(
|
||||||
{
|
{
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
ExCallbackObjectType,
|
ExCallbackObjectType,
|
||||||
NULL,
|
|
||||||
KernelMode,
|
KernelMode,
|
||||||
|
NULL,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
&Handle);
|
&Handle);
|
||||||
|
|
|
@ -212,8 +212,8 @@ NtOpenEvent(OUT PHANDLE EventHandle,
|
||||||
/* Open the Object */
|
/* Open the Object */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
ExEventObjectType,
|
ExEventObjectType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hEvent);
|
&hEvent);
|
||||||
|
|
|
@ -164,8 +164,8 @@ NtOpenEventPair(OUT PHANDLE EventPairHandle,
|
||||||
/* Open the Object */
|
/* Open the Object */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
ExEventPairObjectType,
|
ExEventPairObjectType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hEventPair);
|
&hEventPair);
|
||||||
|
|
|
@ -194,8 +194,8 @@ NtOpenMutant(OUT PHANDLE MutantHandle,
|
||||||
/* Open the Object */
|
/* Open the Object */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
ExMutantObjectType,
|
ExMutantObjectType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hMutant);
|
&hMutant);
|
||||||
|
|
|
@ -188,8 +188,8 @@ NtOpenSemaphore(OUT PHANDLE SemaphoreHandle,
|
||||||
/* Open the Object */
|
/* Open the Object */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
ExSemaphoreObjectType,
|
ExSemaphoreObjectType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hSemaphore);
|
&hSemaphore);
|
||||||
|
|
|
@ -508,8 +508,8 @@ NtOpenTimer(OUT PHANDLE TimerHandle,
|
||||||
/* Open the Timer */
|
/* Open the Timer */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
ExTimerType,
|
ExTimerType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hTimer);
|
&hTimer);
|
||||||
|
|
|
@ -930,9 +930,9 @@ IoCreateFile(OUT PHANDLE FileHandle,
|
||||||
|
|
||||||
/* First try to open an existing named object */
|
/* First try to open an existing named object */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
NULL,
|
|
||||||
NULL,
|
NULL,
|
||||||
AccessMode,
|
AccessMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&LocalHandle);
|
&LocalHandle);
|
||||||
|
|
|
@ -322,8 +322,8 @@ NtOpenIoCompletion(OUT PHANDLE IoCompletionHandle,
|
||||||
/* Open the Object */
|
/* Open the Object */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
IoCompletionType,
|
IoCompletionType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hIoCompletionHandle);
|
&hIoCompletionHandle);
|
||||||
|
|
|
@ -3463,8 +3463,8 @@ NtOpenSection(PHANDLE SectionHandle,
|
||||||
|
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
MmSectionObjectType,
|
MmSectionObjectType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hSection);
|
&hSection);
|
||||||
|
|
|
@ -334,8 +334,8 @@ NtOpenDirectoryObject (OUT PHANDLE DirectoryHandle,
|
||||||
/* Open the directory object */
|
/* Open the directory object */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
ObDirectoryType,
|
ObDirectoryType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hDirectory);
|
&hDirectory);
|
||||||
|
|
|
@ -748,10 +748,10 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
IN POBJECT_TYPE ObjectType,
|
IN POBJECT_TYPE ObjectType,
|
||||||
IN OUT PVOID ParseContext,
|
|
||||||
IN KPROCESSOR_MODE AccessMode,
|
IN KPROCESSOR_MODE AccessMode,
|
||||||
IN ACCESS_MASK DesiredAccess,
|
|
||||||
IN PACCESS_STATE PassedAccessState,
|
IN PACCESS_STATE PassedAccessState,
|
||||||
|
IN ACCESS_MASK DesiredAccess,
|
||||||
|
IN OUT PVOID ParseContext,
|
||||||
OUT PHANDLE Handle)
|
OUT PHANDLE Handle)
|
||||||
{
|
{
|
||||||
UNICODE_STRING RemainingPath;
|
UNICODE_STRING RemainingPath;
|
||||||
|
|
|
@ -403,8 +403,8 @@ NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle,
|
||||||
/* Open the object */
|
/* Open the object */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
ObSymbolicLinkType,
|
ObSymbolicLinkType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hLink);
|
&hLink);
|
||||||
|
|
|
@ -413,8 +413,8 @@ NtOpenJobObject (
|
||||||
{
|
{
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
PsJobType,
|
PsJobType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hJob);
|
&hJob);
|
||||||
|
|
|
@ -1004,8 +1004,8 @@ NtOpenProcess(OUT PHANDLE ProcessHandle,
|
||||||
DPRINT("Opening by name\n");
|
DPRINT("Opening by name\n");
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
PsProcessType,
|
PsProcessType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hProcess);
|
&hProcess);
|
||||||
|
|
|
@ -720,8 +720,8 @@ NtOpenThread(OUT PHANDLE ThreadHandle,
|
||||||
/* Open it */
|
/* Open it */
|
||||||
Status = ObOpenObjectByName(ObjectAttributes,
|
Status = ObOpenObjectByName(ObjectAttributes,
|
||||||
PsThreadType,
|
PsThreadType,
|
||||||
NULL,
|
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
|
NULL,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
&hThread);
|
&hThread);
|
||||||
|
|
|
@ -345,8 +345,8 @@ IntParseDesktopPath(PEPROCESS Process,
|
||||||
|
|
||||||
Status = ObOpenObjectByName(&ObjectAttributes,
|
Status = ObOpenObjectByName(&ObjectAttributes,
|
||||||
ExWindowStationObjectType,
|
ExWindowStationObjectType,
|
||||||
NULL,
|
|
||||||
KernelMode,
|
KernelMode,
|
||||||
|
NULL,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
(HANDLE*)hWinSta);
|
(HANDLE*)hWinSta);
|
||||||
|
@ -379,8 +379,8 @@ IntParseDesktopPath(PEPROCESS Process,
|
||||||
|
|
||||||
Status = ObOpenObjectByName(&ObjectAttributes,
|
Status = ObOpenObjectByName(&ObjectAttributes,
|
||||||
ExDesktopObjectType,
|
ExDesktopObjectType,
|
||||||
NULL,
|
|
||||||
KernelMode,
|
KernelMode,
|
||||||
|
NULL,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
(HANDLE*)hDesktop);
|
(HANDLE*)hDesktop);
|
||||||
|
@ -926,10 +926,10 @@ NtUserCreateDesktop(
|
||||||
Status = ObOpenObjectByName(
|
Status = ObOpenObjectByName(
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
ExDesktopObjectType,
|
ExDesktopObjectType,
|
||||||
(PVOID)&DummyContext,
|
|
||||||
KernelMode,
|
KernelMode,
|
||||||
dwDesiredAccess,
|
|
||||||
NULL,
|
NULL,
|
||||||
|
dwDesiredAccess,
|
||||||
|
(PVOID)&DummyContext,
|
||||||
(HANDLE*)&Desktop);
|
(HANDLE*)&Desktop);
|
||||||
if (!NT_SUCCESS(Status)) RETURN(NULL);
|
if (!NT_SUCCESS(Status)) RETURN(NULL);
|
||||||
if (Status == STATUS_OBJECT_NAME_EXISTS)
|
if (Status == STATUS_OBJECT_NAME_EXISTS)
|
||||||
|
@ -1129,8 +1129,8 @@ NtUserOpenDesktop(
|
||||||
Status = ObOpenObjectByName(
|
Status = ObOpenObjectByName(
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
ExDesktopObjectType,
|
ExDesktopObjectType,
|
||||||
NULL,
|
|
||||||
KernelMode,
|
KernelMode,
|
||||||
|
NULL,
|
||||||
dwDesiredAccess,
|
dwDesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
(HANDLE*)&Desktop);
|
(HANDLE*)&Desktop);
|
||||||
|
|
|
@ -444,8 +444,8 @@ NtUserCreateWindowStation(
|
||||||
Status = ObOpenObjectByName(
|
Status = ObOpenObjectByName(
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
ExWindowStationObjectType,
|
ExWindowStationObjectType,
|
||||||
NULL,
|
|
||||||
KernelMode,
|
KernelMode,
|
||||||
|
NULL,
|
||||||
dwDesiredAccess,
|
dwDesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
(PVOID*)&WindowStation);
|
(PVOID*)&WindowStation);
|
||||||
|
@ -603,8 +603,8 @@ NtUserOpenWindowStation(
|
||||||
Status = ObOpenObjectByName(
|
Status = ObOpenObjectByName(
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
ExWindowStationObjectType,
|
ExWindowStationObjectType,
|
||||||
NULL,
|
|
||||||
UserMode,
|
UserMode,
|
||||||
|
NULL,
|
||||||
dwDesiredAccess,
|
dwDesiredAccess,
|
||||||
NULL,
|
NULL,
|
||||||
(PVOID*)&WindowStation);
|
(PVOID*)&WindowStation);
|
||||||
|
|
Loading…
Reference in a new issue