www.pudn.com > PEMonitor_0.10_src.zip > StackServ.c, change:2004-10-10,size:873b


/////////////////////////////////////////////////////////////////////////////// 
// 
//  FileName    :   StackServ.c 
//  Version     :   1.0 
//  Author      :   Luo Cong 
//  Date        :   2004-09-02 9:58:30 
//  Comment     :    
// 
/////////////////////////////////////////////////////////////////////////////// 
 
#include  
#include "Misc.h" 
#include "StackServ.h" 
 
int GetStackContents( 
    /* [in] */ const HANDLE hProcess, 
    /* [in] */ const unsigned long Esp, 
    /* [out] */ unsigned long *lpStackAddress 
) 
{ 
    int nRetResult = 0; 
    int nRetCode; 
 
    *lpStackAddress = 0; 
 
    nRetCode = ReadProcessMemory( 
        hProcess, 
        (unsigned long *)Esp, 
        lpStackAddress, 
        sizeof(lpStackAddress), 
        NULL 
    ); 
    MY_PROCESS_ERROR(nRetCode); 
 
    nRetResult = 1; 
Exit0: 
    return nRetResult; 
}