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.

81 lines
1.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998.
  5. //
  6. // File: vpb.c
  7. //
  8. // Contents: windbg extension to dump a Vpb
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // Coupling:
  15. //
  16. // Notes:
  17. //
  18. // History: 2-17-1998 benl Created
  19. //
  20. //----------------------------------------------------------------------------
  21. #include "precomp.h"
  22. #pragma hdrstop
  23. //+---------------------------------------------------------------------------
  24. //
  25. // Function: DECLARE_API(vpb)
  26. //
  27. // Synopsis: just print out the fields in the vpb (Volume Parameter Block)
  28. //
  29. // Arguments: address of vpb
  30. //
  31. // Returns:
  32. //
  33. // History: 2-17-1998 benl Created
  34. //
  35. // Notes:
  36. //
  37. //----------------------------------------------------------------------------
  38. DECLARE_API( vpb )
  39. {
  40. ULONG64 dwAddress;
  41. DWORD dwRead, Flags;
  42. UCHAR VolumeLabel[80]={0};
  43. //read in the vpb
  44. dwAddress = GetExpression(args);
  45. if (GetFieldValue(dwAddress, "VPB", "Flags", Flags))
  46. {
  47. dprintf("ReadMemory at 0x%p failed\n", dwAddress);
  48. return E_INVALIDARG;
  49. }
  50. //now print some stuff
  51. dprintf("Vpb at 0x%p\n", dwAddress);
  52. dprintf("Flags: 0x%x ", Flags);
  53. if (Flags & VPB_MOUNTED) {
  54. dprintf("mounted ");
  55. }
  56. if (Flags & VPB_LOCKED) {
  57. dprintf("locked ");
  58. }
  59. if (Flags & VPB_PERSISTENT) {
  60. dprintf("persistent");
  61. }
  62. dprintf("\n");
  63. GetFieldValue(dwAddress, "VPB", "VolumeLabel", VolumeLabel);
  64. InitTypeRead(dwAddress, VPB);
  65. dprintf("DeviceObject: 0x%p\n", ReadField(DeviceObject));
  66. dprintf("RealDevice: 0x%p\n", ReadField(RealDevice));
  67. dprintf("RefCount: %d\n", (ULONG) ReadField(ReferenceCount));
  68. dprintf("Volume Label: %*S\n", (ULONG) ReadField(VolumeLabelLength), VolumeLabel);
  69. return S_OK;
  70. } // DECLARE_API