Home > Software engineering >  The enumeration process as well as the module code compiled through, but the output is empty, why?
The enumeration process as well as the module code compiled through, but the output is empty, why?

Time:09-30

#include
#include
# include "tlhelp32. H"


BOOL GetProcessList ()
{
HANDLE hProcessSnap;
HANDLE hModuleSnap;
BOOL bRet=FALSE;
BOOL bModule=FALSE;
PROCESSENTRY32 pe32={0};
MODULEENTRY32 me32={0};

HProcessSnap=CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS, 0);
BRet=Process32First (hProcessSnap, & amp; Pe32);
While (bRet)
{

Printf (" % s \ n ", pe32 szExeFile);
HModuleSnap=CreateToolhelp32Snapshot (TH32CS_SNAPMODULE, 0);
BModule=Module32First (hModuleSnap, & amp; Me32);
While (bModule)
{
Printf (" % s \ n \ t, "me32. SzExePath);

}
BRet=Process32Next (hProcessSnap, & amp; Pe32);


}
The CloseHandle (hProcessSnap);
The CloseHandle (hModuleSnap);
Return TRUE;

}

Void main ()
{

GetProcessList ();
}

CodePudding user response:

To set breakpoints single-step debugging see

CreateToolhelp32Snapshot snapshot view the process module and thread

CodePudding user response:

Step through seems wrong, why

CodePudding user response:

Most of the API error can be get error code GetLastError
See the MSDN documentation in detail

CodePudding user response:

Not tlhelp32 not

CodePudding user response:

Microsoft has to write good code, compare to know

https://msdn.microsoft.com/en-us/library/windows/desktop/ms686701 (v=versus 85). Aspx

CodePudding user response:

You didn't finish writing the code, so there is no list.
  • Related