<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Заморозка Threads]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=16658</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16658&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Заморозка Threads».]]></description>
		<lastBuildDate>Mon, 01 Nov 2021 07:08:24 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150354#p150354</link>
			<description><![CDATA[<p>Какие огрехи?<br />Если моим не доказать, докажите своим.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 01 Nov 2021 07:08:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150354#p150354</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150352#p150352</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>У меня в блокноте SuspenThread работает на 20% быстрее...</p></blockquote></div><p>Прям-таки <strong>в</strong> блокноте?<br /></p><div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Так что вместо советов о приеме витаминов, на профильном форуме рекомендуется свои гипотезы доказывать кодом.</p></blockquote></div><p>Вашим кодом (огрехи которого целиком на вашей совести) ничего не доказать (витамины вам действительно необходимы).</p>]]></description>
			<author><![CDATA[null@example.com (greg zakharov)]]></author>
			<pubDate>Mon, 01 Nov 2021 06:11:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150352#p150352</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150349#p150349</link>
			<description><![CDATA[<div class="quotebox"><cite>greg zakharov пишет:</cite><blockquote><p>А вы осмелитесь утверждать, что вызванная NtSuspenThread из юзермодной ntdll.dll снизит быстродействие? о_О... Знаете, осенью полезны витамины.</p></blockquote></div><p>Да, представьте себе, осмелюсь.<br />У меня в блокноте SuspenThread работает на 20% быстрее чем NtSuspenThread 800ms/1000ms (win10 ahk64bit).<br />Так что вместо советов о приеме витаминов, на профильном форуме рекомендуется свои гипотезы доказывать кодом.<br /></p><div class="codebox"><pre><code>setbatchlines -1
f11::
ThreadID := DllCall(&quot;GetWindowThreadProcessId&quot;, &quot;ptr&quot;, WinExist(&quot;A&quot;), &quot;uint&quot;, 0)
hThread := DllCall(&quot;OpenThread&quot;, &quot;uint&quot;, 0x0002, &quot;int&quot;, 0, &quot;uint&quot;, ThreadID, &quot;ptr&quot;)
a := a_tickcount
loop 1000000
{
   DllCall(&quot;SuspendThread&quot;, &quot;ptr&quot;, hThread)
   DllCall(&quot;ResumeThread&quot;, &quot;ptr&quot;, hThread)
}
msgbox % a_tickcount - a

DllCall(&quot;LoadLibrary&quot;, &quot;str&quot;, &quot;ntdll&quot;, &quot;ptr&quot;)
a := a_tickcount
loop 1000000
{
   DllCall(&quot;ntdll\NtSuspendThread&quot;, &quot;ptr&quot;, hThread, &quot;uint*&quot;, count)
   DllCall(&quot;ntdll\NtResumeThread&quot;, &quot;ptr&quot;, hThread, &quot;uint*&quot;, count)
}
msgbox % a_tickcount - a
DllCall(&quot;CloseHandle&quot;, &quot;ptr&quot;, hThread)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sun, 31 Oct 2021 22:53:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150349#p150349</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150345#p150345</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Ссылку на msdn с использованием этой функции приведите, тогда и будем считать, что она документирована.</p></blockquote></div><p>Ужель документированность определяется скудным docs.microsoft.com? Есть заголовочные файлы WDK, чай тоже своего рода документация. Хотя может что в нём и изменилось за последнее время, не в курсе.<br /></p><div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Вы на автохотки быстродействие замеряли?</p></blockquote></div><p>А вы осмелитесь утверждать, что вызванная NtSuspenThread из юзермодной ntdll.dll снизит быстродействие? о_О... Знаете, осенью полезны витамины.</p>]]></description>
			<author><![CDATA[null@example.com (greg zakharov)]]></author>
			<pubDate>Sun, 31 Oct 2021 19:50:19 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150345#p150345</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150343#p150343</link>
			<description><![CDATA[<div class="quotebox"><cite>greg zakharov пишет:</cite><blockquote><p>С вашей стороны будет ещё контраргументация?</p></blockquote></div><p>Да.<br /></p><div class="quotebox"><cite>greg zakharov пишет:</cite><blockquote><p> Что здесь недокументированного?</p></blockquote></div><p>Ссылку на msdn с использованием этой функции приведите, тогда и будем считать, что она документирована.<br />А то по вашей логике существование документаций функций напрямую зависит от знаний ассемблера.<br /></p><div class="quotebox"><cite>greg zakharov пишет:</cite><blockquote><p>Сам же резон более в быстродействии.</p></blockquote></div><p>Вы на автохотки быстродействие замеряли?<br />Если да, то покажите результаты.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sun, 31 Oct 2021 19:32:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150343#p150343</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150340#p150340</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>а смысл пользоваться недокументированной, когда есть SuspendThread.</p></blockquote></div><p>В грубом схематичном округлении: kernel32!SuspendThread (заглушка) -&gt; kernelbase!SuspendThread (call) -&gt; ntdll!NtSuspendThead (syscall) -&gt; ... Далее берем в руки cdb.<br /></p><div class="codebox"><pre><code>cdb -z %__appdir__%ntoskrnl.exe -c &quot;uf ntoskrnl!NtSuspendThread;q&quot;</code></pre></div><p>Смотрим на дизассемблерный код и видим, что NtSuspendThread отличается от просто SuspendThread одним параметром, передаваемым по ссылке. Что здесь недокументированного? Сам же резон более в быстродействии.<br />С вашей стороны будет ещё контраргументация?</p>]]></description>
			<author><![CDATA[null@example.com (greg zakharov)]]></author>
			<pubDate>Sun, 31 Oct 2021 19:14:10 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150340#p150340</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150317#p150317</link>
			<description><![CDATA[<p><strong>greg zakharov</strong>, а смысл пользоваться недокументированной, когда есть SuspendThread.<br /><a href="https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-suspendthread">https://docs.microsoft.com/en-us/window … pendthread</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sun, 31 Oct 2021 08:24:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150317#p150317</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150242#p150242</link>
			<description><![CDATA[<div class="quotebox"><cite>Kakuo пишет:</cite><blockquote><p>Подскажите команду пожалуйста.</p></blockquote></div><p>Функцию NTAPI? NtSuspendThread. Как найти TID, полагаю, знаете.</p>]]></description>
			<author><![CDATA[null@example.com (greg zakharov)]]></author>
			<pubDate>Wed, 27 Oct 2021 19:41:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150242#p150242</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150193#p150193</link>
			<description><![CDATA[<p>Подскажите команду пожалуйста.</p>]]></description>
			<author><![CDATA[null@example.com (Kakuo)]]></author>
			<pubDate>Sun, 24 Oct 2021 09:24:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150193#p150193</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150077#p150077</link>
			<description><![CDATA[<p>UP</p>]]></description>
			<author><![CDATA[null@example.com (Kakuo)]]></author>
			<pubDate>Fri, 15 Oct 2021 11:54:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150077#p150077</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150044#p150044</link>
			<description><![CDATA[<p><strong>__Михаил__</strong><span class="postimg"><img src="https://i.imgur.com/oncQCob.png" alt="https://i.imgur.com/oncQCob.png" /></span><br />Мне надо заморозить TID процесса.</p>]]></description>
			<author><![CDATA[null@example.com (Kakuo)]]></author>
			<pubDate>Tue, 12 Oct 2021 17:49:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150044#p150044</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150042#p150042</link>
			<description><![CDATA[<p>Возможно нужно указать сами процессы по отдельности?</p>]]></description>
			<author><![CDATA[null@example.com (__Михаил__)]]></author>
			<pubDate>Tue, 12 Oct 2021 14:01:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150042#p150042</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Заморозка Threads]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150023#p150023</link>
			<description><![CDATA[<p>У меня есть код который замораживает процесс игры, но как мне сделать чтоб он замораживал не весь процесс игры, а мне надо заморозить его пару подпроцессов (Threads) вот код</p><div class="codebox"><pre><code>sc3E::
 
if (toggle := !toggle) {
 
Process_Suspend(&quot;SoTGame.exe&quot;)
 
Process_Suspend(PID_or_Name){
 
    PID := (InStr(PID_or_Name,&quot;.&quot;)) ? ProcExist(PID_or_Name) : PID_or_Name
 
    h:=DllCall(&quot;OpenProcess&quot;, &quot;uInt&quot;, 0x1F0FFF, &quot;Int&quot;, 0, &quot;Int&quot;, pid)
 
    If !h   
 
        Return -1
 
    DllCall(&quot;ntdll.dll\NtSuspendProcess&quot;, &quot;Int&quot;, h)
 
    DllCall(&quot;CloseHandle&quot;, &quot;Int&quot;, h)
	}
 
} else {
 
Process_Resume(&quot;SoTGame.exe&quot;)
 
Process_Resume(PID_or_Name){
 
    PID := (InStr(PID_or_Name,&quot;.&quot;)) ? ProcExist(PID_or_Name) : PID_or_Name
 
    h:=DllCall(&quot;OpenProcess&quot;, &quot;uInt&quot;, 0x1F0FFF, &quot;Int&quot;, 0, &quot;Int&quot;, pid)
 
    If !h   
 
        Return -1
 
    DllCall(&quot;ntdll.dll\NtResumeProcess&quot;, &quot;Int&quot;, h)
 
    DllCall(&quot;CloseHandle&quot;, &quot;Int&quot;, h)
}
 
ProcExist(PID_or_Name=&quot;&quot;){
 
    Process, Exist, % (PID_or_Name=&quot;&quot;) ? DllCall(&quot;GetCurrentProcessID&quot;) : PID_or_Name
 
    Return Errorlevel
	}
}
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Kakuo)]]></author>
			<pubDate>Tue, 12 Oct 2021 09:37:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150023#p150023</guid>
		</item>
	</channel>
</rss>
