mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
- Catch illegal call to Ob functions when ObjectAttributes == NULL and return distinguished status code for this situation (STATUS_INVALID_PARAMETER), instead of failing due to access violation.
- Create the BNO Global and Local symbolic links in kernel32. - We pass all the Ob+Native tests in ntdll_winetest om now (we fail some named pipe ones, but I have no idea why WINE calls them "Object Manager" related...) svn path=/trunk/; revision=22652
This commit is contained in:
@@ -66,7 +66,10 @@ OpenBaseDirectory(PHANDLE DirHandle)
|
||||
{
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
UNICODE_STRING Name = RTL_CONSTANT_STRING(L"\\BaseNamedObjects");
|
||||
UNICODE_STRING SymName = RTL_CONSTANT_STRING(L"Local");
|
||||
UNICODE_STRING SymName2 = RTL_CONSTANT_STRING(L"Global");
|
||||
NTSTATUS Status;
|
||||
HANDLE SymHandle;
|
||||
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&Name,
|
||||
@@ -88,6 +91,36 @@ OpenBaseDirectory(PHANDLE DirHandle)
|
||||
{
|
||||
DPRINT1("NtCreateDirectoryObject() failed\n");
|
||||
}
|
||||
|
||||
/* Create the "local" Symbolic Link. FIXME: CSR should do this */
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&SymName,
|
||||
OBJ_CASE_INSENSITIVE,
|
||||
*DirHandle,
|
||||
NULL);
|
||||
Status = NtCreateSymbolicLinkObject(&SymHandle,
|
||||
SYMBOLIC_LINK_ALL_ACCESS,
|
||||
&ObjectAttributes,
|
||||
&Name);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("NtCreateSymbolicLinkObject() failed\n");
|
||||
}
|
||||
|
||||
/* Create the "global" Symbolic Link. FIXME: CSR should do this */
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&SymName2,
|
||||
OBJ_CASE_INSENSITIVE,
|
||||
*DirHandle,
|
||||
NULL);
|
||||
Status = NtCreateSymbolicLinkObject(&SymHandle,
|
||||
SYMBOLIC_LINK_ALL_ACCESS,
|
||||
&ObjectAttributes,
|
||||
&Name);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("NtCreateSymbolicLinkObject() failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
DPRINT("Opened BNO: %lx\n", *DirHandle);
|
||||
|
||||
@@ -1455,6 +1455,14 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||
OB_OPEN_REASON OpenReason;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Check if we didn't get any Object Attributes */
|
||||
if (!ObjectAttributes)
|
||||
{
|
||||
/* Fail with special status code */
|
||||
*Handle = NULL;
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
/* Capture all the info */
|
||||
Status = ObpCaptureObjectAttributes(ObjectAttributes,
|
||||
AccessMode,
|
||||
|
||||
Reference in New Issue
Block a user