ホーム › System.DeploymentServices › WdsTransportClientCompleteReceive
WdsTransportClientCompleteReceive
関数WDSトランスポートクライアントの受信処理完了を通知する。
シグネチャ
// WDSTPTC.dll
#include <windows.h>
DWORD WdsTransportClientCompleteReceive(
HANDLE hSessionKey,
DWORD ulSize,
ULONGLONG* pullOffset
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hSessionKey | HANDLE | in | 受信完了を通知する対象のセッションハンドル。 |
| ulSize | DWORD | in | 処理したデータのサイズ(バイト単位)。 |
| pullOffset | ULONGLONG* | in | 処理したデータの開始オフセットを示す64ビット整数ポインタ。 |
戻り値の型: DWORD
各言語での呼び出し定義
// WDSTPTC.dll
#include <windows.h>
DWORD WdsTransportClientCompleteReceive(
HANDLE hSessionKey,
DWORD ulSize,
ULONGLONG* pullOffset
);[DllImport("WDSTPTC.dll", ExactSpelling = true)]
static extern uint WdsTransportClientCompleteReceive(
IntPtr hSessionKey, // HANDLE
uint ulSize, // DWORD
ref ulong pullOffset // ULONGLONG*
);<DllImport("WDSTPTC.dll", ExactSpelling:=True)>
Public Shared Function WdsTransportClientCompleteReceive(
hSessionKey As IntPtr, ' HANDLE
ulSize As UInteger, ' DWORD
ByRef pullOffset As ULong ' ULONGLONG*
) As UInteger
End Function' hSessionKey : HANDLE
' ulSize : DWORD
' pullOffset : ULONGLONG*
Declare PtrSafe Function WdsTransportClientCompleteReceive Lib "wdstptc" ( _
ByVal hSessionKey As LongPtr, _
ByVal ulSize As Long, _
ByRef pullOffset As LongLong) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WdsTransportClientCompleteReceive = ctypes.windll.wdstptc.WdsTransportClientCompleteReceive
WdsTransportClientCompleteReceive.restype = wintypes.DWORD
WdsTransportClientCompleteReceive.argtypes = [
wintypes.HANDLE, # hSessionKey : HANDLE
wintypes.DWORD, # ulSize : DWORD
ctypes.POINTER(ctypes.c_ulonglong), # pullOffset : ULONGLONG*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WDSTPTC.dll')
WdsTransportClientCompleteReceive = Fiddle::Function.new(
lib['WdsTransportClientCompleteReceive'],
[
Fiddle::TYPE_VOIDP, # hSessionKey : HANDLE
-Fiddle::TYPE_INT, # ulSize : DWORD
Fiddle::TYPE_VOIDP, # pullOffset : ULONGLONG*
],
-Fiddle::TYPE_INT)#[link(name = "wdstptc")]
extern "system" {
fn WdsTransportClientCompleteReceive(
hSessionKey: *mut core::ffi::c_void, // HANDLE
ulSize: u32, // DWORD
pullOffset: *mut u64 // ULONGLONG*
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WDSTPTC.dll")]
public static extern uint WdsTransportClientCompleteReceive(IntPtr hSessionKey, uint ulSize, ref ulong pullOffset);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WDSTPTC_WdsTransportClientCompleteReceive' -Namespace Win32 -PassThru
# $api::WdsTransportClientCompleteReceive(hSessionKey, ulSize, pullOffset)#uselib "WDSTPTC.dll"
#func global WdsTransportClientCompleteReceive "WdsTransportClientCompleteReceive" sptr, sptr, sptr
; WdsTransportClientCompleteReceive hSessionKey, ulSize, varptr(pullOffset) ; 戻り値は stat
; hSessionKey : HANDLE -> "sptr"
; ulSize : DWORD -> "sptr"
; pullOffset : ULONGLONG* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WDSTPTC.dll" #cfunc global WdsTransportClientCompleteReceive "WdsTransportClientCompleteReceive" sptr, int, var ; res = WdsTransportClientCompleteReceive(hSessionKey, ulSize, pullOffset) ; hSessionKey : HANDLE -> "sptr" ; ulSize : DWORD -> "int" ; pullOffset : ULONGLONG* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WDSTPTC.dll" #cfunc global WdsTransportClientCompleteReceive "WdsTransportClientCompleteReceive" sptr, int, sptr ; res = WdsTransportClientCompleteReceive(hSessionKey, ulSize, varptr(pullOffset)) ; hSessionKey : HANDLE -> "sptr" ; ulSize : DWORD -> "int" ; pullOffset : ULONGLONG* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD WdsTransportClientCompleteReceive(HANDLE hSessionKey, DWORD ulSize, ULONGLONG* pullOffset) #uselib "WDSTPTC.dll" #cfunc global WdsTransportClientCompleteReceive "WdsTransportClientCompleteReceive" intptr, int, var ; res = WdsTransportClientCompleteReceive(hSessionKey, ulSize, pullOffset) ; hSessionKey : HANDLE -> "intptr" ; ulSize : DWORD -> "int" ; pullOffset : ULONGLONG* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD WdsTransportClientCompleteReceive(HANDLE hSessionKey, DWORD ulSize, ULONGLONG* pullOffset) #uselib "WDSTPTC.dll" #cfunc global WdsTransportClientCompleteReceive "WdsTransportClientCompleteReceive" intptr, int, intptr ; res = WdsTransportClientCompleteReceive(hSessionKey, ulSize, varptr(pullOffset)) ; hSessionKey : HANDLE -> "intptr" ; ulSize : DWORD -> "int" ; pullOffset : ULONGLONG* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wdstptc = windows.NewLazySystemDLL("WDSTPTC.dll")
procWdsTransportClientCompleteReceive = wdstptc.NewProc("WdsTransportClientCompleteReceive")
)
// hSessionKey (HANDLE), ulSize (DWORD), pullOffset (ULONGLONG*)
r1, _, err := procWdsTransportClientCompleteReceive.Call(
uintptr(hSessionKey),
uintptr(ulSize),
uintptr(pullOffset),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction WdsTransportClientCompleteReceive(
hSessionKey: THandle; // HANDLE
ulSize: DWORD; // DWORD
pullOffset: Pointer // ULONGLONG*
): DWORD; stdcall;
external 'WDSTPTC.dll' name 'WdsTransportClientCompleteReceive';result := DllCall("WDSTPTC\WdsTransportClientCompleteReceive"
, "Ptr", hSessionKey ; HANDLE
, "UInt", ulSize ; DWORD
, "Ptr", pullOffset ; ULONGLONG*
, "UInt") ; return: DWORD●WdsTransportClientCompleteReceive(hSessionKey, ulSize, pullOffset) = DLL("WDSTPTC.dll", "dword WdsTransportClientCompleteReceive(void*, dword, void*)")
# 呼び出し: WdsTransportClientCompleteReceive(hSessionKey, ulSize, pullOffset)
# hSessionKey : HANDLE -> "void*"
# ulSize : DWORD -> "dword"
# pullOffset : ULONGLONG* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "wdstptc" fn WdsTransportClientCompleteReceive(
hSessionKey: ?*anyopaque, // HANDLE
ulSize: u32, // DWORD
pullOffset: [*c]u64 // ULONGLONG*
) callconv(std.os.windows.WINAPI) u32;proc WdsTransportClientCompleteReceive(
hSessionKey: pointer, # HANDLE
ulSize: uint32, # DWORD
pullOffset: ptr uint64 # ULONGLONG*
): uint32 {.importc: "WdsTransportClientCompleteReceive", stdcall, dynlib: "WDSTPTC.dll".}pragma(lib, "wdstptc");
extern(Windows)
uint WdsTransportClientCompleteReceive(
void* hSessionKey, // HANDLE
uint ulSize, // DWORD
ulong* pullOffset // ULONGLONG*
);ccall((:WdsTransportClientCompleteReceive, "WDSTPTC.dll"), stdcall, UInt32,
(Ptr{Cvoid}, UInt32, Ptr{UInt64}),
hSessionKey, ulSize, pullOffset)
# hSessionKey : HANDLE -> Ptr{Cvoid}
# ulSize : DWORD -> UInt32
# pullOffset : ULONGLONG* -> Ptr{UInt64}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t WdsTransportClientCompleteReceive(
void* hSessionKey,
uint32_t ulSize,
uint64_t* pullOffset);
]]
local wdstptc = ffi.load("wdstptc")
-- wdstptc.WdsTransportClientCompleteReceive(hSessionKey, ulSize, pullOffset)
-- hSessionKey : HANDLE
-- ulSize : DWORD
-- pullOffset : ULONGLONG*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('WDSTPTC.dll');
const WdsTransportClientCompleteReceive = lib.func('__stdcall', 'WdsTransportClientCompleteReceive', 'uint32_t', ['void *', 'uint32_t', 'uint64_t *']);
// WdsTransportClientCompleteReceive(hSessionKey, ulSize, pullOffset)
// hSessionKey : HANDLE -> 'void *'
// ulSize : DWORD -> 'uint32_t'
// pullOffset : ULONGLONG* -> 'uint64_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("WDSTPTC.dll", {
WdsTransportClientCompleteReceive: { parameters: ["pointer", "u32", "pointer"], result: "u32" },
});
// lib.symbols.WdsTransportClientCompleteReceive(hSessionKey, ulSize, pullOffset)
// hSessionKey : HANDLE -> "pointer"
// ulSize : DWORD -> "u32"
// pullOffset : ULONGLONG* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t WdsTransportClientCompleteReceive(
void* hSessionKey,
uint32_t ulSize,
uint64_t* pullOffset);
C, "WDSTPTC.dll");
// $ffi->WdsTransportClientCompleteReceive(hSessionKey, ulSize, pullOffset);
// hSessionKey : HANDLE
// ulSize : DWORD
// pullOffset : ULONGLONG*
// 構造体/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 Wdstptc extends StdCallLibrary {
Wdstptc INSTANCE = Native.load("wdstptc", Wdstptc.class);
int WdsTransportClientCompleteReceive(
Pointer hSessionKey, // HANDLE
int ulSize, // DWORD
LongByReference pullOffset // ULONGLONG*
);
}@[Link("wdstptc")]
lib LibWDSTPTC
fun WdsTransportClientCompleteReceive = WdsTransportClientCompleteReceive(
hSessionKey : Void*, # HANDLE
ulSize : UInt32, # DWORD
pullOffset : UInt64* # ULONGLONG*
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef WdsTransportClientCompleteReceiveNative = Uint32 Function(Pointer<Void>, Uint32, Pointer<Uint64>);
typedef WdsTransportClientCompleteReceiveDart = int Function(Pointer<Void>, int, Pointer<Uint64>);
final WdsTransportClientCompleteReceive = DynamicLibrary.open('WDSTPTC.dll')
.lookupFunction<WdsTransportClientCompleteReceiveNative, WdsTransportClientCompleteReceiveDart>('WdsTransportClientCompleteReceive');
// hSessionKey : HANDLE -> Pointer<Void>
// ulSize : DWORD -> Uint32
// pullOffset : ULONGLONG* -> Pointer<Uint64>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function WdsTransportClientCompleteReceive(
hSessionKey: THandle; // HANDLE
ulSize: DWORD; // DWORD
pullOffset: Pointer // ULONGLONG*
): DWORD; stdcall;
external 'WDSTPTC.dll' name 'WdsTransportClientCompleteReceive';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "WdsTransportClientCompleteReceive"
c_WdsTransportClientCompleteReceive :: Ptr () -> Word32 -> Ptr Word64 -> IO Word32
-- hSessionKey : HANDLE -> Ptr ()
-- ulSize : DWORD -> Word32
-- pullOffset : ULONGLONG* -> Ptr Word64
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let wdstransportclientcompletereceive =
foreign "WdsTransportClientCompleteReceive"
((ptr void) @-> uint32_t @-> (ptr uint64_t) @-> returning uint32_t)
(* hSessionKey : HANDLE -> (ptr void) *)
(* ulSize : DWORD -> uint32_t *)
(* pullOffset : ULONGLONG* -> (ptr uint64_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wdstptc (t "WDSTPTC.dll"))
(cffi:use-foreign-library wdstptc)
(cffi:defcfun ("WdsTransportClientCompleteReceive" wds-transport-client-complete-receive :convention :stdcall) :uint32
(h-session-key :pointer) ; HANDLE
(ul-size :uint32) ; DWORD
(pull-offset :pointer)) ; ULONGLONG*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $WdsTransportClientCompleteReceive = Win32::API::More->new('WDSTPTC',
'DWORD WdsTransportClientCompleteReceive(HANDLE hSessionKey, DWORD ulSize, LPVOID pullOffset)');
# my $ret = $WdsTransportClientCompleteReceive->Call($hSessionKey, $ulSize, $pullOffset);
# hSessionKey : HANDLE -> HANDLE
# ulSize : DWORD -> DWORD
# pullOffset : ULONGLONG* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。