Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/107405

From BetaArchive Wiki

BUG: _DBReplace() in LCK Leaks Memory

ID: Q107405

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5x, 2.6x
  • Microsoft FoxPro for MS-DOS, versions 2.6x


In the FoxPro Library Construction Kit, if you use the _DBReplace() function to replace information into a character field in a database, memory will slowly be lost.


Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


Steps to Reproduce Problem

The following code can be used to reproduce the problem. The SYS(1016) value will change approximately every 200-400 calls to the library. It will change by values around 2 kilobytes each time. There is currently no known workaround.

   * FoxPro Code
   x = "a"
   CREATE TABLE lcktest (tstfield c(25))
   SET LIBRARY TO test.dll
   FOR i=1 TO 10000
     =myplbfunc(REPLICATE( X ,10))

   // LCK 'C' Code test.c
   #include <pro_ext.h>
   void FAR Generic(ParamBlk FAR *parm)
   Value myval;
   Locator DbfFldLoc;

   // Locate field named 'tstfield'

   if ((DbfFldLoc.l_NTI = _NameTableIndex("tstfield")) == -1)
      _UserError("Failed at _NameTableIndex call.");

   // Find the field in the database, and store location to Locator
   // structure

   if (_FindVar(DbfFldLoc.l_NTI, 1, &DbfFldLoc) == 0)
      _UserError("Failed at _FindVar call.");

   // Replace character field with information from passed in variable



   FoxInfo myFoxInfo[] = {
        {"MYPLBFUNC", (FPFI) Generic, 1, "C"},

   FoxTable _FoxTable = {
        (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo

Additional reference words: FoxWin FoxDos 2.50 2.50a 2.50b 2.60 2.60a buglist2.50 buglist2.50a buglist2.50b buglist2.60 buglist2.60a LCK API KBCategory: kbtool kbenv kbbuglist KBSubcategory: FxtoolLck

Last Reviewed: September 26, 1995
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.