Caught one problem where a BOOL fn was returning 3 different values :-).
authorJeremy Allison <jra@samba.org>
Tue, 8 Jan 2002 01:22:23 +0000 (01:22 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 8 Jan 2002 01:22:23 +0000 (01:22 +0000)
Roll on defined types :-).
Jeremy.

source/printing/nt_printing.c

index 3436d2c1c49589b8c34ebd16dec7cda1b758707d..5070cf1ac4de12a2f6aa8788aaf414e1b61109cc 100644 (file)
@@ -569,13 +569,14 @@ BOOL get_short_archi(char *short_archi, char *long_archi)
 }
 
 /****************************************************************************
-Version information in Microsoft files is held in a VS_VERSION_INFO structure.
-There are two case to be covered here: PE (Portable Executable) and NE (New
-Executable) files. Both files support the same INFO structure, but PE files
-store the signature in unicode, and NE files store it as !unicode.
+ Version information in Microsoft files is held in a VS_VERSION_INFO structure.
+ There are two case to be covered here: PE (Portable Executable) and NE (New
+ Executable) files. Both files support the same INFO structure, but PE files
+ store the signature in unicode, and NE files store it as !unicode.
+ returns -1 on error, 1 on version info found, and 0 on no version info found.
 ****************************************************************************/
-static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major,
-                                                        uint32 *minor)
+
+static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32 *minor)
 {
        int     i;
        char    *buf;
@@ -689,7 +690,7 @@ static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major,
                                                                          (*major>>16)&0xffff, *major&0xffff,
                                                                          (*minor>>16)&0xffff, *minor&0xffff));
                                                        SAFE_FREE(buf);
-                                                       return True;
+                                                       return 1;
                                                }
                                        }
                                }
@@ -699,7 +700,7 @@ static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major,
                /* Version info not found, fall back to origin date/time */
                DEBUG(10,("get_file_version: PE file [%s] has no version info\n", fname));
                SAFE_FREE(buf);
-               return False;
+               return 0;
 
        } else if (SVAL(buf,NE_HEADER_SIGNATURE_OFFSET) == NE_HEADER_SIGNATURE) {
                if (CVAL(buf,NE_HEADER_TARGET_OS_OFFSET) != NE_HEADER_TARGOS_WIN ) {
@@ -766,7 +767,7 @@ static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major,
                                                          (*major>>16)&0xffff, *major&0xffff,
                                                          (*minor>>16)&0xffff, *minor&0xffff));
                                        SAFE_FREE(buf);
-                                       return True;
+                                       return 1;
                                }
                        }
                }
@@ -774,7 +775,7 @@ static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major,
                /* Version info not found, fall back to origin date/time */
                DEBUG(0,("get_file_version: NE file [%s] Version info not found\n", fname));
                SAFE_FREE(buf);
-               return False;
+               return 0;
 
        } else
                /* Assume this isn't an error... the file just looks sort of like a PE/NE file */
@@ -783,7 +784,7 @@ static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major,
 
        no_version_info:
                SAFE_FREE(buf);
-               return False;
+               return 0;
 
        error_exit:
                SAFE_FREE(buf);