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

ACTIVATION_CONTEXT_DETAILED_INFORMATION

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

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

フィールド

フィールドサイズx64x86説明
dwFlagsDWORD4+0+0詳細情報に関するフラグ。
ulFormatVersionDWORD4+4+4アクティベーションコンテキストのフォーマットバージョン。
ulAssemblyCountDWORD4+8+8含まれるアセンブリの数。
ulRootManifestPathTypeDWORD4+12+12ルートマニフェストパスの種別を示す値。
ulRootManifestPathCharsDWORD4+16+16ルートマニフェストパスの文字数。
ulRootConfigurationPathTypeDWORD4+20+20ルート構成ファイルパスの種別を示す値。
ulRootConfigurationPathCharsDWORD4+24+24ルート構成ファイルパスの文字数。
ulAppDirPathTypeDWORD4+28+28アプリケーションディレクトリパスの種別を示す値。
ulAppDirPathCharsDWORD4+32+32アプリケーションディレクトリパスの文字数。
lpRootManifestPathLPWSTR8/4+40+36ルートマニフェストのパス文字列へのポインタ。
lpRootConfigurationPathLPWSTR8/4+48+40ルート構成ファイルのパス文字列へのポインタ。
lpAppDirPathLPWSTR8/4+56+44アプリケーションディレクトリのパス文字列へのポインタ。

各言語での定義

#include <windows.h>

