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

DBIMPLICITSESSION

構造体
サイズx64: 24 バイト / x86: 12 バイトパッキング2

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

フィールド

フィールドサイズx64x86説明
pUnkOuterIUnknown*8/4+0+0集約(aggregation)時の外側IUnknownへのポインタ。集約しない場合はNULL。
piidGUID*8/4+8+4要求するセッションオブジェクトのインターフェイスID(IID)へのポインタ。
pSessionIUnknown*8/4+16+8生成された暗黙セッションオブジェクトのインターフェイスを受け取るポインタ(出力)。

各言語での定義

#include <windows.h>

// DBIMPLICITSESSION  (x64 24 / x86 12 バイト)
#pragma pack(push, 2)
typedef struct DBIMPLICITSESSION {
    IUnknown* pUnkOuter;
    GUID* piid;
    IUnknown* pSession;
} DBIMPLICITSESSION;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]
public struct DBIMPLICITSESSION
{
    public IntPtr pUnkOuter;
    public IntPtr piid;
    public IntPtr pSession;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=2, CharSet:=CharSet.Unicode)>
Public Structure DBIMPLICITSESSION
    Public pUnkOuter As IntPtr
    Public piid As IntPtr
    Public pSession As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DBIMPLICITSESSION(ctypes.Structure):
    _pack_ = 2
    _fields_ = [
        ("pUnkOuter", ctypes.c_void_p),
        ("piid", ctypes.c_void_p),
        ("pSession", ctypes.c_void_p),
    ]
#[repr(C, packed(2))]
pub struct DBIMPLICITSESSION {
    pub pUnkOuter: *mut core::ffi::c_void,
    pub piid: *mut core::ffi::c_void,
    pub pSession: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DBIMPLICITSESSION struct {
	pUnkOuter uintptr
	piid uintptr
	pSession uintptr
}
type
  DBIMPLICITSESSION = packed record
    pUnkOuter: Pointer;
    piid: Pointer;
    pSession: Pointer;
  end;
const DBIMPLICITSESSION = extern struct {
    pUnkOuter: ?*anyopaque,
    piid: ?*anyopaque,
    pSession: ?*anyopaque,
};
type
  DBIMPLICITSESSION {.packed.} = object
    pUnkOuter: pointer
    piid: pointer
    pSession: pointer
align(2)
struct DBIMPLICITSESSION
{
    void* pUnkOuter;
    void* piid;
    void* pSession;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DBIMPLICITSESSION サイズ: 12 バイト(x86)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; pUnkOuter : IUnknown* (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; piid : GUID* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; pSession : IUnknown* (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DBIMPLICITSESSION サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; pUnkOuter : IUnknown* (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; piid : GUID* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; pSession : IUnknown* (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DBIMPLICITSESSION, pack=2
    #field intptr pUnkOuter
    #field intptr piid
    #field intptr pSession
#endstruct

stdim st, DBIMPLICITSESSION        ; NSTRUCT 変数を確保