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

ACTCTXA

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のバイトサイズ。
dwFlagsDWORD4+4+4有効なメンバを示すフラグ。ACTCTX_FLAG_系を組み合わせる。
lpSourceLPSTR8/4+8+8マニフェストファイルまたはPEモジュールのパス文字列(ANSI)。
wProcessorArchitectureWORD2+16+12対象プロセッサアーキテクチャ。dwFlags指定時のみ有効。
wLangIdWORD2+18+14リソース言語ID。dwFlags指定時のみ有効。
lpAssemblyDirectoryLPSTR8/4+24+16アセンブリ検索の基準ディレクトリ文字列。NULL可。
lpResourceNameLPSTR8/4+32+20PE内のマニフェストリソース名。リソースID指定も可。
lpApplicationNameLPSTR8/4+40+24アプリケーション名文字列。NULL可。
hModuleHMODULE8/4+48+28リソースを含むモジュールのハンドル。dwFlags指定時のみ有効。

各言語での定義

#include <windows.h>

// ACTCTXA  (x64 56 / x86 32 バイト)
typedef struct ACTCTXA {
    DWORD cbSize;
    DWORD dwFlags;
    LPSTR lpSource;
    WORD wProcessorArchitecture;
    WORD wLangId;
    LPSTR lpAssemblyDirectory;
    LPSTR lpResourceName;
    LPSTR lpApplicationName;
    HMODULE hModule;
} ACTCTXA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ACTCTXA
{
    public uint cbSize;
    public uint dwFlags;
    public IntPtr lpSource;
    public ushort wProcessorArchitecture;
    public ushort wLangId;
    public IntPtr lpAssemblyDirectory;
    public IntPtr lpResourceName;
    public IntPtr lpApplicationName;
    public IntPtr hModule;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ACTCTXA
    Public cbSize As UInteger
    Public dwFlags As UInteger
    Public lpSource As IntPtr
    Public wProcessorArchitecture As UShort
    Public wLangId As UShort
    Public lpAssemblyDirectory As IntPtr
    Public lpResourceName As IntPtr
    Public lpApplicationName As IntPtr
    Public hModule As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class ACTCTXA(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("lpSource", ctypes.c_void_p),
        ("wProcessorArchitecture", ctypes.c_ushort),
        ("wLangId", ctypes.c_ushort),
        ("lpAssemblyDirectory", ctypes.c_void_p),
        ("lpResourceName", ctypes.c_void_p),
        ("lpApplicationName", ctypes.c_void_p),
        ("hModule", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct ACTCTXA {
    pub cbSize: u32,
    pub dwFlags: u32,
    pub lpSource: *mut core::ffi::c_void,
    pub wProcessorArchitecture: u16,
    pub wLangId: u16,
    pub lpAssemblyDirectory: *mut core::ffi::c_void,
    pub lpResourceName: *mut core::ffi::c_void,
    pub lpApplicationName: *mut core::ffi::c_void,
    pub hModule: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type ACTCTXA struct {
	cbSize uint32
	dwFlags uint32
	lpSource uintptr
	wProcessorArchitecture uint16
	wLangId uint16
	lpAssemblyDirectory uintptr
	lpResourceName uintptr
	lpApplicationName uintptr
	hModule uintptr
}
type
  ACTCTXA = record
    cbSize: DWORD;
    dwFlags: DWORD;
    lpSource: Pointer;
    wProcessorArchitecture: Word;
    wLangId: Word;
    lpAssemblyDirectory: Pointer;
    lpResourceName: Pointer;
    lpApplicationName: Pointer;
    hModule: Pointer;
  end;
const ACTCTXA = extern struct {
    cbSize: u32,
    dwFlags: u32,
    lpSource: ?*anyopaque,
    wProcessorArchitecture: u16,
    wLangId: u16,
    lpAssemblyDirectory: ?*anyopaque,
    lpResourceName: ?*anyopaque,
    lpApplicationName: ?*anyopaque,
    hModule: ?*anyopaque,
};
type
  ACTCTXA {.bycopy.} = object
    cbSize: uint32
    dwFlags: uint32
    lpSource: pointer
    wProcessorArchitecture: uint16
    wLangId: uint16
    lpAssemblyDirectory: pointer
    lpResourceName: pointer
    lpApplicationName: pointer
    hModule: pointer
struct ACTCTXA
{
    uint cbSize;
    uint dwFlags;
    void* lpSource;
    ushort wProcessorArchitecture;
    ushort wLangId;
    void* lpAssemblyDirectory;
    void* lpResourceName;
    void* lpApplicationName;
    void* hModule;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; ACTCTXA サイズ: 32 バイト(x86)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; lpSource : LPSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; wProcessorArchitecture : WORD (+12, 2byte)  wpoke st,12,値  /  値 = wpeek(st,12)
; wLangId : WORD (+14, 2byte)  wpoke st,14,値  /  値 = wpeek(st,14)
; lpAssemblyDirectory : LPSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; lpResourceName : LPSTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; lpApplicationName : LPSTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; hModule : HMODULE (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ACTCTXA サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; lpSource : LPSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; wProcessorArchitecture : WORD (+16, 2byte)  wpoke st,16,値  /  値 = wpeek(st,16)
; wLangId : WORD (+18, 2byte)  wpoke st,18,値  /  値 = wpeek(st,18)
; lpAssemblyDirectory : LPSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; lpResourceName : LPSTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; lpApplicationName : LPSTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; hModule : HMODULE (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ACTCTXA
    #field int cbSize
    #field int dwFlags
    #field intptr lpSource
    #field short wProcessorArchitecture
    #field short wLangId
    #field intptr lpAssemblyDirectory
    #field intptr lpResourceName
    #field intptr lpApplicationName
    #field intptr hModule
#endstruct

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