Win32 API 日本語リファレンス
ホームSystem.DeploymentServices › WdsTransportClientCancelSession

WdsTransportClientCancelSession

関数
WDSトランスポートクライアントの転送セッションを取り消す。
DLLWDSTPTC.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD WdsTransportClientCancelSession(
    HANDLE hSessionKey
);

パラメーター

名前方向
hSessionKeyHANDLEin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD WdsTransportClientCancelSession(
    HANDLE hSessionKey
);
[DllImport("WDSTPTC.dll", ExactSpelling = true)]
static extern uint WdsTransportClientCancelSession(
    IntPtr hSessionKey   // HANDLE
);
<DllImport("WDSTPTC.dll", ExactSpelling:=True)>
Public Shared Function WdsTransportClientCancelSession(
    hSessionKey As IntPtr   ' HANDLE
) As UInteger
End Function
' hSessionKey : HANDLE
Declare PtrSafe Function WdsTransportClientCancelSession Lib "wdstptc" ( _
    ByVal hSessionKey As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WdsTransportClientCancelSession = ctypes.windll.wdstptc.WdsTransportClientCancelSession
WdsTransportClientCancelSession.restype = wintypes.DWORD
WdsTransportClientCancelSession.argtypes = [
    wintypes.HANDLE,  # hSessionKey : HANDLE
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WDSTPTC.dll')
WdsTransportClientCancelSession = Fiddle::Function.new(
  lib['WdsTransportClientCancelSession'],
  [
    Fiddle::TYPE_VOIDP,  # hSessionKey : HANDLE
  ],
  -Fiddle::TYPE_INT)
#[link(name = "wdstptc")]
extern "system" {
    fn WdsTransportClientCancelSession(
        hSessionKey: *mut core::ffi::c_void  // HANDLE
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WDSTPTC.dll")]
public static extern uint WdsTransportClientCancelSession(IntPtr hSessionKey);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WDSTPTC_WdsTransportClientCancelSession' -Namespace Win32 -PassThru
# $api::WdsTransportClientCancelSession(hSessionKey)
#uselib "WDSTPTC.dll"
#func global WdsTransportClientCancelSession "WdsTransportClientCancelSession" sptr
; WdsTransportClientCancelSession hSessionKey   ; 戻り値は stat
; hSessionKey : HANDLE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WDSTPTC.dll"
#cfunc global WdsTransportClientCancelSession "WdsTransportClientCancelSession" sptr
; res = WdsTransportClientCancelSession(hSessionKey)
; hSessionKey : HANDLE -> "sptr"
; DWORD WdsTransportClientCancelSession(HANDLE hSessionKey)
#uselib "WDSTPTC.dll"
#cfunc global WdsTransportClientCancelSession "WdsTransportClientCancelSession" intptr
; res = WdsTransportClientCancelSession(hSessionKey)
; hSessionKey : HANDLE -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wdstptc = windows.NewLazySystemDLL("WDSTPTC.dll")
	procWdsTransportClientCancelSession = wdstptc.NewProc("WdsTransportClientCancelSession")
)

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