What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] RtlMoveMemory: file not found

Pages: (2): « First [ 1 ] 2 » Last »
[?] RtlMoveMemory: file not found
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. [?] RtlMoveMemory: file not found
Hi folks,

I'm trying to move a string from pointer A to B. The debugger states that an exception has occurred while executing RtlMoveMemory, without any specific information. Interop.GetLastError() returns 2, which means a specified file is not found. I don't see what files have to do with moving memory data.

Can anyone help me on this one?
03-24-2009 06:46 PM
Profile PM Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: [?] RtlMoveMemory: file not found
Care to paste full code? :P (including the GetLastError part)

This post was edited on 03-24-2009 at 07:07 PM by Mnjul.
03-24-2009 07:05 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] RtlMoveMemory: file not found
js code:
var ptrA = Interop.Allocate(4);
var s = 'this is some text';
var ptrA_string = Interop.Allocate(2*s.length+2)
    ptrA_string.WriteString(0, s);
    ptrA.WriteDWORD(0, ptrA_string.DataPtr);
var ptrB = Interop.Allocate(4);

Interop.Call('kernel32', 'RtlMoveMemory', ptrB, ptrA, 4);

Debug.Trace(ptrB.ReadString(0));

This post was edited on 03-24-2009 at 08:07 PM by matty.
03-24-2009 07:29 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: [?] RtlMoveMemory: file not found
JScript code:
var PagePtr = lParam;
if(PagePtr === 0) {
    Internet(Script.WebURL);
    return API_SUCCESS;
}
var Size = lParam;
var oPage = Interop.Allocate(Size);
Interop.Call("Kernel32.dll","RtlMoveMemory",oPage.DataPtr,PagePtr,Size);
TraceWin32Error();
03-24-2009 07:50 PM
Profile PM Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: [?] RtlMoveMemory: file not found
Well, you're taking lParam for PagePtr's use and Size's use, I guess one should be wParam.

And matty, a 4-byte DataBloc can not hold "this is some text", which is a couple dozen bytes.
03-24-2009 07:53 PM
Profile PM Web Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: [?] RtlMoveMemory: file not found
well, that's another stupid one ^o) :S

Thanks anyway :)
03-24-2009 07:57 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] RtlMoveMemory: file not found
quote:
Originally posted by Mnjul
And matty, a 4-byte DataBloc can not hold "this is some text", which is a couple dozen bytes.
I thought I made a booboo and changed it hence the

quote:
Originally posted by matty
This post was edited Today at 02:30 PM by matty.
03-24-2009 08:06 PM
Profile E-Mail PM Find Quote Report
TheSteve
Full Member
***

Avatar
The Man from Japan

Posts: 179
Reputation: 23
40 / Male / Flag
Joined: Aug 2005
RE: [?] RtlMoveMemory: file not found
Is there a reason that you're using RtlMoveMemory rather than RtlCopyMemory? 

If the two buffers don't overlap (which they don't)  you should not be using RtlMoveMemory.
03-25-2009 12:38 AM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] RtlMoveMemory: file not found
quote:
Originally posted by TheSteve
Is there a reason that you're using RtlMoveMemory rather than RtlCopyMemory? 

If the two buffers don't overlap (which they don't)  you should not be using RtlMoveMemory.
I didn't realize that API existed... learned something new today.
03-25-2009 10:48 AM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: [?] RtlMoveMemory: file not found
There is.

I use this system for communication between two different scripts. RtlCopyMemory would mean lots of extra memory management to prevent leaks. Let me put it this way:

Script A sends a pointer to script B. Script B is now responsible for handling that pointer, to relieve script A (the contents of the pointer will most likely be stored in a variable). Script B then destroys the pointer (allocated by the Interop object) when it's no longer needed.

Using RtlCopyMemory would mean extra work for script A.
03-25-2009 06:24 PM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On