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

StgIsStorageILockBytes

関数
ILockBytesが複合ドキュメントを含むかどうかを判定する。
DLLOLE32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

HRESULT StgIsStorageILockBytes(
    ILockBytes* plkbyt
);

パラメーター

名前方向
plkbytILockBytes*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

StgIsStorageILockBytes = ctypes.windll.ole32.StgIsStorageILockBytes
StgIsStorageILockBytes.restype = ctypes.c_int
StgIsStorageILockBytes.argtypes = [
    ctypes.c_void_p,  # plkbyt : ILockBytes*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	ole32 = windows.NewLazySystemDLL("OLE32.dll")
	procStgIsStorageILockBytes = ole32.NewProc("StgIsStorageILockBytes")
)

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