🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #308964

Re: Parametry innego procesu Win&Lin

#308964
From: Borneq
Date: Thu, 19 Jan 2017 07:55
23 lines
1624 bytes
W dniu 19.01.2017 o 08:36, Borneq pisze:
> W dniu 18.01.2017 o 10:27, Borneq pisze:
>> jak to zrobić pod Windows?
>
> Używam CreateToolhelp32Snapshot ale zwraca mi tylko moduły;
> OpenProcess otwiera ale co dalej?
> https://gist.github.com/borneq/8e5885773c315cd85ac75eb2a3f4bada

for (int i = 0; i < cbNeeded / sizeof(DWORD); i++)
	{
		HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | 
PROCESS_VM_READ,false, ProcessIds[i]);
		if (hProcess != 0)
		{
			char buf[MAX_PATH];
			DWORD ret  = GetModuleBaseNameA(hProcess, NULL, buf, MAX_PATH);
			buf[ret] = 0;
			printf("%d %s\n", ProcessIds[i],buf);
			CloseHandle(hProcess);
		}
	}

Podaje nazwy, ale dla wielu np. dla zwykłego Chrome nie podaje (?)
Technical Details
Message-ID: <o5prdd$c9v$1@node1.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <o5ncd4$753$1@node2.news.atman.pl> <o5pq9i$b83$1@node1.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: Borneq <borneq@antyspam.hidden.pl>
Newsgroups: pl.comp.lang.c
Subject: Re: Parametry innego procesu Win&Lin
Date: Thu, 19 Jan 2017 08:55:39 +0100
Organization: ATMAN - ATM S.A.
Lines: 23
Message-ID: <o5prdd$c9v$1@node1.news.atman.pl>
References: <o5ncd4$753$1@node2.news.atman.pl> <o5pq9i$b83$1@node1.news.atman.pl>
NNTP-Posting-Host: 91.239.205.105
Mime-Version: 1.0
X-Trace: node1.news.atman.pl 1484812525 12607 91.239.205.105 (19 Jan 2017 07:55:25 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Thu, 19 Jan 2017 07:55:25 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0
In-Reply-To: <o5pq9i$b83$1@node1.news.atman.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit