Ignore:
Timestamp:
Dec 31, 1999, 11:47:12 AM (26 years ago)
Author:
sandervl
Message:

EB's debug support added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/wprocess.cpp

    r2264 r2280  
    1 /* $Id: wprocess.cpp,v 1.62 1999-12-30 11:19:54 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.63 1999-12-31 10:47:12 sandervl Exp $ */
    22
    33/*
     
    3232#include "exceptutil.h"
    3333#include "oslibmisc.h"
     34#include "oslibdebug.h"
    3435
    3536#include "console.h"
     
    707708                            LPPROCESS_INFORMATION lpProcessInfo )
    708709{
     710 THDB *pThreadDB = (THDB*)GetThreadTHDB();
     711 char *cmdline = NULL;
    709712 BOOL  rc;
    710  char *cmdline = NULL;
    711713
    712714    dprintf(("KERNEL32: CreateProcessA %s cline:%s inherit:%d cFlags:%x Env:%x CurDir:%s StartupFlags:%x\n",
     
    722724                         lpEnvironment, lpCurrentDirectory, lpStartupInfo,
    723725                         lpProcessInfo) == TRUE)
    724         return(TRUE);
    725 
     726    {
     727      if (dwCreationFlags & DEBUG_PROCESS && pThreadDB != NULL)
     728      {
     729        if(pThreadDB->pidDebuggee != 0)
     730        {
     731          // TODO: handle this
     732          dprintf(("KERNEL32: CreateProcess ERROR: This thread is already a debugger\n"));
     733        }
     734        else
     735        {
     736          pThreadDB->pidDebuggee = lpProcessInfo->dwProcessId;
     737          OSLibStartDebugger((ULONG*)&pThreadDB->pidDebuggee);
     738        }
     739      }
     740      else pThreadDB->pidDebuggee = 0;
     741
     742      return(TRUE);
     743    }
    726744    //probably a win32 exe, so run it in the pe loader
    727745    if(lpApplicationName) {
     
    751769                         lpEnvironment, lpCurrentDirectory, lpStartupInfo,
    752770                         lpProcessInfo);
     771    if(rc == TRUE) {
     772      if (dwCreationFlags & DEBUG_PROCESS && pThreadDB != NULL)
     773      {
     774        if(pThreadDB->pidDebuggee != 0)
     775        {
     776          // TODO: handle this
     777          dprintf(("KERNEL32: CreateProcess ERROR: This thread is already a debugger\n"));
     778        }
     779        else
     780        {
     781          pThreadDB->pidDebuggee = lpProcessInfo->dwProcessId;
     782          OSLibStartDebugger((ULONG*)&pThreadDB->pidDebuggee);
     783        }
     784      }
     785      else
     786        pThreadDB->pidDebuggee = 0;
     787    }
    753788    if(cmdline)
    754789        free(cmdline);
Note: See TracChangeset for help on using the changeset viewer.