ReactOS 0.4.17-dev-684-ga6524ef
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 845 of file init.c.

846{
848 PSID SystemSid;
850 PSECURITY_DESCRIPTOR SystemSd;
851 PACL Dacl;
853
854 /* Initialize the System SID */
857 0, 0, 0, 0, 0, 0, 0,
858 &SystemSid);
859
860 /* Get the length of the SID */
861 Length = RtlLengthSid(SystemSid) + sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE);
862
863 /* Allocate a buffer for the Security Descriptor, with SID and DACL */
865
866 /* Set the pointer to the DACL */
868
869 /* Now create the SD itself */
871 if (!NT_SUCCESS(Status)) goto Quit;
872
873 /* Create the DACL for it */
875
876 /* Create the ACE */
878 if (!NT_SUCCESS(Status)) goto Quit;
879
880 /* Clear the DACL in the SD */
882 if (!NT_SUCCESS(Status)) goto Quit;
883
884Quit:
885 if (!NT_SUCCESS(Status))
886 {
887 RtlFreeHeap(CsrHeap, 0, SystemSd);
888 SystemSd = NULL;
889 }
890
891 /* Free the SID and return*/
892 RtlFreeSid(SystemSid);
893 *LocalSystemSd = SystemSd;
894 return Status;
895}
LONG NTSTATUS
Definition: precomp.h:26
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:616
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:634
#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:33
Status
Definition: gdiplustypes.h:24
#define PORT_ALL_ACCESS
Definition: lpctypes.h:51
struct _ACL ACL
struct _ACL * PACL
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
Definition: rtlfuncs.h:1625
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
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL, DWORD, DWORD, PSID)
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
#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:827
#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"%lu", Session);
455 RtlInitUnicodeString(&SessionString, SessionBuffer);
456
457 /* Create the per-session symlink to the BaseNamedObjects directory */
458 if (Session)
459 {
460 /* Use the session path */
461 _swprintf(BnoBuffer, L"%ws\\%lu\\BaseNamedObjects", SESSION_ROOT, Session);
462 RtlInitUnicodeString(&BnoString, BnoBuffer);
463 }
464 else
465 {
466 /* Use the direct name */
467 RtlInitUnicodeString(&BnoString, L"\\BaseNamedObjects");
468 }
470 &SessionString,
473 NULL);
477 &BnoString);
478 if (!NT_SUCCESS(Status))
479 {
480 DPRINT1("CSRSS: NtCreateSymbolicLinkObject failed in "
481 "CsrCreateSessionObjectDirectory - status = %lx\n", Status);
482 return Status;
483 }
484
485 /* Create the \DosDevices security descriptor */
486 Status = GetDosDevicesProtection(&DosDevicesSd);
487 if (!NT_SUCCESS(Status)) return Status;
488
489 /* Now create a directory for this session */
490 _swprintf(SessionBuffer, L"%ws\\%lu", SESSION_ROOT, Session);
491 RtlInitUnicodeString(&SessionString, SessionBuffer);
492
493 /* Create the directory */
495 &SessionString,
497 0,
498 &DosDevicesSd);
502 if (!NT_SUCCESS(Status))
503 {
504 DPRINT1("CSRSS: NtCreateDirectoryObject failed in "
505 "CsrCreateSessionObjectDirectory - status = %lx\n", Status);
506 FreeDosDevicesProtection(&DosDevicesSd);
507 return Status;
508 }
509
510 /* Next, create a directory for this session's DOS Devices */
511 RtlInitUnicodeString(&SessionString, L"DosDevices");
513 &SessionString,
516 &DosDevicesSd);
520 if (!NT_SUCCESS(Status))
521 {
522 DPRINT1("CSRSS: NtCreateDirectoryObject failed in "
523 "CsrCreateSessionObjectDirectory - status = %lx\n", Status);
524 }
525
526 /* Release the security descriptor */
527 FreeDosDevicesProtection(&DosDevicesSd);
528
529 /* Return */
530 return Status;
531}
#define DPRINT1
Definition: precomp.h:8
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define L(x)
Definition: resources.c:13
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:115
#define SYMBOLIC_LINK_ALL_ACCESS
Definition: nt_native.h:1270
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define DIRECTORY_ALL_ACCESS
Definition: nt_native.h:1262
NTSTATUS NTAPI NtCreateDirectoryObject(OUT PHANDLE DirectoryHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
Definition: obdir.c:765
short WCHAR
Definition: pedump.c:58
#define OBJ_OPENIF
Definition: winternl.h:229
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#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

Referenced by CsrParseServerCommandLine().

◆ CsrInitCsrRootProcess()

NTSTATUS NTAPI CsrInitCsrRootProcess ( VOID  )

Definition at line 767 of file init.c.

768{
769 PVOID ProcessData;
770 PCSR_SERVER_DLL ServerDll;
771 ULONG i = 0;
772
773 /* All Server DLLs are now loaded, allocate a heap for the Root Process */
774 ProcessData = RtlAllocateHeap(CsrHeap,
777 if (!ProcessData)
778 {
779 DPRINT1("CSRSRV:%s: RtlAllocateHeap failed (Status=%08lx)\n",
781 return STATUS_NO_MEMORY;
782 }
783
784 /*
785 * Our Root Process was never officially initialized,
786 * so write the data for each Server DLL manually.
787 */
788
789 /* Loop every DLL */
790 for (i = 0; i < CSR_SERVER_DLL_MAX; i++)
791 {
792 /* Get the current Server */
793 ServerDll = CsrLoadedServerDll[i];
794
795 /* Is it loaded, and does it have per process data? */
796 if (ServerDll && ServerDll->SizeOfProcessData)
797 {
798 /* It does, give it part of our allocated heap */
799 CsrRootProcess->ServerData[i] = ProcessData;
800
801 /* Move to the next heap position */
802 ProcessData = (PVOID)((ULONG_PTR)ProcessData +
803 ServerDll->SizeOfProcessData);
804 }
805 else
806 {
807 /* Nothing for this Server DLL */
809 }
810 }
811
812 /* Now initialize the Root Process manually as well */
813 for (i = 0; i < CSR_SERVER_DLL_MAX; i++)
814 {
815 /* Get the current Server */
816 ServerDll = CsrLoadedServerDll[i];
817
818 /* Is it loaded, and does it a callback for new processes? */
819 if (ServerDll && ServerDll->NewProcessCallback)
820 {
821 /* Call the callback */
823 }
824 }
825
826 return STATUS_SUCCESS;
827}
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#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_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 552 of file init.c.

554{
556 PCHAR ParameterName = NULL, ParameterValue = NULL, EntryPoint, ServerString;
557 ULONG i, DllIndex;
560
561 /* Set the Defaults */
564#ifdef __REACTOS__
565 CsrWindowsControl = FALSE;
566 CsrSubSystemType = IMAGE_SUBSYSTEM_UNKNOWN;
567#endif
569
570 /* Save our Session ID, and create a Directory for it */
571 SessionId = NtCurrentPeb()->SessionId;
573 if (!NT_SUCCESS(Status))
574 {
575 DPRINT1("CSRSS: CsrCreateSessionObjectDirectory failed (%lx)\n",
576 Status);
577
578 /* It's not fatal if the session ID isn't zero */
579 if (SessionId != 0) return Status;
581 }
582
583 /* Loop through every argument */
584 for (i = 1; i < ArgumentCount; i++)
585 {
586 /* Split Name and Value */
587 ParameterName = Arguments[i];
591 DPRINT("Name=%s, Value=%s\n", ParameterName, ParameterValue);
592
593 /* Check for Object Directory */
594 if (_stricmp(ParameterName, "ObjectDirectory") == 0)
595 {
596 /* Check if a session ID is specified */
597 if (SessionId != 0)
598 {
599 DPRINT1("Sessions not yet implemented\n");
601 }
602
603 /* Initialize the directory name */
606 &AnsiString,
607 TRUE);
609 if (!NT_SUCCESS(Status)) return Status;
610
611 /* Create it */
615 NULL,
616 NULL);
620 if (!NT_SUCCESS(Status)) return Status;
621
622 /* Secure it */
624 if (!NT_SUCCESS(Status)) return Status;
625 }
626 else if (_stricmp(ParameterName, "SubSystemType") == 0)
627 {
628#ifdef __REACTOS__
629 /* Well-known subsystems, specified by names */
630 if (_stricmp(ParameterValue, "windows") == 0)
631 {
632 /* Behaviour compatible with Windows 7+ */
633 if (CsrWindowsControl)
634 CsrSubSystemType = IMAGE_SUBSYSTEM_WINDOWS_GUI;
635 else
636 CsrSubSystemType = IMAGE_SUBSYSTEM_WINDOWS_CUI;
637 }
638 else if (_stricmp(ParameterValue, "posix") == 0)
639 {
640 CsrSubSystemType = IMAGE_SUBSYSTEM_POSIX_CUI;
641 }
642 else if (_stricmp(ParameterValue, "os2") == 0)
643 {
644 CsrSubSystemType = IMAGE_SUBSYSTEM_OS2_CUI;
645 }
646 else if (_stricmp(ParameterValue, "native") == 0)
647 {
648 CsrSubSystemType = IMAGE_SUBSYSTEM_NATIVE;
649 }
650 else
651 {
652 /* Another subsystem type, specified by a numerical value */
653 Status = RtlCharToInteger(ParameterValue, 0, &CsrSubSystemType);
654 }
655#else
656 /* Ignored */
657#endif
658 }
659 else if (_stricmp(ParameterName, "MaxRequestThreads") == 0)
660 {
662 0,
664 }
665 else if (_stricmp(ParameterName, "RequestThreads") == 0)
666 {
667 /* Ignored */
669 }
670 else if (_stricmp(ParameterName, "ProfileControl") == 0)
671 {
672 /* Related functionality ignored since NT 3.5 */
673 }
674 else if (_stricmp(ParameterName, "SharedSection") == 0)
675 {
676 /* Create the Section */
678 if (!NT_SUCCESS(Status))
679 {
680 DPRINT1("CSRSS: *** Invalid syntax for %s=%s (Status == %X)\n",
682 return Status;
683 }
684
685 /* Load us */
686 Status = CsrLoadServerDll("CSRSS" /* "CSRSRV" */, NULL, CSRSRV_SERVERDLL_INDEX);
687 }
688 else if (_stricmp(ParameterName, "ServerDll") == 0)
689 {
690 /* Loop the command line */
691 EntryPoint = NULL;
693 ServerString = ParameterValue;
694 while (*ServerString)
695 {
696 /* Check for the Entry Point */
697 if ((*ServerString == ':') && (!EntryPoint))
698 {
699 /* Found it. NULL-terminate and save it. */
700 *ServerString++ = ANSI_NULL;
701 EntryPoint = ServerString;
702 }
703
704 /* Check for the Dll Index */
705 if (*ServerString++ == ',') break;
706 }
707
708 /* Did we find something to load? */
709 if (!*ServerString)
710 {
711 DPRINT1("CSRSS: *** Invalid syntax for ServerDll=%s (Status == %X)\n",
713 return Status;
714 }
715
716 /* Convert it to a ULONG */
717 Status = RtlCharToInteger(ServerString, 10, &DllIndex);
718
719 /* Add a null char if it was valid */
720 if (NT_SUCCESS(Status)) ServerString[-1] = ANSI_NULL;
721
722 /* Load it */
723 if (CsrDebug & 1) DPRINT1("CSRSS: Loading ServerDll=%s:%s\n", ParameterValue, EntryPoint);
724 Status = CsrLoadServerDll(ParameterValue, EntryPoint, DllIndex);
725 if (!NT_SUCCESS(Status))
726 {
727 DPRINT1("CSRSS: *** Failed loading ServerDll=%s (Status == 0x%x)\n",
729 return Status;
730 }
731 }
732 else if (_stricmp(ParameterName, "Windows") == 0)
733 {
734#ifdef __REACTOS__
735 CsrWindowsControl = (_stricmp(ParameterValue, "On") == 0);
736#else
737 /* Ignored */
738#endif
739 }
740 else
741 {
742 /* Invalid parameter on the command line */
744 }
745 }
746
747 /* Return status */
748 return Status;
749}
#define NtCurrentPeb()
Definition: FLS.c:22
#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
_ACRTIMP char *__cdecl strchr(const char *, int)
Definition: string.c:3291
@ AnsiString
Definition: dnslib.h:19
#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 OBJ_PERMANENT
Definition: winternl.h:226
#define DPRINT
Definition: sndvol32.h:73
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 1144 of file init.c.

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

◆ CsrSbApiPortInitialize()

NTSTATUS NTAPI CsrSbApiPortInitialize ( VOID  )

Definition at line 913 of file init.c.

914{
915 ULONG Size;
919 HANDLE hRequestThread;
921
922 /* Calculate how much space we'll need for the Port Name */
923 Size = CsrDirectoryName.Length + sizeof(SB_PORT_NAME) + sizeof(WCHAR);
924
925 /* Create the buffer for it */
928
929 /* Setup the rest of the empty string */
932
933 /* Now append the full port name */
937 if (CsrDebug & 2) DPRINT1("CSRSS: Creating %wZ port and associated thread\n", &CsrSbApiPortName);
938
939 /* Create Security Descriptor for this Port */
941 if (!NT_SUCCESS(Status)) return Status;
942
943 /* Initialize the Attributes */
946 0,
947 NULL,
948 PortSd);
949
950 /* Create the Port Object */
953 sizeof(SB_CONNECTION_INFO),
954 sizeof(SB_API_MSG),
955 32 * sizeof(SB_API_MSG));
956 if (PortSd) RtlFreeHeap(CsrHeap, 0, PortSd);
957
958 if (NT_SUCCESS(Status))
959 {
960 /* Create the Thread to handle the API Requests */
962 NULL,
963 TRUE,
964 0,
965 0,
966 0,
968 NULL,
969 &hRequestThread,
970 &ClientId);
971 if (NT_SUCCESS(Status))
972 {
973 /* Add it as a Static Server Thread */
975 &ClientId,
976 0);
977
978 /* Activate it */
979 Status = NtResumeThread(hRequestThread, NULL);
980 }
981 }
982
983 return Status;
984}
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:1660
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:845
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1151

