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

PeerDistClientCompleteContentInformation

関数
クライアントへのコンテンツ情報追加を完了する。
DLLPeerDist.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

DWORD PeerDistClientCompleteContentInformation(
    INT_PTR hPeerDist,
    INT_PTR hContentHandle,
    OVERLAPPED* lpOverlapped
);

パラメーター

名前方向
hPeerDistINT_PTRin
hContentHandleINT_PTRin
lpOverlappedOVERLAPPED*in

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD PeerDistClientCompleteContentInformation(
    INT_PTR hPeerDist,
    INT_PTR hContentHandle,
    OVERLAPPED* lpOverlapped
);
[DllImport("PeerDist.dll", ExactSpelling = true)]
static extern uint PeerDistClientCompleteContentInformation(
    IntPtr hPeerDist,   // INT_PTR
    IntPtr hContentHandle,   // INT_PTR
    IntPtr lpOverlapped   // OVERLAPPED*
);
<DllImport("PeerDist.dll", ExactSpelling:=True)>
Public Shared Function PeerDistClientCompleteContentInformation(
    hPeerDist As IntPtr,   ' INT_PTR
    hContentHandle As IntPtr,   ' INT_PTR
    lpOverlapped As IntPtr   ' OVERLAPPED*
) As UInteger
End Function
' hPeerDist : INT_PTR
' hContentHandle : INT_PTR
' lpOverlapped : OVERLAPPED*
Declare PtrSafe Function PeerDistClientCompleteContentInformation Lib "peerdist" ( _
    ByVal hPeerDist As LongPtr, _
    ByVal hContentHandle As LongPtr, _
    ByVal lpOverlapped As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

PeerDistClientCompleteContentInformation = ctypes.windll.peerdist.PeerDistClientCompleteContentInformation
PeerDistClientCompleteContentInformation.restype = wintypes.DWORD
PeerDistClientCompleteContentInformation.argtypes = [
    ctypes.c_ssize_t,  # hPeerDist : INT_PTR
    ctypes.c_ssize_t,  # hContentHandle : INT_PTR
    ctypes.c_void_p,  # lpOverlapped : OVERLAPPED*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	peerdist = windows.NewLazySystemDLL("PeerDist.dll")
	procPeerDistClientCompleteContentInformation = peerdist.NewProc("PeerDistClientCompleteContentInformation")
)

// hPeerDist (INT_PTR), hContentHandle (INT_PTR), lpOverlapped (OVERLAPPED*)
r1, _, err := procPeerDistClientCompleteContentInformation.Call(
	uintptr(hPeerDist),
	uintptr(hContentHandle),
	uintptr(lpOverlapped),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function PeerDistClientCompleteContentInformation(
  hPeerDist: NativeInt;   // INT_PTR
  hContentHandle: NativeInt;   // INT_PTR
  lpOverlapped: Pointer   // OVERLAPPED*
): DWORD; stdcall;
  external 'PeerDist.dll' name 'PeerDistClientCompleteContentInformation';
result := DllCall("PeerDist\PeerDistClientCompleteContentInformation"
    , "Ptr", hPeerDist   ; INT_PTR
    , "Ptr", hContentHandle   ; INT_PTR
    , "Ptr", lpOverlapped   ; OVERLAPPED*
    , "UInt")   ; return: DWORD
●PeerDistClientCompleteContentInformation(hPeerDist, hContentHandle, lpOverlapped) = DLL("PeerDist.dll", "dword PeerDistClientCompleteContentInformation(int, int, void*)")
# 呼び出し: PeerDistClientCompleteContentInformation(hPeerDist, hContentHandle, lpOverlapped)
# hPeerDist : INT_PTR -> "int"
# hContentHandle : INT_PTR -> "int"
# lpOverlapped : OVERLAPPED* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。