ホーム › UI.Shell.PropertiesSystem › PSPropertyBag_ReadStream
PSPropertyBag_ReadStream
関数プロパティバッグからストリームを読み取る。
シグネチャ
// PROPSYS.dll
#include <windows.h>
HRESULT PSPropertyBag_ReadStream(
IPropertyBag* propBag,
LPCWSTR propName,
IStream** value
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| propBag | IPropertyBag* | in |
| propName | LPCWSTR | in |
| value | IStream** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// PROPSYS.dll
#include <windows.h>
HRESULT PSPropertyBag_ReadStream(
IPropertyBag* propBag,
LPCWSTR propName,
IStream** value
);[DllImport("PROPSYS.dll", ExactSpelling = true)]
static extern int PSPropertyBag_ReadStream(
IntPtr propBag, // IPropertyBag*
[MarshalAs(UnmanagedType.LPWStr)] string propName, // LPCWSTR
IntPtr value // IStream** out
);<DllImport("PROPSYS.dll", ExactSpelling:=True)>
Public Shared Function PSPropertyBag_ReadStream(
propBag As IntPtr, ' IPropertyBag*
<MarshalAs(UnmanagedType.LPWStr)> propName As String, ' LPCWSTR
value As IntPtr ' IStream** out
) As Integer
End Function' propBag : IPropertyBag*
' propName : LPCWSTR
' value : IStream** out
Declare PtrSafe Function PSPropertyBag_ReadStream Lib "propsys" ( _
ByVal propBag As LongPtr, _
ByVal propName As LongPtr, _
ByVal value As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
PSPropertyBag_ReadStream = ctypes.windll.propsys.PSPropertyBag_ReadStream
PSPropertyBag_ReadStream.restype = ctypes.c_int
PSPropertyBag_ReadStream.argtypes = [
ctypes.c_void_p, # propBag : IPropertyBag*
wintypes.LPCWSTR, # propName : LPCWSTR
ctypes.c_void_p, # value : IStream** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('PROPSYS.dll')
PSPropertyBag_ReadStream = Fiddle::Function.new(
lib['PSPropertyBag_ReadStream'],
[
Fiddle::TYPE_VOIDP, # propBag : IPropertyBag*
Fiddle::TYPE_VOIDP, # propName : LPCWSTR
Fiddle::TYPE_VOIDP, # value : IStream** out
],
Fiddle::TYPE_INT)#[link(name = "propsys")]
extern "system" {
fn PSPropertyBag_ReadStream(
propBag: *mut core::ffi::c_void, // IPropertyBag*
propName: *const u16, // LPCWSTR
value: *mut *mut core::ffi::c_void // IStream** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("PROPSYS.dll")]
public static extern int PSPropertyBag_ReadStream(IntPtr propBag, [MarshalAs(UnmanagedType.LPWStr)] string propName, IntPtr value);
"@
$api = Add-Type -MemberDefinition $sig -Name 'PROPSYS_PSPropertyBag_ReadStream' -Namespace Win32 -PassThru
# $api::PSPropertyBag_ReadStream(propBag, propName, value)#uselib "PROPSYS.dll"
#func global PSPropertyBag_ReadStream "PSPropertyBag_ReadStream" sptr, sptr, sptr
; PSPropertyBag_ReadStream propBag, propName, value ; 戻り値は stat
; propBag : IPropertyBag* -> "sptr"
; propName : LPCWSTR -> "sptr"
; value : IStream** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "PROPSYS.dll"
#cfunc global PSPropertyBag_ReadStream "PSPropertyBag_ReadStream" sptr, wstr, sptr
; res = PSPropertyBag_ReadStream(propBag, propName, value)
; propBag : IPropertyBag* -> "sptr"
; propName : LPCWSTR -> "wstr"
; value : IStream** out -> "sptr"; HRESULT PSPropertyBag_ReadStream(IPropertyBag* propBag, LPCWSTR propName, IStream** value)
#uselib "PROPSYS.dll"
#cfunc global PSPropertyBag_ReadStream "PSPropertyBag_ReadStream" intptr, wstr, intptr
; res = PSPropertyBag_ReadStream(propBag, propName, value)
; propBag : IPropertyBag* -> "intptr"
; propName : LPCWSTR -> "wstr"
; value : IStream** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
propsys = windows.NewLazySystemDLL("PROPSYS.dll")
procPSPropertyBag_ReadStream = propsys.NewProc("PSPropertyBag_ReadStream")
)
// propBag (IPropertyBag*), propName (LPCWSTR), value (IStream** out)
r1, _, err := procPSPropertyBag_ReadStream.Call(
uintptr(propBag),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(propName))),
uintptr(value),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction PSPropertyBag_ReadStream(
propBag: Pointer; // IPropertyBag*
propName: PWideChar; // LPCWSTR
value: Pointer // IStream** out
): Integer; stdcall;
external 'PROPSYS.dll' name 'PSPropertyBag_ReadStream';result := DllCall("PROPSYS\PSPropertyBag_ReadStream"
, "Ptr", propBag ; IPropertyBag*
, "WStr", propName ; LPCWSTR
, "Ptr", value ; IStream** out
, "Int") ; return: HRESULT●PSPropertyBag_ReadStream(propBag, propName, value) = DLL("PROPSYS.dll", "int PSPropertyBag_ReadStream(void*, char*, void*)")
# 呼び出し: PSPropertyBag_ReadStream(propBag, propName, value)
# propBag : IPropertyBag* -> "void*"
# propName : LPCWSTR -> "char*"
# value : IStream** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。