36ULONG CsrSubSystemType;
121 DPRINT1(
"CSRSS: SD creation failed - status = %lx\n",
Status);
129 DPRINT1(
"CSRSS: DACL creation failed - status = %lx\n",
Status);
143 DPRINT1(
"CSRSS: ACE creation failed - status = %lx\n",
Status);
159 DPRINT1(
"CSRSS: set process DACL failed - status = %lx\n",
Status);
215 UCHAR KeyValueBuffer[0x40];
275 sizeof(KeyValueBuffer),
426 WCHAR SessionBuffer[512], BnoBuffer[512];
448 DPRINT1(
"CSRSS: NtCreateDirectoryObject failed in "
449 "CsrCreateSessionObjectDirectory - status = %lx\n",
Status);
454 swprintf(SessionBuffer,
L"%ld", Session);
482 DPRINT1(
"CSRSS: NtCreateSymbolicLinkObject failed in "
483 "CsrCreateSessionObjectDirectory - status = %lx\n",
Status);
506 DPRINT1(
"CSRSS: NtCreateDirectoryObject failed in "
507 "CsrCreateSessionObjectDirectory - status = %lx\n",
Status);
524 DPRINT1(
"CSRSS: NtCreateDirectoryObject failed in "
525 "CsrCreateSessionObjectDirectory - status = %lx\n",
Status);
567 CsrWindowsControl =
FALSE;
577 DPRINT1(
"CSRSS: CsrCreateSessionObjectDirectory failed (%lx)\n",
586 for (
i = 1;
i < ArgumentCount;
i++)
601 DPRINT1(
"Sessions not yet implemented\n");
635 if (CsrWindowsControl)
682 DPRINT1(
"CSRSS: *** Invalid syntax for %s=%s (Status == %X)\n",
696 while (*ServerString)
699 if ((*ServerString ==
':') && (!EntryPoint))
703 EntryPoint = ServerString;
707 if (*ServerString++ ==
',')
break;
713 DPRINT1(
"CSRSS: *** Invalid syntax for ServerDll=%s (Status == %X)\n",
729 DPRINT1(
"CSRSS: *** Failed loading ServerDll=%s (Status == 0x%x)\n",
781 DPRINT1(
"CSRSRV:%s: RtlAllocateHeap failed (Status=%08lx)\n",
895 *LocalSystemSd = SystemSd;
1023 DPRINT1(
"CSRSRV:%s: NtQuerySystemInformation failed (Status=0x%08lx)\n",
1029 CsrHeap = RtlGetProcessHeap();
1035 DPRINT1(
"CSRSRV:%s: CsrSetProcessSecurity failed (Status=0x%08lx)\n",
1044 DPRINT1(
"CSRSRV:%s: CsrInitializeSessions failed (Status=0x%08lx)\n",
1053 DPRINT1(
"CSRSRV:%s: CsrInitializeProcessStructure failed (Status=0x%08lx)\n",
1062 DPRINT1(
"CSRSRV:%s: CsrParseServerCommandLine failed (Status=0x%08lx)\n",
1071 DPRINT1(
"CSRSRV:%s: CsrInitCsrRootProcess failed (Status=0x%08lx)\n",
1080 DPRINT1(
"CSRSRV:%s: CsrApiPortInitialize failed (Status=0x%08lx)\n",
1093 DPRINT1(
"CSRSRV:%s: CsrSbApiPortInitialize failed (Status=0x%08lx)\n",
1109 DPRINT1(
"CSRSRV:%s: SmConnectToSm failed (Status=0x%08lx)\n",
1121 DPRINT1(
"CSRSRV:%s: NtSetDefaultHardErrorPort failed (Status=0x%08lx)\n",
1148 DPRINT1(
"Deprecated API in r55585.\n");
char * strchr(const char *String, int ch)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
_In_opt_ PWSTR _In_ PWSTR ParameterName
_In_opt_ PWSTR _In_ PWSTR _Inout_ PULONG ParameterValue
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define CSRSRV_SERVERDLL_INDEX
PCSR_THREAD NTAPI CsrAddStaticServerThread(IN HANDLE hThread, IN PCLIENT_ID ClientId, IN ULONG ThreadFlags)
#define NT_SUCCESS(StatCode)
BOOLEAN WINAPI DllMain(HINSTANCE Instance, DWORD Reason, LPVOID Reserved)
static SID_IDENTIFIER_AUTHORITY WorldAuthority
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
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
NTSTATUS NTAPI NtSetDefaultHardErrorPort(IN HANDLE PortHandle)
#define PROCESS_SUSPEND_RESUME
#define PROCESS_TERMINATE
#define PROCESS_QUERY_INFORMATION
#define PROCESS_VM_OPERATION
#define OBJ_CASE_INSENSITIVE
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL, DWORD, DWORD, PSID)
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
#define PROCESS_DUP_HANDLE
_In_ BOOL _In_ HANDLE hProcess
#define InitializeObjectAttributes(p, n, a, r, s)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision)
NTSYSAPI NTSTATUS NTAPI RtlGetAce(PACL Acl, ULONG AceIndex, PVOID *Ace)
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ ULONG Revision)
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 PVOID NTAPI RtlFreeSid(_In_ _Post_invalid_ PSID Sid)
NTSYSAPI NTSTATUS NTAPI RtlGetDaclSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PBOOLEAN DaclPresent, _Out_ PACL *Dacl, _Out_ PBOOLEAN DaclDefaulted)
#define SYMBOLIC_LINK_ALL_ACCESS
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
@ KeyValuePartialInformation
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define NtCurrentProcess()
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)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
struct _KEY_VALUE_PARTIAL_INFORMATION * PKEY_VALUE_PARTIAL_INFORMATION
#define DIRECTORY_ALL_ACCESS
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
NTSYSAPI NTSTATUS NTAPI RtlCharToInteger(PCSZ String, ULONG Base, PULONG Value)
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG _In_ ULONG Length
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)
#define IMAGE_SUBSYSTEM_POSIX_CUI
#define IMAGE_SUBSYSTEM_WINDOWS_CUI
#define IMAGE_SUBSYSTEM_OS2_CUI
#define IMAGE_SUBSYSTEM_WINDOWS_GUI
#define IMAGE_SUBSYSTEM_NATIVE
#define IMAGE_SUBSYSTEM_UNKNOWN
NTSTATUS NTAPI NtCreatePort(OUT PHANDLE PortHandle, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG MaxConnectInfoLength, IN ULONG MaxDataLength, IN ULONG MaxPoolUsage)
NTSTATUS NTAPI NtOpenProcessToken(IN HANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, OUT PHANDLE TokenHandle)
NTSTATUS NTAPI NtResumeThread(IN HANDLE ThreadHandle, OUT PULONG SuspendCount OPTIONAL)
NTSTATUS NTAPI NtCreateDirectoryObject(OUT PHANDLE DirectoryHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
NTSTATUS NTAPI NtCreateSymbolicLinkObject(OUT PHANDLE LinkHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN PUNICODE_STRING LinkTarget)
static SID_IDENTIFIER_AUTHORITY NtSidAuthority
#define STATUS_BUFFER_TOO_SMALL
NTSTATUS WINAPI NtSetSecurityObject(HANDLE Handle, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor)
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,...
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
PVOID ServerData[ANYSIZE_ARRAY]
PCSR_NEWPROCESS_CALLBACK NewProcessCallback
NTSTATUS NTAPI CsrApiPortInitialize(VOID)
PCSR_PROCESS CsrRootProcess
VOID NTAPI CsrSbApiRequestThread(IN PVOID Parameter)
NTSTATUS NTAPI CsrSrvCreateSharedSection(IN PCHAR ParameterValue)
NTSTATUS NTAPI CsrInitializeNtSessionList(VOID)
NTSTATUS NTAPI CsrLoadServerDll(IN PCHAR DllString, IN PCHAR EntryPoint OPTIONAL, IN ULONG ServerId)
#define CSR_SERVER_DLL_MAX
NTSTATUS NTAPI CsrInitializeProcessStructure(VOID)
PCSR_SERVER_DLL CsrLoadedServerDll[CSR_SERVER_DLL_MAX]
NTSTATUS NTAPI CsrSbApiPortInitialize(VOID)
PCSR_THREAD CsrSbApiRequestThreadPtr
VOID NTAPI FreeDosDevicesProtection(IN PSECURITY_DESCRIPTOR DosDevicesSd)
ULONG CsrTotalPerProcessDataLength
NTSTATUS NTAPI CsrParseServerCommandLine(IN ULONG ArgumentCount, IN PCHAR Arguments[])
NTSTATUS NTAPI GetDosDevicesProtection(OUT PSECURITY_DESCRIPTOR DosDevicesSd)
NTSTATUS NTAPI CsrCreateSessionObjectDirectory(IN ULONG Session)
NTSTATUS NTAPI CsrSetProcessSecurity(VOID)
UNICODE_STRING CsrDirectoryName
HANDLE DosDevicesDirectory
HANDLE SessionObjectDirectory
VOID NTAPI CsrPopulateDosDevices(VOID)
ULONG CsrMaxApiRequestThreads
HANDLE CsrObjectDirectory
NTSTATUS NTAPI CsrInitCsrRootProcess(VOID)
NTSTATUS NTAPI CsrSetDirectorySecurity(IN HANDLE ObjectDirectory)
UNICODE_STRING CsrSbApiPortName
SYSTEM_BASIC_INFORMATION CsrNtSysInfo
NTSTATUS NTAPI CsrServerInitialization(IN ULONG ArgumentCount, IN PCHAR Arguments[])
NTSTATUS NTAPI CsrCreateLocalSystemSD(OUT PSECURITY_DESCRIPTOR *LocalSystemSd)
_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....
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Out_ PCLIENT_ID ClientId
#define CONTAINER_INHERIT_ACE
#define SECURITY_BUILTIN_DOMAIN_RID
#define DACL_SECURITY_INFORMATION
#define SECURITY_WORLD_SID_AUTHORITY
#define SECURITY_WORLD_RID
#define SECURITY_LOCAL_SYSTEM_RID
#define SECURITY_NT_AUTHORITY
#define OBJECT_INHERIT_ACE
#define SECURITY_DESCRIPTOR_REVISION
#define SECURITY_CREATOR_OWNER_RID
#define SECURITY_DESCRIPTOR_MIN_LENGTH
#define DOMAIN_ALIAS_RID_ADMINS
#define SECURITY_CREATOR_SID_AUTHORITY