ホーム › NetworkManagement.P2P › PeerGraphDelete
PeerGraphDelete
関数指定したピアグラフをデータベースから削除する。
シグネチャ
// P2PGRAPH.dll
#include <windows.h>
HRESULT PeerGraphDelete(
LPCWSTR pwzGraphId,
LPCWSTR pwzPeerId,
LPCWSTR pwzDatabaseName
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pwzGraphId | LPCWSTR | in |
| pwzPeerId | LPCWSTR | in |
| pwzDatabaseName | LPCWSTR | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// P2PGRAPH.dll
#include <windows.h>
HRESULT PeerGraphDelete(
LPCWSTR pwzGraphId,
LPCWSTR pwzPeerId,
LPCWSTR pwzDatabaseName
);[DllImport("P2PGRAPH.dll", ExactSpelling = true)]
static extern int PeerGraphDelete(
[MarshalAs(UnmanagedType.LPWStr)] string pwzGraphId, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string pwzPeerId, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string pwzDatabaseName // LPCWSTR
);<DllImport("P2PGRAPH.dll", ExactSpelling:=True)>
Public Shared Function PeerGraphDelete(
<MarshalAs(UnmanagedType.LPWStr)> pwzGraphId As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> pwzPeerId As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> pwzDatabaseName As String ' LPCWSTR
) As Integer
End Function' pwzGraphId : LPCWSTR
' pwzPeerId : LPCWSTR
' pwzDatabaseName : LPCWSTR
Declare PtrSafe Function PeerGraphDelete Lib "p2pgraph" ( _
ByVal pwzGraphId As LongPtr, _
ByVal pwzPeerId As LongPtr, _
ByVal pwzDatabaseName As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
PeerGraphDelete = ctypes.windll.p2pgraph.PeerGraphDelete
PeerGraphDelete.restype = ctypes.c_int
PeerGraphDelete.argtypes = [
wintypes.LPCWSTR, # pwzGraphId : LPCWSTR
wintypes.LPCWSTR, # pwzPeerId : LPCWSTR
wintypes.LPCWSTR, # pwzDatabaseName : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('P2PGRAPH.dll')
PeerGraphDelete = Fiddle::Function.new(
lib['PeerGraphDelete'],
[
Fiddle::TYPE_VOIDP, # pwzGraphId : LPCWSTR
Fiddle::TYPE_VOIDP, # pwzPeerId : LPCWSTR
Fiddle::TYPE_VOIDP, # pwzDatabaseName : LPCWSTR
],
Fiddle::TYPE_INT)#[link(name = "p2pgraph")]
extern "system" {
fn PeerGraphDelete(
pwzGraphId: *const u16, // LPCWSTR
pwzPeerId: *const u16, // LPCWSTR
pwzDatabaseName: *const u16 // LPCWSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("P2PGRAPH.dll")]
public static extern int PeerGraphDelete([MarshalAs(UnmanagedType.LPWStr)] string pwzGraphId, [MarshalAs(UnmanagedType.LPWStr)] string pwzPeerId, [MarshalAs(UnmanagedType.LPWStr)] string pwzDatabaseName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'P2PGRAPH_PeerGraphDelete' -Namespace Win32 -PassThru
# $api::PeerGraphDelete(pwzGraphId, pwzPeerId, pwzDatabaseName)#uselib "P2PGRAPH.dll"
#func global PeerGraphDelete "PeerGraphDelete" sptr, sptr, sptr
; PeerGraphDelete pwzGraphId, pwzPeerId, pwzDatabaseName ; 戻り値は stat
; pwzGraphId : LPCWSTR -> "sptr"
; pwzPeerId : LPCWSTR -> "sptr"
; pwzDatabaseName : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "P2PGRAPH.dll"
#cfunc global PeerGraphDelete "PeerGraphDelete" wstr, wstr, wstr
; res = PeerGraphDelete(pwzGraphId, pwzPeerId, pwzDatabaseName)
; pwzGraphId : LPCWSTR -> "wstr"
; pwzPeerId : LPCWSTR -> "wstr"
; pwzDatabaseName : LPCWSTR -> "wstr"; HRESULT PeerGraphDelete(LPCWSTR pwzGraphId, LPCWSTR pwzPeerId, LPCWSTR pwzDatabaseName)
#uselib "P2PGRAPH.dll"
#cfunc global PeerGraphDelete "PeerGraphDelete" wstr, wstr, wstr
; res = PeerGraphDelete(pwzGraphId, pwzPeerId, pwzDatabaseName)
; pwzGraphId : LPCWSTR -> "wstr"
; pwzPeerId : LPCWSTR -> "wstr"
; pwzDatabaseName : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
p2pgraph = windows.NewLazySystemDLL("P2PGRAPH.dll")
procPeerGraphDelete = p2pgraph.NewProc("PeerGraphDelete")
)
// pwzGraphId (LPCWSTR), pwzPeerId (LPCWSTR), pwzDatabaseName (LPCWSTR)
r1, _, err := procPeerGraphDelete.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwzGraphId))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwzPeerId))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwzDatabaseName))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction PeerGraphDelete(
pwzGraphId: PWideChar; // LPCWSTR
pwzPeerId: PWideChar; // LPCWSTR
pwzDatabaseName: PWideChar // LPCWSTR
): Integer; stdcall;
external 'P2PGRAPH.dll' name 'PeerGraphDelete';result := DllCall("P2PGRAPH\PeerGraphDelete"
, "WStr", pwzGraphId ; LPCWSTR
, "WStr", pwzPeerId ; LPCWSTR
, "WStr", pwzDatabaseName ; LPCWSTR
, "Int") ; return: HRESULT●PeerGraphDelete(pwzGraphId, pwzPeerId, pwzDatabaseName) = DLL("P2PGRAPH.dll", "int PeerGraphDelete(char*, char*, char*)")
# 呼び出し: PeerGraphDelete(pwzGraphId, pwzPeerId, pwzDatabaseName)
# pwzGraphId : LPCWSTR -> "char*"
# pwzPeerId : LPCWSTR -> "char*"
# pwzDatabaseName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。