Ignore:
Timestamp:
Jul 13, 2017, 5:17:57 AM (8 years ago)
Author:
stevenhl
Message:

Import modifications from cwmm-0_2_9-work-01_10_2006.zip dated 2006-08-27

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/common_functions/helper.c

    r2 r4  
    7070void HlpWriteToTrapLog(const char* chrFormat, ...);
    7171
    72 #if 0
    73 /****************************************************
    74  *                                                  *
    75  * This funktion returns the running OS version:    *
    76  *                                                  *
    77  * 30: Warp 3, 40 Warp 4                            *
    78  *                                                  *
    79  ****************************************************/
    80 ULONG cwQueryOSRelease()
    81 {
    82   static ULONG ulVersionMinor=0;
    83 
    84   if(!ulVersionMinor)
    85     if(DosQuerySysInfo(QSV_VERSION_MINOR, QSV_VERSION_MINOR, &ulVersionMinor, sizeof(ulVersionMinor)))
    86       ulVersionMinor=30;/* Default Warp 3 */
    87 
    88   return ulVersionMinor;
    89 
    90 }
    91 #endif
    9272
    9373void removeLog(void)
     
    564544}
    565545#endif
    566 
     546#if 0
     547if(SysQueryHomeDir(chrHomeDir, sizeof(chrHomeDir))) {
     548    strcpy(chrPath, chrHomeDir);
     549    strncat(chrPath, "\\WPSWIZZ.INI", size-strlen(chrPath)-1);/* Default is INI file in users home dir */
     550    return;
     551  }
     552
     553  strcpy(chrPath, queryHelpPath());
     554  if((ptrChar=strrchr(chrPath, '\\'))!=NULLHANDLE) {
     555    *ptrChar=0;
     556    if((ptrChar=strrchr(chrPath, '\\'))!=NULLHANDLE)
     557      *ptrChar=0;
     558  }
     559  strncat(chrPath, "\\WPSWIZZ.INI", size-strlen(chrPath)-1);
     560  chrPath[size-1]=0;
     561#endif
     562
     563/*
     564  Query the path to the INI file used by the MM progs to store the private data.
     565  If a home dir exists on the users system the INI file will be create there otherwise
     566  in the directory where the calling EXE is located.
     567 */
    567568BOOL HlpBuildMMProgIniFileName(char* chrProgname, char * chrBuffer, ULONG ulBufferSize)
    568569{
    569570  char * chrPtr; 
    570   strncpy(chrBuffer, chrProgname,ulBufferSize);
    571   chrBuffer[ulBufferSize-1]=0;
     571
     572  /* Default is INI file in users home dir */
     573  if(SysQueryHomeDir(chrBuffer, ulBufferSize)) {
     574    strlcat(chrBuffer, MMCLS_INI_FILE_NAME, ulBufferSize); /* MMCLS_INI_FILE_NAME = "\\CWMM.INI" */
     575    return TRUE;
     576  }
     577
     578  /* No HOME dir for some reason */
     579  strlcpy(chrBuffer, chrProgname, ulBufferSize);
    572580
    573581  if((chrPtr=strrchr(chrBuffer,'\\'))==NULLHANDLE)
    574     return FALSE;
     582    return FALSE; // This shouldn't happen!
    575583
    576584  *chrPtr=0;
    577   strncat(chrBuffer,INI_FILE_NAME, ulBufferSize-strlen(chrBuffer)-1);
     585  strlcat(chrBuffer, MMCLS_INI_FILE_NAME, ulBufferSize);
    578586
    579587  return TRUE;
Note: See TracChangeset for help on using the changeset viewer.