typedef struct _FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME, *PFILETIME;__int64 FileTimeToQuadWord(PFILETIME pft)
{
return (Int64ShllMod32(
pft->dwHighDateTime, 32) | pft->dwLowDateTime);
}
注:
Int64ShllMod32The Int64ShllMod32 function performs a left logical shift operation on an unsigned 64-bit integer value. The function provides improved shifting code for left logical shifts where the shift count is in the range 0 – 31.
ULONGLONG Int64ShllMod32(
ULONGLONG Value,
DWORD ShiftCount
);Parameters
Value
[in] Unsigned 64-bit integer to be shifted.
ShiftCount
[in] Shift count in the range 0 – 31.
我的问题:Int64ShllMod32要求64位数据,可pft->dwHighDateTime是DWORD型,搞不懂了....
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME, *PFILETIME;__int64 FileTimeToQuadWord(PFILETIME pft)
{
return (Int64ShllMod32(
pft->dwHighDateTime, 32) | pft->dwLowDateTime);
}
注:
Int64ShllMod32The Int64ShllMod32 function performs a left logical shift operation on an unsigned 64-bit integer value. The function provides improved shifting code for left logical shifts where the shift count is in the range 0 – 31.
ULONGLONG Int64ShllMod32(
ULONGLONG Value,
DWORD ShiftCount
);Parameters
Value
[in] Unsigned 64-bit integer to be shifted.
ShiftCount
[in] Shift count in the range 0 – 31.
我的问题:Int64ShllMod32要求64位数据,可pft->dwHighDateTime是DWORD型,搞不懂了....
解决方案 »
- WMD驱动开发中的单步调试问题?
- 有关修改CListCtrl项的图标问题。
- 一个简单的VC的问题
- 请问我想要在击一个dialog里面的button时发出message,并且在view里面接受该message应该怎样做?
- 谁能告诉我在哪儿能买的到候捷先生在<<MFC深入浅出>>附录中推荐的<<Windows Internals>>
- 好象很简单,可我不会:一个简单的带打印预览功能的程序,为什么编译后找个没装VC的机器,却显示不出预览页面呢?
- 请教:如何判断我的VC是否装了补丁,以及补丁的版本?急!立即结帐,谢谢!
- 求教,在MFC下,如果结束程序?
- 关于CFILE的菜鸟问题,请高手解答。
- 控制台程序如何调用mfc类
- 在ATL中,为什么要把派生类的名字传给基类模版?
- 如何在程序中启动另一程序?并且要不影响本程序的运行.
NTAPI
Int64ShllMod32 (
ULONGLONG Value,
DWORD ShiftCount
)
{
__asm {
mov ecx, ShiftCount
mov eax, dword ptr [Value]
mov edx, dword ptr [Value+4]
shld edx, eax, cl
shl eax, cl
}
}
实现如下,调用的时候 扩展了位数
pft->dwHighDateTime被转换为(提升)一个ULONGLONG类型的值(看看c++函数参数匹配)下边这句是
Int64ShllMod32(pft->dwHighDateTime, 32) | pft->dwLowDateTime
Int64ShllMod32函数将这个pft->dwHighDateTime参数右移32位,返回64位,低32位为零,然后和
pft->dwLowDateTime求与
比如:参数类型DWORD,你传入一个WORD或者BYTE,会怎么样呢?
其实道理一样的。