#1 2013-04-16 07:49:54

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

SafeLoadLibrary vs LoadLibrary

Hi Arnaud

SOmetimes you use LoadLibrary, sometimes you use SafeLoadLibrary in your code to load DLL's. Is this coincidence or is there a deeper reason for this?

Just wondering.

Hans

Offline

#2 2013-04-16 09:46:02

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,274
Website

Re: SafeLoadLibrary vs LoadLibrary

SafeLoadLibrary re-initialize the x86 FPU exception vector.
Most of the time, it is safer to use it, especially if you may call 3rd party runtimes, e.g. the .NET CLR or VC CLR.

It is a no-op otherwise.

I had sometimes unexpected FPU exceptions in the code (e.g. in fast Move() procedure) when using external libraries - this fix the issue.

Offline

#3 2013-04-16 11:32:41

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

Re: SafeLoadLibrary vs LoadLibrary

Ah.. but why not use SafeLoadLibrary everywhere then? - Just for the sake of simplicity.

Offline

#4 2013-04-16 11:45:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,274
Website

Re: SafeLoadLibrary vs LoadLibrary

If I'm sure it is unnecessary, it was not used...

Offline

Board footer

Powered by FluxBB