[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Tr: Returned mail: User unknown
From:       "eric pouech" <eric.pouech () lemel ! fr>
Date:       1999-09-29 15:11:55
[Download RAW message or body]

This is a Multipart MIME message

delivery

---------------     
Eric Pouech 
(http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", 
Vice President Dan Quayle


[Attachment #3 (message/rfc822)]



Hi,

added warning for future VERSION_GetVersion() (mis-)users and made
OSVERSIONINFO warning more detailed.

Andreas Mohr

["version.diff" (text/plain)]

Index: misc/version.c
===================================================================
RCS file: /home/wine/wine/misc/version.c,v
retrieving revision 1.16
diff -u -w -r1.16 version.c
--- misc/version.c	1999/08/14 15:53:07	1.16
+++ misc/version.c	1999/09/29 12:56:17
@@ -237,6 +237,15 @@
 /**********************************************************************
  *         VERSION_GetVersion
  *
+ * WARNING !!!
+ * Don't call this function too early during the Wine init,
+ * as pdb->exe_modref (required by VERSION_GetImageVersion()) might still
+ * be NULL in such cases, which causes the winver to ALWAYS be detected
+ * as WIN31.
+ * And as we cache the winver once it has been determined, this is bad.
+ * This can happen much easier than you might think, as this function
+ * is called by EVERY GetVersion*() API !
+ *
  * Some version data:
  * linker/OS/image/subsys	Name			Intended for
  *
@@ -331,7 +340,8 @@
     WINDOWS_VERSION ver = VERSION_GetVersion();
     if (v->dwOSVersionInfoSize != sizeof(OSVERSIONINFO16))
     {
-        WARN("wrong OSVERSIONINFO size from app");
+        WARN("wrong OSVERSIONINFO size from app (got: %ld, expected: %d)",
+                        v->dwOSVersionInfoSize, sizeof(OSVERSIONINFO16));
         SetLastError(ERROR_INSUFFICIENT_BUFFER);
         return FALSE;
     }
@@ -352,7 +362,8 @@
     WINDOWS_VERSION ver = VERSION_GetVersion();
     if (v->dwOSVersionInfoSize != sizeof(OSVERSIONINFOA))
     {
-        WARN("wrong OSVERSIONINFO size from app");
+        WARN("wrong OSVERSIONINFO size from app (got: %ld, expected: %d)",
+                        v->dwOSVersionInfoSize, sizeof(OSVERSIONINFOA));
         SetLastError(ERROR_INSUFFICIENT_BUFFER);
         return FALSE;
     }
@@ -374,7 +385,8 @@
 
     if (v->dwOSVersionInfoSize!=sizeof(OSVERSIONINFOW))
     {
-        WARN("wrong OSVERSIONINFO size from app");
+        WARN("wrong OSVERSIONINFO size from app (got: %ld, expected: %d)",
+			v->dwOSVersionInfoSize, sizeof(OSVERSIONINFOW));
         SetLastError(ERROR_INSUFFICIENT_BUFFER);
         return FALSE;
     }

=========================================================================


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic