Sign in to follow this  
Followers 0
Zedna

AutoIt 1-2-3 error on WIN98 (WIN9x/ME)

13 posts in this topic

On WIN98 it crashes when starting with this error:

Line 0 (File "C:\Autoit-123\Autoit-123.exe"):

Return $ai_Return[0]Return $ai_Return^ ERROR

Error: Subscript used with non-Array variable.

Although I haven't sources I think problem is probably in Func _ReduceMemory():

Func _ReduceMemory()
    Local $ai_GetCurrentProcessId = DllCall('kernel32.dll', 'int', 'GetCurrentProcessId')
    Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ai_GetCurrentProcessId[0])
    Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
    DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Return $ai_Return[0]
EndFunc
oÝ÷ ØwöÉè·
+)à¢u7ß,¢Ø^­ë!¢é]mæuçZµ· z¶­~éܶ*'jëh×6If @OSTYPE = 'WIN32_WINDOWS' Then Return

Share this post


Link to post
Share on other sites



On WIN98 it crashes when starting with this error:

Although I haven't sources I think problem is probably in Func _ReduceMemory():

Func _ReduceMemory()
    Local $ai_GetCurrentProcessId = DllCall('kernel32.dll', 'int', 'GetCurrentProcessId')
    Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ai_GetCurrentProcessId[0])
    Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
    DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Return $ai_Return[0]
EndFunc
oÝ÷ ØwöÉè·
+)à¢u7ß,¢Ø^­ë!¢é]mæuçZµ· z¶­~éܶ*'jëh×6If @OSTYPE = 'WIN32_WINDOWS' Then ReturnoÝ÷ Ûú®¢×¨­«­¢+Ø)Õ¹}IÕ5µ½Éä ¤(%1½°ÀÌØí¥}IÑÕɸô±±
±°  ÅÕ½ÐíÁÍÁ¤¹±°ÅÕ½Ðì°Ìäí¥¹ÐÌäì°ÌäíµÁÑå]½É­¥¹MÐÌäì°Ìäí±½¹Ìä찴Ĥ(%%ÉɽÈQ¡¸IÑÕɸÄ(%IÑÕɸÀÌØí¥}IÑÕɹlÁt)¹Õ¹ìôôÐí}IÕ5µ½Éä(

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

On WIN98 it crashes when starting with this error:

Although I haven't sources I think problem is probably in Func _ReduceMemory():

Func _ReduceMemory()
    Local $ai_GetCurrentProcessId = DllCall('kernel32.dll', 'int', 'GetCurrentProcessId')
    Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ai_GetCurrentProcessId[0])
    Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
    DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Return $ai_Return[0]
EndFunc
 oÝ÷ ØwöÉè·
+)à¢u7ß,¢Ø^­ë!¢é]mæuçZµ· z¶­~éܶ*'jëh×6If @OSTYPE = 'WIN32_WINDOWS' Then Return
If you read through the topic for AutoIt 1-2-3 you'll see a post, from me actually, about this error as well as a reply from Valuater in which he states that it's not compatible with Win 98.

Nomad :D


Share this post


Link to post
Share on other sites

If you read through the topic for AutoIt 1-2-3 you'll see a post, from me actually, about this error as well as a reply from Valuater in which he states that it's not compatible with Win 98.

Nomad :D

I wrote this in that topic once but no reply,

but now I don't read this topic because it contains more then 850 posts

and it's incredible. I couldn't find nothing usefull in that topic only bunch of shit statistics :wacko:

If that program doesn't run on WIN98 and correction is so simple why not correct it?

Share this post


Link to post
Share on other sites

I wrote this in that topic once but no reply,

but now I don't read this topic because it contains more then 850 posts

and it's incredible. I couldn't find nothing usefull in that topic only bunch of shit statistics :D

If that program doesn't run on WIN98 and correction is so simple why not correct it?

Have you tried the changed function to see if it works on 98?

Don't have 9x/2k here, just XP Pro and Linux.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Have you tried the changed function to see if it works on 98?

Don't have 9x/2k here, just XP Pro and Linux.

You'd need the source. Either Valuater would have to supply it, or you'd have to use a hacked decompiler. As far as why he doesn't fix it, I don't know...

Share this post


Link to post
Share on other sites