Referenced by CsrServerInitialization().

◆ CsrServerInitialization()

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

Definition at line 1009 of file init.c.

1011{
1013
1014 /* Cache System Basic Information so we don't always request it */
1016 &CsrNtSysInfo,
1018 NULL);
1019 if (!NT_SUCCESS(Status))
1020 {
1021 DPRINT1("CSRSRV:%s: NtQuerySystemInformation failed (Status=0x%08lx)\n",
1023 return Status;
1024 }
1025
1026 /* Save our Heap */
1027 CsrHeap = RtlGetProcessHeap();
1028
1029 /* Set our Security Descriptor to protect the process */
1031 if (!NT_SUCCESS(Status))
1032 {
1033 DPRINT1("CSRSRV:%s: CsrSetProcessSecurity failed (Status=0x%08lx)\n",
1035 return Status;
1036 }
1037
1038 /* Set up Session Support */
1040 if (!NT_SUCCESS(Status))
1041 {
1042 DPRINT1("CSRSRV:%s: CsrInitializeSessions failed (Status=0x%08lx)\n",
1044 return Status;
1045 }
1046
1047 /* Set up Process Support and allocate the CSR Root Process */
1049 if (!NT_SUCCESS(Status))
1050 {
1051 DPRINT1("CSRSRV:%s: CsrInitializeProcessStructure failed (Status=0x%08lx)\n",
1053 return Status;
1054 }
1055
1056 /* Parse the command line */
1057 Status = CsrParseServerCommandLine(ArgumentCount, Arguments);
1058 if (!NT_SUCCESS(Status))
1059 {
1060 DPRINT1("CSRSRV:%s: CsrParseServerCommandLine failed (Status=0x%08lx)\n",
1062 return Status;
1063 }
1064
1065 /* Finish to initialize the CSR Root Process */
1067 if (!NT_SUCCESS(Status))
1068 {
1069 DPRINT1("CSRSRV:%s: CsrInitCsrRootProcess failed (Status=0x%08lx)\n",
1071 return Status;
1072 }
1073
1074 /* Now initialize our API Port */
1076 if (!NT_SUCCESS(Status))
1077 {
1078 DPRINT1("CSRSRV:%s: CsrApiPortInitialize failed (Status=0x%08lx)\n",
1080 return Status;
1081 }
1082
1083#ifdef __REACTOS__
1084 if (CsrSubSystemType != IMAGE_SUBSYSTEM_UNKNOWN)
1085 {
1086#endif
1087 /* Initialize the API Port for SM communication */
1089 if (!NT_SUCCESS(Status))
1090 {
1091 DPRINT1("CSRSRV:%s: CsrSbApiPortInitialize failed (Status=0x%08lx)\n",
1093 return Status;
1094 }
1095
1096 /* We're all set! Connect to SM! */
1099#ifdef __REACTOS__
1100 CsrSubSystemType,
1101#else
1103#endif
1104 &CsrSmApiPort);
1105 if (!NT_SUCCESS(Status))
1106 {
1107 DPRINT1("CSRSRV:%s: SmConnectToSm failed (Status=0x%08lx)\n",
1109 return Status;
1110 }
1111#ifdef __REACTOS__
1112 }
1113#endif
1114
1115 /* Have us handle Hard Errors */
1117 if (!NT_SUCCESS(Status))
1118 {
1119 DPRINT1("CSRSRV:%s: NtSetDefaultHardErrorPort failed (Status=0x%08lx)\n",
1121 return Status;
1122 }
1123
1124 /* Return status */
1125 return Status;
1126}
@ 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:913
NTSTATUS NTAPI CsrParseServerCommandLine(IN ULONG ArgumentCount, IN PCHAR Arguments[])
Definition: init.c:552
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:767
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:163
#define PROCESS_TERMINATE
Definition: pstypes.h:153
#define PROCESS_VM_READ
Definition: pstypes.h:157
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:162
#define PROCESS_VM_WRITE
Definition: pstypes.h:158
#define PROCESS_VM_OPERATION
Definition: pstypes.h:156
#define PROCESS_DUP_HANDLE
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3429
#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:1022
_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:940
@ TokenUser
Definition: setypes.h:978

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 1152 of file init.c.

1155{
1156 /* We don't do much */
1157 UNREFERENCED_PARAMETER(hInstanceDll);
1160
1161 return TRUE;
1162}
DWORD dwReason
Definition: misc.cpp:135
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
_In_ DWORD _In_ int _In_ int _In_opt_ LPNLSVERSIONINFO _In_opt_ LPVOID lpReserved
Definition: winnls.h:1279

◆ 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
Definition: actypes.h:127
@ 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:1185
#define KEY_READ
Definition: nt_native.h:1026
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:615
#define SM_REG_KEY
Definition: srv.h:41
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: typedefs.h:53
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3782
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2705
_In_ ULONG AclLength
Definition: rtlfuncs.h:1859
#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

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().