admin管理员组文章数量:1434929
In Windows kernel programming, I want to iterate through each disk, then iterate through all volumes on those disks, and finally print out the file paths of all files on each volume. How can I do this?
VOID GetAllDisk2() {
NTSTATUS status;
PZZWSTR deviceNaems = NULL;
UNICODE_STRING str1;
DEVICE_OBJECT deviceObject;
FILE_OBJECT fileObject;
WCHAR wcstr[512];
ULONG index = 0;
ULONG ltmp1, ltmp2;
MM_COPY_ADDRESS mmAddress;
status = IoGetDeviceInterfaces(&DiskClassGuid, NULL, 0, &deviceNaems);
if (!NT_SUCCESS(status))
return;
str1.Buffer = wcstr;
str1.MaximumLength = sizeof(wcstr);
while (deviceNaems[index] != 0) {
ltmp1 = wcslen(deviceNaems + index);
str1.Length = sizeof(WCHAR) * ltmp1;
mmAddress.VirtualAddress = deviceNaems + index;
MmCopyMemory(wcstr, mmAddress, str1.Length, MM_COPY_MEMORY_VIRTUAL, <mp2);
status = IoGetDeviceObjectPointer(&str1, GENERIC_READ, &fileObject, &deviceObject);
if (NT_SUCCESS(status)) {
// TODO ============
}
index += ltmp1 + 1;
}
KdPrint(("End insert."));
}
I tried using IorDeviceInterfaces () to obtain all DeviceNames, and then obtained the DeviceObject and FileObject for.
本文标签: cHow to iterate through each file on each volume of each diskStack Overflow
版权声明:本文标题:c - How to iterate through each file on each volume of each disk? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745637482a2667646.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论