<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Разблокировка файла]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13856&amp;type=atom" />
	<updated>2018-07-01T01:22:24Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13856</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126589#p126589" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Сложновато</p></blockquote></div><p>В начале да.<br />Но стоит понять алгоритм и вызвать пару раз нужные функции - не сложнее, чем dllcall.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-07-01T01:22:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126589#p126589</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126584#p126584" />
			<content type="html"><![CDATA[<p>Это в AHK сложновато, поскольку эти интерфейсы напрямую не поддерживаются, а c++, c# они по названиям и вызываются.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-30T22:28:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126584#p126584</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126583#p126583" />
			<content type="html"><![CDATA[<p>Сложновато. С чем связана такая замороченность в доках, почему не в привычном виде названий функций?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-06-30T21:56:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126583#p126583</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126580#p126580" />
			<content type="html"><![CDATA[<p><a href="https://msdn.microsoft.com/ru-ru/office/ms537032(v=vs.90)">IZoneIdentifier interface</a><br />Смотрим внизу страницы, где он определяется:</p><p><span class="postimg"><img src="https://i.imgur.com/U84qlJh.png" alt="https://i.imgur.com/U84qlJh.png" /></span></p><p>Значит можно посмотреть в Urlmon.h или в UrlMon.Idl. Находим эти файлы на компьютере или в гугле, в UrlMon.Idl, например, видим:</p><p><span class="postimg"><img src="https://i.imgur.com/7QF0YBQ.png" alt="https://i.imgur.com/7QF0YBQ.png" /></span></p><p>Это порядок методов, учитывая, что первые три обычно зарезервированы. GetId в списке первый, соответственно, его номер 4 (от 0 будет 3):<br /></p><div class="quotebox"><blockquote><p>DllCall(NumGet(NumGet(ZoneIdentifier+0) + <strong>3</strong>*A_PtrSize) ...</p></blockquote></div><p>URLZONE_INTERNET надо искать запросом <em>URLZONE_INTERNET constant</em></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-30T18:34:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126580#p126580</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126579#p126579" />
			<content type="html"><![CDATA[<p>Как вы это делаете, как нонять по ссылке IZoneIdentifier::GetId method что это NumGet(NumGet(ZoneIdentifier+0) + <strong>3</strong>*A_PtrSize), и что URLZONE_INTERNET надо искать в NativeMethodsOther.cs?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-06-30T18:16:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126579#p126579</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126578#p126578" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>file := &quot;D:\Downloads\qweqwe.dll&quot;
PersistentZoneIdentifier := &quot;{0968E258-16C7-4DBA-AA86-462DD61E31A3}&quot;
IZoneIdentifier := &quot;{CD45F185-1B21-48E2-967B-EAD743A8914E}&quot;
IPersistFile := &quot;{0000010b-0000-0000-C000-000000000046}&quot;
ZoneIdentifier := ComObjCreate(PersistentZoneIdentifier, IZoneIdentifier)
PersistFile := ComObjQuery(ZoneIdentifier, IPersistFile)
DllCall(NumGet(NumGet(PersistFile+0) + 5*A_PtrSize), &quot;ptr&quot;, PersistFile, &quot;ptr&quot;, &amp;file, &quot;UInt&quot;, 0)  ; load
DllCall(NumGet(NumGet(ZoneIdentifier+0) + 3*A_PtrSize), &quot;ptr&quot;, ZoneIdentifier, UIntP, zone)  ; GetId
MsgBox, % zone
ObjRelease(PersistFile)
ObjRelease(ZoneIdentifier)</code></pre></div><p>С твоим файлом у меня 3 выдаёт, что соответствует <a href="https://referencesource.microsoft.com/#WindowsBase/Shared/MS/Win32/NativeMethodsOther.cs,79">URLZONE_INTERNET</a>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-30T18:09:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126578#p126578</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126577#p126577" />
			<content type="html"><![CDATA[<p>Спасибо, с FileExist работает. А можешь код привести, я эти DllCall(NumGet(NumGet( вообще не вкуриваю.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-06-30T17:47:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126577#p126577</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126576#p126576" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Как проверить поток я само собой не знаю.</p></blockquote></div><div class="codebox"><pre><code>if FileExist(fileName . &quot;:Zone.Identifier:$DATA&quot;)</code></pre></div><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Malcev вроде привёл пример как удалить блокировку.</p></blockquote></div><p>Ну там же есть наверно способ не только как удалить, но и как получить: <a href="https://msdn.microsoft.com/ru-ru/office/ms537031(v=vs.90)">IZoneIdentifier::GetId method</a></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-30T17:41:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126576#p126576</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126574#p126574" />
			<content type="html"><![CDATA[<p>Кроме <a href="https://autohotkey.com/boards/viewtopic.php?t=45449">этой темы</a> ничего не нашёл.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-06-30T17:28:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126574#p126574</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126573#p126573" />
			<content type="html"><![CDATA[<p>Как проверить поток я само собой не знаю.<br /><strong>Malcev</strong> вроде привёл пример как удалить блокировку.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-06-30T17:27:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126573#p126573</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126571#p126571" />
			<content type="html"><![CDATA[<p>Наверно проверить, существует ли NTFS-поток с названием %fileName%:Zone.Identifier:$DATA. Или способом, аналогичным тому, что выше привёл <strong>Malcev</strong>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-30T17:22:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126571#p126571</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126569#p126569" />
			<content type="html"><![CDATA[<p>А как можно узнать что файл заблокирован?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2018-06-30T17:16:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126569#p126569</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126240#p126240" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Зачем использовать утилиту, если можно через апи?</p></blockquote></div><p>Я этот способ привел для коллекции.</p>]]></content>
			<author>
				<name><![CDATA[Molotok]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39027</uri>
			</author>
			<updated>2018-06-20T03:25:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126240#p126240</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126213#p126213" />
			<content type="html"><![CDATA[<p>Я так понял, это нужно <strong>serzh82saratov</strong> не для себя.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-19T15:54:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126213#p126213</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разблокировка файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=126212#p126212" />
			<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>2018-06-19T15:19:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=126212#p126212</id>
		</entry>
</feed>
