Author: ion Date: Tue Jun 27 07:06:26 2006 New Revision: 22652
URL: http://svn.reactos.org/svn/reactos?rev=22652&view=rev Log: - 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...)
Modified: trunk/reactos/dll/win32/kernel32/misc/dllmain.c trunk/reactos/ntoskrnl/ob/obhandle.c
Modified: trunk/reactos/dll/win32/kernel32/misc/dllmain.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/dll... ============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/dllmain.c (original) +++ trunk/reactos/dll/win32/kernel32/misc/dllmain.c Tue Jun 27 07:06:26 2006 @@ -66,7 +66,10 @@ { 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, @@ -87,6 +90,36 @@ if (!NT_SUCCESS(Status)) { 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"); } }
Modified: trunk/reactos/ntoskrnl/ob/obhandle.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obhandle.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/ob/obhandle.c (original) +++ trunk/reactos/ntoskrnl/ob/obhandle.c Tue Jun 27 07:06:26 2006 @@ -1455,6 +1455,14 @@ 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,