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

ComponentSummary

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

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

フィールド

フィールドサイズx64x86説明
ApplicationInstanceIdGUID16+0+0コンポーネントをホストするプロセスを一意に識別するアプリケーション インスタンス GUID です。
PartitionIdGUID16+16+16コンポーネントのパーティション ID です。
ApplicationIdGUID16+32+32コンポーネントのアプリケーション ID です。特別な値 {84ac4168-6fe5-4308-a2ed-03688a023c7a} は、これが SWC コンテキストであることを示します。
ClsidGUID16+48+48コンポーネントの CLSID です。
ClassNameLPWSTR8/4+64+64コンポーネントの名前です。通常はコンポーネントの ProgID です (コンポーネントに ProgID が無い場合は、コンポーネントの CLSID の文字列表現)。SWC コンテキストの場合は、そのコンテキストに構成されたコンテキスト名プロパティです。この文字列の領域は呼び出されたメソッドによって割り当てられ、呼び出し元が解放します (詳細については CoTaskMemFree を参照してください)。このメンバーは既定では返されません。このメンバーを返すには、ComponentSummary 構造体を返すメソッドを呼び出すときに GATD_INCLUDE_CLASS_NAME フラグを指定します。
ApplicationNameLPWSTR8/4+72+68COM+ アプリケーションの名前、または SWC コンテキストに構成されたアプリケーション名プロパティです。この文字列の領域は呼び出されたメソッドによって割り当てられ、呼び出し元が解放します (詳細については CoTaskMemFree を参照してください)。このメンバーは既定では返されません。このメンバーを返すには、ComponentSummary 構造体を返すメソッドを呼び出すときに GATD_INCLUDE_APPLICATION_NAME フラグを指定します。

公式ドキュメント

特定のプロセスでホストされる COM+ コンポーネントの概要情報を表します。Services Without Components (SWC) コンテキストを表すこともあります。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// ComponentSummary  (x64 80 / x86 72 バイト)
typedef struct ComponentSummary {
    GUID ApplicationInstanceId;
    GUID PartitionId;
    GUID ApplicationId;
    GUID Clsid;
    LPWSTR ClassName;
    LPWSTR ApplicationName;
} ComponentSummary;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ComponentSummary
{
    public Guid ApplicationInstanceId;
    public Guid PartitionId;
    public Guid ApplicationId;
    public Guid Clsid;
    public IntPtr ClassName;
    public IntPtr ApplicationName;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ComponentSummary
    Public ApplicationInstanceId As Guid
    Public PartitionId As Guid
    Public ApplicationId As Guid
    Public Clsid As Guid
    Public ClassName As IntPtr
    Public ApplicationName As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class ComponentSummary(ctypes.Structure):
    _fields_ = [
        ("ApplicationInstanceId", GUID),
        ("PartitionId", GUID),
        ("ApplicationId", GUID),
        ("Clsid", GUID),
        ("ClassName", ctypes.c_void_p),
        ("ApplicationName", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct ComponentSummary {
    pub ApplicationInstanceId: GUID,
    pub PartitionId: GUID,
    pub ApplicationId: GUID,
    pub Clsid: GUID,
    pub ClassName: *mut core::ffi::c_void,
    pub ApplicationName: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type ComponentSummary struct {
	ApplicationInstanceId windows.GUID
	PartitionId windows.GUID
	ApplicationId windows.GUID
	Clsid windows.GUID
	ClassName uintptr
	ApplicationName uintptr
}
type
  ComponentSummary = record
    ApplicationInstanceId: TGUID;
    PartitionId: TGUID;
    ApplicationId: TGUID;
    Clsid: TGUID;
    ClassName: Pointer;
    ApplicationName: Pointer;
  end;
const ComponentSummary = extern struct {
    ApplicationInstanceId: GUID,
    PartitionId: GUID,
    ApplicationId: GUID,
    Clsid: GUID,
    ClassName: ?*anyopaque,
    ApplicationName: ?*anyopaque,
};
type
  ComponentSummary {.bycopy.} = object
    ApplicationInstanceId: GUID
    PartitionId: GUID
    ApplicationId: GUID
    Clsid: GUID
    ClassName: pointer
    ApplicationName: pointer
struct ComponentSummary
{
    GUID ApplicationInstanceId;
    GUID PartitionId;
    GUID ApplicationId;
    GUID Clsid;
    void* ClassName;
    void* ApplicationName;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; ComponentSummary サイズ: 72 バイト(x86)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; ApplicationInstanceId : GUID (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; PartitionId : GUID (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; ApplicationId : GUID (+32, 16byte)  varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; Clsid : GUID (+48, 16byte)  varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; ClassName : LPWSTR (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; ApplicationName : LPWSTR (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ComponentSummary サイズ: 80 バイト(x64)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; ApplicationInstanceId : GUID (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; PartitionId : GUID (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; ApplicationId : GUID (+32, 16byte)  varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; Clsid : GUID (+48, 16byte)  varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; ClassName : LPWSTR (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; ApplicationName : LPWSTR (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global ComponentSummary
    #field GUID ApplicationInstanceId
    #field GUID PartitionId
    #field GUID ApplicationId
    #field GUID Clsid
    #field intptr ClassName
    #field intptr ApplicationName
#endstruct

stdim st, ComponentSummary        ; NSTRUCT 変数を確保