<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413184&amp;view=findpost&amp;p=3773464</guid>
        <pubDate>Thu, 05 Jul 2018 16:19:07 +0000</pubDate>
        <title>Не работают FindFirstVolumeMountPoint / FindNextVolumeMountPoint</title>
        <link>https://forum.sources.ru/index.php?showtopic=413184&amp;view=findpost&amp;p=3773464</link>
        <description><![CDATA[Jin X: Если речь о папках, смотнированных на том, то я специально монтировал папки, их всё равно не видно через эту функцию :( <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-07-05T19:26:04+03:00">05.07.18, 16:26</time></span></span><br>
Да, я нашёл &quot;They do not return drive letters or volume GUID paths&quot;.<br>
И я разобрался почему не видно было папки.<br>
Оказывается, эти <strong class='tag-b'>Find</strong>&#39;ы работают только от имени администратора, от юзера ничего не показывают.<br>
А вот <strong class='tag-b'>GetVolumePathNamesForVolumeName</strong> работают и от юзера (и диски тоже показывают), и от админа. Бред какой-то...]]></description>
        <author>Jin X</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413184&amp;view=findpost&amp;p=3773451</guid>
        <pubDate>Thu, 05 Jul 2018 12:53:58 +0000</pubDate>
        <title>Не работают FindFirstVolumeMountPoint / FindNextVolumeMountPoint</title>
        <link>https://forum.sources.ru/index.php?showtopic=413184&amp;view=findpost&amp;p=3773451</link>
        <description><![CDATA[Pavia: <strong class='tag-b'>Jin X</strong><br>
Если просто, то эта функция делает не то о чём вы подумали.<br>
Это особые папки которые есть только в NFTS.<br>
Что-бы увидеть их с начало создать надо. <br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">{$APPTYPE CONSOLE}</div><div class="code_line">uses Windows;</div><div class="code_line">&nbsp;</div><div class="code_line">function FindFirstVolume(lpszVolumeName: LPSTR; cchBufferLength: DWORD): THandle; stdcall; external kernel32 name &#39;FindFirstVolumeA&#39;;</div><div class="code_line">function FindNextVolume(hFindVolume: THandle; lpszVolumeName: LPSTR; cchBufferLength: DWORD): BOOL; stdcall; external kernel32 name &#39;FindNextVolumeA&#39;;</div><div class="code_line">function FindVolumeClose(hFindVolume: THandle): BOOL; stdcall; external kernel32;</div><div class="code_line">&nbsp;</div><div class="code_line">function FindFirstVolumeMountPoint(lpszRootPathName, lpszVolumeMountPoint: LPSTR; cchBufferLength: DWORD): THandle; stdcall; external kernel32 name &#39;FindFirstVolumeMountPointA&#39;;</div><div class="code_line">function FindNextVolumeMountPoint(hFindVolumeMountPoint: THandle; lpszVolumeMountPoint: LPSTR; cchBufferLength: DWORD): BOOL; stdcall; external kernel32 name &#39;FindNextVolumeMountPointA&#39;;</div><div class="code_line">function FindVolumeMountPointClose(hFindVolumeMountPoint: THandle): BOOL; stdcall; external kernel32;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">function GetVolumeNameForVolumeMountPoint(lpszVolumeMountPoint: LPSTR; lpszVolumeName: LPSTR; cchBufferLength: DWORD): Bool; stdcall; external kernel32 name &#39;GetVolumeNameForVolumeMountPointA&#39;;</div><div class="code_line">function SetVolumeMountPoint(lpszVolumeMountPoint: LPSTR; lpszVolumeName: LPSTR): Bool; stdcall; external kernel32 name &#39;SetVolumeMountPointA&#39;;</div><div class="code_line">function DeleteVolumeMountPoint(lpszVolumeMountPoint: LPSTR): Bool; stdcall; external kernel32 name &#39;DeleteVolumeMountPointA&#39;;</div><div class="code_line">&nbsp;</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;Vol, Point: array [0..1023] of AnsiChar;</div><div class="code_line">&nbsp;&nbsp;VH, PH: THandle;</div><div class="code_line">&nbsp;&nbsp;Ck:Bool;</div><div class="code_line">begin</div><div class="code_line">&nbsp;// Что мантируем</div><div class="code_line">&nbsp;&nbsp;Ck:=GetVolumeNameForVolumeMountPoint(&#39;H:\&#39;, Vol, SizeOf(Vol));</div><div class="code_line">&nbsp;&nbsp;if not Ck then</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;WriteLn(&#39;No volumes found!&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;Exit;</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">// Куда мантируем</div><div class="code_line">&nbsp;&nbsp;Ck:=SetVolumeMountPoint(&#39;F:\DiskH\&#39;, Vol);</div><div class="code_line">&nbsp;&nbsp;if not Ck then</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;WriteLn(&#39;Cannot mount!&#39;);</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;VH := FindFirstVolume(Vol, SizeOf(Vol));</div><div class="code_line">&nbsp;&nbsp;if VH = INVALID_HANDLE_VALUE then</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;WriteLn(&#39;No volumes found!&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;Exit;</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;repeat</div><div class="code_line">&nbsp;&nbsp; &nbsp;WriteLn(Vol);</div><div class="code_line">&nbsp;&nbsp; &nbsp;PH := FindFirstVolumeMountPoint(Vol, Point, SizeOf(Point));</div><div class="code_line">&nbsp;&nbsp; &nbsp;if PH = INVALID_HANDLE_VALUE then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;WriteLn(&#39; &nbsp;No mounted folders.&#39;)</div><div class="code_line">&nbsp;&nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;repeat</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;WriteLn(&#39; &nbsp;&#39;, Point);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;until not FindNextVolumeMountPoint(PH, Point, SizeOf(Point));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;FindVolumeMountPointClose(PH);</div><div class="code_line">&nbsp;&nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp; &nbsp;WriteLn;</div><div class="code_line">&nbsp;&nbsp;until not FindNextVolume(VH, Vol, SizeOf(Vol));</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;FindVolumeClose(VH);</div><div class="code_line">&nbsp;&nbsp;ck:=DeleteVolumeMountPoint(&#39;F:\DiskH\&#39;);</div><div class="code_line">&nbsp;&nbsp;if not Ck then</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;WriteLn(&#39;Cannot unmount!&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;Exit;</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;&nbsp;ReadLn;</div><div class="code_line">end.</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>Pavia</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413184&amp;view=findpost&amp;p=3773435</guid>
        <pubDate>Thu, 05 Jul 2018 09:50:52 +0000</pubDate>
        <title>Не работают FindFirstVolumeMountPoint / FindNextVolumeMountPoint</title>
        <link>https://forum.sources.ru/index.php?showtopic=413184&amp;view=findpost&amp;p=3773435</link>
        <description><![CDATA[Jin X: Пишу:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">{$APPTYPE CONSOLE}</div><div class="code_line">uses Windows;</div><div class="code_line">&nbsp;</div><div class="code_line">function FindFirstVolume(lpszVolumeName: LPSTR; cchBufferLength: DWORD): THandle; stdcall; external kernel32 name &#39;FindFirstVolumeA&#39;;</div><div class="code_line">function FindNextVolume(hFindVolume: THandle; lpszVolumeName: LPSTR; cchBufferLength: DWORD): BOOL; stdcall; external kernel32 name &#39;FindNextVolumeA&#39;;</div><div class="code_line">function FindVolumeClose(hFindVolume: THandle): BOOL; stdcall; external kernel32;</div><div class="code_line">&nbsp;</div><div class="code_line">function FindFirstVolumeMountPoint(lpszRootPathName, lpszVolumeMountPoint: LPSTR; cchBufferLength: DWORD): THandle; stdcall; external kernel32 name &#39;FindFirstVolumeMountPointA&#39;;</div><div class="code_line">function FindNextVolumeMountPoint(hFindVolumeMountPoint: THandle; lpszVolumeMountPoint: LPSTR; cchBufferLength: DWORD): BOOL; stdcall; external kernel32 name &#39;FindNextVolumeMountPointA&#39;;</div><div class="code_line">function FindVolumeMountPointClose(hFindVolumeMountPoint: THandle): BOOL; stdcall; external kernel32;</div><div class="code_line">&nbsp;</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;Vol, Point: array [0..1023] of AnsiChar;</div><div class="code_line">&nbsp;&nbsp;VH, PH: THandle;</div><div class="code_line">&nbsp;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;VH := FindFirstVolume(Vol, SizeOf(Vol));</div><div class="code_line">&nbsp;&nbsp;if VH = INVALID_HANDLE_VALUE then</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;WriteLn(&#39;No volumes found!&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;Exit;</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;repeat</div><div class="code_line">&nbsp;&nbsp; &nbsp;WriteLn(Vol);</div><div class="code_line">&nbsp;&nbsp; &nbsp;PH := FindFirstVolumeMountPoint(Vol, Point, SizeOf(Point));</div><div class="code_line">&nbsp;&nbsp; &nbsp;if PH = INVALID_HANDLE_VALUE then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;WriteLn(&#39; &nbsp;No mounted folders.&#39;)</div><div class="code_line">&nbsp;&nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;repeat</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;WriteLn(&#39; &nbsp;&#39;, Point);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;until not FindNextVolumeMountPoint(PH, Point, SizeOf(Point));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;FindVolumeMountPointClose(PH);</div><div class="code_line">&nbsp;&nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp; &nbsp;WriteLn;</div><div class="code_line">&nbsp;&nbsp;until not FindNextVolume(VH, Vol, SizeOf(Vol));</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;FindVolumeClose(VH);</div><div class="code_line">&nbsp;&nbsp;ReadLn;</div><div class="code_line">end.</div></ol></div></div></div></div><br>
Выдаёт GUID томов, но точек подключения нет. Почему? Что не так?<br>
А вот функция <strong class='tag-b'>GetVolumePathNamesForVolumeName</strong> работает... <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-07-05T09:52:05+00:00">05.07.18, 09:52</time></span></span><br>
p.s. Это пускается из-под D7. Если убрать объявления функций и компилить через Tokyo (PWideChar), результат тот же.]]></description>
        <author>Jin X</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      </channel>
      </rss>
	