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

PeerGraphDeleteRecord

関数
ピアグラフから指定したレコードを削除する。
DLLP2PGRAPH.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT PeerGraphDeleteRecord(
    void* hGraph,
    const GUID* pRecordId,
    BOOL fLocal
);

パラメーター

名前方向
hGraphvoid*in
pRecordIdGUID*in
fLocalBOOLin

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

PeerGraphDeleteRecord = ctypes.windll.p2pgraph.PeerGraphDeleteRecord
PeerGraphDeleteRecord.restype = ctypes.c_int
PeerGraphDeleteRecord.argtypes = [
    ctypes.POINTER(None),  # hGraph : void*
    ctypes.c_void_p,  # pRecordId : GUID*
    wintypes.BOOL,  # fLocal : BOOL
]
require 'fiddle'
require 'fiddle/import'

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

var (
	p2pgraph = windows.NewLazySystemDLL("P2PGRAPH.dll")
	procPeerGraphDeleteRecord = p2pgraph.NewProc("PeerGraphDeleteRecord")
)

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