Commit e7b6db0
committed
fix: read MFT bitmap with sector-aligned reads
- Fixed volume handle access mode: use FILE_READ_DATA | FILE_READ_ATTRIBUTES | SYNCHRONIZE
instead of incorrect FILE_SHARE_READ | FILE_SHARE_WRITE (matching C++ reference)
- Fixed ReadFile with FILE_FLAG_NO_BUFFERING: read full clusters (always aligned),
then truncate to actual file size
- Added FILE_READ_DATA constant (0x0001) to avoid Win32_System_SystemServices feature dependency
Root cause: ReadFile was failing with ERROR_INVALID_PARAMETER (0x80070057) because
the read size (582048 bytes) was not sector-aligned. With FILE_FLAG_NO_BUFFERING,
reads must be aligned to sector boundaries. The C++ code reads cluster_count × cluster_size
bytes (always aligned), then uses only the valid portion.1 parent c161380 commit e7b6db0
2 files changed
+26
-15
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
469 | 472 | | |
470 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
471 | 478 | | |
472 | 479 | | |
473 | 480 | | |
474 | 481 | | |
475 | | - | |
476 | | - | |
| 482 | + | |
| 483 | + | |
477 | 484 | | |
478 | 485 | | |
479 | 486 | | |
480 | 487 | | |
481 | 488 | | |
| 489 | + | |
482 | 490 | | |
483 | | - | |
484 | 491 | | |
485 | | - | |
486 | | - | |
| 492 | + | |
| 493 | + | |
487 | 494 | | |
488 | 495 | | |
489 | 496 | | |
490 | 497 | | |
491 | | - | |
492 | | - | |
| 498 | + | |
| 499 | + | |
493 | 500 | | |
494 | 501 | | |
495 | 502 | | |
| |||
511 | 518 | | |
512 | 519 | | |
513 | 520 | | |
514 | | - | |
| 521 | + | |
515 | 522 | | |
516 | 523 | | |
517 | 524 | | |
518 | 525 | | |
519 | | - | |
| 526 | + | |
520 | 527 | | |
521 | 528 | | |
522 | 529 | | |
| |||
545 | 552 | | |
546 | 553 | | |
547 | 554 | | |
548 | | - | |
549 | | - | |
550 | | - | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
551 | 561 | | |
552 | 562 | | |
553 | 563 | | |
554 | | - | |
| 564 | + | |
| 565 | + | |
555 | 566 | | |
556 | 567 | | |
557 | 568 | | |
| |||
0 commit comments