Subject: Re: bug#8562: Emacs 23.1 and later don't work in windows 98

From: Eli Zaretskii <[email-masked]>
Date: Fri, 27 May 2011 23:51:41 +0300

> Date: Fri, 27 May 2011 20:33:33 +0200
> From: oslsachem <[email-masked]>
> Cc: [email-masked]
> 
> >  unsigned e;
> >  ...
> >  len = GetOutlineTextMetricsW (dc, 0, NULL);
> >  if (len)
> >    {
> >      metrics = (OUTLINETEXTMETRICW *) alloca (len);
> >      if (GetOutlineTextMetricsW (dc, len, metrics))
> >        bcopy (&metrics->otmTextMetrics, &w32_font->metrics,
> >               sizeof (TEXTMETRICW));
> >      else
> >        metrics = NULL;
> >    }
> >  else
> >    e = GetLastError ();
> >
> >  if (!metrics)
> >    {
> >      if (!GetTextMetricsW (dc, &w32_font->metrics))
> >        e = GetLastError ();
> >    }
> >
> > Then compile, step through the code again, and tell what value gets
> > assigned to e.
> 
> http://www.speedyshare.com/files/28673968/Emacs-23.3GDBprintE.txt

> 849	 len = GetOutlineTextMetricsW (dc, 0, NULL);
> (gdb) 
> 850	 if (len)
> (gdb) 
> 860	   e = GetLastError ();
> (gdb) 
> 862	 if (!metrics)
> (gdb) p e
> $1 = 120
> (gdb) n
> 864	     if (!GetTextMetricsW (dc, &w32_font->metrics))
> (gdb) n
> 865	       e = GetLastError ();
> (gdb) n
> 868	  w32_font->cached_metrics = NULL;
> (gdb) p e
> $2 = 120
> (gdb) 
> 

120 means "This function is not supported on this system".  Do you
have the Microsoft Layer for Unicode (MSLU) installed on that system?
If you do, you should have UNICOWS.DLL somewhere on Path.

If you have that package installed, can you try compiling a simple
program that just calls these two functions, and run it on the Windows
98 machine to see if they fail in the same way?