ホーム › System.Com.Urlmon › ZONEATTRIBUTES
ZONEATTRIBUTES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| szDisplayName | WCHAR | 520 | +4 | +4 | セキュリティゾーンの表示名(ワイド文字配列)。 |
| szDescription | WCHAR | 400 | +524 | +524 | セキュリティゾーンの説明文(ワイド文字配列)。 |
| szIconPath | WCHAR | 520 | +924 | +924 | ゾーンを表すアイコンのパス(ワイド文字配列)。 |
| dwTemplateMinLevel | DWORD | 4 | +1444 | +1444 | 適用可能な最小セキュリティテンプレートレベル。 |
| dwTemplateRecommended | DWORD | 4 | +1448 | +1448 | 推奨されるセキュリティテンプレートレベル。 |
| dwTemplateCurrentLevel | DWORD | 4 | +1452 | +1452 | 現在設定されているセキュリティテンプレートレベル。 |
| dwFlags | DWORD | 4 | +1456 | +1456 | ゾーンの表示・動作を制御するフラグ。 |
各言語での定義
#include <windows.h>
// ZONEATTRIBUTES (x64 1460 / x86 1460 バイト)
typedef struct ZONEATTRIBUTES {
DWORD cbSize;
WCHAR szDisplayName[260];
WCHAR szDescription[200];
WCHAR szIconPath[260];
DWORD dwTemplateMinLevel;
DWORD dwTemplateRecommended;
DWORD dwTemplateCurrentLevel;
DWORD dwFlags;
} ZONEATTRIBUTES;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ZONEATTRIBUTES
{
public uint cbSize;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 200)] public string szDescription;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string szIconPath;
public uint dwTemplateMinLevel;
public uint dwTemplateRecommended;
public uint dwTemplateCurrentLevel;
public uint dwFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ZONEATTRIBUTES
Public cbSize As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> Public szDisplayName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=200)> Public szDescription As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> Public szIconPath As String
Public dwTemplateMinLevel As UInteger
Public dwTemplateRecommended As UInteger
Public dwTemplateCurrentLevel As UInteger
Public dwFlags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class ZONEATTRIBUTES(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("szDisplayName", ctypes.c_wchar * 260),
("szDescription", ctypes.c_wchar * 200),
("szIconPath", ctypes.c_wchar * 260),
("dwTemplateMinLevel", wintypes.DWORD),
("dwTemplateRecommended", wintypes.DWORD),
("dwTemplateCurrentLevel", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
]#[repr(C)]
pub struct ZONEATTRIBUTES {
pub cbSize: u32,
pub szDisplayName: [u16; 260],
pub szDescription: [u16; 200],
pub szIconPath: [u16; 260],
pub dwTemplateMinLevel: u32,
pub dwTemplateRecommended: u32,
pub dwTemplateCurrentLevel: u32,
pub dwFlags: u32,
}import "golang.org/x/sys/windows"
type ZONEATTRIBUTES struct {
cbSize uint32
szDisplayName [260]uint16
szDescription [200]uint16
szIconPath [260]uint16
dwTemplateMinLevel uint32
dwTemplateRecommended uint32
dwTemplateCurrentLevel uint32
dwFlags uint32
}type
ZONEATTRIBUTES = record
cbSize: DWORD;
szDisplayName: array[0..259] of WideChar;
szDescription: array[0..199] of WideChar;
szIconPath: array[0..259] of WideChar;
dwTemplateMinLevel: DWORD;
dwTemplateRecommended: DWORD;
dwTemplateCurrentLevel: DWORD;
dwFlags: DWORD;
end;const ZONEATTRIBUTES = extern struct {
cbSize: u32,
szDisplayName: [260]u16,
szDescription: [200]u16,
szIconPath: [260]u16,
dwTemplateMinLevel: u32,
dwTemplateRecommended: u32,
dwTemplateCurrentLevel: u32,
dwFlags: u32,
};type
ZONEATTRIBUTES {.bycopy.} = object
cbSize: uint32
szDisplayName: array[260, uint16]
szDescription: array[200, uint16]
szIconPath: array[260, uint16]
dwTemplateMinLevel: uint32
dwTemplateRecommended: uint32
dwTemplateCurrentLevel: uint32
dwFlags: uint32struct ZONEATTRIBUTES
{
uint cbSize;
wchar[260] szDisplayName;
wchar[200] szDescription;
wchar[260] szIconPath;
uint dwTemplateMinLevel;
uint dwTemplateRecommended;
uint dwTemplateCurrentLevel;
uint dwFlags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ZONEATTRIBUTES サイズ: 1460 バイト(x64)
dim st, 365 ; 4byte整数×365(構造体サイズ 1460 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; szDisplayName : WCHAR (+4, 520byte) varptr(st)+4 を基点に操作(520byte:入れ子/配列)
; szDescription : WCHAR (+524, 400byte) varptr(st)+524 を基点に操作(400byte:入れ子/配列)
; szIconPath : WCHAR (+924, 520byte) varptr(st)+924 を基点に操作(520byte:入れ子/配列)
; dwTemplateMinLevel : DWORD (+1444, 4byte) st.361 = 値 / 値 = st.361 (lpoke/lpeek も可)
; dwTemplateRecommended : DWORD (+1448, 4byte) st.362 = 値 / 値 = st.362 (lpoke/lpeek も可)
; dwTemplateCurrentLevel : DWORD (+1452, 4byte) st.363 = 値 / 値 = st.363 (lpoke/lpeek も可)
; dwFlags : DWORD (+1456, 4byte) st.364 = 値 / 値 = st.364 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ZONEATTRIBUTES
#field int cbSize
#field wchar szDisplayName 260
#field wchar szDescription 200
#field wchar szIconPath 260
#field int dwTemplateMinLevel
#field int dwTemplateRecommended
#field int dwTemplateCurrentLevel
#field int dwFlags
#endstruct
stdim st, ZONEATTRIBUTES ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize