⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modund.bas

📁 Project to Read Hard Disk data (raw format) at Windows Run Time
💻 BAS
字号:
Attribute VB_Name = "modUnd"
Option Explicit
'drvHandle
Private Declare Function DeviceIoControl Lib "kernel32" _
(ByVal hDevice As Long, ByVal dwIoControlCode As Long, _
lpInBuffer As Any, _
ByVal nInBufferSize As Long, _
lpOutBuffer As Any, ByVal nOutBufferSize As Long, _
lpBytesReturned As Long, lpOverlapped As Any) As Long

Private Const FSCTL_ENUM_USN_DATA = &H940B3


Private Type LARGE_INTEGER
      lowpart As Long
      highpart As Long
End Type
Private Type USN
      lowpart As Long
      highpart As Long
End Type



Private Type MFT_ENUM_DATA
  StartFileReferenceNumber As LARGE_INTEGER
  LowUsn As USN
  HighUsn As USN
End Type

Private Type USN_RECORD
  RecordLength As Long '4
  MajorVersion As Integer  '2
  MinorVersion As Integer '2
  FileReferenceNumber As LARGE_INTEGER  '8
  ParentFileReferenceNumber As LARGE_INTEGER  '8
  iusn As USN  '8
  TimeStamp As LARGE_INTEGER  '8
  Reason As Long '4
  SecurityId As Long '4
  FileAttributes As Long '    4
  FileNameLength As Integer  '  2
  Filename(1) As Byte
End Type
Public musn As USN_RECORD

Public Function trySome()
Dim mft_i As MFT_ENUM_DATA
Dim outl As Long, lnt As Long
''musn.FileName = Space$(256)
mft_i.StartFileReferenceNumber.highpart = 0&
mft_i.StartFileReferenceNumber.lowpart = 0&

Debug.Print DeviceIoControl(drvHandle, FSCTL_ENUM_USN_DATA, ByVal VarPtr(mft_i), Len(mft_i), ByVal musn, lnt, outl, ByVal 0&)
Debug.Print Err.LastDllError
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -