From: Stefan.Hoffmeister@Econos.de (Stefan Hoffmeister (TeamB)) Subject: Re: Floating-point control word Date: 25 Jul 1999 00:00:00 GMT Message-ID: <379b14af.8240569@forums.inprise.com> Content-Transfer-Encoding: 7bit References: <7neu11$as1@forums.borland.com> Content-Type: text/plain; charset=us-ascii Organization: . Mime-Version: 1.0 Reply-To: no.email@please Newsgroups: borland.public.delphi.basm : "Lluis Olle" wrote: >1) Who is changing the $1332 (or $1372, as there are some reserved bits in >the middle), to $1272 ? Please try searching for "Hoffmeister FPU control word" in the complete messages archive at http://www.deja.com/ I recall at least two or three postings to .objectpascal that contain a lengthy explanation showing the effect. The short answer is: any DLL has the potential to do this. Just consider this trivial DLL (I do not know whether it would compile, sorry, but you will get the idea behind it): ***************** library WreakHavoc; const BadFpuControlWord = $1332; procedure DoWreakHavoc; assembler; asm fldcw BadFpuControlWord end; procedure DllProcedure(Reason: Integer); begin DLL_PROCESS_ATTACH: DoWreakHavoc; DLL_THREAD_ATTACH: DoWreakHavoc; end; begin DllProc := @DllProcedure; DllProcedure(DLL_PROCESS_ATTACH); end; ***************** >has to be changed in some "initialization" code of some unit. Yes, indeed, and most probably it is caused by loading / initializing the COM subsystem. >it seems that "sage.dll", a component of Microsoft Plus!, >can affect the floating point precission of other tasks in the system. How >can this be possible in a Win32 enviorment, where each task is isolate from >others ? Processes (and threads) are indeed running in separate environments as far as the CPU and the FPU settings are concerned; but loading a DLL will make that DLL part of your process / thread. Depending on what the DLL does, it may affect anything in your code, at any time. -- Stefan Hoffmeister (TeamB) http://www.econos.de/ Please do apply judgement when sending email.