GNOME Bugzilla – Bug 150746
GTK+ doesn't run on Windows 95
Last modified: 2006-04-19 10:19:44 UTC
I have found that dia does not start on Win 95. Versions are dia-win32-installer 0.94-pre1 and Win 95 4.00.950 B. I get this error message: Error starting program The LIBGTK-WIN32-2.0-0.DLL file is linked to missing export KERNEL32.DLL:GetFileAttributesExA Indeed Win 95 KERNEL32.DLL has similarly named exports: GetFileAttributesA and GetFileAttributesW, but not GetFileAttributesExA.
*** Bug 150748 has been marked as a duplicate of this bug. ***
*** Bug 150747 has been marked as a duplicate of this bug. ***
This is rather a GTK+ bug than a dia bug.
(Bug is not assigned correctly; reassigning to component owner - GTK Win32 maintainers) GetFileAttributesEx is called from filename_get_info() in gtk/gtkfilesystemwin32.c The discussion in bug #137543 is relevant. Is this a WONTFIX (Win95 support dropped)?
It's not WONTFIX, it's WILLWHOEVERFEELSSTRONGLYFORITSUBMITAPATCHTHANKS ;-)
aggreeing with Tor (especially as GetFileAttributeEx isn't the only function missing under win95). The least someone interested in gtk+ running under win95 - and thus having access to one - needs to check exactly which functions are additionally missing. You can do this by running depends.exe on gtk-win32-2.0.dll (or dia.exe) and write down every symbol from every DLL used which has a red icon near to it. I suspect these are at least the additional ones mentioned in my comment to bug #137543 (pasted below) : - afaik win95 (not win9x!) support of gtk is broken for years (to me it is very reasonable to use functions introduced with win98 unconditional, like GetFileAttributesEx). There are other functions in the dependency stack already, e.g. InterlockedExchange*() which simply are not available for win95 (iirc with win98 the 80386 support was dropped and they require a 486 at least, or was it a pentium? )
> e.g. InterlockedExchange*() which simply are not available for win95 Yes but my DLLs, being built with gcc, don't use that, but the inline assembly code ;-)
*** Bug 158547 has been marked as a duplicate of this bug. ***
See this page on Microsoft's web site: http://msdn.microsoft.com/library/en-us/fileio/base/getfileattributesex.asp Quoting from there: "Windows NT Server 3.51 and earlier, Windows 95: Include an additional header file called NewAPIs.h to make GetFileAttributesEx available on these operating systems. The function is not implemented natively, but by a wrapper that utilizes other native functions on these systems. See the header file for details of the use of preprocessor directives that make the function available. If you do not have this header file, it can be obtained by downloading the most recent Windows SDK from the SDK Update Site." So the GetFileAttributesExA bug should be trivial to fix. Examine Microsoft's NewAPIs.h header file and use it, or create an equivalent. -- Mark
Thers is no NewAPIs.h in the headers used when building GTK etc with gcc. (Those headers are a clean-room rewrite, not copied from Microsoft's.) Nor is NewAPIs.h present in MSVC6's headers, although MSVC5 users probably want to use fresh Platform SDK headers anyway. Instead, whoever feels strongly for this needs to submit a patch that does the following: - Looks up GetFileAtributesExA at run-time (just once) from kernel32.dll - Uses result of above look-up if found - Otherwise uses FindFirstFile.
*** Bug 163498 has been marked as a duplicate of this bug. ***
*** Bug 167240 has been marked as a duplicate of this bug. ***
Created attachment 46371 [details] Emulating the missing Win95 functions GetFileAttributesExA and ExW I have a solution to this bug. The problem has doubled in size after it was reported in 2004-08-22. In GTK+ version 2.4.14, GetFileAttributesExA was the only function missing in Win95. In version 2.6.7, there is another function missing from Win95, GetFileAttributesExW. These two functions are only called in one place: inside gtkfilesystemwin32.c by static function filename_get_info, which is only called by gtk_file_folder_win32_get_info. My solution emulates the two missing functions, GetFileAttributesExA{W}. The file attachment is inserted into gtkfilesystemwin32.c: MAR 20 2005 12:25AM gtk+-2.6.7 The correction goes in front of function filename_get_info . Yes, I know that a diff of the changes would be very, very nice but I have this problem with GNU Diffutils for Windows: "DIFF caused an invalid page fault in module MSVCRT.DLL at 013f:780029e5." All I really care about is Inkscape on Win95 < https://sourceforge.net/tracker/?func=detail&atid=604306&aid=1188352&group_id=93438 > I get this error message from Inkscape: The LIBGTK-WIN32-2.0-0.DLL file is linked to missing export KERNEL32.DLL:GetFileAttributesExA In the file attachment, I did something dubious by using these macros: #define GetFileAttributesExA PROBE_GetFileAttributesExA #define GetFileAttributesExW PROBE_GetFileAttributesExW Function PROBE_GetFileAttributesExA{W} decides if the real GetFileAttributesExA{W} is available in KERNEL32.DLL or must instead be emulated. For reference on how Microsoft solved this very same bug, NewAPIs.h is available. It is temporarily at Google cache snapshot for "WANT_GETFILEATTRIBUTESEX_WRAPPER" which is the same as < http://snipurl.com/e6x7 >
Created attachment 47044 [details] test.c for emulate_GetFileAttributesEx
Created attachment 47045 [details] NewAPIs.h (Only GetFileAttributesEx wrapper)
Created attachment 47046 [details] suggested changes to file gtkfilesystemwin32.c
So, which part of "Copyright (c) 1997-1999, Microsoft Corporation" do you not understand?
Sitting for minutes I was embarrassed by what I had done, but I persist. I really want this bug fixed and that will require work by the GTK+ leaders. Because of Comments #9 and 10, a short quote from a very much longer NewAPIs.h is attached for reference only. It is not to become a part of GTK+. But I believe Microsoft does allow use of this particular header. What you can do with the code is limited by the "fair use" provisions of the copyright law. If the very strong words "all rights reserved" had also been used, that would indicate "if you copy our software without our permission, you will hear from our lawyer." An example using the much stronger words "all rights reserved": /* * Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. */ Another: // Copyright 1986 - 1998 Microsoft Corporation. All Rights Reserved. With regrets for possibly offending copyrights, llcSawyer
llcSawyer: Please convince Microsoft to release that code to the public domain or LGPL (or whatever it required by GTK+). We cannot break copyright, no matter how much it is wanted. The "All right reserved" has nothing to do with copyright. Since the Berne convention, even the 'Copyright (c)' can be left out (it is automatically copyrighted).
Created attachment 47268 [details] Using only FindFirstFile The attachment uses only FindFirstFile and never calls GetFileAttributesEx. And there are no special functions to only support Win95 or WinNT 3.1 and later. Can you use this idea?
Unfortunately FindFirstFile() doesn't work for the root of drives. (It even says so in the documentation.) Try again.
Created attachment 49530 [details] [review] patch FindFirstFileA() doesn't work for a Win95 root directory. But it does work for a WinXP NTFS root directory "C:". But, then again, it does not work for a WinXP FAT32 root directory "D:", in a system recovery partition. The patch handles this inconsistency between Win95 and WinXP.
Created attachment 49531 [details] test the patch
Closing as wontfix. If you want to use GTK+ on Windows 95, use some older version that still worked.