Re: Pentium 1.8Ghz / Windows 2000 / Delphi 6 problem

From: Martin Harvey (Demon account) (martin_at_nospam_pergolesi.demon.co.uk)
Date: 10/30/04


Date: Sat, 30 Oct 2004 15:26:03 GMT

On Fri, 29 Oct 2004 18:40:43 -0700, Jamie
<jamie_5_not_valid_after_5_Please@charter.net> wrote:

>there are many cases where DLL's that your app is using may have a flaw
>in it.
> all DLL's that have anything to do with your app will get mapped into
>your Application space. video drivers is a good one for this along with
>other things.

*sigh*. There's a distinction you're missing here.

There's a difference between a user mode DLL, and a kernel mode .SYS

User mode DLL's will not affect the control word *across
applications*, even if they're loaded in the context of several
different processes. They may change the control word in the context
of a process, but those changes are necessarily on a process by
process basis, since they're operating in the user mode virtual
machine.

> if there is any change od the FPU control word not being restored in
>any DLL's that your app is using, it does cause problems.

Yes, but only in the app that loads and uses the DLL.

> the FPU control word gets restored to what ever it was when the process
>was created or what ever it was when i left the process last.
> when i say process i mean when the OS switches to another process space.!

No, this is not right for user mode DLL's.

User mode DLL's affect the control word *synchronously* - that means
that you need to call them, or they need to be invoked via a system
hook, or via the entry point.

For drivers, they may well change and forget to restore the FPU
control word, and this may happen in situations where the process
context is *arbitrary*, and it will tend to happen *asynchronously*,
that is, control will be wrested away from your app, and the control
word could be changed at an arbitrary (i.e. interrupt) time.

> this means that any System DLL's

There is no such thing as a "system DLL". It's either a DLL that
happens to come with the OS, and runs in user mode, or it's a .SYS
driver file that runs in kernel mode.

> my W98 Pc had a bad video driver in it once that would cause my app to
>generate a floating point error after i did some graphic work.
> i found this problem after doing lots of debugging on the GDI api's
>and found the FPU word had got changed on one of the GDI calls.
> i updated my drivers and it solved the problem there.

Fine.

> i also started to use the code to make sure the PFU control word was
>set to what i wanted there after to make sure.

If a driver is corrupting the control word, since it gets control
asynchronously from your app at any arbitrary time, this is no
guaranteed to work. If a driver messes up the control word, it is not
possible (in princple at least) to write a fix that will work for all
situations.

MH.



Relevant Pages

  • Re: USB performance bug since kernel 2.6.13 (CRITICAL???)
    ... user mode for this sort of thing. ... kernel mode drivers in this regard. ... Recall that each transaction ...
    (Linux-Kernel)
  • Re: Migrating app from 3.2v4.2 to OpenServer 5.0.7?
    ... > application talks directly to the device with its own drivers. ... from SCO Unix 3.2v4.2 to OpenServer 5.0.7. ... The app is working fine. ... 3.2v4.2 might be difficult to install on current hardware. ...
    (comp.unix.sco.misc)
  • Re: Allocating and accessing physically contiguous memory in user mode in WinCE 6.0 Beta
    ... because most embedded systems are closed systems, ... User mode drivers are exactly what we have had for all versions prior to CE ... What is new in V6.0 is Kernel mode drivers, ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Detecting Available Resolutions Part Deux
    ... With older drivers - Video For Windows - you have the choice of the dialog ... > I have a capture device that if you bring up the properties of its pin you ... get a dialog with 16 different resolutions available. ... your app starts e.g. a service engineer initially configures the system, ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Excel import with x64 machine
    ... don't know much about x64 architecture...): I guess when the app is ... You are accessing Excel data, right, excel is still 32 bit, you can't possibly have worksheets larger than 2GB. ... Drivers to the 32 Bit OleDB Drivers. ...
    (microsoft.public.dotnet.languages.csharp)