ReactOS 0.4.15-dev-7934-g1dc8d80
init.c File Reference
#include "srv.h"
#include <winreg.h>
#include <ndk/cmfuncs.h>
#include <debug.h>
Include dependency graph for init.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI CsrSetProcessSecurity (VOID)
 
NTSTATUS NTAPI CsrSetDirectorySecurity (IN HANDLE ObjectDirectory)
 
NTSTATUS NTAPI GetDosDevicesProtection (OUT PSECURITY_DESCRIPTOR DosDevicesSd)
 
VOID NTAPI FreeDosDevicesProtection (IN PSECURITY_DESCRIPTOR DosDevicesSd)
 
NTSTATUS NTAPI CsrCreateSessionObjectDirectory (IN ULONG Session)
 
NTSTATUS NTAPI CsrParseServerCommandLine (IN ULONG ArgumentCount, IN PCHAR Arguments[])
 
NTSTATUS NTAPI CsrInitCsrRootProcess (VOID)
 
NTSTATUS NTAPI CsrCreateLocalSystemSD (OUT PSECURITY_DESCRIPTOR *LocalSystemSd)
 
NTSTATUS NTAPI CsrSbApiPortInitialize (VOID)
 
NTSTATUS NTAPI CsrServerInitialization (IN ULONG ArgumentCount, IN PCHAR Arguments[])
 
VOID NTAPI CsrPopulateDosDevices (VOID)
 
BOOL NTAPI DllMain (IN HINSTANCE hInstanceDll, IN DWORD dwReason, IN LPVOID lpReserved)
 

Variables

ULONG CsrDebug = 0
 
HANDLE CsrHeap = NULL
 
HANDLE CsrObjectDirectory = NULL
 
UNICODE_STRING CsrDirectoryName
 
UNICODE_STRING CsrSbApiPortName
 
HANDLE CsrSbApiPort = NULL
 
PCSR_THREAD CsrSbApiRequestThreadPtr
 
HANDLE CsrSmApiPort = NULL
 
HANDLE hSbApiPort = NULL
 
HANDLE CsrApiPort = NULL
 
ULONG CsrMaxApiRequestThreads
 
ULONG CsrTotalPerProcessDataLength
 
ULONG SessionId
 
HANDLE BNOLinksDirectory
 
HANDLE SessionObjectDirectory
 
HANDLE DosDevicesDirectory
 
SYSTEM_BASIC_INFORMATION CsrNtSysInfo
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 17 of file init.c.

Function Documentation

◆ CsrCreateLocalSystemSD()

NTSTATUS NTAPI CsrCreateLocalSystemSD ( OUT PSECURITY_DESCRIPTOR LocalSystemSd)

this API is used with CsrPopulateDosDevices, deprecated in r55585. NTSTATUS NTAPI CsrPopulateDosDevicesDirectory(IN HANDLE DosDevicesDirectory, IN PPROCESS_DEVICEMAP_INFORMATION DeviceMap);

Definition at line 847 of file init.c.

848{
850 PSID SystemSid;
852 PSECURITY_DESCRIPTOR SystemSd;
853 PACL Dacl;
855
856 /* Initialize the System SID */
859 0, 0, 0, 0, 0, 0, 0,
860 &SystemSid);
861
862 /* Get the length of the SID */
863 Length = RtlLengthSid(SystemSid) + sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE);
864
865 /* Allocate a buffer for the Security Descriptor, with SID and DACL */
867
868 /* Set the pointer to the DACL */
870
871 /* Now create the SD itself */
873 if (!NT_SUCCESS(Status)) goto Quit;
874
875 /* Create the DACL for it */
877
878 /* Create the ACE */
880 if (!NT_SUCCESS(Status)) goto Quit;
881
882 /* Clear the DACL in the SD */
884 if (!NT_SUCCESS(Status)) goto Quit;
885
886Quit:
887 if (!NT_SUCCESS(Status))
888 {
889 RtlFreeHeap(CsrHeap, 0, SystemSd);
890 SystemSd = NULL;
891 }
892
893 /* Free the SID and return*/
894 RtlFreeSid(SystemSid);
895 *LocalSystemSd = SystemSd;
896 return Status;
897}
LONG NTSTATUS
Definition: precomp.h:26
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:25
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL, DWORD, DWORD, PSID)
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
#define PORT_ALL_ACCESS
Definition: lpctypes.h:47
struct _ACL ACL
struct _ACL * PACL
Definition: security.c:105
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
Definition: rtlfuncs.h:1593
NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision)
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
Definition: sid.c:150
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ ULONG Revision)
NTSYSAPI PVOID NTAPI RtlFreeSid(_In_ _Post_invalid_ PSID Sid)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSYSAPI NTSTATUS NTAPI RtlAllocateAndInitializeSid(IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount, IN ULONG SubAuthority0, IN ULONG SubAuthority1, IN ULONG SubAuthority2, IN ULONG SubAuthority3, IN ULONG SubAuthority4, IN ULONG SubAuthority5, IN ULONG SubAuthority6, IN ULONG SubAuthority7, OUT PSID *Sid)
Definition: sid.c:290
static SID_IDENTIFIER_AUTHORITY NtSidAuthority
Definition: samrpc.c:14
HANDLE CsrHeap
Definition: init.c:25
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
#define SECURITY_LOCAL_SYSTEM_RID
Definition: setypes.h:574
#define ACL_REVISION2
Definition: setypes.h:43
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:554
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
#define SECURITY_DESCRIPTOR_MIN_LENGTH
Definition: setypes.h:815
#define ACL_REVISION
Definition: setypes.h:39

Referenced by CsrSbApiPortInitialize().

◆ CsrCreateSessionObjectDirectory()

