337{
351 ULONG ServerId, ApiId, MessageType,
i;
353
354
357
358
360 {
361
362 TimeOut.
QuadPart = -30 * 1000 * 1000 * 10;
363
364
367 }
368
369
371
372
374 {
375
378
379
382 }
383
384
386 {
387
389
390#ifdef CSR_DBG
391
393 {
394 DPRINT1(
"CSRSRV: FATAL ERROR. CsrThread is Idle while holding %lu critical sections\n",
396 DPRINT1(
"CSRSRV: Last Receive Message %lx ReplyMessage %lx\n",
397 &ReceiveMsg, ReplyMsg);
399 }
400#endif
401
402
404 &PortContext,
407
408
410 {
411
413 {
414#ifdef CSR_DBG
415
419 {
420
421 DPRINT1(
"CSRSS: ReceivePort failed - Status == %X\n",
Status);
423 }
424#endif
425
426
429 continue;
430 }
431 else
432 {
433
434 DPRINT1(
"NtReplyWaitReceivePort returned \"success\" status 0x%x\n",
Status);
435 continue;
436 }
437 }
438
439
440
441
442
444
445
446 MessageType = ReceiveMsg.
Header.u2.s2.Type;
447
448
450 {
451
453
456 continue;
457 }
458
459
461
462
465
466
467 if (!CsrThread)
468 {
469
471
472
474 {
475 ReplyMsg = &ReceiveMsg;
478 }
481 {
482
485 }
487 {
488
490
491
493
494
497 {
498
500 {
501
503
504
506 {
507
509
510
512 }
513 }
514 }
515
516
518
519
520 if (HardErrorMsg->
Response == 0xFFFFFFFF)
521 {
524 }
525 else
526 {
527 ReplyMsg = &ReceiveMsg;
529 }
530 }
532 {
533
534 ReplyMsg = &ReceiveMsg;
537 }
539 {
540
542
543
547 {
548
549#ifdef CSR_DBG
550 DPRINT1(
"CSRSS: %lx is invalid ServerDllIndex (%08x)\n",
551 ServerId, ServerDll);
553#endif
556 continue;
557 }
558
559
561
562
564 {
565
566#ifdef CSR_DBG
567 DPRINT1(
"CSRSS: %lx is invalid ApiTableIndex for %Z\n",
570#endif
573 continue;
574 }
575
576#ifdef CSR_DBG
578 {
579 DPRINT1(
"[%02x] CSRSS: [%02x,%02x] - %s Api called from %08x\n",
583 ServerDll->NameTable[ApiId],
585 }
586#endif
587
588
590
591
593 {
594
596
597
601
602
604 }
606 {
609 }
611 }
612 else
613 {
614
617 }
618
619
620 continue;
621 }
622
623
625 {
626
628 {
629
632 {
633
635
636
638
639
641
642
644 {
645
647 }
648
649
651 }
652
653
655
658 continue;
659 }
660
661
664
665
667 {
668
670
671
673
674
677 ReplyMsg = &ReceiveMsg;
679
680
682 }
684 {
685
687
688
690
691
694 {
695
697 {
698
700
701
703 {
704
706
707
709 }
710 }
711 }
712
713
715
716
717 if (HardErrorMsg->
Response == 0xFFFFFFFF)
718 {
721 }
722 else
723 {
725 ReplyMsg = &ReceiveMsg;
727 }
728 }
729 else
730 {
731
734 }
735
736
737 continue;
738 }
739
740
743
744
746
747
751 {
752
753#ifdef CSR_DBG
754 DPRINT1(
"CSRSS: %lx is invalid ServerDllIndex (%08x)\n",
755 ServerId, ServerDll);
757#endif
759 ReplyMsg = &ReceiveMsg;
762 continue;
763 }
764
765
767
768
770 {
771#ifdef CSR_DBG
772
773 DPRINT1(
"CSRSS: %lx is invalid ApiTableIndex for %Z\n",
776#endif
778 ReplyMsg = &ReceiveMsg;
781 continue;
782 }
783
784#ifdef CSR_DBG
786 {
787 DPRINT1(
"[%02x] CSRSS: [%02x,%02x] - %s Api called from %08x, Process %08x - %08x\n",
791 ServerDll->NameTable[ApiId],
792 CsrThread,
795 }
796#endif
797
798
799 ReplyMsg = &ReceiveMsg;
801
802
804
805
807 {
808
810 {
811
813 continue;
814 }
815 }
816
817
819 {
820
822
824
825
828
829
831
833
835 {
837 {
839 }
843 }
845 {
846
850 DPRINT1(
"CSRSS: Error while replying to the death message, Status 0x%lx\n", Status2);
851
852
856 }
858 {
861 }
862 else
863 {
865 {
867 }
869 }
870 }
872 {
875 }
877 }
878
879
882}
#define CSR_API_NUMBER_TO_API_ID(ApiNumber)
#define CSR_API_NUMBER_TO_SERVER_ID(ApiNumber)
EXCEPTION_DISPOSITION NTAPI CsrUnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
NTSTATUS NTAPI CsrDestroyProcess(IN PCLIENT_ID Cid, IN NTSTATUS ExitStatus)
enum _CSR_REPLY_CODE CSR_REPLY_CODE
NTSTATUS NTAPI CsrDestroyThread(IN PCLIENT_ID Cid)
VOID NTAPI CsrDereferenceThread(IN PCSR_THREAD CsrThread)
#define STATUS_INVALID_HANDLE
struct _DBGKM_MSG * PDBGKM_MSG
#define InterlockedIncrementUL(Addend)
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
NTSYSAPI void WINAPI DbgBreakPoint(void)
struct _CLIENT_DIED_MSG * PCLIENT_DIED_MSG
#define LPC_CONNECTION_REQUEST
struct _HARDERROR_MSG * PHARDERROR_MSG
NTSTATUS NtTerminateThread(IN HANDLE ThreadHandle OPTIONAL, IN NTSTATUS ExitStatus)
NTSTATUS NTAPI NtTerminateProcess(HANDLE ProcessHandle, LONG ExitStatus)
NTSTATUS NTAPI NtDelayExecution(IN BOOLEAN Alertable, IN PLARGE_INTEGER DelayInterval)
NTSTATUS NTAPI NtSetEvent(IN HANDLE EventHandle, OUT PLONG PreviousState OPTIONAL)
NTSTATUS NTAPI NtReplyPort(IN HANDLE PortHandle, IN PPORT_MESSAGE ReplyMessage)
NTSTATUS NTAPI NtReplyWaitReceivePort(IN HANDLE PortHandle, OUT PVOID *PortContext OPTIONAL, IN PPORT_MESSAGE ReplyMessage OPTIONAL, OUT PPORT_MESSAGE ReceiveMessage)
#define STATUS_INVALID_CID
#define STATUS_ILLEGAL_FUNCTION
#define _SEH2_EXCEPT(...)
#define _SEH2_GetExceptionInformation()
PCSR_CAPTURE_BUFFER CsrCaptureData
PCSR_HARDERROR_CALLBACK HardErrorCallback
ULONG HighestApiSupported
PCSR_API_ROUTINE * DispatchTable
ULONG Win32ClientInfo[31]
ULONG CountOfOwnedCriticalSections
VOID NTAPI CsrReleaseCapturedArguments(IN PCSR_API_MESSAGE ApiMessage)
volatile ULONG CsrpStaticThreadCount
NTSTATUS NTAPI CsrApiHandleConnectionRequest(IN PCSR_API_MESSAGE ApiMessage)
volatile ULONG CsrpDynamicThreadTotal
PCSR_THREAD NTAPI CsrConnectToUser(VOID)
NTSTATUS NTAPI CsrpCheckRequestThreads(VOID)
BOOLEAN NTAPI CsrCaptureArguments(IN PCSR_THREAD CsrThread, IN PCSR_API_MESSAGE ApiMessage)
VOID NTAPI CsrLockedReferenceThread(IN PCSR_THREAD CsrThread)
VOID NTAPI CsrLockedDereferenceThread(IN PCSR_THREAD CsrThread)
#define CSR_SERVER_DLL_MAX
PCSR_SERVER_DLL CsrLoadedServerDll[CSR_SERVER_DLL_MAX]
#define STATUS_UNSUCCESSFUL
_Inout_opt_ PVOID Parameter
#define NtCurrentThread()