Win32 API 日本語リファレンス
ホームSystem.WindowsProgramming › SYSTEM_CODEINTEGRITY_INFORMATION

SYSTEM_CODEINTEGRITY_INFORMATION

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

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

フィールド

フィールドサイズx64x86説明
LengthDWORD4+0+0この構造体のサイズ(バイト)。
CodeIntegrityOptionsDWORD4+4+4コード整合性(Code Integrity)の有効化オプションを示すフラグ。

各言語での定義

#include <windows.h>

// SYSTEM_CODEINTEGRITY_INFORMATION  (x64 8 / x86 8 バイト)
typedef struct SYSTEM_CODEINTEGRITY_INFORMATION {
    DWORD Length;
    DWORD CodeIntegrityOptions;
} SYSTEM_CODEINTEGRITY_INFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYSTEM_CODEINTEGRITY_INFORMATION
{
    public uint Length;
    public uint CodeIntegrityOptions;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYSTEM_CODEINTEGRITY_INFORMATION
    Public Length As UInteger
    Public CodeIntegrityOptions As UInteger
End Structure
import ctypes
from ctypes import wintypes

class SYSTEM_CODEINTEGRITY_INFORMATION(ctypes.Structure):
    _fields_ = [
        ("Length", wintypes.DWORD),
        ("CodeIntegrityOptions", wintypes.DWORD),
    ]
#[repr(C)]
pub struct SYSTEM_CODEINTEGRITY_INFORMATION {
    pub Length: u32,
    pub CodeIntegrityOptions: u32,
}
import "golang.org/x/sys/windows"

type SYSTEM_CODEINTEGRITY_INFORMATION struct {
	Length uint32
	CodeIntegrityOptions uint32
}
type
  SYSTEM_CODEINTEGRITY_INFORMATION = record
    Length: DWORD;
    CodeIntegrityOptions: DWORD;
  end;
const SYSTEM_CODEINTEGRITY_INFORMATION = extern struct {
    Length: u32,
    CodeIntegrityOptions: u32,
};
type
  SYSTEM_CODEINTEGRITY_INFORMATION {.bycopy.} = object
    Length: uint32
    CodeIntegrityOptions: uint32
struct SYSTEM_CODEINTEGRITY_INFORMATION
{
    uint Length;
    uint CodeIntegrityOptions;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SYSTEM_CODEINTEGRITY_INFORMATION サイズ: 8 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; Length : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; CodeIntegrityOptions : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SYSTEM_CODEINTEGRITY_INFORMATION
    #field int Length
    #field int CodeIntegrityOptions
#endstruct

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