WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

DllCall Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Direct Memory Copy - RtlCopyMappedMemory

 Keywords: RtlCopyMappedMemory DllCall Direct Memory Copy Location

Direct Memory copy from one memory location to another using API DllCall. Tested on Win 7 Pro
;Direct Memory copy from one memory location to another using API Dll Call.   Tested on Win 7 Pro
;....IFICantBYTE
dllname=StrCat(DirWindows(1),"ntdll.dll")

DestBufSize = 100

SrcBuf=BinaryAlloc(100) ; allocate a Source memory buffer
BinaryPokeStr(SrcBuf,0,"Put some data in the SOURCE buffer and copy just the portion we want using a DLL Call"); Writes a string into a binary buffer.
;BinaryEODSet(SrcBuf,100)

DestBuf=BinaryAlloc(DestBufSize) ; allocate a Destination memory buffer... it must be big enough for the copied data to fit when the DLL call is made or an error will occurr
BinaryEodSet(DestBuf,100)

;You can adjust the following UP TO THE SIZE OF THE BUFFER but !!!! Carefull... don't copy more than the destination buffer can take!

Bytes = 68; Number of Bytes to copy from Src to Dest. We will just copy the first 68 bytes (characters) as a test....

Ret = DllCall(dllname, long:"RtlCopyMappedMemory", lpbinary:DestBuf, lpbinary:SrcBuf, long:Bytes)

LookAtDest=BinaryPeekStr(DestBuf, 0, 100)
Message(Ret,LookAtDest);Check out the result.

BinaryFree(SrcBuf)
BinaryFree(DestBuf)

Exit

Article ID:   W17786
Filename:   Direct Memory Copy - RtlCopyMappedMemory.txt
File Created: 2013:03:22:08:14:02
Last Updated: 2013:03:22:08:14:02