Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. csrss.c
  5. Abstract:
  6. This is the main startup module for the Server side of the Client
  7. Server Runtime Subsystem (CSRSS)
  8. Author:
  9. Steve Wood (stevewo) 8-Oct-1990
  10. Environment:
  11. User Mode Only
  12. Revision History:
  13. --*/
  14. #include "csrsrv.h"
  15. VOID
  16. DisableErrorPopups(
  17. VOID
  18. )
  19. {
  20. ULONG NewMode;
  21. NewMode = 0;
  22. NtSetInformationProcess(
  23. NtCurrentProcess(),
  24. ProcessDefaultHardErrorMode,
  25. (PVOID) &NewMode,
  26. sizeof(NewMode)
  27. );
  28. }
  29. int
  30. _cdecl
  31. main(
  32. IN ULONG argc,
  33. IN PCH argv[],
  34. IN PCH envp[],
  35. IN ULONG DebugFlag OPTIONAL
  36. )
  37. {
  38. NTSTATUS Status;
  39. ULONG ErrorResponse;
  40. KPRIORITY SetBasePriority;
  41. SetBasePriority = FOREGROUND_BASE_PRIORITY + 4;
  42. Status = NtSetInformationProcess (NtCurrentProcess(),
  43. ProcessBasePriority,
  44. (PVOID) &SetBasePriority,
  45. sizeof(SetBasePriority));
  46. ASSERT (NT_SUCCESS (Status));
  47. Status = CsrServerInitialization( argc, argv );
  48. if (!NT_SUCCESS( Status )) {
  49. IF_DEBUG {
  50. DbgPrint( "CSRSS: Unable to initialize server. status == %X\n",
  51. Status
  52. );
  53. }
  54. NtTerminateProcess( NtCurrentProcess(), Status );
  55. }
  56. DisableErrorPopups();
  57. if (NtCurrentPeb()->SessionId == 0) {
  58. //
  59. // Make terminating the root csrss fatal
  60. //
  61. RtlSetProcessIsCritical(TRUE, NULL, FALSE);
  62. }
  63. NtTerminateThread( NtCurrentThread(), Status );
  64. return( 0 );
  65. }