We are developing a console software, with Delphi 7.

To simplify, this software is using an embedded TCP server to answer to external requests from a CGI. These answers contain generated HTML pages with Teechart graphs, and data extracted from a database, using DbExpress.

On Windows 7 and Windows 2008 R2 servers, we noticed significant increase of the run time of our software – 2 or 3 times the original process time on Windows XP or Windows Server 2003 – in a standard context of execution: software launched as a Service with the system user account.

But when our software is launched as a simple user, from command prompt, or directly from the IDE (debug mode), the problem simply disappear.

**My first question is : has anyone already noticed this problem?**

Using ProcessExplorer, we also noticed that when the software is launched as a service, there is no GDI Handle created, nor is a User Handle. But when the software is launched with a user account, some of these handles are created. With Windows XP and Windows Server 2003, either the software is launched as a service or with a simple user account, these handles are always created.

**Can this observation be linked with our problem?**

**If you already noticed these behaviour, how did you fix the problem?**