다음을 통해 공유


Generating a Dump from a Watched Process (Windows Embedded CE 6.0)

1/5/2010

To capture dump file information about a particular process or thread, use CaptureDumpFileOnDevice. This function causes a dump file to be generated when the watched process is invoked.

Example

The following code example shows how to use CaptureDumpFileOnDevice:

CaptureDumpFileOnDevice(ProcessID, ThreadID, PathToExtraFilesToUpload); 
      // ProcessID = 0 for current process
      // ThreadID = 0 for current thread
      // PathToExtraFilesToUpload can be NULL

Example

The following code example shows how to call CaptureDumpFileOnDevice from debugging code:

DWORD CaptureDump( DWORD dwTargetPID )
{
     // Generate a dump file for the process identified by dwTargetPID
     DWORD dwLastError = 0;
     wchar_t *pBuffer = (wchar_t *)calloc( MAX_PATH,sizeof( wchar_t ) );
     wsprintf( pBuffer, L"Capture Dump for PID %x\n",dwTargetPID );
     OutputDebugString( pBuffer );

     if (FALSE == CaptureDumpFileOnDevice(dwTargetPID, 0, NULL))
     {
          dwLastError = GetLastError();
          wsprintf(pBuffer, L"CaptureDumpFileOnDevice Error: %d\n",dwLastError);
          OutputDebugString(pBuffer);
     }

     ZeroMemory(pBuffer, MAX_PATH);
     return dwLastError;
}

See Also

Tasks

Capturing a Dump File While Debugging

Reference

CaptureDumpFileOnDevice

Other Resources

Post-Mortem Debugging