NTSTATUS NTAPI CsrCreateSessionObjectDirectory ( IN ULONG  Session)

Definition at line 424 of file init.c.

425{
426 WCHAR SessionBuffer[512], BnoBuffer[512];
427 UNICODE_STRING SessionString, BnoString;
429 HANDLE BnoHandle;
430 SECURITY_DESCRIPTOR DosDevicesSd;
432
433 /* Generate the Session BNOLINKS Directory name */
434 swprintf(SessionBuffer, L"%ws\\BNOLINKS", SESSION_ROOT);
435 RtlInitUnicodeString(&SessionString, SessionBuffer);
436
437 /* Create it */
439 &SessionString,
441 NULL,
442 NULL);
446 if (!NT_SUCCESS(Status))
447 {
448 DPRINT1("CSRSS: NtCreateDirectoryObject failed in "
449 "CsrCreateSessionObjectDirectory - status = %lx\n", Status);
450 return Status;
451 }
452
453 /* Now add the Session ID */
454 swprintf(SessionBuffer, L"%ld", Session);
455 RtlInitUnicodeString(&SessionString, SessionBuffer);
456
457 /* Check if this is the first Session */
458 if (Session)
459 {
460 /* Not the first, so the name will be slighly more complex */
461 swprintf(BnoBuffer, L"%ws\\%ld\\BaseNamedObjects", SESSION_ROOT, Session);
462 RtlInitUnicodeString(&BnoString, BnoBuffer);
463 }
464 else
465 {
466 /* Use the direct name */
467 RtlInitUnicodeString(&BnoString, L"\\BaseNamedObjects");
468 }
469
470 /* Create the symlink */
472 &SessionString,
475 NULL);
479 &BnoString);
480 if (!NT_SUCCESS(Status))
481 {
482 DPRINT1("CSRSS: NtCreateSymbolicLinkObject failed in "
483 "CsrCreateSessionObjectDirectory - status = %lx\n", Status);
484 return Status;
485 }
486
487 /* Create the \DosDevices Security Descriptor */
488 Status = GetDosDevicesProtection(&DosDevicesSd);
489 if (!NT_SUCCESS(Status)) return Status;
490
491 /* Now create a directory for this session */
492 swprintf(SessionBuffer, L"%ws\\%ld", SESSION_ROOT, Session);
493 RtlInitUnicodeString(&SessionString, SessionBuffer);
494
495 /* Create the directory */
497 &SessionString,
499 0,
500 &DosDevicesSd);
504 if (!NT_SUCCESS(Status))
505 {
506 DPRINT1("CSRSS: NtCreateDirectoryObject failed in "
507 "CsrCreateSessionObjectDirectory - status = %lx\n", Status);
508 FreeDosDevicesProtection(&DosDevicesSd);
509 return Status;
510 }
511
512 /* Next, create a directory for this session's DOS Devices */
513 RtlInitUnicodeString(&SessionString, L"DosDevices");
515 &SessionString,
518 &DosDevicesSd);
522 if (!NT_SUCCESS(Status))
523 {
524 DPRINT1("CSRSS: NtCreateDirectoryObject failed in "
525 "CsrCreateSessionObjectDirectory - status = %lx\n", Status);
526 }
527
528 /* Release the Security Descriptor */
529 FreeDosDevicesProtection(&DosDevicesSd);
530
531 /* Return */
532 return Status;
533}
#define DPRINT1
Definition: precomp.h:8
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define swprintf
Definition: precomp.h:40
#define OBJ_OPENIF
Definition: winternl.h:229
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define SYMBOLIC_LINK_ALL_ACCESS
Definition: nt_native.h:1267
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define DIRECTORY_ALL_ACCESS
Definition: nt_native.h:1259
#define L(x)
Definition: ntvdm.h:50
NTSTATUS NTAPI NtCreateDirectoryObject(OUT PHANDLE DirectoryHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
Definition: obdir.c:765
#define SESSION_ROOT
Definition: srv.h:44
VOID NTAPI FreeDosDevicesProtection(IN PSECURITY_DESCRIPTOR DosDevicesSd)
Definition: init.c:392
HANDLE BNOLinksDirectory
Definition: init.c:41
NTSTATUS NTAPI GetDosDevicesProtection(OUT PSECURITY_DESCRIPTOR DosDevicesSd)
Definition: init.c:209
HANDLE DosDevicesDirectory
Definition: init.c:43
HANDLE SessionObjectDirectory
Definition: init.c:42
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CsrParseServerCommandLine().

◆ CsrInitCsrRootProcess()

NTSTATUS NTAPI CsrInitCsrRootProcess ( VOID  )

Definition at line 769 of file init.c.

770{
771 PVOID ProcessData;
772 PCSR_SERVER_DLL ServerDll;
773 ULONG i = 0;
774
775 /* All Server DLLs are now loaded, allocate a heap for the Root Process */
776 ProcessData = RtlAllocateHeap(CsrHeap,
779 if (!ProcessData)
780 {
781 DPRINT1("CSRSRV:%s: RtlAllocateHeap failed (Status=%08lx)\n",
783 return STATUS_NO_MEMORY;
784 }
785
786 /*
787 * Our Root Process was never officially initialized,
788 * so write the data for each Server DLL manually.
789 */
790
791 /* Loop every DLL */
792 for (i = 0; i < CSR_SERVER_DLL_MAX; i++)
793 {
794 /* Get the current Server */
795 ServerDll = CsrLoadedServerDll[i];
796
797 /* Is it loaded, and does it have per process data? */
798 if (ServerDll && ServerDll->SizeOfProcessData)
799 {
800 /* It does, give it part of our allocated heap */
801 CsrRootProcess->ServerData[i] = ProcessData;
802
803 /* Move to the next heap position */
804 ProcessData = (PVOID)((ULONG_PTR)ProcessData +
805 ServerDll->SizeOfProcessData);
806 }
807 else
808 {
809 /* Nothing for this Server DLL */
811 }
812 }
813
814 /* Now initialize the Root Process manually as well */
815 for (i = 0; i < CSR_SERVER_DLL_MAX; i++)
816 {
817 /* Get the current Server */
818 ServerDll = CsrLoadedServerDll[i];
819
820 /* Is it loaded, and does it a callback for new processes? */
821 if (ServerDll && ServerDll->NewProcessCallback)
822 {
823 /* Call the callback */
825 }
826 }
827
828 return STATUS_SUCCESS;
829}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define __FUNCTION__
Definition: types.h:116
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define STATUS_SUCCESS
Definition: shellext.h:65
PVOID ServerData[ANYSIZE_ARRAY]
Definition: csrsrv.h:60
PCSR_NEWPROCESS_CALLBACK NewProcessCallback
Definition: csrsrv.h:239
ULONG SizeOfProcessData
Definition: csrsrv.h:234
PCSR_PROCESS CsrRootProcess
Definition: procsup.c:22
#define CSR_SERVER_DLL_MAX
Definition: api.h:34
PCSR_SERVER_DLL CsrLoadedServerDll[CSR_SERVER_DLL_MAX]
Definition: server.c:20
ULONG CsrTotalPerProcessDataLength
Definition: init.c:39
void * PVOID
Definition: typedefs.h:50

Referenced by CsrServerInitialization().

◆ CsrParseServerCommandLine()

NTSTATUS NTAPI CsrParseServerCommandLine ( IN ULONG  ArgumentCount,
IN PCHAR  Arguments[] 
)

Definition at line 554 of file init.c.

556{
558 PCHAR ParameterName = NULL, ParameterValue = NULL, EntryPoint, ServerString;
559 ULONG i, DllIndex;
562
563 /* Set the Defaults */
566#ifdef __REACTOS__
567 CsrWindowsControl = FALSE;
568 CsrSubSystemType = IMAGE_SUBSYSTEM_UNKNOWN;
569#endif
571
572 /* Save our Session ID, and create a Directory for it */
573 SessionId = NtCurrentPeb()->SessionId;
575 if (!NT_SUCCESS(Status))
576 {
577 DPRINT1("CSRSS: CsrCreateSessionObjectDirectory failed (%lx)\n",
578 Status);
579
580 /* It's not fatal if the session ID isn't zero */
581 if (SessionId != 0) return Status;
583 }
584
585 /* Loop through every argument */
586 for (i = 1; i < ArgumentCount; i++)
587 {
588 /* Split Name and Value */
589 ParameterName = Arguments[i];
593 DPRINT("Name=%s, Value=%s\n", ParameterName, ParameterValue);
594
595 /* Check for Object Directory */
596 if (_stricmp(ParameterName, "ObjectDirectory") == 0)
597 {
598 /* Check if a session ID is specified */
599 if (SessionId != 0)
600 {
601 DPRINT1("Sessions not yet implemented\n");
603 }
604
605 /* Initialize the directory name */
608 &AnsiString,
609 TRUE);
611 if (!NT_SUCCESS(Status)) return Status;
612
613 /* Create it */
617 NULL,
618 NULL);
622 if (!NT_SUCCESS(Status)) return Status;
623
624 /* Secure it */
626 if (!NT_SUCCESS(Status)) return Status;
627 }
628 else if (_stricmp(ParameterName, "SubSystemType") == 0)
629 {
630#ifdef __REACTOS__
631 /* Well-known subsystems, specified by names */
632 if (_stricmp(ParameterValue, "windows") == 0)
633 {
634 /* Behaviour compatible with Windows 7+ */
635 if (CsrWindowsControl)
636 CsrSubSystemType = IMAGE_SUBSYSTEM_WINDOWS_GUI;
637 else
638 CsrSubSystemType = IMAGE_SUBSYSTEM_WINDOWS_CUI;
639 }
640 else if (_stricmp(ParameterValue, "posix") == 0)
641 {
642 CsrSubSystemType = IMAGE_SUBSYSTEM_POSIX_CUI;
643 }
644 else if (_stricmp(ParameterValue, "os2") == 0)
645 {
646 CsrSubSystemType = IMAGE_SUBSYSTEM_OS2_CUI;
647 }
648 else if (_stricmp(ParameterValue, "native") == 0)
649 {
650 CsrSubSystemType = IMAGE_SUBSYSTEM_NATIVE;
651 }
652 else
653 {
654 /* Another subsystem type, specified by a numerical value */
655 Status = RtlCharToInteger(ParameterValue, 0, &CsrSubSystemType);
656 }
657#else
658 /* Ignored */
659#endif
660 }
661 else if (_stricmp(ParameterName, "MaxRequestThreads") == 0)
662 {
664 0,
666 }
667 else if (_stricmp(ParameterName, "RequestThreads") == 0)
668 {
669 /* Ignored */
671 }
672 else if (_stricmp(ParameterName, "ProfileControl") == 0)
673 {
674 /* Related functionality ignored since NT 3.5 */
675 }
676 else if (_stricmp(ParameterName, "SharedSection") == 0)
677 {
678 /* Create the Section */
680 if (!NT_SUCCESS(Status))
681 {
682 DPRINT1("CSRSS: *** Invalid syntax for %s=%s (Status == %X)\n",
684 return Status;
685 }
686
687 /* Load us */
688 Status = CsrLoadServerDll("CSRSS" /* "CSRSRV" */, NULL, CSRSRV_SERVERDLL_INDEX);
689 }
690 else if (_stricmp(ParameterName, "ServerDll") == 0)
691 {
692 /* Loop the command line */
693 EntryPoint = NULL;
695 ServerString = ParameterValue;
696 while (*ServerString)
697 {
698 /* Check for the Entry Point */
699 if ((*ServerString == ':') && (!EntryPoint))
700 {
701 /* Found it. NULL-terminate and save it. */
702 *ServerString++ = ANSI_NULL;
703 EntryPoint = ServerString;
704 }
705
706 /* Check for the Dll Index */
707 if (*ServerString++ == ',') break;
708 }
709
710 /* Did we find something to load? */
711 if (!*ServerString)
712 {
713 DPRINT1("CSRSS: *** Invalid syntax for ServerDll=%s (Status == %X)\n",
715 return Status;
716 }
717
718 /* Convert it to a ULONG */
719 Status = RtlCharToInteger(ServerString, 10, &DllIndex);
720
721 /* Add a null char if it was valid */
722 if (NT_SUCCESS(Status)) ServerString[-1] = ANSI_NULL;
723
724 /* Load it */
725 if (CsrDebug & 1) DPRINT1("CSRSS: Loading ServerDll=%s:%s\n", ParameterValue, EntryPoint);
726 Status = CsrLoadServerDll(ParameterValue, EntryPoint, DllIndex);
727 if (!NT_SUCCESS(Status))
728 {
729 DPRINT1("CSRSS: *** Failed loading ServerDll=%s (Status == 0x%x)\n",
731 return Status;
732 }
733 }
734 else if (_stricmp(ParameterName, "Windows") == 0)
735 {
736#ifdef __REACTOS__
737 CsrWindowsControl = (_stricmp(ParameterValue, "On") == 0);
738#else
739 /* Ignored */
740#endif
741 }
742 else
743 {
744 /* Invalid parameter on the command line */
746 }
747 }
748
749 /* Return status */
750 return Status;
751}
#define NtCurrentPeb()
Definition: FLS.c:22
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define _stricmp
Definition: cat.c:22
_In_opt_ PWSTR _In_ PWSTR ParameterName
Definition: cdrom.h:961
_In_opt_ PWSTR _In_ PWSTR _Inout_ PULONG ParameterValue
Definition: cdrom.h:963
#define CSRSRV_SERVERDLL_INDEX
Definition: csrmsg.h:20
@ AnsiString
Definition: dnslib.h:19
#define OBJ_PERMANENT
Definition: winternl.h:226
#define ASSERT(a)
Definition: mode.c:44
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
NTSYSAPI NTSTATUS NTAPI RtlCharToInteger(PCSZ String, ULONG Base, PULONG Value)
Definition: unicode.c:261
#define ANSI_NULL
#define IMAGE_SUBSYSTEM_POSIX_CUI
Definition: ntimage.h:440
#define IMAGE_SUBSYSTEM_WINDOWS_CUI
Definition: ntimage.h:438
#define IMAGE_SUBSYSTEM_OS2_CUI
Definition: ntimage.h:439
#define IMAGE_SUBSYSTEM_WINDOWS_GUI
Definition: ntimage.h:437
#define IMAGE_SUBSYSTEM_NATIVE
Definition: ntimage.h:436
#define IMAGE_SUBSYSTEM_UNKNOWN
Definition: ntimage.h:435
#define DPRINT
Definition: sndvol32.h:71
NTSTATUS NTAPI CsrSrvCreateSharedSection(IN PCHAR ParameterValue)
Definition: server.c:361
NTSTATUS NTAPI CsrLoadServerDll(IN PCHAR DllString, IN PCHAR EntryPoint OPTIONAL, IN ULONG ServerId)
Definition: server.c:126
ULONG SessionId
Definition: init.c:40
NTSTATUS NTAPI CsrCreateSessionObjectDirectory(IN ULONG Session)
Definition: init.c:424
UNICODE_STRING CsrDirectoryName
Definition: init.c:27
ULONG CsrDebug
Definition: init.c:23
ULONG CsrMaxApiRequestThreads
Definition: init.c:38
HANDLE CsrObjectDirectory
Definition: init.c:26
NTSTATUS NTAPI CsrSetDirectorySecurity(IN HANDLE ObjectDirectory)
Definition: init.c:186
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

Referenced by CsrServerInitialization().

◆ CsrPopulateDosDevices()

VOID NTAPI CsrPopulateDosDevices ( VOID  )

Definition at line 1146 of file init.c.

1147{
1148 DPRINT1("Deprecated API in r55585.\n");
1149 return;
1150}

◆ CsrSbApiPortInitialize()

NTSTATUS NTAPI CsrSbApiPortInitialize ( VOID  )

Definition at line 915 of file init.c.

916{
917 ULONG Size;
921 HANDLE hRequestThread;
923
924 /* Calculate how much space we'll need for the Port Name */
925 Size = CsrDirectoryName.Length + sizeof(SB_PORT_NAME) + sizeof(WCHAR);
926
927 /* Create the buffer for it */
930
931 /* Setup the rest of the empty string */
934
935 /* Now append the full port name */
939 if (CsrDebug & 2) DPRINT1("CSRSS: Creating %wZ port and associated thread\n", &CsrSbApiPortName);
940
941 /* Create Security Descriptor for this Port */
943 if (!NT_SUCCESS(Status)) return Status;
944
945 /* Initialize the Attributes */
948 0,
949 NULL,
950 PortSd);
951
952 /* Create the Port Object */
955 sizeof(SB_CONNECTION_INFO),
956 sizeof(SB_API_MSG),
957 32 * sizeof(SB_API_MSG));
958 if (PortSd) RtlFreeHeap(CsrHeap, 0, PortSd);
959
960 if (NT_SUCCESS(Status))
961 {
962 /* Create the Thread to handle the API Requests */
964 NULL,
965 TRUE,
966 0,
967 0,
968 0,
970 NULL,
971 &hRequestThread,
972 &ClientId);
973 if (NT_SUCCESS(Status))
974 {
975 /* Add it as a Static Server Thread */
977 &ClientId,
978 0);
979
980 /* Activate it */
981 Status = NtResumeThread(hRequestThread, NULL);
982 }
983 }
984
985 return Status;
986}
PCSR_THREAD NTAPI CsrAddStaticServerThread(IN HANDLE hThread, IN PCLIENT_ID ClientId, IN ULONG ThreadFlags)
Definition: thredsup.c:512
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
NTSYSAPI NTSTATUS NTAPI RtlCreateUserThread(_In_ PVOID ThreadContext, _Out_ HANDLE *OutThreadHandle, _Reserved_ PVOID Reserved1, _Reserved_ PVOID Reserved2, _Reserved_ PVOID Reserved3, _Reserved_ PVOID Reserved4, _Reserved_ PVOID Reserved5, _Reserved_ PVOID Reserved6, _Reserved_ PVOID Reserved7, _Reserved_ PVOID Reserved8)
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
#define NtCurrentProcess()
Definition: nt_native.h:1657
NTSTATUS NTAPI NtCreatePort(OUT PHANDLE PortHandle, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG MaxConnectInfoLength, IN ULONG MaxDataLength, IN ULONG MaxPoolUsage)
Definition: create.c:222
NTSTATUS NTAPI NtResumeThread(IN HANDLE ThreadHandle, OUT PULONG SuspendCount OPTIONAL)
Definition: state.c:290
unsigned short USHORT
Definition: pedump.c:61
#define SB_PORT_NAME
Definition: srv.h:47
#define UNICODE_PATH_SEP
Definition: srv.h:49
USHORT MaximumLength
Definition: env_spec_w32.h:370
VOID NTAPI CsrSbApiRequestThread(IN PVOID Parameter)
Definition: session.c:484
PCSR_THREAD CsrSbApiRequestThreadPtr
Definition: init.c:30
HANDLE CsrSbApiPort
Definition: init.c:29
UNICODE_STRING CsrSbApiPortName
Definition: init.c:28
NTSTATUS NTAPI CsrCreateLocalSystemSD(OUT PSECURITY_DESCRIPTOR *LocalSystemSd)
Definition: init.c:847
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1151

