Commits

Palmer, 2E0EOL committed 9f41adc

Various changes inherited from svn trunk
Now in develop branch awaiting review before next release.

Comments (0)

Files changed (16)

-29th May 2000
--------------
-I first created this library, I copied as much as I could from other
-Daybo Logic libraries which I had created in the past to save time.
-I intended this library for Colelus developers.  The idea being, why
-the hell would one want everybody else having their own checksum
-routines, their own methods for swapping bytes and the like.  It may not
-seem like much space would be wasted and indeed it is true that these
-little routines don't take up a lot of space.  It is just the complete
-waste of time it is to program these things.  So now common routines
-will go in \Colelus\Private\Lib\Utils.  Today I first created the header
-file too.
-
-26th June 2000
---------------
-First built the files as a library, certain things needed cleaning up,
-they still belonged to namespaces of previous libraries and the like.
-Found that the checksum rotuines I had mashed together were far from
-compilable.
-
-28th June 2000
---------------
-Found that the names for the byte swap routines were bad which would
-have caused linker problems, the name of the functions were ok in the
-headers called 'utils_'.. but then in the actual C files and
-consequently the public sybols they were called 'dlutils_'..
-
-27th August 2000
-----------------
-Converted all filesname to lowercase and created the makefile
-
-2rd October 2000
-----------------
-Created blocking.c, filelen.c & chkfile32.c.  That's file blocking (Nigel
-Crouch and I), simple file length calculator and a utility to get the
-checksum (32-bit) of a file.
-
-5th October 2000
-----------------
-Corrected an error with Borland's compiler.  Well, I won't put it like that
-it's my fault not Borland's.  On GNU, string.h must have been included by
-one of the other headers for some reason.  In Borland's compiler, I needed
-to include string.h in makerttb.c
-
-29th November 2000
-------------------
-Added another parameter to utils_CalcFileBlockSize(), it now wants the caller
-to specify the duffer rather than guess it'self depensing on flag or segmented
-memory model, this seem better to be but will cause some code problems if
-people have started using this function, easy to fix however.  Minor header
-inclusion changes to get rid of a pragma warning.
-
-28th December 2000
-------------------
-Rewrote stricmp(), changed all utils_ stuff to dlutils_ and renamed the
-library.
+29th May 2000
+-------------
+I first created this library, I copied as much as I could from other
+Daybo Logic libraries which I had created in the past to save time.
+I intended this library for Colelus developers.  The idea being, why
+the hell would one want everybody else having their own checksum
+routines, their own methods for swapping bytes and the like.  It may not
+seem like much space would be wasted and indeed it is true that these
+little routines don't take up a lot of space.  It is just the complete
+waste of time it is to program these things.  So now common routines
+will go in \Colelus\Private\Lib\Utils.  Today I first created the header
+file too.
+
+26th June 2000
+--------------
+First built the files as a library, certain things needed cleaning up,
+they still belonged to namespaces of previous libraries and the like.
+Found that the checksum rotuines I had mashed together were far from
+compilable.
+
+28th June 2000
+--------------
+Found that the names for the byte swap routines were bad which would
+have caused linker problems, the name of the functions were ok in the
+headers called 'utils_'.. but then in the actual C files and
+consequently the public sybols they were called 'dlutils_'..
+
+27th August 2000
+----------------
+Converted all filesname to lowercase and created the makefile
+
+2rd October 2000
+----------------
+Created blocking.c, filelen.c & chkfile32.c.  That's file blocking (Nigel
+Crouch and I), simple file length calculator and a utility to get the
+checksum (32-bit) of a file.
+
+5th October 2000
+----------------
+Corrected an error with Borland's compiler.  Well, I won't put it like that
+it's my fault not Borland's.  On GNU, string.h must have been included by
+one of the other headers for some reason.  In Borland's compiler, I needed
+to include string.h in makerttb.c
+
+29th November 2000
+------------------
+Added another parameter to utils_CalcFileBlockSize(), it now wants the caller
+to specify the duffer rather than guess it'self depensing on flag or segmented
+memory model, this seem better to be but will cause some code problems if
+people have started using this function, easy to fix however.  Minor header
+inclusion changes to get rid of a pragma warning.
+
+28th December 2000
+------------------
+Rewrote stricmp(), changed all utils_ stuff to dlutils_ and renamed the
+library.
 
 1st January 2001
 ----------------
 ------------------
 Changed license to a BSD-style license.  Made first initial release, version
 0.1.  We rely on the Daybo Logic scripts and Daybo Logic standards packages.
