Win32 API 日本語リファレンス
ホームSecurity.NetworkAccessProtection › IsolationInfo

IsolationInfo

構造体
サイズx64: 32 バイト / x86: 20 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
isolationStateIsolationState4+0+0マシンの分離状態を格納する IsolationState 値です。
probEndTimeFILETIME8+4+4マシンが保護観察 (probation) 状態から解除される時刻を格納する ProbationTime 値です。
failureUrlCountedString16/8+16+12失敗した場合に移動先となる URL を格納する CountedString 値です。

公式ドキュメント

注意 ネットワーク アクセス保護 (Network Access Protection) プラットフォームは、Windows 10 以降では利用できません
IsolationInfo 構造体は、マシンまたは接続の分離状態を定義します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// FILETIME  (x64 8 / x86 8 バイト)
typedef struct FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
} FILETIME;

// CountedString  (x64 16 / x86 8 バイト)
typedef struct CountedString {
    WORD length;
    LPWSTR string;
} CountedString;

// IsolationInfo  (x64 32 / x86 20 バイト)
typedef struct IsolationInfo {
    IsolationState isolationState;
    FILETIME probEndTime;
    CountedString failureUrl;
} IsolationInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
    public uint dwLowDateTime;
    public uint dwHighDateTime;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CountedString
{
    public ushort length;
    public IntPtr string;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IsolationInfo
{
    public int isolationState;
    public FILETIME probEndTime;
    public CountedString failureUrl;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILETIME
    Public dwLowDateTime As UInteger
    Public dwHighDateTime As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CountedString
    Public length As UShort
    Public string As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IsolationInfo
    Public isolationState As Integer
    Public probEndTime As FILETIME
    Public failureUrl As CountedString
End Structure
import ctypes
from ctypes import wintypes

class FILETIME(ctypes.Structure):
    _fields_ = [
        ("dwLowDateTime", wintypes.DWORD),
        ("dwHighDateTime", wintypes.DWORD),
    ]

class CountedString(ctypes.Structure):
    _fields_ = [
        ("length", ctypes.c_ushort),
        ("string", ctypes.c_void_p),
    ]

class IsolationInfo(ctypes.Structure):
    _fields_ = [
        ("isolationState", ctypes.c_int),
        ("probEndTime", FILETIME),
        ("failureUrl", CountedString),
    ]
#[repr(C)]
pub struct FILETIME {
    pub dwLowDateTime: u32,
    pub dwHighDateTime: u32,
}

#[repr(C)]
pub struct CountedString {
    pub length: u16,
    pub string: *mut core::ffi::c_void,
}

#[repr(C)]
pub struct IsolationInfo {
    pub isolationState: i32,
    pub probEndTime: FILETIME,
    pub failureUrl: CountedString,
}
import "golang.org/x/sys/windows"

type FILETIME struct {
	dwLowDateTime uint32
	dwHighDateTime uint32
}

type CountedString struct {
	length uint16
	string uintptr
}

type IsolationInfo struct {
	isolationState int32
	probEndTime FILETIME
	failureUrl CountedString
}
type
  FILETIME = record
    dwLowDateTime: DWORD;
    dwHighDateTime: DWORD;
  end;

  CountedString = record
    length: Word;
    string: Pointer;
  end;

  IsolationInfo = record
    isolationState: Integer;
    probEndTime: FILETIME;
    failureUrl: CountedString;
  end;
const FILETIME = extern struct {
    dwLowDateTime: u32,
    dwHighDateTime: u32,
};

const CountedString = extern struct {
    length: u16,
    string: ?*anyopaque,
};

const IsolationInfo = extern struct {
    isolationState: i32,
    probEndTime: FILETIME,
    failureUrl: CountedString,
};
type
  FILETIME {.bycopy.} = object
    dwLowDateTime: uint32
    dwHighDateTime: uint32

  CountedString {.bycopy.} = object
    length: uint16
    string: pointer

  IsolationInfo {.bycopy.} = object
    isolationState: int32
    probEndTime: FILETIME
    failureUrl: CountedString
struct FILETIME
{
    uint dwLowDateTime;
    uint dwHighDateTime;
}

struct CountedString
{
    ushort length;
    void* string;
}

struct IsolationInfo
{
    int isolationState;
    FILETIME probEndTime;
    CountedString failureUrl;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; IsolationInfo サイズ: 20 バイト(x86)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; isolationState : IsolationState (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; probEndTime : FILETIME (+4, 8byte)  varptr(st)+4 を基点に操作(8byte:入れ子/配列)
; failureUrl : CountedString (+12, 8byte)  varptr(st)+12 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IsolationInfo サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; isolationState : IsolationState (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; probEndTime : FILETIME (+4, 8byte)  varptr(st)+4 を基点に操作(8byte:入れ子/配列)
; failureUrl : CountedString (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FILETIME
    #field int dwLowDateTime
    #field int dwHighDateTime
#endstruct

#defstruct global CountedString
    #field short length
    #field intptr string
#endstruct

#defstruct global IsolationInfo
    #field int isolationState
    #field FILETIME probEndTime
    #field CountedString failureUrl
#endstruct

stdim st, IsolationInfo        ; NSTRUCT 変数を確保
st->isolationState = 100
mes "isolationState=" + st->isolationState