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

UlPropSize

関数
プロパティ値が占めるバイトサイズを計算して返す。
DLLMAPI32.dll呼出規約winapi

シグネチャ

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

DWORD UlPropSize(
    SPropValue* lpSPropValue
);

パラメーター

名前方向
lpSPropValueSPropValue*inout

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD UlPropSize(
    SPropValue* lpSPropValue
);
[DllImport("MAPI32.dll", ExactSpelling = true)]
static extern uint UlPropSize(
    IntPtr lpSPropValue   // SPropValue* in/out
);
<DllImport("MAPI32.dll", ExactSpelling:=True)>
Public Shared Function UlPropSize(
    lpSPropValue As IntPtr   ' SPropValue* in/out
) As UInteger
End Function
' lpSPropValue : SPropValue* in/out
Declare PtrSafe Function UlPropSize Lib "mapi32" ( _
    ByVal lpSPropValue As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

UlPropSize = ctypes.windll.mapi32.UlPropSize
UlPropSize.restype = wintypes.DWORD
UlPropSize.argtypes = [
    ctypes.c_void_p,  # lpSPropValue : SPropValue* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MAPI32.dll')
UlPropSize = Fiddle::Function.new(
  lib['UlPropSize'],
  [
    Fiddle::TYPE_VOIDP,  # lpSPropValue : SPropValue* in/out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "mapi32")]
extern "system" {
    fn UlPropSize(
        lpSPropValue: *mut SPropValue  // SPropValue* in/out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MAPI32.dll")]
public static extern uint UlPropSize(IntPtr lpSPropValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MAPI32_UlPropSize' -Namespace Win32 -PassThru
# $api::UlPropSize(lpSPropValue)
#uselib "MAPI32.dll"
#func global UlPropSize "UlPropSize" sptr
; UlPropSize varptr(lpSPropValue)   ; 戻り値は stat
; lpSPropValue : SPropValue* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MAPI32.dll"
#cfunc global UlPropSize "UlPropSize" var
; res = UlPropSize(lpSPropValue)
; lpSPropValue : SPropValue* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD UlPropSize(SPropValue* lpSPropValue)
#uselib "MAPI32.dll"
#cfunc global UlPropSize "UlPropSize" var
; res = UlPropSize(lpSPropValue)
; lpSPropValue : SPropValue* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mapi32 = windows.NewLazySystemDLL("MAPI32.dll")
	procUlPropSize = mapi32.NewProc("UlPropSize")
)

// lpSPropValue (SPropValue* in/out)
r1, _, err := procUlPropSize.Call(
	uintptr(lpSPropValue),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function UlPropSize(
  lpSPropValue: Pointer   // SPropValue* in/out
): DWORD; stdcall;
  external 'MAPI32.dll' name 'UlPropSize';
result := DllCall("MAPI32\UlPropSize"
    , "Ptr", lpSPropValue   ; SPropValue* in/out
    , "UInt")   ; return: DWORD
●UlPropSize(lpSPropValue) = DLL("MAPI32.dll", "dword UlPropSize(void*)")
# 呼び出し: UlPropSize(lpSPropValue)
# lpSPropValue : SPropValue* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。