Changeset 104 for trunk/classes/c/c_common
- Timestamp:
- Oct 2, 2023, 11:34:35 PM (23 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/v2.9 merged eligible /branches/v2.9_Lars merged eligible
-
Property svn:mergeinfo
set to
-
trunk/classes/c/c_common/except.c
r41 r104 130 130 USHORT SS; 131 131 } DbgBuf; 132 /*-------------------------------------*/ 133 APIRET APIENTRY DOSQUERYMODFROMEIP( HMODULE *phMod, 134 ULONG *pObjNum, 135 ULONG BuffLen, 136 PCHAR pBuff, 137 ULONG *pOffset, 138 PVOID Address ); 139 /*APIRET APIENTRY DosQueryModFromEIP( HMODULE *phMod, 140 ULONG *pObjNum, 141 ULONG BuffLen, 142 PCHAR pBuff, 143 ULONG *pOffset, 144 PVOID Address );*/ 145 146 /*-------------------------------------*/ 132 147 133 /* CW 148 134 #define DBG_O_OBJMTE 0x10000000L*/ … … 459 445 460 446 return 'c'; 461 } 447 } 462 448 463 449 ULONG _System excHandler(PEXCEPTIONREPORTRECORD pERepRec, … … 515 501 { 516 502 ULONG rc = XCPT_CONTINUE_SEARCH; 517 503 518 504 if (pERepRec->fHandlerFlags & EH_EXIT_UNWIND) 519 505 return (XCPT_CONTINUE_SEARCH); … … 522 508 if (pERepRec->fHandlerFlags & EH_NESTED_CALL) 523 509 return (XCPT_CONTINUE_SEARCH); 524 510 525 511 if ((pERepRec->ExceptionNum & XCPT_SEVERITY_CODE) == XCPT_FATAL_EXCEPTION) 526 512 { … … 655 641 } 656 642 #endif 657 643 658 644 fAlreadyTrapped = TRUE; 659 645 /* end John Currier's recursion prevention */ … … 663 649 (Version[0]>=20) && 664 650 (Version[1]>=10) ) { 665 /* version must be over 2.1 for D OSQUERYMODFROMEIP */651 /* version must be over 2.1 for DosQueryModFromEIP */ 666 652 fprintf(hTrap,"OS/2 Version %d.%d\n",Version[0]/10,Version[1]); 667 rc=D OSQUERYMODFROMEIP( &hMod, &ObjNum, CCHMAXPATH,653 rc=DosQueryModFromEIP( &hMod, &ObjNum, CCHMAXPATH, 668 654 Name, &Offset, pERepRec->ExceptionAddress); 669 655 if (rc==0) { … … 814 800 if ((AllocationFlags&PAG_EXECUTE)&& 815 801 (AllocationFlags&PAG_BASE)) { 816 rc=D OSQUERYMODFROMEIP( &hMod, &ObjNum, CCHMAXPATH,802 rc=DosQueryModFromEIP( &hMod, &ObjNum, CCHMAXPATH, 817 803 Name, &Offset, BaseAddress); 818 804 if (rc==0) { … … 1038 1024 break; /* avoid infinite loops */ 1039 1025 } else { 1040 rc = D OSQUERYMODFROMEIP(&hMod, &ObjNum, sizeof(Name),1026 rc = DosQueryModFromEIP(&hMod, &ObjNum, sizeof(Name), 1041 1027 Name, &Offset, (PVOID)RetAddr); 1042 1028 if (rc == NO_ERROR && ObjNum != -1) … … 1181 1167 } 1182 1168 1183 #include <exe.h>1184 1169 #include <newexe.h> 1185 1170 #define FOR_EXEHDR 1 /* avoid define conflicts between newexe.h and exe386.h */ … … 1835 1820 do { 1836 1821 read(fh,(void *)&FirstLine,sizeof(FirstLine)); 1837 1822 1838 1823 if (FirstLine.LineNum!=0) { 1839 1824 fprintf(hTrap,"Missing Line table information\n"); … … 1864 1849 } 1865 1850 break; 1866 1851 1867 1852 case 1: 1868 1853 lseek(fh, sizeof(struct linlist_rec), SEEK_CUR); 1869 1854 break; 1870 1855 1871 1856 case 2: 1872 1857 lseek(fh, sizeof(struct linsourcelist_rec), SEEK_CUR); 1873 1858 break; 1874 1859 1875 1860 case 3: 1876 1861 lseek(fh, sizeof(struct filenam_rec), SEEK_CUR); 1877 1862 break; 1878 1863 1879 1864 case 4: 1880 1865 lseek(fh, sizeof(struct pathtab_rec), SEEK_CUR); 1881 1866 break; 1882 1867 1883 1868 } 1884 1869 } -
trunk/classes/c/c_common/helper.c
r57 r104 19 19 /* 20 20 * If you need another license for your prject/product contact me at 21 * 21 * 22 22 * http://www.os2world.com/cdwriting 23 23 * http://www.geocities.com/SiliconValley/Sector/5785/ 24 24 */ 25 #define INCL_BASE 25 26 #define INCL_WIN 26 27 #define INCL_DOS … … 41 42 42 43 #ifndef BS_NOTEBOOKBUTTON 43 #define BS_NOTEBOOKBUTTON 8L /* Warp 4 notebook style */ 44 #define BS_NOTEBOOKBUTTON 8L /* Warp 4 notebook style */ 44 45 #endif 45 46 … … 66 67 67 68 68 memset(&pDetails, 0, sizeof(pDetails)); 69 memset(&pDetails, 0, sizeof(pDetails)); 69 70 pDetails.Length = sizeof(PROGDETAILS); 70 71 pDetails.progt.progc = PROG_DEFAULT; … … 81 82 } 82 83 pDetails.pszExecutable = wrapperExe; 83 84 84 85 pDetails.pszEnvironment = NULLHANDLE; 85 86 pDetails.swpInitial.fl = SWP_ACTIVATE|SWP_ZORDER; /* window positioning */ … … 92 93 // pDetails.swpInitial.ulReserved1 = 0; 93 94 // pDetails.swpInitial.ulReserved2 = 0; 94 95 95 96 /* Create an object window which will process the WM_APPTERMINATE message. While processing of this 96 97 message the view item (see below) will be removed from the inuse list thus removing the inuse emphasis. */ … … 150 151 if(!hModule) 151 152 { 152 153 153 154 if(queryModuleHandle()) 154 155 { … … 170 171 if(NO_ERROR!=DosScanEnv("LANG", &pszLang)) 171 172 break; 172 173 173 174 /* Skip leading spaces */ 174 175 chrPtr=pszLang; 175 176 while(*chrPtr==' ') 176 177 chrPtr++; 177 178 178 179 /* Check if value seems to be valid. The var must be something like xx_XX thus length is 5 */ 179 180 if(strlen(chrPtr)<5) 180 181 break; 181 182 /* Extract the first two chars */ 182 183 /* Extract the first two chars */ 183 184 sprintf(buf, RESDLLNAME, chrPtr[0], chrPtr[1]); 184 185 strcat(resDLLPath,buf); … … 187 188 // HlpWriteToTrapLog(resDLLPath); 188 189 // HlpWriteToTrapLog("\n"); 189 190 190 191 rc=DosLoadModule(buf,sizeof(buf), resDLLPath, &hModule); 191 192 if(rc==NO_ERROR) 192 193 break; 193 194 194 195 /* Insert message in Logfile */ 195 196 // writeLog("Ressource-DLL for the current countrycode not found. Trying to load default one (CDFLD001.DLL).\n"); 196 197 197 198 /* NLS DLL not found. Try to load default */ 198 199 found=strrchr(resDLLPath,'\\'); 199 200 if(!found) 200 201 break; 201 202 202 203 *found=0; 203 204 … … 206 207 // HlpWriteToTrapLog(resDLLPath); 207 208 // HlpWriteToTrapLog("\n"); 208 209 209 210 rc=DosLoadModule(buf,sizeof(buf), resDLLPath, &hModule); 210 211 if(rc!=NO_ERROR) { … … 215 216 //writeLog("Ressource DLL loaded.\n"); 216 217 } 217 218 218 219 break; 219 220 }while(TRUE); … … 223 224 } 224 225 225 /*APIRET APIENTRY DosQueryModFromEIP( HMODULE *phMod,226 ULONG *pObjNum,227 ULONG BuffLen,228 PCHAR pBuff,229 ULONG *pOffset,230 PVOID Address );*/231 232 226 /* Get the HMODULE of the MM class DLL */ 233 227 HMODULE queryModuleHandle(void) … … 242 236 ULONG ulObj, ulBufLen, ulOffset; 243 237 char thePath[CCHMAXPATH]; 244 238 245 239 if(DosQueryModFromEIP( &hModule, 246 240 &ulObj, … … 248 242 thePath, 249 243 &ulOffset, 250 ( PVOID)queryModuleHandle )!=NO_ERROR) {244 (ULONG)queryModuleHandle )!=NO_ERROR) { 251 245 SysWriteToTrapLog("Can't get module handle for CWMM class DLL!\n"); 252 246 hModule=0; … … 291 285 strncpy(classDLLPath,moduleName, sizeof(classDLLPath)); 292 286 classDLLPath[sizeof(classDLLPath)-1]=0; 293 287 294 288 /* Get install dir */ 295 289 strncpy(chrInstallDir,moduleName, sizeof(chrInstallDir)); … … 303 297 strncpy(classDLLPath,chrInstallDir, sizeof(classDLLPath)); 304 298 classDLLPath[sizeof(classDLLPath)-1]=0; 305 299 306 300 /* Get install dir */ 307 301 if((chrPtr=strrchr(chrInstallDir,'\\'))!=NULLHANDLE) … … 352 346 HENUM henum; 353 347 HWND hwnd; 354 348 355 349 /* Move the default notebook buttons */ 356 350 if((henum=WinBeginEnumWindows(hwndDlg))!=NULLHANDLE) { … … 396 390 { 397 391 snprintf(setup, sizeof(setup), "LOCATOR=%s;%s", chrUrl, "OPEN=DEFAULT"); 398 WinCreateObject("WPUrl","tempUrl", setup, tempDir, 392 WinCreateObject("WPUrl","tempUrl", setup, tempDir, 399 393 CO_UPDATEIFEXISTS); 400 394 /* WinDestroyObject(hObject); Don't use it, blocks PM */ … … 402 396 } 403 397 404 /* This function checks if the given file exists */ 398 /* This function checks if the given file exists */ 405 399 ULONG checkFileSize(char* chrFileName) 406 400 { … … 410 404 if(stat(chrFileName , &statBuf)==-1) 411 405 return 0; 412 406 413 407 return statBuf.st_size; 414 408 }
Note:
See TracChangeset
for help on using the changeset viewer.