FSCTL_QUERY_FILE_REGIONS stuck on sparse file on ReFS(v2) with 64KB cluster size.
- Windows Server 2025 (26100.3194)
Do Format E: /FS:ReFS /A:64K /Q.
Run below code.
kernel32.lib to Ignore Specific Default Libraries.kernel32.lib from Additional Dependencies.Additional Dependencies to fileextd.lib;ntdll.lib;%(AdditionalDependencies).fileextd.lib must come before kernel32.lib.#define WINBASEAPI before #include <windows.h>. Although this is easy, keep in mind that it affects the entire source file.__imp__SetFileInformationByHandle@16 using assembly.char a = <...>;
2130466 >> a & 1;
とは
https://twitter.com/kumagi/status/1014953960237436928
x86のシフト命令は下位5ビットしか見ない
The count operand can be an immediate value or the CL register. The count is masked to 5 bits (or 6 bits if in 64-bit mode and REX.W is used). The count range is limited to 0 to 31 (or 63 if 64-bit mode and REX.W is used).
TLDR IsWow64Process2()使え。
WowA64ではIsWow64Process()やGetNativeSystemInfo()を使うとx86版Windowsと誤認するようになっている。
バグではなく意図的な仕様と考えられる。(理由考察は省略)
しかしそれらのAPIで得られる値やIsWow64Process2()以外のAPIでも一部の挙動がx86版Windowsと違う。
| AMD64 | x86 | Arm64 | |||
|---|---|---|---|---|---|
| IsWow64Process() | *Wow64Process | TRUE | 0 | 0 |
| #include <windows.h> | |
| #include <cstdio> | |
| #include <cstdlib> | |
| #include <wil/filesystem.h> | |
| #include <wil/resource.h> | |
| int wmain(int, PWSTR argv[]) | |
| { | |
| const auto [d, e] = wil::try_open_file(argv[1], FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_FLAG_BACKUP_SEMANTICS); | |
| if (!d) |
| #include <fenv.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| extern "C" int64_t fto132proc(/* Passing by ST(0) */); | |
| int main() | |
| { | |
| double f = UINT32_MAX + 0.9; | |
| uint32_t h, l; |