Source code of Windows XP (NT5)
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.

110 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1995-1997 Microsoft Corporation
  3. Module Name:
  4. ntstuff.cxx
  5. Abstract:
  6. This module contains an NTSD debugger extension for dumping various
  7. NT-specific properties.
  8. Author:
  9. Keith Moore (keithmo) 08-Nov-1997
  10. Revision History:
  11. --*/
  12. #include "inetdbgp.h"
  13. /************************************************************
  14. * Dump Current Error Mode
  15. ************************************************************/
  16. DECLARE_API( gem )
  17. /*++
  18. Routine Description:
  19. This function is called as an NTSD extension to display the
  20. current error mode of the debugee.
  21. Arguments:
  22. hCurrentProcess - Supplies a handle to the current process (at the
  23. time the extension was called).
  24. hCurrentThread - Supplies a handle to the current thread (at the
  25. time the extension was called).
  26. CurrentPc - Supplies the current pc at the time the extension is
  27. called.
  28. lpExtensionApis - Supplies the address of the functions callable
  29. by this extension.
  30. lpArgumentString - Supplies the asciiz string that describes the
  31. ansi string to be dumped.
  32. Return Value:
  33. None.
  34. --*/
  35. {
  36. NTSTATUS status;
  37. UINT errorMode;
  38. INIT_API();
  39. status = NtQueryInformationProcess(
  40. ExtensionCurrentProcess,
  41. ProcessDefaultHardErrorMode,
  42. (PVOID)&errorMode,
  43. sizeof(errorMode),
  44. NULL
  45. );
  46. if( !NT_SUCCESS(status) ) {
  47. dprintf( "Cannot query error mode, error %08lx\n", status );
  48. return;
  49. }
  50. if( errorMode & 1 ) {
  51. errorMode &= ~SEM_FAILCRITICALERRORS;
  52. } else {
  53. errorMode |= SEM_FAILCRITICALERRORS;
  54. }
  55. dprintf(
  56. "Current error mode = %08lx\n",
  57. errorMode
  58. );
  59. if( errorMode & SEM_FAILCRITICALERRORS ) {
  60. dprintf( " SEM_FAILCRITICALERRORS\n" );
  61. }
  62. if( errorMode & SEM_NOGPFAULTERRORBOX ) {
  63. dprintf( " SEM_NOGPFAULTERRORBOX\n" );
  64. }
  65. if( errorMode & SEM_NOALIGNMENTFAULTEXCEPT ) {
  66. dprintf( " SEM_NOALIGNMENTFAULTEXCEPT\n" );
  67. }
  68. if( errorMode & SEM_NOOPENFILEERRORBOX ) {
  69. dprintf( " SEM_NOOPENFILEERRORBOX\n" );
  70. }
  71. } // DECLARE_API( gem )