Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Debug › IMAGE_LOAD_CONFIG_CODE_INTEGRITY

IMAGE_LOAD_CONFIG_CODE_INTEGRITY

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

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

フィールド

フィールドサイズx64x86説明
FlagsWORD2+0+0コード整合性のフラグ。予約。
CatalogWORD2+2+2カタログ番号。
CatalogOffsetDWORD4+4+4カタログへのオフセット。
ReservedDWORD4+8+8予約フィールド。アラインメント用。

各言語での定義

#include <windows.h>

// IMAGE_LOAD_CONFIG_CODE_INTEGRITY  (x64 12 / x86 12 バイト)
typedef struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY {
    WORD Flags;
    WORD Catalog;
    DWORD CatalogOffset;
    DWORD Reserved;
} IMAGE_LOAD_CONFIG_CODE_INTEGRITY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY
{
    public ushort Flags;
    public ushort Catalog;
    public uint CatalogOffset;
    public uint Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IMAGE_LOAD_CONFIG_CODE_INTEGRITY
    Public Flags As UShort
    Public Catalog As UShort
    Public CatalogOffset As UInteger
    Public Reserved As UInteger
End Structure
import ctypes
from ctypes import wintypes

class IMAGE_LOAD_CONFIG_CODE_INTEGRITY(ctypes.Structure):
    _fields_ = [
        ("Flags", ctypes.c_ushort),
        ("Catalog", ctypes.c_ushort),
        ("CatalogOffset", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
    ]
#[repr(C)]
pub struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY {
    pub Flags: u16,
    pub Catalog: u16,
    pub CatalogOffset: u32,
    pub Reserved: u32,
}
import "golang.org/x/sys/windows"

type IMAGE_LOAD_CONFIG_CODE_INTEGRITY struct {
	Flags uint16
	Catalog uint16
	CatalogOffset uint32
	Reserved uint32
}
type
  IMAGE_LOAD_CONFIG_CODE_INTEGRITY = record
    Flags: Word;
    Catalog: Word;
    CatalogOffset: DWORD;
    Reserved: DWORD;
  end;
const IMAGE_LOAD_CONFIG_CODE_INTEGRITY = extern struct {
    Flags: u16,
    Catalog: u16,
    CatalogOffset: u32,
    Reserved: u32,
};
type
  IMAGE_LOAD_CONFIG_CODE_INTEGRITY {.bycopy.} = object
    Flags: uint16
    Catalog: uint16
    CatalogOffset: uint32
    Reserved: uint32
struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY
{
    ushort Flags;
    ushort Catalog;
    uint CatalogOffset;
    uint Reserved;
}

HSP用 定義

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

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

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