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.

102 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1999-2001 Microsoft Corporation
  3. Module Name:
  4. main.cpp
  5. Abstract:
  6. entry point for command console shell session
  7. Author:
  8. Brian Guarraci (briangu) 2001.
  9. Revision History:
  10. --*/
  11. #include <CmnHdr.h>
  12. #include <New.h>
  13. #include <utils.h>
  14. #include <Session.h>
  15. int __cdecl
  16. NoMoreMemory(
  17. size_t size
  18. )
  19. /*++
  20. Routine Description:
  21. C++ new error handler
  22. Arguments:
  23. size_t - size of request
  24. Return Value:
  25. status
  26. --*/
  27. {
  28. ASSERT(0);
  29. UNREFERENCED_PARAMETER(size);
  30. ExitProcess( 1 );
  31. }
  32. int __cdecl
  33. main()
  34. /*++
  35. Routine Description:
  36. This is the main entry point for the session
  37. Arguments:
  38. None
  39. Return Value:
  40. status
  41. --*/
  42. {
  43. CSession *pClientSession = NULL;
  44. //
  45. // Install the new error handler
  46. //
  47. _set_new_handler( NoMoreMemory );
  48. //
  49. // create the session
  50. //
  51. pClientSession = new CSession;
  52. if( pClientSession )
  53. {
  54. __try
  55. {
  56. if( pClientSession->Init() )
  57. {
  58. pClientSession->WaitForIo();
  59. }
  60. }
  61. __finally
  62. {
  63. pClientSession->Shutdown();
  64. delete pClientSession;
  65. }
  66. }
  67. return( 0 );
  68. }