<?xml version="1.0" encoding="UTF-8" ?>
<feed xml:lang="ja" xmlns="http://www.w3.org/2005/Atom">
	<generator uri="http://nucleuscms.org/" version="Nucleus CMS v3.31SP1-kes">Nucleus CMS v3.31SP1-kes</generator>

	<id>http://fireball.loafer.jp/kes/</id>
	<link rel="self" type="application/atom+xml" href="http://fireball.loafer.jp/kes/atom.xml" />
	<link rel="related" type="text/html" href="http://fireball.loafer.jp/" />
	<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/" />

	<rights>© 2008 Project Loafer/Project Fireball and all blog writers.</rights>

	<title>Entering Passive Mode</title>
	<subtitle>やる気のない受け身なブログ。実験場。</subtitle>

	<updated>2006-11-07T23:48:00+09:00</updated>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="C++, C" scheme="http://fireball.loafer.jp/kes/c/" />
		<content type="html">
<![CDATA[
<div>
<a href="http://fireball.loafer.jp/kes?imagepopup=2/2006-11-07-23-48-0.jpg&amp;width=531&amp;height=387&amp;imagetext=Vista+%E3%81%AE%E3%82%B7%E3%83%B3%E3%83%9C%E3%83%AA%E3%83%83%E3%82%AF%E3%83%AA%E3%83%B3%E3%82%AF" onclick="window.open(this.href,'imagepopup','status=no,toolbar=no,scrollbars=no,resizable=yes,width=531,height=387');return false;" class="thumbnail"><img src="http://media.fireball.loafer.jp/thumbnail/2_2006-11-07-23-48-0.jpg" width="120" height="87" alt="Vista のシンボリックリンク" title="Vista のシンボリックリンク" /></a>
<a href="http://fireball.loafer.jp/kes?imagepopup=2/2006-11-07-23-48-1.jpg&amp;width=517&amp;height=352&amp;imagetext=%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88" onclick="window.open(this.href,'imagepopup','status=no,toolbar=no,scrollbars=no,resizable=yes,width=517,height=352');return false;" class="thumbnail"><img src="http://media.fireball.loafer.jp/thumbnail/2_2006-11-07-23-48-1.jpg" width="120" height="82" alt="コマンドプロンプト" title="コマンドプロンプト" /></a>
</div>
<p>
次世代の Windows OS となる、Windows Vista や、<br />
Longhorn Server（コードネーム）では、<br />
いよいよ真のシンボリックリンクが登場する。
</p>
<p>
シンボリックリンクは、UNIX 系のそれとほぼ同様の機能だ。<br />
Vista では、CreateSymbolicLink API が登場し、<br />
OS で正式にサポートされた機能として実装される。
</p>
<p>
Vista のエクスプローラは、正式にリンクを採用したため、<br />
昨日説明したような問題が起きないような設計になっている。<br />
マウントポイントやシンボリックリンクを削除しても、<br />
リンク先が削除されるようなことは起こらないのだ。
</p>
<a href="http://fireball.loafer.jp/kes/c/article_330.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/c/article_330.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/c/article_330.html" />
		<published>2006-11-07T23:48:00+09:00</published>
		<title type="html"><![CDATA[Vista のシンボリックリンク]]></title>
		<updated>2006-11-07T23:48:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="C++, C" scheme="http://fireball.loafer.jp/kes/c/" />
		<content type="html">
<![CDATA[
<p>
マウントポイント機能は、<br />
使い方次第では非常に便利である。
</p>
<p>
ディスクを複数のパーティションに分けている場合、<br />
システムドライブに空き容量が不足しても<br />
マウントポイント機能を使えば、<br />
ドライブにある適当なディレクトリの実体を、<br />
別のボリュームに置くことができる。
</p>
<p>
ボリュームマウントポイントの場合は、<br />
Windows で正式にサポートされているため、<br />
GUI によって設定することもできるが、<br />
別のボリューム全体がマウントされることになる。
</p>
<a href="http://fireball.loafer.jp/kes/c/article_329.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/c/article_329.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/c/article_329.html" />
		<published>2006-11-06T23:55:00+09:00</published>
		<title type="html"><![CDATA[マウントポイントの長所と短所]]></title>
		<updated>2006-11-06T23:55:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="C++, C" scheme="http://fireball.loafer.jp/kes/c/" />
		<content type="html">
<![CDATA[
<p>
今日はディレクトリジャンクションを作成してみる。<br />
そのものズバリの API は存在しないので、<br />
リパースデータバッファを自分で用意し、<br />
DeviceIOControl を使って設定することになる。
</p>
<p>
========== part of mountpoint.c ========== 
</p>
<p>
HRESULT MountPointCreate(const wchar_t *mountPointPath, const wchar_t *target) {
</p>
<p>
&nbsp; &nbsp; unsigned short pathByteLength;<br />
&nbsp; &nbsp; char dataBuffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];<br />
&nbsp; &nbsp; MOUNT_POINT_INFO *info = (MOUNT_POINT_INFO *)dataBuffer;
</p>
<a href="http://fireball.loafer.jp/kes/c/article_328.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/c/article_328.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/c/article_328.html" />
		<published>2006-11-05T23:56:00+09:00</published>
		<title type="html"><![CDATA[ディレクトリジャンクションを作成する]]></title>
		<updated>2006-11-05T23:56:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="C++, C" scheme="http://fireball.loafer.jp/kes/c/" />
		<content type="html">
<![CDATA[
<p>
パス名で何日か脱線していたが、<br />
改めてボリュームマウントポイントに戻ろう。
</p>
<p>
ボリュームマウントポイントは、<br />
ファイルシステムのディレクトリに対して、<br />
リパースポイント機能を使うことで実現していた。
</p>
<p>
リパースポイント属性を持つディレクトリには、<br />
リパースデータバッファという追加情報が保存されている。
</p>
<p>
リパースデータバッファには種類があるが、<br />
ボリュームマウントポイントは、<br />
IO_REPARSE_TAG_MOUNT_POINT という種類であり、<br />
データとしてリンク先を表すデバイスパスが記録されていた。
</p>
<a href="http://fireball.loafer.jp/kes/c/article_327.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/c/article_327.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/c/article_327.html" />
		<published>2006-11-04T23:45:00+09:00</published>
		<title type="html"><![CDATA[ディレクトリジャンクション]]></title>
		<updated>2006-11-04T23:45:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="C++, C" scheme="http://fireball.loafer.jp/kes/c/" />
		<content type="html">
<![CDATA[
<p>
実際に拡張表現を試してみよう。
</p>
<p>
サンプルとして、Windows フォルダ内にある、<br />
win.ini にアクセスしてみよう。
</p>
<p>
エクスプローラのアドレスバーや、<br />
ファイルを開く汎用コモンダイアログでは、<br />
拡張パス表現に対する対応をしているが、<br />
コマンドプロンプトや「ファイルを指定して実行」は、<br />
そのような制限がないため、入力して試すことが可能だ。
</p>
<a href="http://fireball.loafer.jp/kes/c/article_326.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/c/article_326.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/c/article_326.html" />
		<published>2006-11-03T16:50:00+09:00</published>
		<title type="html"><![CDATA[色々なファイルパスを試してみる]]></title>
		<updated>2006-11-03T16:50:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="C++, C" scheme="http://fireball.loafer.jp/kes/c/" />
		<content type="html">
<![CDATA[
<p>
いよいよ、保留にしていたパスについて考えてみる。<br />
GetVolumeNameForVolumeMountPoint が返却したパスは、<br />
以下のような形式であった。
</p>
<p>
\\?\Volume{f08e7d20-64f1-11db-b10d-001125868411}\
</p>
<p>
実は、これもファイルのパス表現なのである。
</p>
<p>
最初に \\ と並んでいるので、UNC パスにも見えるが、<br />
「?」というサーバに接続するわけではない。<br />
では、上記のパスはどのように解釈されるのか。
</p>
<a href="http://fireball.loafer.jp/kes/c/article_325.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/c/article_325.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/c/article_325.html" />
		<published>2006-11-02T22:39:00+09:00</published>
		<title type="html"><![CDATA[ファイルパスの拡張表現]]></title>
		<updated>2006-11-02T22:39:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="C++, C" scheme="http://fireball.loafer.jp/kes/c/" />
		<content type="html">
<![CDATA[
<p>
昨日のもう 1 つのパスはもう少し保留しておき、<br />
ファイルのパス表現について考えてみよう。
</p>
<p>
パソコン利用者やプログラマに単に「パス」と言えば、<br />
こちらのファイルパス表現のことを指す。<br />
これは、C:\～ や \\server\share\～、..\ などの、<br />
一般的によく見る表現のことである
</p>
<p>
通常は、このパス表記を使ってファイルにアクセスする。<br />
プログラマがファイルを利用する場合、<br />
パスを指定してプログラミング言語固有の機構を使うが、<br />
これは、Windows の基幹 API を呼び出す。<br />
ファイルの場合、通常 CreateFile API である事が多い。
</p>
<a href="http://fireball.loafer.jp/kes/c/article_324.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/c/article_324.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/c/article_324.html" />
		<published>2006-11-01T23:55:00+09:00</published>
		<title type="html"><![CDATA[ファイルのパス表現]]></title>
		<updated>2006-11-01T23:55:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="C++, C" scheme="http://fireball.loafer.jp/kes/c/" />
		<content type="html">
<![CDATA[
<div>
<a href="http://fireball.loafer.jp/kes?imagepopup=2/2006-10-31-23-56-0.jpg&amp;width=597&amp;height=417&amp;imagetext=%E3%83%87%E3%83%90%E3%82%A4%E3%82%B9%E3%83%84%E3%83%AA%E3%83%BC" onclick="window.open(this.href,'imagepopup','status=no,toolbar=no,scrollbars=no,resizable=yes,width=597,height=417');return false;" class="thumbnail"><img src="http://media.fireball.loafer.jp/thumbnail/2_2006-10-31-23-56-0.jpg" width="120" height="84" alt="デバイスツリー" title="デバイスツリー" /></a>
</div>
<p>
昨日、マウントポイントのバッファの内容を直接取り出したが、<br />
そのリンク先のパスは、以下のようになっていた。
</p>
<p>
\??\Volume{f08e7d20-64f1-11db-b10d-001125868411}\
</p>
<p>
だが、これを GetVolumeNameForVolumeMountPoint で<br />
取り出すと以下のようになる。
</p>
<p>
\\?\Volume{f08e7d20-64f1-11db-b10d-001125868411}\
</p>
<p>
一見同じに見えるが、接頭辞が異なっている。<br />
これらはどう違い、どんな意味をもっているのだろうか。
</p>
<a href="http://fireball.loafer.jp/kes/c/article_323.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/c/article_323.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/c/article_323.html" />
		<published>2006-10-31T23:56:00+09:00</published>
		<title type="html"><![CDATA[デバイスのパス表現]]></title>
		<updated>2006-10-31T23:56:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="C++, C" scheme="http://fireball.loafer.jp/kes/c/" />
		<content type="html">
<![CDATA[
<p>
では、実際にリパースデータバッファを取得し、<br />
マウントポイントのリンク先を取得してみよう。
</p>
<p>
========== 1st half of mountpoint.c ==========
</p>
<p>
#define UNICODE<br />
#define STRICT<br />
#define WIN32_LEAN_AND_MEAN 
</p>
<p>
#define _WIN32_WINNT&nbsp; 0x0500
</p>
<a href="http://fireball.loafer.jp/kes/c/article_322.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/c/article_322.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/c/article_322.html" />
		<published>2006-10-30T23:48:00+09:00</published>
		<title type="html"><![CDATA[リパースデータバッファの取得]]></title>
		<updated>2006-10-30T23:48:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="C++, C" scheme="http://fireball.loafer.jp/kes/c/" />
		<content type="html">
<![CDATA[
<div>
<a href="http://fireball.loafer.jp/kes?imagepopup=2/2006-10-29-23-55-0.jpg&amp;width=335&amp;height=428&amp;imagetext=%E6%A7%8B%E9%80%A0" onclick="window.open(this.href,'imagepopup','status=no,toolbar=no,scrollbars=no,resizable=yes,width=335,height=428');return false;" class="thumbnail"><img src="http://media.fireball.loafer.jp/thumbnail/2_2006-10-29-23-55-0.jpg" width="94" height="120" alt="構造" title="構造" /></a>
</div>
<p>
リパースタグなどの特殊なデータにアクセスする場合、<br />
デバイスドライバに対して制御コードを送り、<br />
データ構造を直接扱う必要がある。
</p>
<p>
Windows には、DeviceIoControl という API があり、<br />
これを使うことで、デバイスドライバの制御が可能である。
</p>
<p>
リパースポイントの情報を得るためには、<br />
対象のディレクトリハンドルに対して、<br />
FSCTL_GET_REPARSE_POINT という制御コードを送る。<br />
そうすれば、その結果としてリパースポイントの情報が、<br />
リパースデータバッファと呼ばれる構造で返却される。
</p>
<a href="http://fireball.loafer.jp/kes/c/article_321.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/c/article_321.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/c/article_321.html" />
		<published>2006-10-29T23:55:00+09:00</published>
		<title type="html"><![CDATA[リパースデータバッファの構造]]></title>
		<updated>2006-10-29T23:55:00+09:00</updated>
	</entry>

</feed>
