ホーム › System.ApplicationInstallationAndServicing › ACTCTXW
ACTCTXW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| dwFlags | DWORD | 4 | +4 | +4 | 有効なメンバを示すフラグ。ACTCTX_FLAG_系を組み合わせる。 |
| lpSource | LPWSTR | 8/4 | +8 | +8 | マニフェストファイルまたはPEモジュールのパス文字列(Unicode)。 |
| wProcessorArchitecture | WORD | 2 | +16 | +12 | 対象プロセッサアーキテクチャ。dwFlags指定時のみ有効。 |
| wLangId | WORD | 2 | +18 | +14 | リソース言語ID。dwFlags指定時のみ有効。 |
| lpAssemblyDirectory | LPWSTR | 8/4 | +24 | +16 | アセンブリ検索の基準ディレクトリ文字列。NULL可。 |
| lpResourceName | LPWSTR | 8/4 | +32 | +20 | PE内のマニフェストリソース名。リソースID指定も可。 |
| lpApplicationName | LPWSTR | 8/4 | +40 | +24 | アプリケーション名文字列。NULL可。 |
| hModule | HMODULE | 8/4 | +48 | +28 | リソースを含むモジュールのハンドル。dwFlags指定時のみ有効。 |
各言語での定義
#include <windows.h>
// ACTCTXW (x64 56 / x86 32 バイト)
typedef struct ACTCTXW {
DWORD cbSize;
DWORD dwFlags;
LPWSTR lpSource;
WORD wProcessorArchitecture;
WORD wLangId;
LPWSTR lpAssemblyDirectory;
LPWSTR lpResourceName;
LPWSTR lpApplicationName;
HMODULE hModule;
} ACTCTXW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ACTCTXW
{
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 ACTCTXW
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 Structureimport ctypes
from ctypes import wintypes
class ACTCTXW(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 ACTCTXW {
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 ACTCTXW struct {
cbSize uint32
dwFlags uint32
lpSource uintptr
wProcessorArchitecture uint16
wLangId uint16
lpAssemblyDirectory uintptr
lpResourceName uintptr
lpApplicationName uintptr
hModule uintptr
}type
ACTCTXW = record
cbSize: DWORD;
dwFlags: DWORD;
lpSource: Pointer;
wProcessorArchitecture: Word;
wLangId: Word;
lpAssemblyDirectory: Pointer;
lpResourceName: Pointer;
lpApplicationName: Pointer;
hModule: Pointer;
end;const ACTCTXW = extern struct {
cbSize: u32,
dwFlags: u32,
lpSource: ?*anyopaque,
wProcessorArchitecture: u16,
wLangId: u16,
lpAssemblyDirectory: ?*anyopaque,
lpResourceName: ?*anyopaque,
lpApplicationName: ?*anyopaque,
hModule: ?*anyopaque,
};type
ACTCTXW {.bycopy.} = object
cbSize: uint32
dwFlags: uint32
lpSource: pointer
wProcessorArchitecture: uint16
wLangId: uint16
lpAssemblyDirectory: pointer
lpResourceName: pointer
lpApplicationName: pointer
hModule: pointerstruct ACTCTXW
{
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 レイアウト)
; ACTCTXW サイズ: 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 : LPWSTR (+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 : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lpResourceName : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; lpApplicationName : LPWSTR (+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 レイアウト)
; ACTCTXW サイズ: 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 : LPWSTR (+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 : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; lpResourceName : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; lpApplicationName : LPWSTR (+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 ACTCTXW
#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, ACTCTXW ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize