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

FPropCompareProp

関数
二つのプロパティ値を指定の関係演算子で比較する。
DLLMAPI32.dll呼出規約winapi

シグネチャ

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

BOOL FPropCompareProp(
    SPropValue* lpSPropValue1,
    DWORD ulRelOp,
    SPropValue* lpSPropValue2
);

パラメーター

名前方向
lpSPropValue1SPropValue*inout
ulRelOpDWORDin
lpSPropValue2SPropValue*inout

戻り値の型: BOOL

各言語での呼び出し定義

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

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

FPropCompareProp = ctypes.windll.mapi32.FPropCompareProp
FPropCompareProp.restype = wintypes.BOOL
FPropCompareProp.argtypes = [
    ctypes.c_void_p,  # lpSPropValue1 : SPropValue* in/out
    wintypes.DWORD,  # ulRelOp : DWORD
    ctypes.c_void_p,  # lpSPropValue2 : SPropValue* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mapi32 = windows.NewLazySystemDLL("MAPI32.dll")
	procFPropCompareProp = mapi32.NewProc("FPropCompareProp")
)

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