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

ScRelocNotifications

関数
移動された通知配列内のポインタを再配置する。
DLLMAPI32.dll呼出規約winapi

シグネチャ

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

INT ScRelocNotifications(
    INT cNotification,
    NOTIFICATION* lpNotifications,
    void* lpvBaseOld,
    void* lpvBaseNew,
    DWORD* lpcb
);

パラメーター

名前方向
cNotificationINTin
lpNotificationsNOTIFICATION*inout
lpvBaseOldvoid*inout
lpvBaseNewvoid*inout
lpcbDWORD*inout

戻り値の型: INT

各言語での呼び出し定義

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

INT ScRelocNotifications(
    INT cNotification,
    NOTIFICATION* lpNotifications,
    void* lpvBaseOld,
    void* lpvBaseNew,
    DWORD* lpcb
);
[DllImport("MAPI32.dll", ExactSpelling = true)]
static extern int ScRelocNotifications(
    int cNotification,   // INT
    IntPtr lpNotifications,   // NOTIFICATION* 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 ScRelocNotifications(
    cNotification As Integer,   ' INT
    lpNotifications As IntPtr,   ' NOTIFICATION* 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
' cNotification : INT
' lpNotifications : NOTIFICATION* in/out
' lpvBaseOld : void* in/out
' lpvBaseNew : void* in/out
' lpcb : DWORD* in/out
Declare PtrSafe Function ScRelocNotifications Lib "mapi32" ( _
    ByVal cNotification As Long, _
    ByVal lpNotifications 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

ScRelocNotifications = ctypes.windll.mapi32.ScRelocNotifications
ScRelocNotifications.restype = ctypes.c_int
ScRelocNotifications.argtypes = [
    ctypes.c_int,  # cNotification : INT
    ctypes.c_void_p,  # lpNotifications : NOTIFICATION* 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')
ScRelocNotifications = Fiddle::Function.new(
  lib['ScRelocNotifications'],
  [
    Fiddle::TYPE_INT,  # cNotification : INT
    Fiddle::TYPE_VOIDP,  # lpNotifications : NOTIFICATION* 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 ScRelocNotifications(
        cNotification: i32,  // INT
        lpNotifications: *mut NOTIFICATION,  // NOTIFICATION* 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 ScRelocNotifications(int cNotification, IntPtr lpNotifications, IntPtr lpvBaseOld, IntPtr lpvBaseNew, ref uint lpcb);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MAPI32_ScRelocNotifications' -Namespace Win32 -PassThru
# $api::ScRelocNotifications(cNotification, lpNotifications, lpvBaseOld, lpvBaseNew, lpcb)
#uselib "MAPI32.dll"
#func global ScRelocNotifications "ScRelocNotifications" sptr, sptr, sptr, sptr, sptr
; ScRelocNotifications cNotification, varptr(lpNotifications), lpvBaseOld, lpvBaseNew, varptr(lpcb)   ; 戻り値は stat
; cNotification : INT -> "sptr"
; lpNotifications : NOTIFICATION* 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 ScRelocNotifications "ScRelocNotifications" int, var, sptr, sptr, var
; res = ScRelocNotifications(cNotification, lpNotifications, lpvBaseOld, lpvBaseNew, lpcb)
; cNotification : INT -> "int"
; lpNotifications : NOTIFICATION* in/out -> "var"
; lpvBaseOld : void* in/out -> "sptr"
; lpvBaseNew : void* in/out -> "sptr"
; lpcb : DWORD* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT ScRelocNotifications(INT cNotification, NOTIFICATION* lpNotifications, void* lpvBaseOld, void* lpvBaseNew, DWORD* lpcb)
#uselib "MAPI32.dll"
#cfunc global ScRelocNotifications "ScRelocNotifications" int, var, intptr, intptr, var
; res = ScRelocNotifications(cNotification, lpNotifications, lpvBaseOld, lpvBaseNew, lpcb)
; cNotification : INT -> "int"
; lpNotifications : NOTIFICATION* in/out -> "var"
; lpvBaseOld : void* in/out -> "intptr"
; lpvBaseNew : void* in/out -> "intptr"
; lpcb : DWORD* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mapi32 = windows.NewLazySystemDLL("MAPI32.dll")
	procScRelocNotifications = mapi32.NewProc("ScRelocNotifications")
)

// cNotification (INT), lpNotifications (NOTIFICATION* in/out), lpvBaseOld (void* in/out), lpvBaseNew (void* in/out), lpcb (DWORD* in/out)
r1, _, err := procScRelocNotifications.Call(
	uintptr(cNotification),
	uintptr(lpNotifications),
	uintptr(lpvBaseOld),
	uintptr(lpvBaseNew),
	uintptr(lpcb),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function ScRelocNotifications(
  cNotification: Integer;   // INT
  lpNotifications: Pointer;   // NOTIFICATION* in/out
  lpvBaseOld: Pointer;   // void* in/out
  lpvBaseNew: Pointer;   // void* in/out
  lpcb: Pointer   // DWORD* in/out
): Integer; stdcall;
  external 'MAPI32.dll' name 'ScRelocNotifications';
result := DllCall("MAPI32\ScRelocNotifications"
    , "Int", cNotification   ; INT
    , "Ptr", lpNotifications   ; NOTIFICATION* in/out
    , "Ptr", lpvBaseOld   ; void* in/out
    , "Ptr", lpvBaseNew   ; void* in/out
    , "Ptr", lpcb   ; DWORD* in/out
    , "Int")   ; return: INT
●ScRelocNotifications(cNotification, lpNotifications, lpvBaseOld, lpvBaseNew, lpcb) = DLL("MAPI32.dll", "int ScRelocNotifications(int, void*, void*, void*, void*)")
# 呼び出し: ScRelocNotifications(cNotification, lpNotifications, lpvBaseOld, lpvBaseNew, lpcb)
# cNotification : INT -> "int"
# lpNotifications : NOTIFICATION* 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)。