EOutOfMemory on Process method

delphi package - easy access to kernel objects etc.
Post Reply
Mazinger
Posts: 33
Joined: Wed Jan 26, 2005 6:26 am

EOutOfMemory on Process method

Post by Mazinger »

Hi,

I'm developing and app that uses madkernel's Process method on two escenarios (same executable, 32 bits):

1. On a Windows 2003 server 32bits edition, all fine.

2. On a Windows 2003 server 64bits edition, a EOutofMemory except is raised.

How can I handle this error?

(I'm using last version of MadCollection).

Thanks in advance.

This is the callstack reported by MadExcept:

version : 1.1.0.202
compiled with : BCB 2006
madExcept version : 3.0d
callstack crc : $f2be1c4b, $01d873e9, $43ea3a2c
exception number : 1
exception class : EOutOfMemory
exception message : Out of memory.

main thread ($a98):
0056d784 icom.exe madKernel TIHandle.Create
0056e2f8 icom.exe madKernel Handle
00580e43 icom.exe madKernel Process
00c2fe1d icom.exe uIFDS 2914 +47 AddClientWindows
00c3ad46 icom.exe uIFDS 5762 +142 TFIFDS.WndProc
009f9693 icom.exe LMDWndProcComponent TLMDWndProcComponent.CallPrevWndProc
009f9703 icom.exe LMDWndProcComponent TLMDWndProcComponent.WndProc
00a02680 icom.exe LMDCaptionButtons TLMDCaptionButtons.WndProc
004c1648 icom.exe Controls TWinControl.MainWndProc
0047ff5c icom.exe Classes StdWndProc
7d94a947 USER32.dll DispatchMessageA
004dacb4 icom.exe Forms TApplication.ProcessMessage
004dacee icom.exe Forms TApplication.HandleMessage
004daf0e icom.exe Forms TApplication.Run
00c7375f icom.exe iCom 76 +5 initialization
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Ouch. Can you please show me the code which is failing? It very much looks like a bug in madKernel, but it would help if I could see your code, so I would now how to quickly reproduce the problem.
Mazinger
Posts: 33
Joined: Wed Jan 26, 2005 6:26 am

Post by Mazinger »

Hi madshi,

I don't know what you need of my code, but here you are two lines that when executed produces the exception:

1. Dir:=ExtractFilePath(Process(PID).ExeFile);

2. WriteDebugRoot(Format('[INJECT] No s''ha pogut accedir al procès %d (%s) de la sessió %d',[PID,Process(PID).ExeFile,Process(PID).Session]));

In general, whatever Process(PID) called function.

PID is generally obtained from a Windows handle using this API:

GetWindowThreadProcessID(H,@PID);

Thanks.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Thanks, I'll have a look at that. May take a few days, though.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Sorry for the late reply. The problem was that a system API behaved strangely, when it failed. The way it behaved made madKernel think that it didn't fail but succeed. Anyway, should be fixed in this build:

http://madshi.net/madCollection.exe
Mazinger
Posts: 33
Joined: Wed Jan 26, 2005 6:26 am

Post by Mazinger »

Thanks a lot.
Post Reply