ホーム › NetworkManagement.P2P › PeerDistClientCompleteContentInformation
PeerDistClientCompleteContentInformation
関数クライアントへのコンテンツ情報追加を完了する。
シグネチャ
// PeerDist.dll
#include <windows.h>
DWORD PeerDistClientCompleteContentInformation(
INT_PTR hPeerDist,
INT_PTR hContentHandle,
OVERLAPPED* lpOverlapped
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hPeerDist | INT_PTR | in | 対象のPeerDistセッションのハンドル。 |
| hContentHandle | INT_PTR | in | コンテンツ情報の追加を完了する対象のコンテンツハンドル。 |
| lpOverlapped | OVERLAPPED* | in | 非同期操作に使用するOVERLAPPED構造体へのポインタ。 |
戻り値の型: 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 方式にも切替可。#uselib "PeerDist.dll" #cfunc global PeerDistClientCompleteContentInformation "PeerDistClientCompleteContentInformation" sptr, sptr, sptr ; res = PeerDistClientCompleteContentInformation(hPeerDist, hContentHandle, varptr(lpOverlapped)) ; hPeerDist : INT_PTR -> "sptr" ; hContentHandle : INT_PTR -> "sptr" ; lpOverlapped : OVERLAPPED* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは 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 方式にも切替可。; DWORD PeerDistClientCompleteContentInformation(INT_PTR hPeerDist, INT_PTR hContentHandle, OVERLAPPED* lpOverlapped) #uselib "PeerDist.dll" #cfunc global PeerDistClientCompleteContentInformation "PeerDistClientCompleteContentInformation" intptr, intptr, intptr ; res = PeerDistClientCompleteContentInformation(hPeerDist, hContentHandle, varptr(lpOverlapped)) ; hPeerDist : INT_PTR -> "intptr" ; hContentHandle : INT_PTR -> "intptr" ; lpOverlapped : OVERLAPPED* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは 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 // DWORDfunction 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)。const std = @import("std");
extern "peerdist" fn PeerDistClientCompleteContentInformation(
hPeerDist: isize, // INT_PTR
hContentHandle: isize, // INT_PTR
lpOverlapped: [*c]OVERLAPPED // OVERLAPPED*
) callconv(std.os.windows.WINAPI) u32;proc PeerDistClientCompleteContentInformation(
hPeerDist: int, # INT_PTR
hContentHandle: int, # INT_PTR
lpOverlapped: ptr OVERLAPPED # OVERLAPPED*
): uint32 {.importc: "PeerDistClientCompleteContentInformation", stdcall, dynlib: "PeerDist.dll".}pragma(lib, "peerdist");
extern(Windows)
uint PeerDistClientCompleteContentInformation(
ptrdiff_t hPeerDist, // INT_PTR
ptrdiff_t hContentHandle, // INT_PTR
OVERLAPPED* lpOverlapped // OVERLAPPED*
);ccall((:PeerDistClientCompleteContentInformation, "PeerDist.dll"), stdcall, UInt32,
(Int, Int, Ptr{OVERLAPPED}),
hPeerDist, hContentHandle, lpOverlapped)
# hPeerDist : INT_PTR -> Int
# hContentHandle : INT_PTR -> Int
# lpOverlapped : OVERLAPPED* -> Ptr{OVERLAPPED}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t PeerDistClientCompleteContentInformation(
intptr_t hPeerDist,
intptr_t hContentHandle,
void* lpOverlapped);
]]
local peerdist = ffi.load("peerdist")
-- peerdist.PeerDistClientCompleteContentInformation(hPeerDist, hContentHandle, lpOverlapped)
-- hPeerDist : INT_PTR
-- hContentHandle : INT_PTR
-- lpOverlapped : OVERLAPPED*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('PeerDist.dll');
const PeerDistClientCompleteContentInformation = lib.func('__stdcall', 'PeerDistClientCompleteContentInformation', 'uint32_t', ['intptr_t', 'intptr_t', 'void *']);
// PeerDistClientCompleteContentInformation(hPeerDist, hContentHandle, lpOverlapped)
// hPeerDist : INT_PTR -> 'intptr_t'
// hContentHandle : INT_PTR -> 'intptr_t'
// lpOverlapped : OVERLAPPED* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("PeerDist.dll", {
PeerDistClientCompleteContentInformation: { parameters: ["isize", "isize", "pointer"], result: "u32" },
});
// lib.symbols.PeerDistClientCompleteContentInformation(hPeerDist, hContentHandle, lpOverlapped)
// hPeerDist : INT_PTR -> "isize"
// hContentHandle : INT_PTR -> "isize"
// lpOverlapped : OVERLAPPED* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t PeerDistClientCompleteContentInformation(
intptr_t hPeerDist,
intptr_t hContentHandle,
void* lpOverlapped);
C, "PeerDist.dll");
// $ffi->PeerDistClientCompleteContentInformation(hPeerDist, hContentHandle, lpOverlapped);
// hPeerDist : INT_PTR
// hContentHandle : INT_PTR
// lpOverlapped : OVERLAPPED*
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Peerdist extends StdCallLibrary {
Peerdist INSTANCE = Native.load("peerdist", Peerdist.class);
int PeerDistClientCompleteContentInformation(
long hPeerDist, // INT_PTR
long hContentHandle, // INT_PTR
Pointer lpOverlapped // OVERLAPPED*
);
}@[Link("peerdist")]
lib LibPeerDist
fun PeerDistClientCompleteContentInformation = PeerDistClientCompleteContentInformation(
hPeerDist : LibC::SSizeT, # INT_PTR
hContentHandle : LibC::SSizeT, # INT_PTR
lpOverlapped : OVERLAPPED* # OVERLAPPED*
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef PeerDistClientCompleteContentInformationNative = Uint32 Function(IntPtr, IntPtr, Pointer<Void>);
typedef PeerDistClientCompleteContentInformationDart = int Function(int, int, Pointer<Void>);
final PeerDistClientCompleteContentInformation = DynamicLibrary.open('PeerDist.dll')
.lookupFunction<PeerDistClientCompleteContentInformationNative, PeerDistClientCompleteContentInformationDart>('PeerDistClientCompleteContentInformation');
// hPeerDist : INT_PTR -> IntPtr
// hContentHandle : INT_PTR -> IntPtr
// lpOverlapped : OVERLAPPED* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function PeerDistClientCompleteContentInformation(
hPeerDist: NativeInt; // INT_PTR
hContentHandle: NativeInt; // INT_PTR
lpOverlapped: Pointer // OVERLAPPED*
): DWORD; stdcall;
external 'PeerDist.dll' name 'PeerDistClientCompleteContentInformation';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "PeerDistClientCompleteContentInformation"
c_PeerDistClientCompleteContentInformation :: CIntPtr -> CIntPtr -> Ptr () -> IO Word32
-- hPeerDist : INT_PTR -> CIntPtr
-- hContentHandle : INT_PTR -> CIntPtr
-- lpOverlapped : OVERLAPPED* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let peerdistclientcompletecontentinformation =
foreign "PeerDistClientCompleteContentInformation"
(intptr_t @-> intptr_t @-> (ptr void) @-> returning uint32_t)
(* hPeerDist : INT_PTR -> intptr_t *)
(* hContentHandle : INT_PTR -> intptr_t *)
(* lpOverlapped : OVERLAPPED* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library peerdist (t "PeerDist.dll"))
(cffi:use-foreign-library peerdist)
(cffi:defcfun ("PeerDistClientCompleteContentInformation" peer-dist-client-complete-content-information :convention :stdcall) :uint32
(h-peer-dist :int64) ; INT_PTR
(h-content-handle :int64) ; INT_PTR
(lp-overlapped :pointer)) ; OVERLAPPED*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $PeerDistClientCompleteContentInformation = Win32::API::More->new('PeerDist',
'DWORD PeerDistClientCompleteContentInformation(LPARAM hPeerDist, LPARAM hContentHandle, LPVOID lpOverlapped)');
# my $ret = $PeerDistClientCompleteContentInformation->Call($hPeerDist, $hContentHandle, $lpOverlapped);
# hPeerDist : INT_PTR -> LPARAM
# hContentHandle : INT_PTR -> LPARAM
# lpOverlapped : OVERLAPPED* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型