ホーム › System.AddressBook › ScRelocProps
ScRelocProps
関数移動されたプロパティ配列内のポインタを再配置する。
シグネチャ
// MAPI32.dll
#include <windows.h>
INT ScRelocProps(
INT cValues,
SPropValue* lpPropArray,
void* lpvBaseOld,
void* lpvBaseNew,
DWORD* lpcb
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| cValues | INT | in |
| lpPropArray | SPropValue* | inout |
| lpvBaseOld | void* | inout |
| lpvBaseNew | void* | inout |
| lpcb | DWORD* | inout |
戻り値の型: INT
各言語での呼び出し定義
// MAPI32.dll
#include <windows.h>
INT ScRelocProps(
INT cValues,
SPropValue* lpPropArray,
void* lpvBaseOld,
void* lpvBaseNew,
DWORD* lpcb
);[DllImport("MAPI32.dll", ExactSpelling = true)]
static extern int ScRelocProps(
int cValues, // INT
IntPtr lpPropArray, // SPropValue* in/out
IntPtr lpvBaseOld, // void* in/out
IntPtr lpvBaseNew, // void* in/out
ref uint lpcb // DWORD* in/out
);<DllImport("MAPI32.dll", ExactSpelling:=True)>
Public Shared Function ScRelocProps(
cValues As Integer, ' INT
lpPropArray As IntPtr, ' SPropValue* in/out
lpvBaseOld As IntPtr, ' void* in/out
lpvBaseNew As IntPtr, ' void* in/out
ByRef lpcb As UInteger ' DWORD* in/out
) As Integer
End Function' cValues : INT
' lpPropArray : SPropValue* in/out
' lpvBaseOld : void* in/out
' lpvBaseNew : void* in/out
' lpcb : DWORD* in/out
Declare PtrSafe Function ScRelocProps Lib "mapi32" ( _
ByVal cValues As Long, _
ByVal lpPropArray As LongPtr, _
ByVal lpvBaseOld As LongPtr, _
ByVal lpvBaseNew As LongPtr, _
ByRef lpcb As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ScRelocProps = ctypes.windll.mapi32.ScRelocProps
ScRelocProps.restype = ctypes.c_int
ScRelocProps.argtypes = [
ctypes.c_int, # cValues : INT
ctypes.c_void_p, # lpPropArray : SPropValue* in/out
ctypes.POINTER(None), # lpvBaseOld : void* in/out
ctypes.POINTER(None), # lpvBaseNew : void* in/out
ctypes.POINTER(wintypes.DWORD), # lpcb : DWORD* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MAPI32.dll')
ScRelocProps = Fiddle::Function.new(
lib['ScRelocProps'],
[
Fiddle::TYPE_INT, # cValues : INT
Fiddle::TYPE_VOIDP, # lpPropArray : SPropValue* in/out
Fiddle::TYPE_VOIDP, # lpvBaseOld : void* in/out
Fiddle::TYPE_VOIDP, # lpvBaseNew : void* in/out
Fiddle::TYPE_VOIDP, # lpcb : DWORD* in/out
],
Fiddle::TYPE_INT)#[link(name = "mapi32")]
extern "system" {
fn ScRelocProps(
cValues: i32, // INT
lpPropArray: *mut SPropValue, // SPropValue* in/out
lpvBaseOld: *mut (), // void* in/out
lpvBaseNew: *mut (), // void* in/out
lpcb: *mut u32 // DWORD* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MAPI32.dll")]
public static extern int ScRelocProps(int cValues, IntPtr lpPropArray, IntPtr lpvBaseOld, IntPtr lpvBaseNew, ref uint lpcb);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MAPI32_ScRelocProps' -Namespace Win32 -PassThru
# $api::ScRelocProps(cValues, lpPropArray, lpvBaseOld, lpvBaseNew, lpcb)#uselib "MAPI32.dll"
#func global ScRelocProps "ScRelocProps" sptr, sptr, sptr, sptr, sptr
; ScRelocProps cValues, varptr(lpPropArray), lpvBaseOld, lpvBaseNew, varptr(lpcb) ; 戻り値は stat
; cValues : INT -> "sptr"
; lpPropArray : SPropValue* in/out -> "sptr"
; lpvBaseOld : void* in/out -> "sptr"
; lpvBaseNew : void* in/out -> "sptr"
; lpcb : DWORD* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "MAPI32.dll" #cfunc global ScRelocProps "ScRelocProps" int, var, sptr, sptr, var ; res = ScRelocProps(cValues, lpPropArray, lpvBaseOld, lpvBaseNew, lpcb) ; cValues : INT -> "int" ; lpPropArray : SPropValue* in/out -> "var" ; lpvBaseOld : void* in/out -> "sptr" ; lpvBaseNew : void* in/out -> "sptr" ; lpcb : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "MAPI32.dll" #cfunc global ScRelocProps "ScRelocProps" int, sptr, sptr, sptr, sptr ; res = ScRelocProps(cValues, varptr(lpPropArray), lpvBaseOld, lpvBaseNew, varptr(lpcb)) ; cValues : INT -> "int" ; lpPropArray : SPropValue* in/out -> "sptr" ; lpvBaseOld : void* in/out -> "sptr" ; lpvBaseNew : void* in/out -> "sptr" ; lpcb : DWORD* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT ScRelocProps(INT cValues, SPropValue* lpPropArray, void* lpvBaseOld, void* lpvBaseNew, DWORD* lpcb) #uselib "MAPI32.dll" #cfunc global ScRelocProps "ScRelocProps" int, var, intptr, intptr, var ; res = ScRelocProps(cValues, lpPropArray, lpvBaseOld, lpvBaseNew, lpcb) ; cValues : INT -> "int" ; lpPropArray : SPropValue* in/out -> "var" ; lpvBaseOld : void* in/out -> "intptr" ; lpvBaseNew : void* in/out -> "intptr" ; lpcb : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT ScRelocProps(INT cValues, SPropValue* lpPropArray, void* lpvBaseOld, void* lpvBaseNew, DWORD* lpcb) #uselib "MAPI32.dll" #cfunc global ScRelocProps "ScRelocProps" int, intptr, intptr, intptr, intptr ; res = ScRelocProps(cValues, varptr(lpPropArray), lpvBaseOld, lpvBaseNew, varptr(lpcb)) ; cValues : INT -> "int" ; lpPropArray : SPropValue* in/out -> "intptr" ; lpvBaseOld : void* in/out -> "intptr" ; lpvBaseNew : void* in/out -> "intptr" ; lpcb : DWORD* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mapi32 = windows.NewLazySystemDLL("MAPI32.dll")
procScRelocProps = mapi32.NewProc("ScRelocProps")
)
// cValues (INT), lpPropArray (SPropValue* in/out), lpvBaseOld (void* in/out), lpvBaseNew (void* in/out), lpcb (DWORD* in/out)
r1, _, err := procScRelocProps.Call(
uintptr(cValues),
uintptr(lpPropArray),
uintptr(lpvBaseOld),
uintptr(lpvBaseNew),
uintptr(lpcb),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction ScRelocProps(
cValues: Integer; // INT
lpPropArray: Pointer; // SPropValue* in/out
lpvBaseOld: Pointer; // void* in/out
lpvBaseNew: Pointer; // void* in/out
lpcb: Pointer // DWORD* in/out
): Integer; stdcall;
external 'MAPI32.dll' name 'ScRelocProps';result := DllCall("MAPI32\ScRelocProps"
, "Int", cValues ; INT
, "Ptr", lpPropArray ; SPropValue* in/out
, "Ptr", lpvBaseOld ; void* in/out
, "Ptr", lpvBaseNew ; void* in/out
, "Ptr", lpcb ; DWORD* in/out
, "Int") ; return: INT●ScRelocProps(cValues, lpPropArray, lpvBaseOld, lpvBaseNew, lpcb) = DLL("MAPI32.dll", "int ScRelocProps(int, void*, void*, void*, void*)")
# 呼び出し: ScRelocProps(cValues, lpPropArray, lpvBaseOld, lpvBaseNew, lpcb)
# cValues : INT -> "int"
# lpPropArray : SPropValue* in/out -> "void*"
# lpvBaseOld : void* in/out -> "void*"
# lpvBaseNew : void* in/out -> "void*"
# lpcb : DWORD* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。