+
+22nd September 2005
+-------------------
+Removed dlutils_sdynmem.h.  We only want one header.  Moved contents into
+main header.
+
 # Ross Palmer.  Authors of individual modules may differ as stated.
 
 
+
+# Default to little endian, please override on command line
+ENDIAN=__L_ENDIAN__
+
 # The path and filenames we use
 LIBTITLE=dlutils
 SEP=.
 LIBNAME=lib$(LIBTITLE)$(LIB)
 LIBHEAD=$(LIBTITLE)$(H)
 LIBTOOL=perl ../scripts/libtool.pl gnu
-IPATH=-I../stds/
+IPATH=-I../../shared/stds/ -I../../shared/c99.h/
+DEFINES=-DHAVE_STDINT_H -DHAVE_STDBOOL_H -D$(ENDIAN)
+
 OBJECTS= \
   dlutils_byteswap$(O) \
   dlutils_checksum$(O) \
 PREFIX_BIN=/usr/local/bin/
 PREFIX_INC=/usr/local/include/
 
-#Default to little endian, please override on command line
-ENDIAN=__L_ENDIAN__
-
 # The tools we use and command line parameters
-COMPILE=gcc -c $(CWARNINGS) $(IPATH) -D$(ENDIAN) -ansi -pedantic -Wall
+COMPILE=gcc -c $(CWARNINGS) $(IPATH) $(DEFINES) -ansi -pedantic -Wall
 ERASE=perl ../scripts/erase.pl
 
 all : $(LIBNAME)

src/blocking.c

-/*
-Daybo Logic Utilities Library
-Copyright (C) 2000-2005 Daybo Logic.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. Neither the name of the project nor the names of its contributors
-   may be used to endorse or promote products derived from this software
-   without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-  Written by David Duncan Ross Palmer <http://www.daybologic.co.uk/mailddrp/>
-  with thanks to Nigel Crouch - <NigelCrouch@Hotmail.com>
-*/
-
-
-#include <stddef.h>
-#include <stdio.h>
-#ifdef HDRSTOP
-# pragma hdrstop
-#endif /*HDRSTOP*/
-
-#include "dlstdinc.h"
-#include "dlutils.h"
-/*-------------------------------------------------------------------------*/
-int dlutils_CalcFileBlockSize(
-  unsigned long FileLength,
-  DLUTILS_FILE_BLOCK_SIZE *CallerFileBlockSizePtr,
-  const size_t BufferSize
-)
-{
-  /* Mathematics by Nigel Crouch, written in C by D. D. R. Palmer. */
-  /* initialize structure */
-  CallerFileBlockSizePtr->BufferSize = 0UL;
-  CallerFileBlockSizePtr->Loops = 0UL;
-  CallerFileBlockSizePtr->Remainder = 0UL;
-
-  if (FileLength == 0)
-  {
-    /* zero file length, handle this error */
-    return 0; /*FALSE*/
-  }
-
-  if (FileLength <= BufferSize)
-    CallerFileBlockSizePtr->BufferSize = FileLength;
-  else
-    CallerFileBlockSizePtr->BufferSize = BufferSize;
-
-  CallerFileBlockSizePtr->Loops = FileLength / (CallerFileBlockSizePtr->BufferSize);
-  CallerFileBlockSizePtr->Remainder = (FileLength - (CallerFileBlockSizePtr->BufferSize) * CallerFileBlockSizePtr->Loops);
-  return 1; /*TRUE*/
-}
-/*-------------------------------------------------------------------------*/

src/checksum.c

