#uselib "kernel32.dll"
#cfunc global GetVolumeInformation "GetVolumeInformationA" sptr, var, int, var, var, var, var, int
#module
#defcfunc getvolumeinfo int root, int type, int reget, local i
if reget ! 0 || root + 100 ! rootb {
sdim name, 256, 3
name = "?:\\" : poke name, , root + 64
if type = 0 : return name
i = GetVolumeInformation(name, name.1, 256, size, size.1, size.2, name.2, 256)
if i = 0 {
if type = 1 || type = 5 : return "" : else : return 0
}
rootb = root + 100
}
if type = 1 || type = 5 : return name((type = 5) + (type ! 0)) : else : return size(type - 2)
#global
sdim drv, 128
sdim flginfo, 30, 12
sdim yn, 8, 2
flag = 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x8000, 0x00000020, 0x00000040, 0x00000080, 0x00010000, 0x00020000, 0x00040000
flginfo.0 = "大・小文字を区別して検索可能"
flginfo.1 = "大・小文字を区別して保存可能"
flginfo.2 = "Unicodeファイル名を格納可能"
flginfo.3 = "ACLの保存と適用が可能"
flginfo.4 = "ファイルベースの圧縮が可能"
flginfo.5 = "ボリュームは圧縮済み"
flginfo.6 = "ディスククォータに対応可能"
flginfo.7 = "ディスパースに対応可能"
flginfo.8 = "再解析ポイントに対応可能"
flginfo.9 = "オブジェクト識別子に対応可能"
flginfo.10 = "EPSが可能"
flginfo.11= "名前付きストリームに対応可能"
yn = "でない", "である"
repeat 26, 1
if cnt > 1 : drv += "\n"
wpoke drv, (cnt - 1) * 3, (':' << 8) + cnt + 64 // コンボボックス用に「A: B: C: … Z:」を格納
loop
pos 10, 10 : mes "ドライブ"
pos 80, 10 : combox index, 100, drv
pos 150, 10 : button gosub "確認", *check
stop
*check
color 255, 255, 255 : boxf , 50 : color
pos 10, 50 : mes "【ドライブ" + getvolumeinfo(index + 1, 0) + "の情報】"
pos 10, 80 : mes "ボリューム名:" + getvolumeinfo(index + 1, 1)
pos 10, 110 : mes "シリアル番号:" + getvolumeinfo(index + 1, 2)
pos 10, 140 : mes "ファイル名最大長:" + getvolumeinfo(index + 1, 3)
pos 10, 170 : mes "ファイルシステム名:" + getvolumeinfo(index + 1, 5)
pos 10, 200 : mes "付加情報:"
repeat length(flag)
pos 90, cnt * 20 + 200 : mes flginfo.cnt
pos ginfo_mesx + 90, cnt * 20 + 200 : mes yn((getvolumeinfo(index + 1, 4) & flag.cnt) ! 0)
loop
return
|