Esempio n. 1
0
bool	DumpRunner::DumpProcess(Dumper* dumper, DumpLevel level, const char* processName)
{
	bool result = false;

	EnumProcess enumProcess;
	if (enumProcess.open() == true)
	{
		DWORD processId = 0;
		std::string enumProcessName = enumProcess.getFirst();
		while (enumProcessName.empty() == false)
		{
			if (::_stricmp(processName, enumProcessName.c_str()) == 0)
			{
				processId = enumProcess.getProcessID();
				break;
			}

			enumProcessName = enumProcess.getNext();
		}

		enumProcess.close();

		if (processId != 0)
		{
			result = DumpProcess(dumper, level, processId);
		}
	}

	return result;
}
Esempio n. 2
0
bool	DumpRunner::DumpProcess(Dumper* dumper, int level, const wchar_t* processName)
{
	bool result = false;

	EnumProcess enumProcess;
	if (enumProcess.open() == true)
	{
		DWORD processId = 0;
		const wchar_t* enumProcessName = enumProcess.getFirst();
		while (enumProcessName != NULL)
		{
			if (::_wcsicmp(processName, enumProcessName) == 0)
			{
				processId = enumProcess.getProcessID();
				break;
			}

			enumProcessName = enumProcess.getNext();
		}

		enumProcess.close();

		if (processId != 0)
		{
			result = DumpProcess(dumper, level, processId);
		}
	}

	return result;
}