Jump to content

DosDumpProcess: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
'''DosDumpProcess''' initiates a process dump from a specified process. This may be used as part of an error handling routine to gather information about an error that may be analyzed later using the ''OS/2 System Dump Formatter''. Configuration of ''Process Dump'' may be done using the PDUMPSYS, PDUMPUSR, and PROCDUMP commands.
DosDumpProcess initiates a process dump from a specified process. This may be used as part of an error handling routine to gather information about an error that may be analyzed later using the OS/2 System Dump Formatter. Configuration of Process Dump may be done using the PDUMPSYS, PDUMPUSR, and PROCDUMP commands.  


==Syntax==
==Syntax==
<PRE>
  APIRET APIENTRY DosDumpProcess (ULONG Flag, ULONG Drive, PID Pid)
#define INCL_DOSMISC
#include os2.h>


    APIRET APIENTRY DosDumpProcess (ULONG Flag, ULONG Drive, PID Pid)
</PRE>
==Parameters==
==Parameters==
; flag (ULONG) input : Flags specify the function to be performed
;flag (ULONG) input : Flags specify the function to be performed
 
:DDP_DISABLEPROCDUMP 0x00000000L - Disable process dumps.
    DDP_DISABLEPROCDUMP 0x00000000L
:DDP_ENABLEPROCDUMP 0x00000001L - Enable process dumps.
        Disable process dumps.  
:DDP_PERFORMPROCDUMP 0x00000002L - Perform process dump.
;drive (ULONG) input : The ASCII character for the drive on which process dump files are to be created. This is required only with the DDP_ENABLEPROCDUMP.
    DDP_ENABLEPROCDUMP 0x00000001L
:'''Note:''' Use the PROCDUMP command to customize fully the drive and path.
        Enable process dumps.  
;pid (PID) input : The process to be dumped. 0L specified the current process; otherwise a valid process ID must be specified.
:'''Note:''' Use the PDUMPUSR command to specify what information will be dumped. Use the PROCDUMP command to customize options per process and in particular to specify whether child or parent process will be dumped. This parameter is actioned only with DDP_PERFORMPROCDUMP.
    DDP_PERFORMPROCDUMP 0x00000002L
        Perform process dump.  
 
; drive (ULONG) input : The ASCII character for the drive on which process dump files are to be created. This is required only with the DDP_ENABLEPROCDUMP.
 
'''Note:''' Use the PROCDUMP command to customize fully the drive and path.  
   
; pid (PID) input : The process to be dumped. 0L specified the current process; otherwise a valid process ID must be specified.
 
'''Note:''' Use the PDUMPUSR command to specify what information will be dumped. Use the PROCDUMP command to customize options per process and in particular to specify whether child or parent process will be dumped. This parameter is actioned only with DDP_PERFORMPROCDUMP.


==Return Code==
==Return Code==
  ulrc (APIRET) returns
  ulrc (APIRET) returns
DosDumpProcess returns the following value:
*87 ERROR_INVLAID PARAMETER


DosDumpProcess returns the following value
==Linkage Definition==
 
IMPORTS DosDumpProcess = DOSCALLS.113
* 87    ERROR_INVLAID PARAMETER


==Remarks==
==Remarks==
For maximum flexibility the use of DosDumpProcess should be limited to the DDP_PERFORMPROCDUMP function. This allows you to specify whether Process Dump should be enabled through the use of the PROCDUMP command. You may customize Process Dump completely through use of the PDUMPUSR, PDUMPSYS, AND PROCDUMP commands. For further information, see PROCDUMP.DOC in the OS2\SYSTEM\RAS directory. DDP_ENABLEPROCDUMP and DDP_DISABLEPROCDUMP are provided for backwards compatibility only.  
For maximum flexibility the use of DosDumpProcess should be limited to the DDP_PERFORMPROCDUMP function. This allows you to specify whether Process Dump should be enabled through the use of the PROCDUMP command. You may customize Process Dump completely through use of the PDUMPUSR, PDUMPSYS, AND PROCDUMP commands. For further information, see PROCDUMP.DOC in the OS2\SYSTEM\RAS directory. DDP_ENABLEPROCDUMP and DDP_DISABLEPROCDUMP are provided for backwards compatibility only.


==Example Code==
==Example Code==
Line 57: Line 42:
}
}
</PRE>
</PRE>
==Related Functions==
==Related Functions==
* [[OS2 API:CPI:DosForceSystemDump|DosForceSystemDump]]
*[[DosForceSystemDump]]
* [[OS2 API:CPI:Dos16SysTrace|Dos16SysTrace]]
*[[Dos16SysTrace]]
 


[[Category:The OS/2 API Project]]
[[Category:Dos]]

Latest revision as of 01:25, 9 November 2022

DosDumpProcess initiates a process dump from a specified process. This may be used as part of an error handling routine to gather information about an error that may be analyzed later using the OS/2 System Dump Formatter. Configuration of Process Dump may be done using the PDUMPSYS, PDUMPUSR, and PROCDUMP commands.

Syntax

APIRET APIENTRY DosDumpProcess (ULONG Flag, ULONG Drive, PID Pid)

Parameters

flag (ULONG) input
Flags specify the function to be performed
DDP_DISABLEPROCDUMP 0x00000000L - Disable process dumps.
DDP_ENABLEPROCDUMP 0x00000001L - Enable process dumps.
DDP_PERFORMPROCDUMP 0x00000002L - Perform process dump.
drive (ULONG) input
The ASCII character for the drive on which process dump files are to be created. This is required only with the DDP_ENABLEPROCDUMP.
Note: Use the PROCDUMP command to customize fully the drive and path.
pid (PID) input
The process to be dumped. 0L specified the current process; otherwise a valid process ID must be specified.
Note: Use the PDUMPUSR command to specify what information will be dumped. Use the PROCDUMP command to customize options per process and in particular to specify whether child or parent process will be dumped. This parameter is actioned only with DDP_PERFORMPROCDUMP.

Return Code

ulrc (APIRET) returns

DosDumpProcess returns the following value:

  • 87 ERROR_INVLAID PARAMETER

Linkage Definition

IMPORTS DosDumpProcess = DOSCALLS.113

Remarks

For maximum flexibility the use of DosDumpProcess should be limited to the DDP_PERFORMPROCDUMP function. This allows you to specify whether Process Dump should be enabled through the use of the PROCDUMP command. You may customize Process Dump completely through use of the PDUMPUSR, PDUMPSYS, AND PROCDUMP commands. For further information, see PROCDUMP.DOC in the OS2\SYSTEM\RAS directory. DDP_ENABLEPROCDUMP and DDP_DISABLEPROCDUMP are provided for backwards compatibility only.

Example Code

int main (int argc, char *argv[], char *envp[]){
   APIRET rc;

   /* Take a process dump;leave drive specification as specified by the user in the   */
   /* PROCDUMP command. If the user has not enabled process dump using PROCDUMP ON, then  */
   /* ERROR_INVALID_PARAMETER is returned.   */
   rc=DosDumpProcess(DDP_PERFORMPROCDUMP,0L,0L);
   if (rc!=0) {
      printf("DosDumpProcess returned %u\n",rc);
      return rc;
   } /* endif */

   return 0;
}

Related Functions