<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Заморозка Threads]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16658&amp;type=atom" />
	<updated>2021-11-01T07:08:24Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16658</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150354#p150354" />
			<content type="html"><![CDATA[<p>Какие огрехи?<br />Если моим не доказать, докажите своим.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2021-11-01T07:08:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150354#p150354</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150352#p150352" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2021-11-01T06:11:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150352#p150352</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150349#p150349" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2021-10-31T22:53:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150349#p150349</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150345#p150345" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2021-10-31T19:50:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150345#p150345</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150343#p150343" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2021-10-31T19:32:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150343#p150343</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150340#p150340" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2021-10-31T19:14:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150340#p150340</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150317#p150317" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2021-10-31T08:24:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150317#p150317</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150242#p150242" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Kakuo пишет:</cite><blockquote><p>Подскажите команду пожалуйста.</p></blockquote></div><p>Функцию NTAPI? NtSuspendThread. Как найти TID, полагаю, знаете.</p>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2021-10-27T19:41:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150242#p150242</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150193#p150193" />
			<content type="html"><![CDATA[<p>Подскажите команду пожалуйста.</p>]]></content>
			<author>
				<name><![CDATA[Kakuo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38615</uri>
			</author>
			<updated>2021-10-24T09:24:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150193#p150193</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150077#p150077" />
			<content type="html"><![CDATA[<p>UP</p>]]></content>
			<author>
				<name><![CDATA[Kakuo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38615</uri>
			</author>
			<updated>2021-10-15T11:54:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150077#p150077</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150044#p150044" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Kakuo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38615</uri>
			</author>
			<updated>2021-10-12T17:49:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150044#p150044</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150042#p150042" />
			<content type="html"><![CDATA[<p>Возможно нужно указать сами процессы по отдельности?</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-10-12T14:01:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150042#p150042</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Заморозка Threads]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150023#p150023" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Kakuo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38615</uri>
			</author>
			<updated>2021-10-12T09:37:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150023#p150023</id>
		</entry>
</feed>
