Move creation of global objects to csrss as specified in the fixmes. Whatever

was broken before that prevented this seems to have been resolved.

svn path=/trunk/; revision=28643
This commit is contained in:
Art Yerkes 2007-08-29 05:57:00 +00:00
parent 72d3e9bd7e
commit 8da0438ac6
2 changed files with 69 additions and 41 deletions

View file

@ -66,10 +66,7 @@ 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,
@ -83,44 +80,7 @@ OpenBaseDirectory(PHANDLE DirHandle)
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
/* FIXME: It's not our job to create the BNO directory, csr does it */
Status = NtCreateDirectoryObject(DirHandle,
DIRECTORY_ALL_ACCESS,
&ObjectAttributes);
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");
}
return Status;
}
DPRINT("Opened BNO: %lx\n", *DirHandle);

View file

@ -339,6 +339,73 @@ CsrpCreateListenPort (IN LPWSTR Name,
/* === INIT ROUTINES === */
/**********************************************************************
* CsrpCreateBNODirectory/3
*
* These used to be part of kernel32 startup, but that clearly wasn't a good
* idea, as races were definately possible. These are moved (as in the
* previous fixmes).
*/
static NTSTATUS
CsrpCreateBNODirectory (int argc, char ** argv, char ** envp)
{
NTSTATUS Status;
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");
HANDLE DirHandle, SymHandle;
/* Seems like a good place to create these objects which are needed by
* win32 processes */
InitializeObjectAttributes(&ObjectAttributes,
&Name,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtCreateDirectoryObject(&DirHandle,
DIRECTORY_ALL_ACCESS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtCreateDirectoryObject() failed %08x\n", Status);
}
/* Create the "local" Symbolic Link.
* FIXME: CSR should do this -- Fixed */
InitializeObjectAttributes(&ObjectAttributes,
&SymName,
OBJ_CASE_INSENSITIVE,
DirHandle,
NULL);
Status = NtCreateSymbolicLinkObject(&SymHandle,
SYMBOLIC_LINK_ALL_ACCESS,
&ObjectAttributes,
&Name);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtCreateDirectoryObject() failed %08x\n", Status);
}
/* Create the "global" Symbolic Link. */
InitializeObjectAttributes(&ObjectAttributes,
&SymName2,
OBJ_CASE_INSENSITIVE,
DirHandle,
NULL);
Status = NtCreateSymbolicLinkObject(&SymHandle,
SYMBOLIC_LINK_ALL_ACCESS,
&ObjectAttributes,
&Name);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtCreateDirectoryObject() failed %08x\n", Status);
}
return Status;
}
/**********************************************************************
* CsrpCreateHeap/3
*/
@ -623,6 +690,7 @@ struct {
CSR_INIT_ROUTINE EntryPoint;
PCHAR ErrorMessage;
} InitRoutine [] = {
{TRUE, CsrpCreateBNODirectory, "create base named objects directory"},
{TRUE, CsrpCreateCallbackPort, "create the callback port \\Windows\\SbApiPort"},
{TRUE, CsrpRegisterSubsystem, "register with SM"},
{TRUE, CsrpCreateHeap, "create the CSR heap"},