Show
Ignore:
Timestamp:
02/23/00 14:32:32 (14 years ago)
Author:
ucackha
Message:

Add TclpGetProcess? which just does the opposite of TclpGetPid? (ie return the process handle given an id rather than returning an id given a handle). KH

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tcl-8.0/trunk/win/tclWinPipe.c

    r1086 r1151  
    773773} 
    774774 
     775/* 
     776 *-------------------------------------------------------------------------- 
     777 * 
     778 * TclpGetProcess -- 
     779 * 
     780 *      Given a process id return the Handle. 
     781 * 
     782 * Results: 
     783 *  Return the process handle, if the process id was unknown return 0 
     784 * 
     785 * Side effects: 
     786 *      None. 
     787 * 
     788 *-------------------------------------------------------------------------- 
     789 */ 
     790 
     791HANDLE 
     792TclpGetProcess(pid) 
     793    unsigned long pid;   
     794{ 
     795    ProcInfo *infoPtr; 
     796     
     797    for (infoPtr = procList; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { 
     798        if (infoPtr->dwProcessId == pid) { 
     799            return infoPtr->hProcess; 
     800        } 
     801    } 
     802    return 0; 
     803} 
     804 
    775805/* 
    776806 *--------------------------------------------------------------------------