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

CLSIDDATA

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

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

フィールド

フィールドサイズx64x86説明
m_clsidGUID16+0+0対象コンポーネントのクラスID(CLSID)。
m_cReferencesDWORD4+16+16現在の参照数。
m_cBoundDWORD4+20+20バインド済みオブジェクトの数。
m_cPooledDWORD4+24+24プール内に保持されているオブジェクト数。
m_cInCallDWORD4+28+28現在呼び出し処理中のオブジェクト数。
m_dwRespTimeDWORD4+32+32平均応答時間(ミリ秒)。
m_cCallsCompletedDWORD4+36+36完了した呼び出し回数。
m_cCallsFailedDWORD4+40+40失敗した呼び出し回数。

各言語での定義

#include <windows.h>

// CLSIDDATA  (x64 44 / x86 44 バイト)
typedef struct CLSIDDATA {
    GUID m_clsid;
    DWORD m_cReferences;
    DWORD m_cBound;
    DWORD m_cPooled;
    DWORD m_cInCall;
    DWORD m_dwRespTime;
    DWORD m_cCallsCompleted;
    DWORD m_cCallsFailed;
} CLSIDDATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLSIDDATA
{
    public Guid m_clsid;
    public uint m_cReferences;
    public uint m_cBound;
    public uint m_cPooled;
    public uint m_cInCall;
    public uint m_dwRespTime;
    public uint m_cCallsCompleted;
    public uint m_cCallsFailed;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLSIDDATA
    Public m_clsid As Guid
    Public m_cReferences As UInteger
    Public m_cBound As UInteger
    Public m_cPooled As UInteger
    Public m_cInCall As UInteger
    Public m_dwRespTime As UInteger
    Public m_cCallsCompleted As UInteger
    Public m_cCallsFailed As UInteger
End Structure
import ctypes
from ctypes import wintypes

class CLSIDDATA(ctypes.Structure):
    _fields_ = [
        ("m_clsid", GUID),
        ("m_cReferences", wintypes.DWORD),
        ("m_cBound", wintypes.DWORD),
        ("m_cPooled", wintypes.DWORD),
        ("m_cInCall", wintypes.DWORD),
        ("m_dwRespTime", wintypes.DWORD),
        ("m_cCallsCompleted", wintypes.DWORD),
        ("m_cCallsFailed", wintypes.DWORD),
    ]
#[repr(C)]
pub struct CLSIDDATA {
    pub m_clsid: GUID,
    pub m_cReferences: u32,
    pub m_cBound: u32,
    pub m_cPooled: u32,
    pub m_cInCall: u32,
    pub m_dwRespTime: u32,
    pub m_cCallsCompleted: u32,
    pub m_cCallsFailed: u32,
}
import "golang.org/x/sys/windows"

type CLSIDDATA struct {
	m_clsid windows.GUID
	m_cReferences uint32
	m_cBound uint32
	m_cPooled uint32
	m_cInCall uint32
	m_dwRespTime uint32
	m_cCallsCompleted uint32
	m_cCallsFailed uint32
}
type
  CLSIDDATA = record
    m_clsid: TGUID;
    m_cReferences: DWORD;
    m_cBound: DWORD;
    m_cPooled: DWORD;
    m_cInCall: DWORD;
    m_dwRespTime: DWORD;
    m_cCallsCompleted: DWORD;
    m_cCallsFailed: DWORD;
  end;
const CLSIDDATA = extern struct {
    m_clsid: GUID,
    m_cReferences: u32,
    m_cBound: u32,
    m_cPooled: u32,
    m_cInCall: u32,
    m_dwRespTime: u32,
    m_cCallsCompleted: u32,
    m_cCallsFailed: u32,
};
type
  CLSIDDATA {.bycopy.} = object
    m_clsid: GUID
    m_cReferences: uint32
    m_cBound: uint32
    m_cPooled: uint32
    m_cInCall: uint32
    m_dwRespTime: uint32
    m_cCallsCompleted: uint32
    m_cCallsFailed: uint32
struct CLSIDDATA
{
    GUID m_clsid;
    uint m_cReferences;
    uint m_cBound;
    uint m_cPooled;
    uint m_cInCall;
    uint m_dwRespTime;
    uint m_cCallsCompleted;
    uint m_cCallsFailed;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLSIDDATA サイズ: 44 バイト(x64)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; m_clsid : GUID (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; m_cReferences : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; m_cBound : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; m_cPooled : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; m_cInCall : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; m_dwRespTime : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; m_cCallsCompleted : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; m_cCallsFailed : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※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 CLSIDDATA
    #field GUID m_clsid
    #field int m_cReferences
    #field int m_cBound
    #field int m_cPooled
    #field int m_cInCall
    #field int m_dwRespTime
    #field int m_cCallsCompleted
    #field int m_cCallsFailed
#endstruct

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