ホーム › NetworkManagement.P2P › PeerCollabEnumObjects
PeerCollabEnumObjects
関数エンドポイントに関連するオブジェクトを列挙する。
シグネチャ
// P2P.dll
#include <windows.h>
HRESULT PeerCollabEnumObjects(
PEER_ENDPOINT* pcEndpoint, // optional
const GUID* pObjectId, // optional
void** phPeerEnum
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pcEndpoint | PEER_ENDPOINT* | inoptional |
| pObjectId | GUID* | inoptional |
| phPeerEnum | void** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// P2P.dll
#include <windows.h>
HRESULT PeerCollabEnumObjects(
PEER_ENDPOINT* pcEndpoint, // optional
const GUID* pObjectId, // optional
void** phPeerEnum
);[DllImport("P2P.dll", ExactSpelling = true)]
static extern int PeerCollabEnumObjects(
IntPtr pcEndpoint, // PEER_ENDPOINT* optional
IntPtr pObjectId, // GUID* optional
IntPtr phPeerEnum // void** out
);<DllImport("P2P.dll", ExactSpelling:=True)>
Public Shared Function PeerCollabEnumObjects(
pcEndpoint As IntPtr, ' PEER_ENDPOINT* optional
pObjectId As IntPtr, ' GUID* optional
phPeerEnum As IntPtr ' void** out
) As Integer
End Function' pcEndpoint : PEER_ENDPOINT* optional
' pObjectId : GUID* optional
' phPeerEnum : void** out
Declare PtrSafe Function PeerCollabEnumObjects Lib "p2p" ( _
ByVal pcEndpoint As LongPtr, _
ByVal pObjectId As LongPtr, _
ByVal phPeerEnum As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
PeerCollabEnumObjects = ctypes.windll.p2p.PeerCollabEnumObjects
PeerCollabEnumObjects.restype = ctypes.c_int
PeerCollabEnumObjects.argtypes = [
ctypes.c_void_p, # pcEndpoint : PEER_ENDPOINT* optional
ctypes.c_void_p, # pObjectId : GUID* optional
ctypes.c_void_p, # phPeerEnum : void** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('P2P.dll')
PeerCollabEnumObjects = Fiddle::Function.new(
lib['PeerCollabEnumObjects'],
[
Fiddle::TYPE_VOIDP, # pcEndpoint : PEER_ENDPOINT* optional
Fiddle::TYPE_VOIDP, # pObjectId : GUID* optional
Fiddle::TYPE_VOIDP, # phPeerEnum : void** out
],
Fiddle::TYPE_INT)#[link(name = "p2p")]
extern "system" {
fn PeerCollabEnumObjects(
pcEndpoint: *mut PEER_ENDPOINT, // PEER_ENDPOINT* optional
pObjectId: *const GUID, // GUID* optional
phPeerEnum: *mut *mut () // void** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("P2P.dll")]
public static extern int PeerCollabEnumObjects(IntPtr pcEndpoint, IntPtr pObjectId, IntPtr phPeerEnum);
"@
$api = Add-Type -MemberDefinition $sig -Name 'P2P_PeerCollabEnumObjects' -Namespace Win32 -PassThru
# $api::PeerCollabEnumObjects(pcEndpoint, pObjectId, phPeerEnum)#uselib "P2P.dll"
#func global PeerCollabEnumObjects "PeerCollabEnumObjects" sptr, sptr, sptr
; PeerCollabEnumObjects varptr(pcEndpoint), varptr(pObjectId), phPeerEnum ; 戻り値は stat
; pcEndpoint : PEER_ENDPOINT* optional -> "sptr"
; pObjectId : GUID* optional -> "sptr"
; phPeerEnum : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "P2P.dll" #cfunc global PeerCollabEnumObjects "PeerCollabEnumObjects" var, var, sptr ; res = PeerCollabEnumObjects(pcEndpoint, pObjectId, phPeerEnum) ; pcEndpoint : PEER_ENDPOINT* optional -> "var" ; pObjectId : GUID* optional -> "var" ; phPeerEnum : void** out -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "P2P.dll" #cfunc global PeerCollabEnumObjects "PeerCollabEnumObjects" sptr, sptr, sptr ; res = PeerCollabEnumObjects(varptr(pcEndpoint), varptr(pObjectId), phPeerEnum) ; pcEndpoint : PEER_ENDPOINT* optional -> "sptr" ; pObjectId : GUID* optional -> "sptr" ; phPeerEnum : void** out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT PeerCollabEnumObjects(PEER_ENDPOINT* pcEndpoint, GUID* pObjectId, void** phPeerEnum) #uselib "P2P.dll" #cfunc global PeerCollabEnumObjects "PeerCollabEnumObjects" var, var, intptr ; res = PeerCollabEnumObjects(pcEndpoint, pObjectId, phPeerEnum) ; pcEndpoint : PEER_ENDPOINT* optional -> "var" ; pObjectId : GUID* optional -> "var" ; phPeerEnum : void** out -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT PeerCollabEnumObjects(PEER_ENDPOINT* pcEndpoint, GUID* pObjectId, void** phPeerEnum) #uselib "P2P.dll" #cfunc global PeerCollabEnumObjects "PeerCollabEnumObjects" intptr, intptr, intptr ; res = PeerCollabEnumObjects(varptr(pcEndpoint), varptr(pObjectId), phPeerEnum) ; pcEndpoint : PEER_ENDPOINT* optional -> "intptr" ; pObjectId : GUID* optional -> "intptr" ; phPeerEnum : void** out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
p2p = windows.NewLazySystemDLL("P2P.dll")
procPeerCollabEnumObjects = p2p.NewProc("PeerCollabEnumObjects")
)
// pcEndpoint (PEER_ENDPOINT* optional), pObjectId (GUID* optional), phPeerEnum (void** out)
r1, _, err := procPeerCollabEnumObjects.Call(
uintptr(pcEndpoint),
uintptr(pObjectId),
uintptr(phPeerEnum),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction PeerCollabEnumObjects(
pcEndpoint: Pointer; // PEER_ENDPOINT* optional
pObjectId: PGUID; // GUID* optional
phPeerEnum: Pointer // void** out
): Integer; stdcall;
external 'P2P.dll' name 'PeerCollabEnumObjects';result := DllCall("P2P\PeerCollabEnumObjects"
, "Ptr", pcEndpoint ; PEER_ENDPOINT* optional
, "Ptr", pObjectId ; GUID* optional
, "Ptr", phPeerEnum ; void** out
, "Int") ; return: HRESULT●PeerCollabEnumObjects(pcEndpoint, pObjectId, phPeerEnum) = DLL("P2P.dll", "int PeerCollabEnumObjects(void*, void*, void*)")
# 呼び出し: PeerCollabEnumObjects(pcEndpoint, pObjectId, phPeerEnum)
# pcEndpoint : PEER_ENDPOINT* optional -> "void*"
# pObjectId : GUID* optional -> "void*"
# phPeerEnum : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。