如题。谢谢

解决方案 »

  1.   

    The GetProcessTimes function retrieves timing information for the specified process.
    BOOL GetProcessTimes(
      HANDLE hProcess,
      LPFILETIME lpCreationTime,
      LPFILETIME lpExitTime,
      LPFILETIME lpKernelTime,
      LPFILETIME lpUserTime
    );Parameters
    hProcess 
    [in] Handle to the process whose timing information is sought. This handle must be created with the PROCESS_QUERY_INFORMATION access right. For more information, see Process Security and Access Rights. 
    lpCreationTime 
    [out] Pointer to a FILETIME structure that receives the creation time of the process. 
    lpExitTime 
    [out] Pointer to a FILETIME structure that receives the exit time of the process. If the process has not exited, the content of this structure is undefined. 
    lpKernelTime 
    [out] Pointer to a FILETIME structure that receives the amount of time that the process has executed in kernel mode. The time that each of the threads of the process has executed in kernel mode is determined, and then all of those times are summed together to obtain this value. 
    lpUserTime 
    [out] Pointer to a FILETIME structure that receives the amount of time that the process has executed in user mode. The time that each of the threads of the process has executed in user mode is determined, and then all of those times are summed together to obtain this value. 
      

  2.   

    use
    PsSetCreateProcessNotifyRoutine and PsSetCreateThreadNotifyRoutinecheck out this article:
    http://msdn.microsoft.com/library/en-us/dnmag00/html/VTrace.asp?frame=true