You'd need the source. Either Valuater would have to supply it, or you'd have to use a hacked decompiler. As far as why he doesn't fix it, I don't know...

hadn't downloaded it, so didn't know source wasn't included.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

hadn't downloaded it, so didn't know source wasn't included.

Yeah, it wasn't included when I downloaded it. For all I know it might be now. This was a couple months ago, but this is the same error I got when I tried to run it.

Share this post


Link to post
Share on other sites

You'd need the source. Either Valuater would have to supply it, or you'd have to use a hacked decompiler. As far as why he doesn't fix it, I don't know...

If it will not be corrected I will try to create small DLL psapi.dll with function EmptyWorkingSet which only returns 0 and I will place it in current directory.

This could be "hack" workaround ...

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

If it will not be corrected I will try to create small DLL psapi.dll with function EmptyWorkingSet which only returns 0 and I will place it in current directory.

This could be "hack" workaround ...

Yes, that might work. Here is the function which is giving the error:
Func _ReduceMemory()
If StringInStr(@OSTYPE,"WIN32_WINDOWS") And Not FileExists(@ScriptDir & "\psapi.dll") Then
  FileInstall("C:\Program Files\AutoIt3\psapi.dll", @ScriptDir & "\psapi.dll")
EndIf
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
Return $ai_Return[0]
EndFunc

However, after fixing this, you may find more errors. There are a few AutoIt functions which are not compatible with Win 9x, and he might have used some of them. But it's worth a shot. I can try fixing this myself and running the script to see.

Nomad :D

Edited by Nomad

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

If it will not be corrected I will try to create small DLL psapi.dll with function EmptyWorkingSet which only returns 0 and I will place it in current directory.

This could be "hack" workaround ...

That isn't going to work. I've been messing around with the source a little. I've tried removing the DllCall and setting $ai_Return[0] to 0, which is what you would've accomplished with the return value of 0 from EmptyWorkingSet, and I get "AUTOIT3 caused an invalid page fault in module USER.EXE at 0008:00004435.". Also, the funtion is called with AdlibEnable, so it's polled constantly. I don't think fixing this is something that can be done in 10 minutes. I might try reworking some of the source, but I don't know how far I'm willing to go without some input from Valuater, since this is his script after all (I'm starting to feel like I'm doing something bad :D ). Edited by Nomad

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

That isn't going to work. I've been messing around with the source a little. I've tried removing the DllCall and setting $ai_Return[0] to 0, which is what you would've accomplished with the return value of 0 from EmptyWorkingSet, and I get "AUTOIT3 caused an invalid page fault in module USER.EXE at 0008:00004435.". Also, the funtion is called with AdlibEnable, so it's polled constantly. I don't think fixing this is something that can be done in 10 minutes. I might try reworking some of the source, but I don't know how far I'm willing to go without some input from Valuater, since this is his script after all (I'm starting to feel like I'm doing something bad :D ).

I created dummy DLL psapi.dll as I proposed to workaround first error.

First error is now with this DLL OK, but I have same page fault in module USER.EXE as you.

I don't have sources neither hacked decompiler, so I can't look where are another problems.

But if it's impossible to correct sources for run on WIN9x then Valuater could add at begin some test of OS

and MessageBox & Exit in case of WIN9x.

psapi.dll source:

#include "dll.h"

EXPORT int EmptyWorkingSet(long par)
{
    return 0;
}

#define EXPORT extern "C" __declspec(dllexport)

EXPORT int EmptyWorkingSet(long);
Edited by Zedna

Share this post


Link to post
Share on other sites

That isn't going to work. I've been messing around with the source a little. I've tried removing the DllCall and setting $ai_Return[0] to 0, which is what you would've accomplished with the return value of 0 from EmptyWorkingSet, and I get "AUTOIT3 caused an invalid page fault in module USER.EXE at 0008:00004435.". Also, the funtion is called with AdlibEnable, so it's polled constantly. I don't think fixing this is something that can be done in 10 minutes. I might try reworking some of the source, but I don't know how far I'm willing to go without some input from Valuater, since this is his script after all (I'm starting to feel like I'm doing something bad :D ).

Any help that makes this program better... is appreciated!

maybe i could do something like this????

If Not StringInStr(@OSTYPE,"WIN32_WINDOWS") Then AdlibEnable("_ReduceMemory", 500)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0