ILLoadFromStreamEx
関数ストリームからPIDLを読み込んで復元する。
シグネチャ
// SHELL32.dll
#include <windows.h>
HRESULT ILLoadFromStreamEx(
IStream* pstm,
ITEMIDLIST** pidl
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pstm | IStream* | in |
| pidl | ITEMIDLIST** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// SHELL32.dll
#include <windows.h>
HRESULT ILLoadFromStreamEx(
IStream* pstm,
ITEMIDLIST** pidl
);[DllImport("SHELL32.dll", ExactSpelling = true)]
static extern int ILLoadFromStreamEx(
IntPtr pstm, // IStream*
IntPtr pidl // ITEMIDLIST** out
);<DllImport("SHELL32.dll", ExactSpelling:=True)>
Public Shared Function ILLoadFromStreamEx(
pstm As IntPtr, ' IStream*
pidl As IntPtr ' ITEMIDLIST** out
) As Integer
End Function' pstm : IStream*
' pidl : ITEMIDLIST** out
Declare PtrSafe Function ILLoadFromStreamEx Lib "shell32" ( _
ByVal pstm As LongPtr, _
ByVal pidl As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ILLoadFromStreamEx = ctypes.windll.shell32.ILLoadFromStreamEx
ILLoadFromStreamEx.restype = ctypes.c_int
ILLoadFromStreamEx.argtypes = [
ctypes.c_void_p, # pstm : IStream*
ctypes.c_void_p, # pidl : ITEMIDLIST** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SHELL32.dll')
ILLoadFromStreamEx = Fiddle::Function.new(
lib['ILLoadFromStreamEx'],
[
Fiddle::TYPE_VOIDP, # pstm : IStream*
Fiddle::TYPE_VOIDP, # pidl : ITEMIDLIST** out
],
Fiddle::TYPE_INT)#[link(name = "shell32")]
extern "system" {
fn ILLoadFromStreamEx(
pstm: *mut core::ffi::c_void, // IStream*
pidl: *mut *mut ITEMIDLIST // ITEMIDLIST** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SHELL32.dll")]
public static extern int ILLoadFromStreamEx(IntPtr pstm, IntPtr pidl);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_ILLoadFromStreamEx' -Namespace Win32 -PassThru
# $api::ILLoadFromStreamEx(pstm, pidl)#uselib "SHELL32.dll"
#func global ILLoadFromStreamEx "ILLoadFromStreamEx" sptr, sptr
; ILLoadFromStreamEx pstm, varptr(pidl) ; 戻り値は stat
; pstm : IStream* -> "sptr"
; pidl : ITEMIDLIST** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "SHELL32.dll" #cfunc global ILLoadFromStreamEx "ILLoadFromStreamEx" sptr, var ; res = ILLoadFromStreamEx(pstm, pidl) ; pstm : IStream* -> "sptr" ; pidl : ITEMIDLIST** out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "SHELL32.dll" #cfunc global ILLoadFromStreamEx "ILLoadFromStreamEx" sptr, sptr ; res = ILLoadFromStreamEx(pstm, varptr(pidl)) ; pstm : IStream* -> "sptr" ; pidl : ITEMIDLIST** out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT ILLoadFromStreamEx(IStream* pstm, ITEMIDLIST** pidl) #uselib "SHELL32.dll" #cfunc global ILLoadFromStreamEx "ILLoadFromStreamEx" intptr, var ; res = ILLoadFromStreamEx(pstm, pidl) ; pstm : IStream* -> "intptr" ; pidl : ITEMIDLIST** out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT ILLoadFromStreamEx(IStream* pstm, ITEMIDLIST** pidl) #uselib "SHELL32.dll" #cfunc global ILLoadFromStreamEx "ILLoadFromStreamEx" intptr, intptr ; res = ILLoadFromStreamEx(pstm, varptr(pidl)) ; pstm : IStream* -> "intptr" ; pidl : ITEMIDLIST** out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
shell32 = windows.NewLazySystemDLL("SHELL32.dll")
procILLoadFromStreamEx = shell32.NewProc("ILLoadFromStreamEx")
)
// pstm (IStream*), pidl (ITEMIDLIST** out)
r1, _, err := procILLoadFromStreamEx.Call(
uintptr(pstm),
uintptr(pidl),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction ILLoadFromStreamEx(
pstm: Pointer; // IStream*
pidl: Pointer // ITEMIDLIST** out
): Integer; stdcall;
external 'SHELL32.dll' name 'ILLoadFromStreamEx';result := DllCall("SHELL32\ILLoadFromStreamEx"
, "Ptr", pstm ; IStream*
, "Ptr", pidl ; ITEMIDLIST** out
, "Int") ; return: HRESULT●ILLoadFromStreamEx(pstm, pidl) = DLL("SHELL32.dll", "int ILLoadFromStreamEx(void*, void*)")
# 呼び出し: ILLoadFromStreamEx(pstm, pidl)
# pstm : IStream* -> "void*"
# pidl : ITEMIDLIST** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。