// ACTIVATION_CONTEXT_DETAILED_INFORMATION  (x64 64 / x86 48 バイト)
typedef struct ACTIVATION_CONTEXT_DETAILED_INFORMATION {
    DWORD dwFlags;
    DWORD ulFormatVersion;
    DWORD ulAssemblyCount;
    DWORD ulRootManifestPathType;
    DWORD ulRootManifestPathChars;
    DWORD ulRootConfigurationPathType;
    DWORD ulRootConfigurationPathChars;
    DWORD ulAppDirPathType;
    DWORD ulAppDirPathChars;
    LPWSTR lpRootManifestPath;
    LPWSTR lpRootConfigurationPath;
    LPWSTR lpAppDirPath;
} ACTIVATION_CONTEXT_DETAILED_INFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ACTIVATION_CONTEXT_DETAILED_INFORMATION
{
    public uint dwFlags;
    public uint ulFormatVersion;
    public uint ulAssemblyCount;
    public uint ulRootManifestPathType;
    public uint ulRootManifestPathChars;
    public uint ulRootConfigurationPathType;
    public uint ulRootConfigurationPathChars;
    public uint ulAppDirPathType;
    public uint ulAppDirPathChars;
    public IntPtr lpRootManifestPath;
    public IntPtr lpRootConfigurationPath;
    public IntPtr lpAppDirPath;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ACTIVATION_CONTEXT_DETAILED_INFORMATION
    Public dwFlags As UInteger
    Public ulFormatVersion As UInteger
    Public ulAssemblyCount As UInteger
    Public ulRootManifestPathType As UInteger
    Public ulRootManifestPathChars As UInteger
    Public ulRootConfigurationPathType As UInteger
    Public ulRootConfigurationPathChars As UInteger
    Public ulAppDirPathType As UInteger
    Public ulAppDirPathChars As UInteger
    Public lpRootManifestPath As IntPtr
    Public lpRootConfigurationPath As IntPtr
    Public lpAppDirPath As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class ACTIVATION_CONTEXT_DETAILED_INFORMATION(ctypes.Structure):
    _fields_ = [
        ("dwFlags", wintypes.DWORD),
        ("ulFormatVersion", wintypes.DWORD),
        ("ulAssemblyCount", wintypes.DWORD),
        ("ulRootManifestPathType", wintypes.DWORD),
        ("ulRootManifestPathChars", wintypes.DWORD),
        ("ulRootConfigurationPathType", wintypes.DWORD),
        ("ulRootConfigurationPathChars", wintypes.DWORD),
        ("ulAppDirPathType", wintypes.DWORD),
        ("ulAppDirPathChars", wintypes.DWORD),
        ("lpRootManifestPath", ctypes.c_void_p),
        ("lpRootConfigurationPath", ctypes.c_void_p),
        ("lpAppDirPath", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct ACTIVATION_CONTEXT_DETAILED_INFORMATION {
    pub dwFlags: u32,
    pub ulFormatVersion: u32,
    pub ulAssemblyCount: u32,
    pub ulRootManifestPathType: u32,
    pub ulRootManifestPathChars: u32,
    pub ulRootConfigurationPathType: u32,
    pub ulRootConfigurationPathChars: u32,
    pub ulAppDirPathType: u32,
    pub ulAppDirPathChars: u32,
    pub lpRootManifestPath: *mut core::ffi::c_void,
    pub lpRootConfigurationPath: *mut core::ffi::c_void,
    pub lpAppDirPath: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type ACTIVATION_CONTEXT_DETAILED_INFORMATION struct {
	dwFlags uint32
	ulFormatVersion uint32
	ulAssemblyCount uint32
	ulRootManifestPathType uint32
	ulRootManifestPathChars uint32
	ulRootConfigurationPathType uint32
	ulRootConfigurationPathChars uint32
	ulAppDirPathType uint32
	ulAppDirPathChars uint32
	lpRootManifestPath uintptr
	lpRootConfigurationPath uintptr
	lpAppDirPath uintptr
}
type
  ACTIVATION_CONTEXT_DETAILED_INFORMATION = record
    dwFlags: DWORD;
    ulFormatVersion: DWORD;
    ulAssemblyCount: DWORD;
    ulRootManifestPathType: DWORD;
    ulRootManifestPathChars: DWORD;
    ulRootConfigurationPathType: DWORD;
    ulRootConfigurationPathChars: DWORD;
    ulAppDirPathType: DWORD;
    ulAppDirPathChars: DWORD;
    lpRootManifestPath: Pointer;
    lpRootConfigurationPath: Pointer;
    lpAppDirPath: Pointer;
  end;
const ACTIVATION_CONTEXT_DETAILED_INFORMATION = extern struct {
    dwFlags: u32,
    ulFormatVersion: u32,
    ulAssemblyCount: u32,
    ulRootManifestPathType: u32,
    ulRootManifestPathChars: u32,
    ulRootConfigurationPathType: u32,
    ulRootConfigurationPathChars: u32,
    ulAppDirPathType: u32,
    ulAppDirPathChars: u32,
    lpRootManifestPath: ?*anyopaque,
    lpRootConfigurationPath: ?*anyopaque,
    lpAppDirPath: ?*anyopaque,
};
type
  ACTIVATION_CONTEXT_DETAILED_INFORMATION {.bycopy.} = object
    dwFlags: uint32
    ulFormatVersion: uint32
    ulAssemblyCount: uint32
    ulRootManifestPathType: uint32
    ulRootManifestPathChars: uint32
    ulRootConfigurationPathType: uint32
    ulRootConfigurationPathChars: uint32
    ulAppDirPathType: uint32
    ulAppDirPathChars: uint32
    lpRootManifestPath: pointer
    lpRootConfigurationPath: pointer
    lpAppDirPath: pointer
struct ACTIVATION_CONTEXT_DETAILED_INFORMATION
{
    uint dwFlags;
    uint ulFormatVersion;
    uint ulAssemblyCount;
    uint ulRootManifestPathType;
    uint ulRootManifestPathChars;
    uint ulRootConfigurationPathType;
    uint ulRootConfigurationPathChars;
    uint ulAppDirPathType;
    uint ulAppDirPathChars;
    void* lpRootManifestPath;
    void* lpRootConfigurationPath;
    void* lpAppDirPath;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; ACTIVATION_CONTEXT_DETAILED_INFORMATION サイズ: 48 バイト(x86)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ulFormatVersion : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ulAssemblyCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ulRootManifestPathType : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ulRootManifestPathChars : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ulRootConfigurationPathType : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ulRootConfigurationPathChars : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ulAppDirPathType : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ulAppDirPathChars : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; lpRootManifestPath : LPWSTR (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; lpRootConfigurationPath : LPWSTR (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; lpAppDirPath : LPWSTR (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ACTIVATION_CONTEXT_DETAILED_INFORMATION サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ulFormatVersion : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ulAssemblyCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ulRootManifestPathType : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ulRootManifestPathChars : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ulRootConfigurationPathType : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ulRootConfigurationPathChars : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ulAppDirPathType : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ulAppDirPathChars : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; lpRootManifestPath : LPWSTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; lpRootConfigurationPath : LPWSTR (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; lpAppDirPath : LPWSTR (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ACTIVATION_CONTEXT_DETAILED_INFORMATION
    #field int dwFlags
    #field int ulFormatVersion
    #field int ulAssemblyCount
    #field int ulRootManifestPathType
    #field int ulRootManifestPathChars
    #field int ulRootConfigurationPathType
    #field int ulRootConfigurationPathChars
    #field int ulAppDirPathType
    #field int ulAppDirPathChars
    #field intptr lpRootManifestPath
    #field intptr lpRootConfigurationPath
    #field intptr lpAppDirPath
#endstruct

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