Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.5 KiB

  1. /*
  2. * dem.c - Main Module of DOS Emulation DLL.
  3. *
  4. * Sudeepb 09-Apr-1991 Craeted
  5. */
  6. #include "io.h"
  7. #include "dem.h"
  8. /* DemInit - DEM Initialiazation routine. (This name may change when DEM is
  9. * converted to DLL).
  10. *
  11. * Entry
  12. * argc,argv - from softpc as it is.
  13. *
  14. *
  15. * Exit
  16. * None
  17. */
  18. PSZ pszDefaultDOSDirectory;
  19. extern VOID TerminateVDM(VOID);
  20. extern VOID dempInitLFNSupport(VOID);
  21. CHAR demDebugBuffer [256];
  22. #if DBG
  23. BOOL ToDebugOnF11 = FALSE;
  24. #endif
  25. BOOL DemInit (int argc, char *argv[])
  26. {
  27. PSZ psz;
  28. DWORD dw;
  29. // Modify default hard error handling
  30. // - turn off all file io related popups
  31. // - keep GP fault popups from system
  32. //
  33. SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
  34. pszDefaultDOSDirectory = (PCHAR) malloc(MAX_PATH+14);
  35. if (!pszDefaultDOSDirectory ||
  36. !(dw = GetSystemDirectory(pszDefaultDOSDirectory, MAX_PATH)) ||
  37. dw >= MAX_PATH )
  38. {
  39. return FALSE;
  40. }
  41. dempInitLFNSupport();
  42. if (VDMForWOW)
  43. return TRUE;
  44. // Check the debugging level
  45. while (--argc > 0) {
  46. psz = *++argv;
  47. if (*psz == '-' || *psz == '/') {
  48. psz++;
  49. if(tolower(*psz) == 'd'){
  50. fShowSVCMsg = DEMDOSDISP | DEMFILIO;
  51. break;
  52. }
  53. }
  54. }
  55. #if DBG
  56. #ifndef i386
  57. if( getenv( "YODA" ) != 0 )
  58. #else
  59. if( getenv( "DEBUGDOS" ) != 0 )
  60. #endif
  61. ToDebugOnF11 = TRUE;
  62. #endif
  63. return TRUE;
  64. }
  65.