Changeset 705 for trunk/src/kernel32/misc.cpp
- Timestamp:
- Aug 26, 1999, 2:56:02 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/misc.cpp
r646 r705 1 /* $Id: misc.cpp,v 1. 9 1999-08-23 13:54:43sandervl Exp $ */1 /* $Id: misc.cpp,v 1.10 1999-08-26 12:55:36 sandervl Exp $ */ 2 2 3 3 /* … … 26 26 #include <stdarg.h> 27 27 #include <win32type.h> 28 #include "misc.h" 29 #include "os2util.h" 28 #include <misc.h> 30 29 #include "initterm.h" 31 30 … … 240 239 *****************************************************************************/ 241 240 242 #if 1 /*PLF Mon 97-09-08 20:04:28*/243 241 static FILE *flog = NULL; /*PLF Mon 97-09-08 20:00:15*/ 244 242 static BOOL init = FALSE; … … 277 275 return 1; 278 276 } 279 277 //****************************************************************************** 280 278 //NOTE: No need to save/restore FS, as our FS selectors have already been 281 279 // destroyed and FS == 0x150B. 280 //****************************************************************************** 282 281 void CloseLogFile() 283 282 { … … 285 284 flog = 0; 286 285 } 287 288 286 //****************************************************************************** 287 //****************************************************************************** 289 288 int SYSTEM EXPORT WriteLogError(char *tekst, ...) 290 289 { … … 302 301 return 1; 303 302 } 303 //****************************************************************************** 304 //****************************************************************************** 305 void SYSTEM CheckVersion(ULONG version, char *modname) 306 { 307 dprintf(("CheckVersion of %s, %d\n", modname, version)); 308 if(version != PE2LX_VERSION){ 309 static char msg[300]; 310 int r; 311 dprintf(("Version mismatch! %d, %d: %s\n", version, PE2LX_VERSION, modname)); 312 sprintf(msg, "%s is intended for use with a different release of PE2LX.\n", modname); 313 do{ 314 r = WinMessageBox(HWND_DESKTOP, NULLHANDLE, msg, "Version Mismatch!", 0, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION | MB_MOVEABLE); 315 }while(r == MBID_RETRY); // giggle 316 if( r != MBID_IGNORE ) 317 exit(987); 318 } 319 } 320 //****************************************************************************** 321 //****************************************************************************** 322 void SYSTEM CheckVersionFromHMOD(ULONG version, HMODULE hModule) 323 { 324 char name[_MAX_PATH]; 325 326 // query name of dll. 327 if(!DosQueryModuleName(hModule, sizeof(name), name)) 328 CheckVersion(version, name); 329 } 330 //****************************************************************************** 331 //****************************************************************************** 332 #ifdef __WATCOMC__ /*PLF Sat 97-06-21 17:12:36*/ 333 extern void interrupt3( void ); 334 #pragma aux interrupt3= \ 335 "int 3" 304 336 #endif 305 306 307 /***************************************************************************** 308 * Modified Standard Version * 309 *****************************************************************************/ 310 311 #if 0 /*PLF Mon 97-09-08 20:04:26*/ 312 /******************************************************************************/ 313 static BOOL init = FALSE; 314 static BOOL fLog = TRUE; 315 /******************************************************************************/ 316 int SYSTEM EXPORT WriteLog(char *tekst, ...) 317 { 318 ULONG Action, Wrote; 319 HFILE log; 320 APIRET rc; 321 char message[4096]; 322 va_list argptr; 323 ULONG openFlags = OPEN_ACTION_CREATE_IF_NEW; 324 325 if(fLog == FALSE) 326 return(FALSE); 327 328 if(!init) { 329 init = TRUE; 330 openFlags |= OPEN_ACTION_REPLACE_IF_EXISTS; 331 if(getenv("NOWIN32LOG")) 332 fLog = FALSE; 333 } 334 else openFlags |= OPEN_ACTION_OPEN_IF_EXISTS; 335 336 rc = DosOpen( 337 "win32os2.log", 338 &log, /* file handle returned */ 339 &Action, 340 0L, 341 FILE_NORMAL, 342 openFlags, 343 OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYWRITE, 344 (PEAOP2)NULL); 345 346 rc = DosSetFilePtr(log, 0, FILE_END, &Wrote); 347 va_start(argptr, tekst); 348 vsprintf(message, tekst, argptr); 349 va_end(argptr); 350 351 rc = DosWrite(log, message, strlen(message), &Wrote); 352 353 DosClose(log); /*PLF Mon 97-09-08 20:01:43*/ 354 return(TRUE); 355 } 356 #endif /*PLF Mon 97-09-08 20:04:23*/ 357 337 void WIN32API DebugBreak() 338 { 339 dprintf(("DebugBreak\n")); 340 #ifdef __WATCOMC__ 341 interrupt3(); 342 #else 343 _interrupt(3); 344 #endif 345 } 346 //****************************************************************************** 347 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.