RtlMoveMemory和copymemory函数
RtlMoveMemory是API原名,在VB的API浏览器中的化名就是著名的CopyMemory
新建个模块,将一下代码考入模块, 在将启动项改为sub main 就可以运行了
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"
(pDst As Any, pSrc As Any, ByVal ByteLen As Long)
Option Explicit
Declare Sub RtlMoveMemory Lib "KERNEL32" (lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)
Sub Main()
Dim L1 As Long, L2 As Long
L1 = &H11223344
RtlMoveMemory L2, L1, 4
MsgBox "L2=" & Hex(L2)
End Sub
AND
Option Explicit
Declare Sub RtlMoveMemory Lib "KERNEL32" (lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)
Sub Main()
Dim bArr(3) As Byte, L As Long
L = &H11223344
RtlMoveMemory bArr(0), L, 4
MsgBox "bArr=" & Hex(bArr(0)) & Hex(bArr(1)) & Hex(bArr(2)) & Hex(bArr(3))
End Sub
这俩个运行结果怎么差那么多,尤其是第二个怎么运行结果是44332211?????