Closed smithtrenton closed 12 years ago
Run this, I'm getting access errors: http://paste.villavu.com/raw/2836/
Are we still required to write a wrapper for the Smart I/O functions(ie. SmartSendKeys)? I thought the EIOS functionality didn't require that.
I'll look at this once 1) I'm done moving my stuff to a new apartment 2) presented my research at DAMO :|
I looked at this briefly. To answer your question, no, you do not need to override anything when using EIOS. I think what is happening here is that lape's pugin interface is not passing strings correctly to plugin imported functions. Should notify those maintainers. If you wanted to test further, you could try a pre v7.1alpha EIOS version of SMART with pascalscript.
Ben, doesn't the same happen with Pascalscript?
Regardless, you should not pass Strings to FPC from C; why not just use PChar?
Well, I can't open the link with the access violation script, so I don't really know what to test, but he mentioned the SmartSendKeys. However if he's using EIOS it shouldn't be using the plugin calling framework anyway. That being said, it's still probably related to strings.
Further, are the same methods producing the same error for both of the links, or has the first link been resolved? Just because it causes an 'access violation' does not mean it's the same problem or even related.
First error: It would get an access violation when a smart client was already spawned, on the SmartGetClients function. Second error: The access violation came on the second letter of anything it tried to type using EIOS.
Is the first error solved now? For the second error, does it happen with anything else besides SendString? I'll build a version using PChar instead of String since I broke pascalscript compatibility anyway, and see if that fixes things. In the mean time, could you re-post that program that you pasted earlier? The link no longer works.
On 22/05/12 19:27, Benjamin Land wrote:
Is the first error solved now? For the second error, does it happen with anything else besides SendString? I'll build a version using PChar instead of String since I broke pascalscript compatibility anyway, and see if that fixes things. In the mean time, could you re-post that program that you pasted earlier? The link no longer works.
Reply to this email directly or view it on GitHub: https://github.com/BenLand100/SMART/issues/4#issuecomment-5853268 Let me just point out that PascalScript supports PChar.
I cannot reproduce; the pasted code works fine for me. What version of Simba/SMART are you using?
Smart from here, and the auto-build from that day. Let me try with today's build.
It now works. Odd.
Sidenote: both lape and ps work.
:-)
Getting this again. Running using lape and build 200 of simba.
To be more clear, it types whatever SendKeys() has as the string, then gives the access violation at SendKeys().
Use this instead: http://pastebin.com/BG1aqt22
Second link doesn't appear to function properly. Doesn't give an access violation but also doesn't seem to do anything useful, e.g. doesn't seem to invoke SMART with the appropriate arguments. I'll attempt to correct and diagnose the problem
I changed the parameter grabbing function to the following. The test script did not use SendKeys, but I will add that in to test.
procedure GetSmartParams(var root,params: string);
var
path: String;
loc: integer;
begin
path:= Between('<iframe id="game" src="', '" frameborder', GetPage('http://www.runescape.com/game.ws?j=1'));
loc:= pos('runescape.com/',path);
root:= Copy(path,0,loc+13);
params:= Copy(path,loc+14,length(path)-loc+14);
writeln(root)
writeln(params);
end;
The following main loop did not give any problems when tested on x86_64 linux
begin
SetupSmart;
SendKeys('LOL TEST',100,30);
end.
However, the same program failed to recognize that SMART was loaded in wine. When that check was removed, SendKeys did in fact produce an access violation. I'll look into this further
Problem was not in SMART, but in Simba. https://github.com/MerlijnWajer/Simba/commit/3861cf96196ca4b0832ceb9656e28b03647c39df broke binary compatibility with EIOS_SendString which resulted in stack corruption and then the access violation. I adjusted SMART to use this new form, but it should be noted that EIOS methods should never break binary compatibility. Fixed in v7.1beta2
http://villavu.com/forum/showthread.php?p=1011389#post1011389