by Michael S. Kaplan, published on 2005/04/13 16:15 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2005/04/13/407912.aspx
It is all about perspective.
I am sure there are people who look at this DLL as being the answer to their prayers in terms of providing helpful interface to AVI capabilities.
But from my point of view, it kind of sucks. :-(
The other day someone with the handle PRR posted the following to the microsoft.public.platformsdk.mslayerforunicode newsgroup:
Problem description: If unicows.lib is included in the project, floating point control word may become invalid during program startup on Windows 98/95 machines (not tested on ME).
Compiler platform: MS VS.NET 2003 Pro, Platform SDK Feb 2003, Unicows.dll 1.1.3790, Win XP Pro, P4@2.4G, 1G RAM,
Steps to repro:
/nod:kernel32.lib /nod:advapi32.lib /nod:user32.lib /nod:gdi32.lib /nod:shell32.lib /nod:comdlg32.lib
/nod:version.lib /nod:mpr.lib /nod:rasapi32.lib /nod:winmm.lib /nod:winspool.lib /nod:vfw32.lib
/nod:secur32.lib /nod:oleacc.lib /nod:oledlg.lib /nod:sensapi.lib unicows.lib kernel32.lib advapi32.lib
user32.lib gdi32.lib shell32.lib comdlg32.lib version.lib mpr.lib rasapi32.lib winmm.lib winspool.lib
vfw32.lib secur32.lib oleacc.lib oledlg.lib sensapi.lib
int _tmain(int argc, _TCHAR* argv)
printf("%x\n", _control87(0, 0));
The problem was reproduced on machine, which has a clean install of Win95OSR2 + clean upgrade to Win98SE. It does not happen all the time. If program should return 9001f, reboot Win98 and try again.
Note: It does not matter, whether project uses Multi-byte or Unicode charset.
Note: As soon as unicows.lib is removed from project, program starts acting as expected.
Now for the record, it is not MSLU that is doing this. In order to have maximum compatibility with every version of Win9x (including Windows 95), there is no dependency whatsoever on the C Runtime. So it is defnitely not setting the floating point stuff. It is actually harder to do this than I realized, but Phil Lucido helped me shed the dependency while still using stuff like structured exception handling....
Now I knew this issue had come up before but honestly could not remember what it was. Luckily, Ted (who unlike me remembered this issue) came to the rescue with the answer for PRR, and a workaround:
The thing that actually destroys the floating point is avicap32.dll which unicows.dll is dependent on. Several searches will come up with information about this.
The solution is to create your own AVICAP32.DLL stub DLL that sits in the same folder as unicows.dll (if you don't rely on functionality in that DLL).
The problem is that unicows.lib is statically linked to many of the system DLLs that it has to call for the functions it wraps, and AVICAP32.DLL does indeed change these settings in the process. Whether you wanted it to or not.
Now this DLL only has two APIs that MSLU wraps: capCreateCaptureWindow and capGetDriverDescription. For all of the trouble that they cause with this floating point crap, I wish no one had noticed these two APIs that were missed for so long (they were added to MSLU on March 24, 2001 and I doubt anyone has actually used the wrappers since then, beyond the meager tests I wrote!).
Back then, I had toyed with the idea of delay loading all of the DLLs and functions being called, but somewhere in the 15+ DLLs and 550+ APIs it just seemed like an excessive amount of work. And it never ended up happening. It probably should have happened for this one DLL/two functions to work around the floating point problem, but it is not really worth rev'ing the DLL for that one change. I'll put it on the list of things to triage, if and when....
This post brought to you by "ಊ" (U+0c8a, a.k.a. KANNADA LETTER UU)
A letter that is selcom seen on Win9x but well represented in the Tunga font that ships with Windows XP and Server 2003!
# Steve Loughran on 15 Apr 2005 5:53 AM:
# Michael S. Kaplan on 15 Apr 2005 7:04 AM:
# James Todd on 16 Apr 2005 1:34 PM:
# Michael S. Kaplan on 16 Apr 2005 2:54 PM:
# James Todd on 19 Apr 2005 5:06 PM:
# Michael S. Kaplan on 20 Apr 2005 11:58 AM:
# James Todd on 28 Apr 2005 6:46 PM:
# Michael S. Kaplan on 28 Apr 2005 7:15 PM:
# James Todd on 2 May 2005 12:38 PM:
# Michael S. Kaplan on 2 May 2005 1:29 PM:
# James Todd on 3 May 2005 2:35 PM:
Yuhong Bao on 30 Dec 2010 2:05 AM:
"I don't realy install in9x myself these days, as I have a laptop that can boot into about thirty different versions of it in different languages. :-) "
How do you do this? Do you use WinBoot?
Michael S. Kaplan on 30 Dec 2010 7:51 AM:
It was an internal program provided by test. of course the MSLU virtual test machine is no more at this point....
2006/04/28 DEFAULT_GUI_FONT really stinks
go to newer or older post, or back to index or month or day