update for HEAD-2003050101
[reactos.git] / ntoskrnl / se / semgr.c
index 6102752..7788419 100644 (file)
@@ -64,6 +64,61 @@ SeInit2(VOID)
 }
 
 
+BOOLEAN
+SeInitSRM(VOID)
+{
+  OBJECT_ATTRIBUTES ObjectAttributes;
+  UNICODE_STRING Name;
+  HANDLE DirectoryHandle;
+  HANDLE EventHandle;
+  NTSTATUS Status;
+
+  /* Create '\Security' directory */
+  RtlInitUnicodeString(&Name,
+                      L"\\Security");
+  InitializeObjectAttributes(&ObjectAttributes,
+                            &Name,
+                            OBJ_PERMANENT,
+                            0,
+                            NULL);
+  Status = NtCreateDirectoryObject(&DirectoryHandle,
+                                  DIRECTORY_ALL_ACCESS,
+                                  &ObjectAttributes);
+  if (!NT_SUCCESS(Status))
+    {
+      DPRINT1("Failed to create 'Security' directory!\n");
+      return(FALSE);
+    }
+
+  /* Create 'LSA_AUTHENTICATION_INITALIZED' event */
+  RtlInitUnicodeString(&Name,
+                      L"\\LSA_AUTHENTICATION_INITALIZED");
+  InitializeObjectAttributes(&ObjectAttributes,
+                            &Name,
+                            OBJ_PERMANENT,
+                            DirectoryHandle,
+                            SePublicDefaultSd);
+  Status = NtCreateEvent(&EventHandle,
+                        EVENT_ALL_ACCESS,
+                        &ObjectAttributes,
+                        FALSE,
+                        FALSE);
+  if (!NT_SUCCESS(Status))
+    {
+      DPRINT1("Failed to create 'Security' directory!\n");
+      NtClose(DirectoryHandle);
+      return(FALSE);
+    }
+
+  NtClose(EventHandle);
+  NtClose(DirectoryHandle);
+
+  /* FIXME: Create SRM port and listener thread */
+
+  return(TRUE);
+}
+
+
 static BOOLEAN
 SepInitExports(VOID)
 {