-/*
-Daybo Logic Utilities Library
-Copyright (C) 2000-2005 Daybo Logic.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. Neither the name of the project nor the names of its contributors
-   may be used to endorse or promote products derived from this software
-   without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-*/
-
-
-/*
-  File: checksum.c
-  Author: David Duncan Ross Palmer <http://www.daybologic.co.uk/mailddrp/>
-  Title: Very simple checksum routines
-  Version: 1.01
-*/
-#include <stddef.h>
-#include <stdio.h>
-#ifdef HDRSTOP
-#  pragma hdrstop
-#endif /*HDRSTOP*/
-
-#include "dlstdinc.h"
-#include "dlutils.h"
-/*-------------------------------------------------------------------------*/
-WORD dlutils_CalcChk16(
-  const void *RawData,
-  const size_t SizeOfData
-)
-{
-  WORD genChk16 = 0; /* Generated 16-bit checksum */
-  size_t offset;
-  const BYTE *castedPtr = (const BYTE*)RawData;
-
-  if (!castedPtr || !SizeOfData) return genChk16; /* Safety */
-
-  for ( offset = 0U; offset < SizeOfData; offset++ ) {
-    /* Add value of byte to total */
-    genChk16 += *((const BYTE*)(castedPtr + offset));
-  }
-
-  return genChk16; /* Give 16-bit checksum to caller */
-}
-/*-------------------------------------------------------------------------*/
-DWORD dlutils_CalcChk32(
-  const void *RawData,
-  const size_t SizeOfData
-)
-{
-  DWORD genChk32 = 0; /* Generated 32-bit checksum */
-  size_t offset;
-  const BYTE *castedPtr = (const BYTE*)RawData;
-
-  if (!castedPtr || !SizeOfData) return genChk32; /* Safety */
-
-  for ( offset = 0U; offset < SizeOfData; offset++ )
-    genChk32 += *((const BYTE*)(castedPtr + offset));
-
-  return genChk32; /* Give 32-bit checksum to caller */
-}
-/*-------------------------------------------------------------------------*/
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
-
-This completely ANSI C (1990) portable library set is a set of
-utilities that may be used by Daybo Logic and ther selected
-parties given permission to use, modify and work on add-ins for
-the library.  The main header itself should only be worked on
-by David Duncan Ross Palmer for management reasons.  Add-in
-modules should be written by David Duncan Ross Palmer, members
-of Daybo Logic or any other selected individuals or alies.
-Their headers can then be included ultimately in this module
-providing other library or program programmers with one header
-to include the enture library.  Any add-in modules should know
-that they may be included in a static or dynamic link library
-at some stage.
-
-Written by David Duncan Ross Palmer 11th April 1999
-*/
-
-/* Revision: --->("3")<--- */
-
-#ifndef INC_DLUTILS_DLUTILS_H
-#define INC_DLUTILS_DLUTILS_H
+
+This completely ANSI C (1990) portable library set is a set of
+utilities that may be used by Daybo Logic and ther selected
+parties given permission to use, modify and work on add-ins for
+the library.  The main header itself should only be worked on
+by David Duncan Ross Palmer for management reasons.  Add-in
+modules should be written by David Duncan Ross Palmer, members
+of Daybo Logic or any other selected individuals or alies.
+Their headers can then be included ultimately in this module
+providing other library or program programmers with one header
+to include the enture library.  Any add-in modules should know
+that they may be included in a static or dynamic link library
+at some stage.
+
+Written by David Duncan Ross Palmer 11th April 1999
+*/
+
+/* Revision: --->("5")<--- */
+
+#ifndef INC_DLUTILS_H
+#define INC_DLUTILS_H
 /*-------------------------------------------------------------------------*/
 /* Version information */
 #define DLUTILS_VER_MAJOR (0)
 #define DLUTILS_VER_MINOR (1)
-#define DLUTILS_VER_BUILD (0)
-
+#define DLUTILS_VER_PATCH (2)
+
 typedef struct S_DLUTILS_FILE_BLOCK_SIZE {
-  unsigned long BufferSize;
-  unsigned long Loops;
-  unsigned long Remainder;
+  unsigned long BufferSize;
+  unsigned long Loops;
+  unsigned long Remainder;
 } DLUTILS_FILE_BLOCK_SIZE;
 
 /*
   Support for "out of memory" messages and automatic program failure
   in case of allocation failure, so programmers don't have to bother
   with NULL returns from malloc() etc.
-*/
-#include "dlutils_sdynmem.h"
+*/
+void *dlutils_xmalloc(size_t size);
+void *dlutils_xrealloc(void *old, size_t size);
+void *dlutils_xcalloc(size_t nitems, size_t size);
+
+/* Macros intended for us always goto us... */
+#define XMALLOC   dlutils_xmalloc
+#define XREALLOC  dlutils_xrealloc
+#define XCALLOC   dlutils_xcalloc
+
+/* The lead programmer may define __NOSDYNMEM__ to make
+normal allocation calls goto normal functions, else they
+are redirected to us */
+#ifdef __NOSDYNMEM__ /* Normal C library mode only? */
+/* Portable macros goto C funcs */
+#  define MALLOC  malloc
+#  define REALLOC realloc
+#  define CALLOC  calloc
+#else /* We are allowed to operate normally? */
+/* Redirect portable macros too ourselves */
+#  define MALLOC  XMALLOC
+#  define REALLOC XREALLOC
+#  define CALLOC  XCALLOC
+/* Redirect people that don't know about us, to us too */
+#  ifndef SYNMEM_WANT_IGNORANCE
+#    define malloc  XMALLOC
+#    define realloc XREALLOC
+#    define calloc  XCALLOC
+#  endif
+#endif /*__NOSDYNMEM__*/
 
 /*
   DLUtils' fatal trap support has temporarily been disabled and is
   due for a revamp.  If you find legacy code which uses it, let me
   know and I'll hack something up
-*/
+*/
 /*#include "fatltrap.h"*/
 
 BOOL dlutils_Version(
   const size_t BufferSize
 );
 
