开发者

Convert NT file time to Win32 time

开发者 https://www.devze.com 2023-03-19 16:36 出处:网络
I need to convert the LARGE_INTEGER CreationTime member in this structure to the FILETIME ftCreationTime member in this structure. The times are in different formats so simply casting it does开发者_开

I need to convert the LARGE_INTEGER CreationTime member in this structure to the FILETIME ftCreationTime member in this structure. The times are in different formats so simply casting it does开发者_开发百科 not work, is there any documentation on what format NT API uses for file time and how I could convert it?


They are the same representation, just different structures. You can either memcpy it across or manual assignment:

FILETIME ft;
LARGE_INTEGER creationTime;

memcpy(&ft, &creationTime, sizeof(ft));

or

FILETIME ft;
LARGE_INTEGER creationTime;

ft.dwLowDateTime = creationTime.LowPart;
ft.dwHighDateTime = creationTime.HighPart;
0

精彩评论

暂无评论...
验证码 换一张
取 消