Win32 API 日本語リファレンス
ホームNetworkManagement.P2P › PeerGraphValidateDeferredRecords

PeerGraphValidateDeferredRecords

関数
保留中のピアグラフレコードを検証する。
DLLP2PGRAPH.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT PeerGraphValidateDeferredRecords(
    void* hGraph,
    DWORD cRecordIds,
    const GUID* pRecordIds
);

パラメーター

名前方向
hGraphvoid*in
cRecordIdsDWORDin
pRecordIdsGUID*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT PeerGraphValidateDeferredRecords(
    void* hGraph,
    DWORD cRecordIds,
    const GUID* pRecordIds
);
[DllImport("P2PGRAPH.dll", ExactSpelling = true)]
static extern int PeerGraphValidateDeferredRecords(
    IntPtr hGraph,   // void*
    uint cRecordIds,   // DWORD
    ref Guid pRecordIds   // GUID*
);
<DllImport("P2PGRAPH.dll", ExactSpelling:=True)>
Public Shared Function PeerGraphValidateDeferredRecords(
    hGraph As IntPtr,   ' void*
    cRecordIds As UInteger,   ' DWORD
    ByRef pRecordIds As Guid   ' GUID*
) As Integer
End Function
' hGraph : void*
' cRecordIds : DWORD
' pRecordIds : GUID*
Declare PtrSafe Function PeerGraphValidateDeferredRecords Lib "p2pgraph" ( _
    ByVal hGraph As LongPtr, _
    ByVal cRecordIds As Long, _
    ByVal pRecordIds As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

PeerGraphValidateDeferredRecords = ctypes.windll.p2pgraph.PeerGraphValidateDeferredRecords
PeerGraphValidateDeferredRecords.restype = ctypes.c_int
PeerGraphValidateDeferredRecords.argtypes = [
    ctypes.POINTER(None),  # hGraph : void*
    wintypes.DWORD,  # cRecordIds : DWORD
    ctypes.c_void_p,  # pRecordIds : GUID*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	p2pgraph = windows.NewLazySystemDLL("P2PGRAPH.dll")
	procPeerGraphValidateDeferredRecords = p2pgraph.NewProc("PeerGraphValidateDeferredRecords")
)

// hGraph (void*), cRecordIds (DWORD), pRecordIds (GUID*)
r1, _, err := procPeerGraphValidateDeferredRecords.Call(
	uintptr(hGraph),
	uintptr(cRecordIds),
	uintptr(pRecordIds),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function PeerGraphValidateDeferredRecords(
  hGraph: Pointer;   // void*
  cRecordIds: DWORD;   // DWORD
  pRecordIds: PGUID   // GUID*
): Integer; stdcall;
  external 'P2PGRAPH.dll' name 'PeerGraphValidateDeferredRecords';
result := DllCall("P2PGRAPH\PeerGraphValidateDeferredRecords"
    , "Ptr", hGraph   ; void*
    , "UInt", cRecordIds   ; DWORD
    , "Ptr", pRecordIds   ; GUID*
    , "Int")   ; return: HRESULT
●PeerGraphValidateDeferredRecords(hGraph, cRecordIds, pRecordIds) = DLL("P2PGRAPH.dll", "int PeerGraphValidateDeferredRecords(void*, dword, void*)")
# 呼び出し: PeerGraphValidateDeferredRecords(hGraph, cRecordIds, pRecordIds)
# hGraph : void* -> "void*"
# cRecordIds : DWORD -> "dword"
# pRecordIds : GUID* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。