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.

166 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. kuser.c
  5. Abstract:
  6. WinDbg Extension Api
  7. Author:
  8. Ramon J San Andres (ramonsa) 5-Nov-1993
  9. Environment:
  10. User Mode.
  11. Revision History:
  12. --*/
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. VOID
  16. KUserExtension(
  17. PCSTR lpArgumentString,
  18. ULONG64 SharedData
  19. );
  20. DECLARE_API( kuser )
  21. /*++
  22. Routine Description:
  23. This function is called as an NTSD extension to dump the shared user mode
  24. page (KUSER_SHARED_DATA)
  25. Called as:
  26. !kuser
  27. Arguments:
  28. None
  29. Return Value:
  30. None
  31. --*/
  32. {
  33. INIT_API();
  34. KUserExtension( args, (ULONG64) MM_SHARED_USER_DATA_VA); // SharedUserData );
  35. EXIT_API();
  36. return S_OK;
  37. }
  38. char *DriveTypes[] = {
  39. "DOSDEVICE_DRIVE_UNKNOWN",
  40. "DOSDEVICE_DRIVE_CALCULATE",
  41. "DOSDEVICE_DRIVE_REMOVABLE",
  42. "DOSDEVICE_DRIVE_FIXED",
  43. "DOSDEVICE_DRIVE_REMOTE",
  44. "DOSDEVICE_DRIVE_CDROM",
  45. "DOSDEVICE_DRIVE_RAMDISK"
  46. };
  47. VOID
  48. KUserExtension(
  49. PCSTR lpArgumentString,
  50. ULONG64 SharedData
  51. )
  52. {
  53. BOOLEAN fFirst;
  54. ULONG i;
  55. try {
  56. InitTypeRead(SharedData, KUSER_SHARED_DATA);
  57. dprintf( "KUSER_SHARED_DATA at %p\n", SharedData ),
  58. dprintf( "TickCount: %x * %08x\n",
  59. (ULONG)ReadField(TickCountMultiplier),
  60. (ULONG)ReadField(TickCountLow)
  61. );
  62. #if 0
  63. dprintf( "Interrupt Time: %x:%08x:%08x\n",
  64. (ULONG)ReadField(InterruptTime.High2Time),
  65. (ULONG)ReadField(InterruptTime.High1Time),
  66. (ULONG)ReadField(InterruptTime.LowPart)
  67. );
  68. dprintf( "System Time: %x:%08x:%08x\n",
  69. (ULONG)ReadField(SystemTime.High2Time),
  70. (ULONG)ReadField(SystemTime.High1Time),
  71. (ULONG)ReadField(SystemTime.LowPart)
  72. );
  73. dprintf( "TimeZone Bias: %x:%08x:%08x\n",
  74. (ULONG)ReadField(TimeZoneBias.High2Time),
  75. (ULONG)ReadField(TimeZoneBias.High1Time),
  76. (ULONG)ReadField(TimeZoneBias.LowPart)
  77. );
  78. #endif
  79. dprintf( "TimeZone Id: %x\n", (ULONG)ReadField(TimeZoneId) );
  80. dprintf( "ImageNumber Range: [%x .. %x]\n",
  81. (ULONG)ReadField(ImageNumberLow),
  82. (ULONG)ReadField(ImageNumberHigh)
  83. );
  84. dprintf( "Crypto Exponent: %x\n", (ULONG)ReadField(CryptoExponent) );
  85. dprintf( "SystemRoot: '%ws'\n",
  86. (ULONG)ReadField(NtSystemRoot)
  87. );
  88. #if 0
  89. dprintf( "DosDeviceMap: %08x", (ULONG)ReadField(DosDeviceMap) );
  90. fFirst = TRUE;
  91. for (i=0; i<32; i++) {
  92. if ((ULONG)ReadField(DosDeviceMap) & (1 << i)) {
  93. if (fFirst) {
  94. dprintf( " (" );
  95. fFirst = FALSE;
  96. }
  97. else {
  98. dprintf( " " );
  99. }
  100. dprintf( "%c:", 'A'+i );
  101. }
  102. }
  103. if (!fFirst) {
  104. dprintf( ")" );
  105. }
  106. dprintf( "\n" );
  107. for (i=0; i<32; i++) {
  108. CHAR Field[40];
  109. ULONG DosDeviceDriveType;
  110. sprintf(Field, "DosDeviceDriveType[%d]", i);
  111. DosDeviceDriveType = (ULONG) GetShortField(0, Field, 0);
  112. if (DosDeviceDriveType > DOSDEVICE_DRIVE_UNKNOWN &&
  113. DosDeviceDriveType <= DOSDEVICE_DRIVE_RAMDISK
  114. ) {
  115. dprintf( "DriveType[ %02i ] (%c:) == %s\n",
  116. i, 'A'+i,
  117. DriveTypes[ DosDeviceDriveType ]
  118. );
  119. }
  120. }
  121. #endif
  122. } except (EXCEPTION_EXECUTE_HANDLER) {
  123. ;
  124. }
  125. }