diff --git a/reactos/dll/win32/kernel32/misc/dllmain.c b/reactos/dll/win32/kernel32/misc/dllmain.c index bb609a8419f..16f7fa582c8 100644 --- a/reactos/dll/win32/kernel32/misc/dllmain.c +++ b/reactos/dll/win32/kernel32/misc/dllmain.c @@ -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); diff --git a/reactos/ntoskrnl/ob/obhandle.c b/reactos/ntoskrnl/ob/obhandle.c index 4c72ac32801..eca177bfe9a 100644 --- a/reactos/ntoskrnl/ob/obhandle.c +++ b/reactos/ntoskrnl/ob/obhandle.c @@ -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,