dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosFlagProcess (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSSIGNALS
 
USHORT DosFlagProcess(pidProcess, fScope, usFlagNum, usFlagArg)
PID pidProcess;      /* identifier of process receiving flag */
USHORT fScope;       /* flag process or process subtree      */
USHORT usFlagNum;    /* flag number                          */
USHORT usFlagArg;    /* flag argument                        */
 
The DosFlagProcess function generates a signal that is sent to the calling
process. By default, the process ignores these signals, but it can respond
to them by using the DosSetSigHandler function to define a signal handler. A
process can also refuse event-flag signals, causing the DosFlagProcess
function to return an error value.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
pidProcess  Specifies the process identifier of the process that receives
            the flag.
 
fScope      Specifies how many external event flags to set. If this
            parameter is FLGP_SUBTREE, the function sets the external event
            flags for the specified process and all of its child processes.
            If it is FLGP_PID, the function sets the event flag for only the
            specified process.
 
usFlagNum   Specifies the number of the flag to set. This parameter can be
            one of the following values:
 
            Value   Meaning
            ────────────────────────────────────────────────────────────────
            PFLG_A  Process flag A.
 
            PFLG_B  Process flag B.
 
            PFLG_C  Process flag C.
 
usFlagArg   Specifies an argument to pass to the specified process.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_INVALID_FLAG_NUMBER
     ERROR_INVALID_FUNCTION
     ERROR_INVALID_PROCID
     ERROR_SIGNAL_PENDING
     ERROR_SIGNAL_REFUSED
     ERROR_ZOMBIE_PROCESS
 
Comments
 
The current signal cannot be accepted if a signal of the same type is
already waiting to be processed.
 
Example
 
This example executes a process called abc.exe. It then calls the
DosFlagProcess function to send the PFLG_A (process flag A) signal to that
process.
 
UCHAR szFailName[CCHMAXPATH];
RESULTCODES rescResults;
DosExecPgm(szFailName, sizeof(szFailName),
    EXEC_ASYNCH, "abc\0", 0, &rescResults, "abc.exe");
    .
    .
    .
DosFlagProcess(rescResults.codeTerminate, /* process identifier */
    FLGP_SUBTREE,                /* notifies the entire subtree */
    PFLG_A,                      /* sends process flag A        */
    1);                          /* value to send process       */
 
See Also
 
DosExecPgm, DosSetSigHandler