Referenced by CsrServerInitialization().

◆ CsrServerInitialization()

NTSTATUS NTAPI CsrServerInitialization ( IN ULONG  ArgumentCount,
IN PCHAR  Arguments[] 
)

Definition at line 1011 of file init.c.

1013{
1015
1016 /* Cache System Basic Information so we don't always request it */
1018 &CsrNtSysInfo,
1020 NULL);
1021 if (!NT_SUCCESS(Status))
1022 {
1023 DPRINT1("CSRSRV:%s: NtQuerySystemInformation failed (Status=0x%08lx)\n",
1025 return Status;
1026 }
1027
1028 /* Save our Heap */
1029 CsrHeap = RtlGetProcessHeap();
1030
1031 /* Set our Security Descriptor to protect the process */
1033 if (!NT_SUCCESS(Status))
1034 {
1035 DPRINT1("CSRSRV:%s: CsrSetProcessSecurity failed (Status=0x%08lx)\n",
1037 return Status;
1038 }
1039
1040 /* Set up Session Support */
1042 if (!NT_SUCCESS(Status))
1043 {
1044 DPRINT1("CSRSRV:%s: CsrInitializeSessions failed (Status=0x%08lx)\n",
1046 return Status;
1047 }
1048
1049 /* Set up Process Support and allocate the CSR Root Process */
1051 if (!NT_SUCCESS(Status))
1052 {
1053 DPRINT1("CSRSRV:%s: CsrInitializeProcessStructure failed (Status=0x%08lx)\n",
1055 return Status;
1056 }
1057
1058 /* Parse the command line */
1059 Status = CsrParseServerCommandLine(ArgumentCount, Arguments);
1060 if (!NT_SUCCESS(Status))
1061 {
1062 DPRINT1("CSRSRV:%s: CsrParseServerCommandLine failed (Status=0x%08lx)\n",
1064 return Status;
1065 }
1066
1067 /* Finish to initialize the CSR Root Process */
1069 if (!NT_SUCCESS(Status))
1070 {
1071 DPRINT1("CSRSRV:%s: CsrInitCsrRootProcess failed (Status=0x%08lx)\n",
1073 return Status;
1074 }
1075
1076 /* Now initialize our API Port */
1078 if (!NT_SUCCESS(Status))
1079 {
1080 DPRINT1("CSRSRV:%s: CsrApiPortInitialize failed (Status=0x%08lx)\n",
1082 return Status;
1083 }
1084
1085#ifdef __REACTOS__
1086 if (CsrSubSystemType != IMAGE_SUBSYSTEM_UNKNOWN)
1087 {
1088#endif
1089 /* Initialize the API Port for SM communication */
1091 if (!NT_SUCCESS(Status))
1092 {
1093 DPRINT1("CSRSRV:%s: CsrSbApiPortInitialize failed (Status=0x%08lx)\n",
1095 return Status;
1096 }
1097
1098 /* We're all set! Connect to SM! */
1101#ifdef __REACTOS__
1102 CsrSubSystemType,
1103#else
1105#endif
1106 &CsrSmApiPort);
1107 if (!NT_SUCCESS(Status))
1108 {
1109 DPRINT1("CSRSRV:%s: SmConnectToSm failed (Status=0x%08lx)\n",
1111 return Status;
1112 }
1113#ifdef __REACTOS__
1114 }
1115#endif
1116
1117 /* Have us handle Hard Errors */
1119 if (!NT_SUCCESS(Status))
1120 {
1121 DPRINT1("CSRSRV:%s: NtSetDefaultHardErrorPort failed (Status=0x%08lx)\n",
1123 return Status;
1124 }
1125
1126 /* Return status */
1127 return Status;
1128}
@ SystemBasicInformation
Definition: ntddk_ex.h:11
NTSTATUS NTAPI NtSetDefaultHardErrorPort(IN HANDLE PortHandle)
Definition: harderr.c:740
NTSTATUS NTAPI SmConnectToSm(_In_opt_ PUNICODE_STRING SbApiPortName, _In_opt_ HANDLE SbApiPort, _In_opt_ ULONG ImageType, _Out_ PHANDLE SmApiPort)
Connects to the SM API port for registering a session callback port (Sb) associated to a subsystem,...
Definition: smclient.c:57
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
NTSTATUS NTAPI CsrApiPortInitialize(VOID)
Definition: api.c:900
NTSTATUS NTAPI CsrInitializeNtSessionList(VOID)
Definition: session.c:53
NTSTATUS NTAPI CsrInitializeProcessStructure(VOID)
Definition: procsup.c:255
NTSTATUS NTAPI CsrSbApiPortInitialize(VOID)
Definition: init.c:915
NTSTATUS NTAPI CsrParseServerCommandLine(IN ULONG ArgumentCount, IN PCHAR Arguments[])
Definition: init.c:554
NTSTATUS NTAPI CsrSetProcessSecurity(VOID)
Definition: init.c:66
HANDLE CsrSmApiPort
Definition: init.c:31
HANDLE CsrApiPort
Definition: init.c:33
NTSTATUS NTAPI CsrInitCsrRootProcess(VOID)
Definition: init.c:769
SYSTEM_BASIC_INFORMATION CsrNtSysInfo
Definition: init.c:44

Referenced by _main().

◆ CsrSetDirectorySecurity()

NTSTATUS NTAPI CsrSetDirectorySecurity ( IN HANDLE  ObjectDirectory)

Definition at line 186 of file init.c.

187{
188 /* FIXME: Implement */
189 return STATUS_SUCCESS;
190}

Referenced by CsrParseServerCommandLine().

◆ CsrSetProcessSecurity()

NTSTATUS NTAPI CsrSetProcessSecurity ( VOID  )

Definition at line 66 of file init.c.

67{
71 PTOKEN_USER TokenInfo = NULL;
73 PACL Dacl;
74 PSID UserSid;
75
76 /* Open our token */
78 if (!NT_SUCCESS(Status)) goto Quickie;
79
80 /* Get the Token User Length */
83 {
84 NtClose(hToken);
85 goto Quickie;
86 }
87
88 /* Allocate space for it */
90 if (!TokenInfo)
91 {
92 NtClose(hToken);
94 goto Quickie;
95 }
96
97 /* Now query the data */
98 Status = NtQueryInformationToken(hToken, TokenUser, TokenInfo, Length, &Length);
99 NtClose(hToken);
100 if (!NT_SUCCESS(Status)) goto Quickie;
101
102 /* Now check the SID Length */
103 UserSid = TokenInfo->User.Sid;
104 Length = RtlLengthSid(UserSid) + sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE);
105
106 /* Allocate a buffer for the Security Descriptor, with SID and DACL */
108 if (!ProcSd)
109 {
111 goto Quickie;
112 }
113
114 /* Set the pointer to the DACL */
116
117 /* Now create the SD itself */
119 if (!NT_SUCCESS(Status))
120 {
121 DPRINT1("CSRSS: SD creation failed - status = %lx\n", Status);
122 goto Quickie;
123 }
124
125 /* Create the DACL for it*/
127 if (!NT_SUCCESS(Status))
128 {
129 DPRINT1("CSRSS: DACL creation failed - status = %lx\n", Status);
130 goto Quickie;
131 }
132
133 /* Create the ACE */
140 UserSid);
141 if (!NT_SUCCESS(Status))
142 {
143 DPRINT1("CSRSS: ACE creation failed - status = %lx\n", Status);
144 goto Quickie;
145 }
146
147 /* Clear the DACL in the SD */
149 if (!NT_SUCCESS(Status))
150 {
151 DPRINT1("CSRSS: set DACL failed - status = %lx\n", Status);
152 goto Quickie;
153 }
154
155 /* Write the SD into the Process */
157 if (!NT_SUCCESS(Status))
158 {
159 DPRINT1("CSRSS: set process DACL failed - status = %lx\n", Status);
160 goto Quickie;
161 }
162
163 /* Free the memory and return */
164Quickie:
165 if (ProcSd) RtlFreeHeap(CsrHeap, 0, ProcSd);
166 if (TokenInfo) RtlFreeHeap(CsrHeap, 0, TokenInfo);
167 return Status;
168}
#define PROCESS_SUSPEND_RESUME
Definition: pstypes.h:167
#define PROCESS_TERMINATE
Definition: pstypes.h:157
#define PROCESS_VM_READ
Definition: pstypes.h:161
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:166
#define PROCESS_VM_WRITE
Definition: pstypes.h:162
#define PROCESS_VM_OPERATION
Definition: pstypes.h:160
#define PROCESS_DUP_HANDLE
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
#define READ_CONTROL
Definition: nt_native.h:58
NTSTATUS NTAPI NtOpenProcessToken(IN HANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, OUT PHANDLE TokenHandle)
Definition: security.c:350
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
NTSTATUS WINAPI NtSetSecurityObject(HANDLE Handle, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor)
SID_AND_ATTRIBUTES User
Definition: setypes.h:1010
_Must_inspect_result_ __kernel_entry NTSTATUS NTAPI NtQueryInformationToken(_In_ HANDLE TokenHandle, _In_ TOKEN_INFORMATION_CLASS TokenInformationClass, _Out_writes_bytes_to_opt_(TokenInformationLength, *ReturnLength) PVOID TokenInformation, _In_ ULONG TokenInformationLength, _Out_ PULONG ReturnLength)
Queries a specific type of information in regard of an access token based upon the information class....
Definition: tokencls.c:473
#define DACL_SECURITY_INFORMATION
Definition: setypes.h:125
#define TOKEN_QUERY
Definition: setypes.h:928
@ TokenUser
Definition: setypes.h:966

Referenced by CsrServerInitialization().

◆ DllMain()

BOOL NTAPI DllMain ( IN HINSTANCE  hInstanceDll,
IN DWORD  dwReason,
IN LPVOID  lpReserved 
)

@DllMain

Core routine of the Utility Manager's library.

Parameters
[in]hDllInstanceThe entry point instance of the library.
[in]fdwReasonThe reason argument to indicate the motive DllMain is being called.
[in]lpvReservedReserved.
Returns
Returns TRUE when main call initialization has succeeded, FALSE otherwise.

Definition at line 1154 of file init.c.

1157{
1158 /* We don't do much */
1159 UNREFERENCED_PARAMETER(hInstanceDll);
1161 UNREFERENCED_PARAMETER(lpReserved);
1162
1163 return TRUE;
1164}
DWORD dwReason
Definition: misc.cpp:154
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317

◆ FreeDosDevicesProtection()

VOID NTAPI FreeDosDevicesProtection ( IN PSECURITY_DESCRIPTOR  DosDevicesSd)

Definition at line 392 of file init.c.

393{
394 PACL Dacl;
395 BOOLEAN Present, Default;
397
398 /* Get the DACL corresponding to this SD */
399 Status = RtlGetDaclSecurityDescriptor(DosDevicesSd, &Present, &Dacl, &Default);
401 ASSERT(Present);
402 ASSERT(Dacl != NULL);
403
404 /* Free it */
405 if ((NT_SUCCESS(Status)) && (Dacl)) RtlFreeHeap(CsrHeap, 0, Dacl);
406}
unsigned char BOOLEAN
@ Default
Definition: stdole2.idl:392
NTSYSAPI NTSTATUS NTAPI RtlGetDaclSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PBOOLEAN DaclPresent, _Out_ PACL *Dacl, _Out_ PBOOLEAN DaclDefaulted)

Referenced by CsrCreateSessionObjectDirectory().

◆ GetDosDevicesProtection()

NTSTATUS NTAPI GetDosDevicesProtection ( OUT PSECURITY_DESCRIPTOR  DosDevicesSd)

Definition at line 209 of file init.c.

210{
214 PSID WorldSid, CreatorSid, AdminSid, SystemSid;
215 UCHAR KeyValueBuffer[0x40];
216 PKEY_VALUE_PARTIAL_INFORMATION KeyValuePartialInfo;
220 PACL Dacl;
222 HANDLE hKey;
224 ULONG ResultLength, SidLength, AclLength;
225
226 /* Create the SD */
229
230 /* Initialize the System SID */
233 0, 0, 0, 0, 0, 0, 0,
234 &SystemSid);
236
237 /* Initialize the World SID */
240 0, 0, 0, 0, 0, 0, 0,
241 &WorldSid);
243
244 /* Initialize the Admin SID */
248 0, 0, 0, 0, 0, 0,
249 &AdminSid);
251
252 /* Initialize the Creator SID */
253 Status = RtlAllocateAndInitializeSid(&CreatorAuthority, 1,
255 0, 0, 0, 0, 0, 0, 0,
256 &CreatorSid);
258
259 /* Open the Session Manager Key */
262 &KeyName,
264 NULL,
265 NULL);
267 if (NT_SUCCESS(Status))
268 {
269 /* Read the key value */
270 RtlInitUnicodeString(&KeyName, L"ProtectionMode");
272 &KeyName,
274 KeyValueBuffer,
275 sizeof(KeyValueBuffer),
276 &ResultLength);
277
278 /* Make sure it's what we expect it to be */
279 KeyValuePartialInfo = (PKEY_VALUE_PARTIAL_INFORMATION)KeyValueBuffer;
280 if ((NT_SUCCESS(Status)) && (KeyValuePartialInfo->Type == REG_DWORD) &&
281 (*(PULONG)KeyValuePartialInfo->Data))
282 {
283 /* Save the Protection Mode */
284 ProtectionMode = *(PULONG)KeyValuePartialInfo->Data;
285 }
286
287 /* Close the handle */
288 NtClose(hKey);
289 }
290
291 /* Check the Protection Mode */
292 if (ProtectionMode & 3)
293 {
294 /* Calculate SID Lengths */
295 SidLength = RtlLengthSid(CreatorSid) + RtlLengthSid(SystemSid) +
297 AclLength = sizeof(ACL) + 3 * sizeof(ACCESS_ALLOWED_ACE) + SidLength;
298
299 /* Allocate memory for the DACL */
301 ASSERT(Dacl != NULL);
302
303 /* Build the ACL and add 3 ACEs */
312
313 /* Edit the ACEs to make them inheritable */
314 Status = RtlGetAce(Dacl, 0, (PVOID*)&Ace);
316 Ace->Header.AceFlags |= OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE;
317 Status = RtlGetAce(Dacl, 1, (PVOID*)&Ace);
319 Ace->Header.AceFlags |= OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE;
320 Status = RtlGetAce(Dacl, 2, (PVOID*)&Ace);
323
324 /* Set this DACL with the SD */
327 goto Quickie;
328 }
329 else
330 {
331 /* Calculate SID Lengths */
332 SidLength = RtlLengthSid(WorldSid) + RtlLengthSid(SystemSid);
333 AclLength = sizeof(ACL) + 3 * sizeof(ACCESS_ALLOWED_ACE) + SidLength;
334
335 /* Allocate memory for the DACL */
337 ASSERT(Dacl != NULL);
338
339 /* Build the ACL and add 3 ACEs */
348
349 /* Edit the last ACE to make it inheritable */
350 Status = RtlGetAce(Dacl, 2, (PVOID*)&Ace);
353
354 /* Set this DACL with the SD */
357 goto Quickie;
358 }
359
360/* FIXME: failure cases! Fail: */
361 /* Free the memory */
363
364/* FIXME: semi-failure cases! Quickie: */
365Quickie:
366 /* Free the SIDs */
367 RtlFreeSid(CreatorSid);
370 RtlFreeSid(SystemSid);
371
372 /* Return */
373 return Status;
374}
PSID WorldSid
Definition: globals.c:15
ULONG ProtectionMode
Definition: init.c:34
@ Ace
Definition: card.h:12
#define GENERIC_READ
Definition: compat.h:135
static SID_IDENTIFIER_AUTHORITY WorldAuthority
Definition: security.c:14
FxAutoRegKey hKey
static PSID AdminSid
Definition: msgina.c:39
NTSYSAPI NTSTATUS NTAPI RtlGetAce(PACL Acl, ULONG AceIndex, PVOID *Ace)
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
Definition: ntapi.c:336
@ KeyValuePartialInformation
Definition: nt_native.h:1182
#define KEY_READ
Definition: nt_native.h:1023
NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
#define GENERIC_ALL
Definition: nt_native.h:92
struct _KEY_VALUE_PARTIAL_INFORMATION * PKEY_VALUE_PARTIAL_INFORMATION
#define GENERIC_WRITE
Definition: nt_native.h:90
#define GENERIC_EXECUTE
Definition: nt_native.h:91
#define REG_DWORD
Definition: sdbapi.c:596
#define SM_REG_KEY
Definition: srv.h:41
uint32_t * PULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
_In_ ULONG AclLength
Definition: rtlfuncs.h:1842
#define CONTAINER_INHERIT_ACE
Definition: setypes.h:747
#define INHERIT_ONLY_ACE
Definition: setypes.h:749
#define SECURITY_BUILTIN_DOMAIN_RID
Definition: setypes.h:581
#define SECURITY_WORLD_SID_AUTHORITY
Definition: setypes.h:527
#define SECURITY_WORLD_RID
Definition: setypes.h:541
#define OBJECT_INHERIT_ACE
Definition: setypes.h:746
#define SECURITY_CREATOR_OWNER_RID
Definition: setypes.h:545
#define DOMAIN_ALIAS_RID_ADMINS
Definition: setypes.h:652
#define SECURITY_CREATOR_SID_AUTHORITY
Definition: setypes.h:533
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by CsrCreateSessionObjectDirectory().

