本文介绍了关于x64问题的FILETIME.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用FILETIME结构进行互操作.它似乎可以在我的comp上正常工作,但是在x64体系结构上会出现一些问题吗?
I''m using my FILETIME structure for interop. It seems to work on my comp ,but will I have some problems on x64 architectures?
[StructLayout(LayoutKind.Explicit)]
public struct FILETIME
{
[FieldOffset(0)]
public int dwLowDateTime;
[FieldOffset(4)]
public int dwHighDateTime;
[FieldOffset(0)]
public long QuadDateTime;
}
我正在访问结构的四部分,而不是分别访问低和高,以在DateTime之间进行转换.
I''m accessing quad part of the structure instead of low and high separately for converting between DateTime.
推荐答案
[StructLayout(LayoutKind.Sequential)]
struct FILETIME {
public uint DateTimeLow;
public uint DateTimeHigh;
}
没有FieldOffSet.但这取决于您要调用的Win32函数返回的FILETIME.
With no FieldOffSet. But it depends on what Win32 function you are calling that returns a FILETIME.
这篇关于关于x64问题的FILETIME.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!