Changeset 4 for trunk/common_functions/helper.c
- Timestamp:
- Jul 13, 2017, 5:17:57 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/common_functions/helper.c
r2 r4 70 70 void HlpWriteToTrapLog(const char* chrFormat, ...); 71 71 72 #if 073 /****************************************************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 #endif92 72 93 73 void removeLog(void) … … 564 544 } 565 545 #endif 566 546 #if 0 547 if(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 */ 567 568 BOOL HlpBuildMMProgIniFileName(char* chrProgname, char * chrBuffer, ULONG ulBufferSize) 568 569 { 569 570 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); 572 580 573 581 if((chrPtr=strrchr(chrBuffer,'\\'))==NULLHANDLE) 574 return FALSE; 582 return FALSE; // This shouldn't happen! 575 583 576 584 *chrPtr=0; 577 str ncat(chrBuffer,INI_FILE_NAME, ulBufferSize-strlen(chrBuffer)-1);585 strlcat(chrBuffer, MMCLS_INI_FILE_NAME, ulBufferSize); 578 586 579 587 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.