Variable Documentation

◆ BNOLinksDirectory

HANDLE BNOLinksDirectory

Definition at line 41 of file init.c.

Referenced by CsrCreateSessionObjectDirectory().

◆ CsrApiPort

HANDLE CsrApiPort = NULL

Definition at line 33 of file init.c.

Referenced by CsrServerInitialization(), and UserClientConnect().

◆ CsrDebug

◆ CsrDirectoryName

UNICODE_STRING CsrDirectoryName

Definition at line 27 of file init.c.

Referenced by CsrApiPortInitialize(), CsrParseServerCommandLine(), and CsrSbApiPortInitialize().

◆ CsrHeap

◆ CsrMaxApiRequestThreads

ULONG CsrMaxApiRequestThreads

Definition at line 38 of file init.c.

Referenced by CsrParseServerCommandLine(), and CsrpCheckRequestThreads().

◆ CsrNtSysInfo

Definition at line 44 of file init.c.

Referenced by CsrServerInitialization(), and CsrSrvCreateSharedSection().

◆ CsrObjectDirectory

HANDLE CsrObjectDirectory = NULL

Definition at line 26 of file init.c.

Referenced by CsrParseServerCommandLine().

◆ CsrSbApiPort

HANDLE CsrSbApiPort = NULL

Definition at line 29 of file init.c.

