gpt4 book ai didi

winapi - 什么是 dwLowDateTime 和 dwHighDateTime

转载 作者:行者123 更新时间:2023-12-02 09:33:25 25 4
gpt4 key购买 nike

我知道它们是 FileTime 结构中的变量,但是文件时间的低位和高位部分是什么?

最佳答案

较旧的编译器不支持 64 位类型。因此该结构将 64 位值拆分为两个 32 位部分。低位部分包含最低有效 32 位。高位部分包含最高有效 32 位。

因此,如果有两个 32 位部分,则相应的 64 位值是

low + 2^32 * high

官方认可的从两个 32 位部分获取 64 位值的方法是通过 ULARGE_INTEGER联盟。

来自FILETIME文档:

It is not recommended that you add and subtract values from the FILETIME structure to obtain relative times. Instead, you should copy the low- and high-order parts of the file time to a ULARGE_INTEGER structure, perform 64-bit arithmetic on the QuadPart member, and copy the LowPart and HighPart members into the FILETIME structure.

Do not cast a pointer to a FILETIME structure to either a ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows.

关于winapi - 什么是 dwLowDateTime 和 dwHighDateTime,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29266743/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com