<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Anz. Prozesse herausfinden, die gerade auf einen Ordner zugreifen]]></title><description><![CDATA[<p>Hallo,</p>
<p>gibt es eine Möglicheit herauszufinden, wieviele Programme gerade auf einen Ordner &quot;zugreifen&quot;?<br />
Wenn man z.B. im Windows-Explorer einen Ordner umbenennen will, kann sein, dass das nicht geht, weil der Ordner gerade von einem Programm verwendet wird...</p>
<p>Weiß jemand, wie man sowas anstellen kann bzw. Funktionen kennt, mit denen man das herausbekommen kann?</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/242094/anz-prozesse-herausfinden-die-gerade-auf-einen-ordner-zugreifen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Apr 2026 11:18:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/242094.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 30 May 2009 08:44:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Anz. Prozesse herausfinden, die gerade auf einen Ordner zugreifen on Sat, 30 May 2009 08:44:33 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>gibt es eine Möglicheit herauszufinden, wieviele Programme gerade auf einen Ordner &quot;zugreifen&quot;?<br />
Wenn man z.B. im Windows-Explorer einen Ordner umbenennen will, kann sein, dass das nicht geht, weil der Ordner gerade von einem Programm verwendet wird...</p>
<p>Weiß jemand, wie man sowas anstellen kann bzw. Funktionen kennt, mit denen man das herausbekommen kann?</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718189</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718189</guid><dc:creator><![CDATA[HH77]]></dc:creator><pubDate>Sat, 30 May 2009 08:44:33 GMT</pubDate></item><item><title><![CDATA[Reply to Anz. Prozesse herausfinden, die gerade auf einen Ordner zugreifen on Sat, 30 May 2009 16:03:58 GMT]]></title><description><![CDATA[<p>Das geht wahscheinlich nicht, weil Windows die Zugriffe regelt. Vielleicht kann Dir ein Mutex-Objekt helfen? Ich weiss aber nicht, ob das auch bei Fremdprozessen wirkt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718333</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718333</guid><dc:creator><![CDATA[berniebutt]]></dc:creator><pubDate>Sat, 30 May 2009 16:03:58 GMT</pubDate></item><item><title><![CDATA[Reply to Anz. Prozesse herausfinden, die gerade auf einen Ordner zugreifen on Sat, 30 May 2009 18:10:18 GMT]]></title><description><![CDATA[<p>Das ist aber relativ aufwendig. Du müsstest einen Filtertreiber schreiben und Dein programm müsste als Admin gestartet werden.</p>
<p>Siehe mal nach alten Sourcen von FILEMON von Sysinternals.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718381</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718381</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 30 May 2009 18:10:18 GMT</pubDate></item><item><title><![CDATA[Reply to Anz. Prozesse herausfinden, die gerade auf einen Ordner zugreifen on Sat, 30 May 2009 19:58:44 GMT]]></title><description><![CDATA[<p>Zur Not die Ausgabe des Programms Handle von Sysinternals parsen:</p>
<p><a href="http://technet.microsoft.com/de-de/sysinternals/bb896655.aspx" rel="nofollow">http://technet.microsoft.com/de-de/sysinternals/bb896655.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718410</guid><dc:creator><![CDATA[handle]]></dc:creator><pubDate>Sat, 30 May 2009 19:58:44 GMT</pubDate></item><item><title><![CDATA[Reply to Anz. Prozesse herausfinden, die gerade auf einen Ordner zugreifen on Sat, 30 May 2009 20:33:42 GMT]]></title><description><![CDATA[<p>das geht relativ einfach auch im userspace mit undokumentierten api funktionen. stichwort NtQuerySystemInformation, NtQueryObject, etc.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718423</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718423</guid><dc:creator><![CDATA[ichiban]]></dc:creator><pubDate>Sat, 30 May 2009 20:33:42 GMT</pubDate></item><item><title><![CDATA[Reply to Anz. Prozesse herausfinden, die gerade auf einen Ordner zugreifen on Sun, 31 May 2009 16:22:51 GMT]]></title><description><![CDATA[<p>Aber damit bekommt man doch nicht heraus weclhe fremden Prozesse ein Directory nutzen, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718700</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sun, 31 May 2009 16:22:51 GMT</pubDate></item><item><title><![CDATA[Reply to Anz. Prozesse herausfinden, die gerade auf einen Ordner zugreifen on Sun, 31 May 2009 23:38:34 GMT]]></title><description><![CDATA[<p>hab hier grad nix zum testen installiert aber denke mal es steht im attributes field der OBJECT_BASIC_INFORMATION struktur drin ob es ein directory ist. ich kann ja morgen mal gucken, wenn ich daheim bin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718873</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718873</guid><dc:creator><![CDATA[ichiban]]></dc:creator><pubDate>Sun, 31 May 2009 23:38:34 GMT</pubDate></item><item><title><![CDATA[Reply to Anz. Prozesse herausfinden, die gerade auf einen Ordner zugreifen on Tue, 02 Jun 2009 11:21:09 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">/*
 * GetPIDsFromFile - Returns process identifiers of all processes that have
 *			currently opened target file.
 *
 * @lpFileName
 *	Name of the file to look up.
 *
 * @lpPIDs
 *	Pointer to an array of DWORDs that will receive the process identifiers.
 *
 * @dwNumPIDs
 *	Maximum number of entries to store in the buffer pointed to by lpPIDs.
 *
 * @return
 *	The function returns the actual number of entries in lpPIDs on success,
 *		-1 on failure.
 *
 */
int GetPIDsFromFile( PTCHAR lpFileName, PDWORD lpPIDs, DWORD dwNumPIDs ) {
	ULONG *p, n, i, count = 0;
	PSYSTEM_HANDLE_INFORMATION h;
	HANDLE hProcess;
	PFN_NtQuerySystemInformation NtQuerySystemInformation =
		(PFN_NtQuerySystemInformation) GetProcAddress(LoadLibrary(&quot;NTDLL&quot;),
		&quot;NtQuerySystemInformation&quot;);
	PFN_NtQueryObject NtQueryObject = (PFN_NtQueryObject)
		GetProcAddress(LoadLibrary(&quot;NTDLL&quot;), &quot;NtQueryObject&quot;);
	if(!NtQuerySystemInformation || !NtQueryObject)
		return -1;

	n = 0x1000;
	p = malloc(sizeof(ULONG) * n);

	while(NtQuerySystemInformation(SystemHandleInformation, p, n * sizeof(*p),
		0) == STATUS_INFO_LENGTH_MISMATCH) {
		free(p);
		n = n * 2;
		p = malloc(sizeof(ULONG) * n);
	}

	h = (PSYSTEM_HANDLE_INFORMATION)(p + 1);
	for(i = 0; i &lt; *p; i++) {
		HANDLE hObject;
		OBJECT_BASIC_INFORMATION obi;
		OBJECT_NAME_INFORMATION *poni;
		TCHAR szFileName[MAX_PATH];

		if(count &gt;= dwNumPIDs)
			break;

		if(!(hProcess = OpenProcess(PROCESS_DUP_HANDLE, FALSE, h[i].ProcessId)))
			continue;

		if(!DuplicateHandle(hProcess, (HANDLE)h[i].Handle, GetCurrentProcess(),
			&amp;hObject, 0, 0, DUPLICATE_SAME_ATTRIBUTES)) {
			CloseHandle(hProcess);
			continue;
		}

		CloseHandle(hProcess);
		NtQueryObject(hObject, ObjectBasicInformation, &amp;obi, sizeof(obi), NULL);

		n = obi.NameInformationLength == 0 ? MAX_PATH * sizeof(WCHAR) :
				obi.NameInformationLength;
		poni = (POBJECT_NAME_INFORMATION)malloc(n);

		NtQueryObject(hObject, ObjectNameInformation, poni, n, NULL);
		if(DeviceToDosPath(poni-&gt;Name.Buffer, szFileName, sizeof(szFileName))) {
			if(!_tcscmp(lpFileName, szFileName))
				lpPIDs[count++] = h[i].ProcessId;
		}

		CloseHandle(hObject);
	}

	free(p);
	return count;
}
</code></pre>
<p><a href="http://www.devfull.de/downloads/openfiles.rar" rel="nofollow">http://www.devfull.de/downloads/openfiles.rar</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1719532</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1719532</guid><dc:creator><![CDATA[ichiban]]></dc:creator><pubDate>Tue, 02 Jun 2009 11:21:09 GMT</pubDate></item><item><title><![CDATA[Reply to Anz. Prozesse herausfinden, die gerade auf einen Ordner zugreifen on Tue, 02 Jun 2009 13:26:31 GMT]]></title><description><![CDATA[<p>Ist eine interessante Frage. Wünsche verifizierte Nachricht, wie das möglichst einfach geht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1719636</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1719636</guid><dc:creator><![CDATA[berniebutt]]></dc:creator><pubDate>Tue, 02 Jun 2009 13:26:31 GMT</pubDate></item></channel></rss>