On Mon, Jun 23, 2008 at 12:52:51AM -0700, Boian Mitov wrote: > The problem is only when the CriticalSection Enter/Leave is called from a > callback of a windows thread such as DirectShow Grabber or VFW frame > callback or a media timer callback. In all other cases TCriticalSection > works fine. This is issue under Delphi. I have not confirmed if it exists > under Lazarus yet, as I have just started to port to Lazarus. > > To reproduce the bug in Delphi if you wish, start a media timer, and in the > callback function call a Pascal calling convention function. It can be an > empty body procedure as example. Run it for about 1H. Suddenly Delphi will > stop and will report stack corruption. Change the procedure to be "cdecl", > and it will run forever. > > I state again, we are not at the point when we are running our code for > hours under Lazarus. Once we are there I will report if the problem appears.
Hmm, it might be a problem of those api's callbacks, or their declarations that assume some registers are saved that aren't saved when the register calling convention is used. IOW, you could be looking at the wrong place, the problem not being the cdecl adding, but a wrong declaration of the callbacks (cdecl vs stdcall?) _______________________________________________ Lazarus mailing list [email protected] http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
