ホーム › NetworkManagement.P2P › PeerGraphDeleteRecord
PeerGraphDeleteRecord
関数ピアグラフから指定したレコードを削除する。
シグネチャ
// P2PGRAPH.dll
#include <windows.h>
HRESULT PeerGraphDeleteRecord(
void* hGraph,
const GUID* pRecordId,
BOOL fLocal
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hGraph | void* | in |
| pRecordId | GUID* | in |
| fLocal | BOOL | in |
戻り値の型: 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 方式にも切替可。#uselib "P2PGRAPH.dll" #cfunc global PeerGraphDeleteRecord "PeerGraphDeleteRecord" sptr, sptr, int ; res = PeerGraphDeleteRecord(hGraph, varptr(pRecordId), fLocal) ; hGraph : void* -> "sptr" ; pRecordId : GUID* -> "sptr" ; fLocal : BOOL -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは 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 方式にも切替可。; HRESULT PeerGraphDeleteRecord(void* hGraph, GUID* pRecordId, BOOL fLocal) #uselib "P2PGRAPH.dll" #cfunc global PeerGraphDeleteRecord "PeerGraphDeleteRecord" intptr, intptr, int ; res = PeerGraphDeleteRecord(hGraph, varptr(pRecordId), fLocal) ; hGraph : void* -> "intptr" ; pRecordId : GUID* -> "intptr" ; fLocal : BOOL -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは 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 // HRESULTfunction 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)。