Referenced by CsrSbApiPortInitialize(), CsrSbApiRequestThread(), and CsrServerInitialization().

◆ CsrSbApiPortName

UNICODE_STRING CsrSbApiPortName

Definition at line 28 of file init.c.

Referenced by CsrSbApiPortInitialize(), and CsrServerInitialization().

◆ CsrSbApiRequestThreadPtr

PCSR_THREAD CsrSbApiRequestThreadPtr

Definition at line 30 of file init.c.

Referenced by CsrSbApiPortInitialize().

◆ CsrSmApiPort

HANDLE CsrSmApiPort = NULL

Definition at line 31 of file init.c.

Referenced by CsrDereferenceNtSession(), and CsrServerInitialization().

◆ CsrTotalPerProcessDataLength

ULONG CsrTotalPerProcessDataLength

◆ DosDevicesDirectory

HANDLE DosDevicesDirectory

Definition at line 43 of file init.c.

Referenced by CsrCreateSessionObjectDirectory().

◆ hSbApiPort

HANDLE hSbApiPort = NULL

Definition at line 32 of file init.c.

◆ SessionId

ULONG SessionId

◆ SessionObjectDirectory

HANDLE SessionObjectDirectory

Definition at line 42 of file init.c.

Referenced by CsrCreateSessionObjectDirectory().