Win32 API 日本語リファレンス
ホームSystem.Com.StructuredStorage › StgGetIFillLockBytesOnILockBytes

StgGetIFillLockBytesOnILockBytes

関数
ILockBytesを基にIFillLockBytesインターフェイスを取得する。
DLLole32.dll呼出規約winapi

シグネチャ

// ole32.dll
#include <windows.h>

HRESULT StgGetIFillLockBytesOnILockBytes(
    ILockBytes* pilb,
    IFillLockBytes** ppflb
);

パラメーター

名前方向
pilbILockBytes*in
ppflbIFillLockBytes**out

戻り値の型: HRESULT

各言語での呼び出し定義

// ole32.dll
#include <windows.h>

HRESULT StgGetIFillLockBytesOnILockBytes(
    ILockBytes* pilb,
    IFillLockBytes** ppflb
);
[DllImport("ole32.dll", ExactSpelling = true)]
static extern int StgGetIFillLockBytesOnILockBytes(
    IntPtr pilb,   // ILockBytes*
    IntPtr ppflb   // IFillLockBytes** out
);
<DllImport("ole32.dll", ExactSpelling:=True)>
Public Shared Function StgGetIFillLockBytesOnILockBytes(
    pilb As IntPtr,   ' ILockBytes*
    ppflb As IntPtr   ' IFillLockBytes** out
) As Integer
End Function
' pilb : ILockBytes*
' ppflb : IFillLockBytes** out
Declare PtrSafe Function StgGetIFillLockBytesOnILockBytes Lib "ole32" ( _
    ByVal pilb As LongPtr, _
    ByVal ppflb As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

StgGetIFillLockBytesOnILockBytes = ctypes.windll.ole32.StgGetIFillLockBytesOnILockBytes
StgGetIFillLockBytesOnILockBytes.restype = ctypes.c_int
StgGetIFillLockBytesOnILockBytes.argtypes = [
    ctypes.c_void_p,  # pilb : ILockBytes*
    ctypes.c_void_p,  # ppflb : IFillLockBytes** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ole32.dll')
StgGetIFillLockBytesOnILockBytes = Fiddle::Function.new(
  lib['StgGetIFillLockBytesOnILockBytes'],
  [
    Fiddle::TYPE_VOIDP,  # pilb : ILockBytes*
    Fiddle::TYPE_VOIDP,  # ppflb : IFillLockBytes** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "ole32")]
extern "system" {
    fn StgGetIFillLockBytesOnILockBytes(
        pilb: *mut core::ffi::c_void,  // ILockBytes*
        ppflb: *mut *mut core::ffi::c_void  // IFillLockBytes** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ole32.dll")]
public static extern int StgGetIFillLockBytesOnILockBytes(IntPtr pilb, IntPtr ppflb);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ole32_StgGetIFillLockBytesOnILockBytes' -Namespace Win32 -PassThru
# $api::StgGetIFillLockBytesOnILockBytes(pilb, ppflb)
#uselib "ole32.dll"
#func global StgGetIFillLockBytesOnILockBytes "StgGetIFillLockBytesOnILockBytes" sptr, sptr
; StgGetIFillLockBytesOnILockBytes pilb, ppflb   ; 戻り値は stat
; pilb : ILockBytes* -> "sptr"
; ppflb : IFillLockBytes** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ole32.dll"
#cfunc global StgGetIFillLockBytesOnILockBytes "StgGetIFillLockBytesOnILockBytes" sptr, sptr
; res = StgGetIFillLockBytesOnILockBytes(pilb, ppflb)
; pilb : ILockBytes* -> "sptr"
; ppflb : IFillLockBytes** out -> "sptr"
; HRESULT StgGetIFillLockBytesOnILockBytes(ILockBytes* pilb, IFillLockBytes** ppflb)
#uselib "ole32.dll"
#cfunc global StgGetIFillLockBytesOnILockBytes "StgGetIFillLockBytesOnILockBytes" intptr, intptr
; res = StgGetIFillLockBytesOnILockBytes(pilb, ppflb)
; pilb : ILockBytes* -> "intptr"
; ppflb : IFillLockBytes** out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	ole32 = windows.NewLazySystemDLL("ole32.dll")
	procStgGetIFillLockBytesOnILockBytes = ole32.NewProc("StgGetIFillLockBytesOnILockBytes")
)

// pilb (ILockBytes*), ppflb (IFillLockBytes** out)
r1, _, err := procStgGetIFillLockBytesOnILockBytes.Call(
	uintptr(pilb),
	uintptr(ppflb),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function StgGetIFillLockBytesOnILockBytes(
  pilb: Pointer;   // ILockBytes*
  ppflb: Pointer   // IFillLockBytes** out
): Integer; stdcall;
  external 'ole32.dll' name 'StgGetIFillLockBytesOnILockBytes';
result := DllCall("ole32\StgGetIFillLockBytesOnILockBytes"
    , "Ptr", pilb   ; ILockBytes*
    , "Ptr", ppflb   ; IFillLockBytes** out
    , "Int")   ; return: HRESULT
●StgGetIFillLockBytesOnILockBytes(pilb, ppflb) = DLL("ole32.dll", "int StgGetIFillLockBytesOnILockBytes(void*, void*)")
# 呼び出し: StgGetIFillLockBytesOnILockBytes(pilb, ppflb)
# pilb : ILockBytes* -> "void*"
# ppflb : IFillLockBytes** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。