Ignore:
Timestamp:
Oct 2, 2023, 11:34:35 PM (23 months ago)
Author:
gyoung
Message:

Remaining changes from merge with Lars 2.9 branch

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/classes/c/c_common/helper.c

    r57 r104  
    1919/*
    2020 * If you need another license for your prject/product contact me at
    21  * 
     21 *
    2222 * http://www.os2world.com/cdwriting
    2323 * http://www.geocities.com/SiliconValley/Sector/5785/
    2424 */
     25#define INCL_BASE
    2526#define INCL_WIN
    2627#define INCL_DOS
     
    4142
    4243#ifndef BS_NOTEBOOKBUTTON
    43 #define BS_NOTEBOOKBUTTON 8L   /* Warp 4 notebook style */ 
     44#define BS_NOTEBOOKBUTTON 8L   /* Warp 4 notebook style */
    4445#endif
    4546
     
    6667
    6768
    68   memset(&pDetails, 0, sizeof(pDetails)); 
     69  memset(&pDetails, 0, sizeof(pDetails));
    6970  pDetails.Length          = sizeof(PROGDETAILS);
    7071  pDetails.progt.progc     = PROG_DEFAULT;
     
    8182  }
    8283  pDetails.pszExecutable   = wrapperExe;
    83  
     84
    8485  pDetails.pszEnvironment  = NULLHANDLE;
    8586  pDetails.swpInitial.fl   = SWP_ACTIVATE|SWP_ZORDER; /* window positioning */
     
    9293  //  pDetails.swpInitial.ulReserved1      = 0;
    9394  //  pDetails.swpInitial.ulReserved2      = 0;
    94  
     95
    9596  /* Create an object window which will process the WM_APPTERMINATE message. While processing of this
    9697   message the view item (see below) will be removed from the inuse list thus removing the inuse emphasis. */
     
    150151  if(!hModule)
    151152    {
    152      
     153
    153154      if(queryModuleHandle())
    154155        {
     
    170171              if(NO_ERROR!=DosScanEnv("LANG", &pszLang))
    171172                break;
    172              
     173
    173174              /* Skip leading spaces */
    174175              chrPtr=pszLang;
    175176              while(*chrPtr==' ')
    176177                chrPtr++;
    177              
     178
    178179              /* Check if value seems to be valid. The var must be something like xx_XX thus length is 5 */
    179180              if(strlen(chrPtr)<5)
    180181                break;
    181              
    182               /* Extract the first two chars */       
     182
     183              /* Extract the first two chars */
    183184              sprintf(buf, RESDLLNAME, chrPtr[0], chrPtr[1]);
    184185              strcat(resDLLPath,buf);
     
    187188              //  HlpWriteToTrapLog(resDLLPath);
    188189              //  HlpWriteToTrapLog("\n");
    189        
     190
    190191              rc=DosLoadModule(buf,sizeof(buf), resDLLPath, &hModule);
    191192              if(rc==NO_ERROR)
    192193                break;
    193        
     194
    194195              /* Insert message in Logfile */
    195196              //  writeLog("Ressource-DLL for the current countrycode not found. Trying to load default one (CDFLD001.DLL).\n");
    196        
     197
    197198              /* NLS DLL not found. Try to load default */
    198199              found=strrchr(resDLLPath,'\\');
    199200              if(!found)
    200201                break;
    201              
     202
    202203              *found=0;
    203204
     
    206207              //   HlpWriteToTrapLog(resDLLPath);
    207208              //   HlpWriteToTrapLog("\n");
    208              
     209
    209210              rc=DosLoadModule(buf,sizeof(buf), resDLLPath, &hModule);
    210211              if(rc!=NO_ERROR) {
     
    215216                //writeLog("Ressource DLL loaded.\n");
    216217              }
    217              
     218
    218219              break;
    219220            }while(TRUE);
     
    223224 }
    224225
    225 /*APIRET APIENTRY DosQueryModFromEIP( HMODULE *phMod,
    226                                     ULONG *pObjNum,
    227                                     ULONG BuffLen,
    228                                     PCHAR pBuff,
    229                                     ULONG *pOffset,
    230                                     PVOID Address );*/
    231 
    232226 /* Get the HMODULE of the MM class DLL */
    233227HMODULE queryModuleHandle(void)
     
    242236      ULONG ulObj, ulBufLen, ulOffset;
    243237      char thePath[CCHMAXPATH];
    244      
     238
    245239      if(DosQueryModFromEIP( &hModule,
    246240                             &ulObj,
     
    248242                             thePath,
    249243                             &ulOffset,
    250                              (PVOID)queryModuleHandle )!=NO_ERROR) {
     244                             (ULONG)queryModuleHandle )!=NO_ERROR) {
    251245        SysWriteToTrapLog("Can't get module handle for CWMM class DLL!\n");
    252246        hModule=0;
     
    291285      strncpy(classDLLPath,moduleName, sizeof(classDLLPath));
    292286      classDLLPath[sizeof(classDLLPath)-1]=0;
    293      
     287
    294288      /* Get install dir */
    295289      strncpy(chrInstallDir,moduleName, sizeof(chrInstallDir));
     
    303297        strncpy(classDLLPath,chrInstallDir, sizeof(classDLLPath));
    304298        classDLLPath[sizeof(classDLLPath)-1]=0;
    305        
     299
    306300        /* Get install dir */
    307301        if((chrPtr=strrchr(chrInstallDir,'\\'))!=NULLHANDLE)
     
    352346    HENUM henum;
    353347    HWND hwnd;
    354    
     348
    355349    /* Move the default notebook buttons */
    356350    if((henum=WinBeginEnumWindows(hwndDlg))!=NULLHANDLE) {
     
    396390    {
    397391      snprintf(setup, sizeof(setup), "LOCATOR=%s;%s", chrUrl, "OPEN=DEFAULT");
    398       WinCreateObject("WPUrl","tempUrl", setup, tempDir, 
     392      WinCreateObject("WPUrl","tempUrl", setup, tempDir,
    399393                      CO_UPDATEIFEXISTS);
    400394        /* WinDestroyObject(hObject); Don't use it, blocks PM */
     
    402396}
    403397
    404 /* This function checks if the given file exists */ 
     398/* This function checks if the given file exists */
    405399ULONG checkFileSize(char* chrFileName)
    406400{
     
    410404  if(stat(chrFileName , &statBuf)==-1)
    411405    return 0;
    412  
     406
    413407  return statBuf.st_size;
    414408}
Note: See TracChangeset for help on using the changeset viewer.