-WORD utils_RevWORD(
+WORD dlutils_RevWORD(
   const WORD W
 );
 
-DWORD utils_RevDWORD(
+DWORD dlutils_RevDWORD(
   const DWORD DW
 );
 
 
 char *dlutils_strdup(
   const char *source
-);
-/*-------------------------------------------------------------------------*/
-#endif /*!INC_DLUTILS_DLUTILS_H*/
+);
+/*-------------------------------------------------------------------------*/
+#endif /*!INC_DLUTILS_H*/

src/dlutils_blocking.c

 
 #include <stddef.h>
 #include <stdio.h>
+#include <limits.h>
 #ifdef HDRSTOP
 # pragma hdrstop
 #endif /*HDRSTOP*/

src/dlutils_byteswap.c

   Last modified - 20050907
 */
 #include <stddef.h>
+#include <limits.h>
 #include <stdio.h>
 #ifdef HDRSTOP
 # pragma hdrstop
 #include "dlstdinc.h"
 #include "dlutils.h"
 /*-------------------------------------------------------------------------*/
-WORD utils_RevWORD(const WORD W)
+WORD dlutils_RevWORD(const WORD W)
 {
   return MAKEWORD(HIBYTE(W), LOWORD(W)); /* Reverse word and return */
 }
 /*-------------------------------------------------------------------------*/
-DWORD utils_RevDWORD(const DWORD DW)
+DWORD dlutils_RevDWORD(const DWORD DW)
 {
   WORD DWH = HIWORD(DW);
   WORD DWL = LOWORD(DW);
-  DWH = utils_RevWORD(DWH); /* Reverse BYTEs in high WORD */
-  DWL = utils_RevWORD(DWL); /* Reverse BYTEs in low WORD */
+  DWH = dlutils_RevWORD(DWH); /* Reverse BYTEs in high WORD */
+  DWL = dlutils_RevWORD(DWL); /* Reverse BYTEs in low WORD */
   return MAKEDW(DWH, DWL); /* Make DWORD from WORDs backtofront */
 }
 /*-------------------------------------------------------------------------*/

src/dlutils_checksum.c

   File: checksum.c
   Author: David Duncan Ross Palmer <http://www.daybologic.co.uk/mailddrp/>
   Title: Very simple checksum routines
-  Version: 1.01
+  Version: 1.02
 */
 #include <stddef.h>
 #include <stdio.h>
+#include <limits.h>
 #ifdef HDRSTOP
 #  pragma hdrstop
 #endif /*HDRSTOP*/

src/dlutils_chkfile32.c

 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <limits.h>
 #ifdef HDRSTOP
 # pragma hdrstop
 #endif /*HDRSTOP*/
 
 #include "dlstdinc.h"
 #include "dlutils.h"
-
-/* Local types */
-typedef unsigned long ULONG;
 /*-------------------------------------------------------------------------*/
 DWORD dlutils_CalcFileChecksum32(FILE *HFile)
 {

src/dlutils_filelen.c

 */
 
 #include <stdio.h>
+#include <limits.h>
 #ifdef HDRSTOP
 # pragma hdrstop
 #endif /*HDRSTOP*/

src/dlutils_sdynmem.c

 SUCH DAMAGE.
 
 
-Safe dynamic memory allocator.
-
-Author: David Duncan Ross Palmer
-Company: Daybo Logic
-Library: Utilities
-Language compliance: ANSI C (1990)
-Created: 19990000
-Last modified: 20050907
-
-Serious bug fix: The SYNMEM_WANT_IGNORANCE define is needed to stop
-the header converting our calls to malloc() etc. into calls back to
-ourselves, this was a serious bug which caused a hidden stack overflow
-which took hours to find. - OVERLORD 20th Jan 2000
-*/
-
-#include <stdlib.h>
+Safe dynamic memory allocator.
+
+Author: David Duncan Ross Palmer
+Company: Daybo Logic
+Library: Utilities
+Language compliance: ANSI C (1990)
+Created: 19990000
+Last modified: 20050922
+
+Serious bug fix: The SYNMEM_WANT_IGNORANCE define is needed to stop
+the header converting our calls to malloc() etc. into calls back to
+ourselves, this was a serious bug which caused a hidden stack overflow
+which took hours to find. - OVERLORD 20th Jan 2000
+*/
+
+#include <stdlib.h>
+#include <limits.h>
 #include "dlstdinc.h"
-#ifdef HDRSTOP
+#ifdef HDRSTOP
 # pragma hdrstop
-#endif /*HDRSTOP*/
-
-#define SYNMEM_WANT_IGNORANCE
-#include "dlutils_sdynmem.h" /* Ours */
-
-void* xmalloc(size_t size)
-{
-  void* ptr = malloc(size);
-  if (!ptr)
-  {
-    /*FIXME: dlutils_FatalTrap("Out of memory");*/
-    abort();
-  }
-  return ptr;
-}
-
-void* xrealloc(void* old, size_t size)
-{
-  void* ptr = realloc(old, size);
-  if (!ptr)
-  {
-    /*FIXME: dlutils_FatalTrap("Out of memory");*/
-    abort();
-  }
-  return ptr;
-}
-
-void* xcalloc(size_t nitems, size_t size)
-{
-  void* ptr = calloc(nitems, size);
-  if (!ptr)
-  {
-    /*FIXME: dlutils_FatalTrap("Out of memory");*/
-    abort();
-  }
-  return ptr;
-}
+#endif /*HDRSTOP*/
+
+#define __NOSDYNMEM__
+#include "dlutils.h"
+
+void* dlutils_xmalloc(size_t size)
+{
+  void* ptr = malloc(size);
+  if (!ptr)
+  {
+    /*FIXME: dlutils_FatalTrap("Out of memory");*/
+    abort();
+  }
+  return ptr;
+}
+
+void* dlutils_xrealloc(void* old, size_t size)
+{
+  void* ptr = realloc(old, size);
+  if (!ptr)
+  {
+    /*FIXME: dlutils_FatalTrap("Out of memory");*/
+    abort();
+  }
+  return ptr;
+}
+
+void* dlutils_xcalloc(size_t nitems, size_t size)
+{
+  void* ptr = calloc(nitems, size);
+  if (!ptr)
+  {
+    /*FIXME: dlutils_FatalTrap("Out of memory");*/
+    abort();
+  }
+  return ptr;
+}
 Language Compliance: ANSI C (1990)
 
 Created: 20010101
-Last modified: 20050907
+Last modified: 20050922
 */
 
 #include <string.h>
 #include <stdlib.h>
 #include <assert.h>
 #include <stdio.h>
+#include <limits.h>
 #ifdef HDRSTOP
 # pragma hdrstop
 #endif /*HDRSTOP*/

src/dlutils_stricmp.c

 #include <stdlib.h>
 #include <stdio.h>
 #include <ctype.h>
+#include <limits.h>
 #ifdef HDRSTOP
 # pragma hdrstop
 #endif /*HDRSTOP*/
 #include <ctype.h>
 #include <stddef.h>
 #include <stdio.h>
+#include <limits.h>
 #ifdef HDRSTOP
 # pragma hdrstop
 #endif /*HDRSTOP*/
 #include <ctype.h>
 #include <stddef.h>
 #include <stdio.h>
+#include <limits.h>
 #ifdef HDRSTOP
 # pragma hdrstop
 #endif /*HDRSTOP*/

src/dlutils_version.c

 */
 /*-------------------------------------------------------------------------*/
 #include <string.h>
+#include <limits.h>
 #ifdef HDRSTOP
 # pragma hdrstop
 #endif /*HDRSTOP*/
     if ( sizeof(struct _S_DL_MODVER) == PModVer->size ) {
       PModVer->major = DLUTILS_VER_MAJOR;
       PModVer->minor = DLUTILS_VER_MINOR;
-      PModVer->build = DLUTILS_VER_BUILD;
+      PModVer->build = DLUTILS_VER_PATCH;
       return TRUE;
     }
   }