ホーム › Networking.Ldap › ldap_stop_tls_s
ldap_stop_tls_s
関数LDAP接続のTLSセッションを停止する。
シグネチャ
// WLDAP32.dll
#include <windows.h>
BOOLEAN ldap_stop_tls_s(
LDAP* ExternalHandle
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| ExternalHandle | LDAP* | inout | 対象のLDAPセッションハンドル。確立済みTLS層を停止し平文に戻す接続を指す。 |
戻り値の型: BOOLEAN
各言語での呼び出し定義
// WLDAP32.dll
#include <windows.h>
BOOLEAN ldap_stop_tls_s(
LDAP* ExternalHandle
);[return: MarshalAs(UnmanagedType.U1)]
[DllImport("WLDAP32.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern bool ldap_stop_tls_s(
IntPtr ExternalHandle // LDAP* in/out
);<DllImport("WLDAP32.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ldap_stop_tls_s(
ExternalHandle As IntPtr ' LDAP* in/out
) As <MarshalAs(UnmanagedType.U1)> Boolean
End Function' ExternalHandle : LDAP* in/out
Declare PtrSafe Function ldap_stop_tls_s Lib "wldap32" ( _
ByVal ExternalHandle As LongPtr) As Byte
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ldap_stop_tls_s = ctypes.cdll.wldap32.ldap_stop_tls_s
ldap_stop_tls_s.restype = wintypes.BOOLEAN
ldap_stop_tls_s.argtypes = [
ctypes.c_void_p, # ExternalHandle : LDAP* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WLDAP32.dll')
ldap_stop_tls_s = Fiddle::Function.new(
lib['ldap_stop_tls_s'],
[
Fiddle::TYPE_VOIDP, # ExternalHandle : LDAP* in/out
],
Fiddle::TYPE_CHAR, Fiddle::Function::CDECL)#[link(name = "wldap32")]
extern "C" {
fn ldap_stop_tls_s(
ExternalHandle: *mut LDAP // LDAP* in/out
) -> u8;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.U1)]
[DllImport("WLDAP32.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern bool ldap_stop_tls_s(IntPtr ExternalHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WLDAP32_ldap_stop_tls_s' -Namespace Win32 -PassThru
# $api::ldap_stop_tls_s(ExternalHandle)#uselib "WLDAP32.dll"
#func global ldap_stop_tls_s "ldap_stop_tls_s" sptr
; ldap_stop_tls_s varptr(ExternalHandle) ; 戻り値は stat
; ExternalHandle : LDAP* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WLDAP32.dll" #cfunc global ldap_stop_tls_s "ldap_stop_tls_s" var ; res = ldap_stop_tls_s(ExternalHandle) ; ExternalHandle : LDAP* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WLDAP32.dll" #cfunc global ldap_stop_tls_s "ldap_stop_tls_s" sptr ; res = ldap_stop_tls_s(varptr(ExternalHandle)) ; ExternalHandle : LDAP* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOLEAN ldap_stop_tls_s(LDAP* ExternalHandle) #uselib "WLDAP32.dll" #cfunc global ldap_stop_tls_s "ldap_stop_tls_s" var ; res = ldap_stop_tls_s(ExternalHandle) ; ExternalHandle : LDAP* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOLEAN ldap_stop_tls_s(LDAP* ExternalHandle) #uselib "WLDAP32.dll" #cfunc global ldap_stop_tls_s "ldap_stop_tls_s" intptr ; res = ldap_stop_tls_s(varptr(ExternalHandle)) ; ExternalHandle : LDAP* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wldap32 = windows.NewLazySystemDLL("WLDAP32.dll")
procldap_stop_tls_s = wldap32.NewProc("ldap_stop_tls_s")
)
// ExternalHandle (LDAP* in/out)
r1, _, err := procldap_stop_tls_s.Call(
uintptr(ExternalHandle),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLEANfunction ldap_stop_tls_s(
ExternalHandle: Pointer // LDAP* in/out
): ByteBool; cdecl;
external 'WLDAP32.dll' name 'ldap_stop_tls_s';result := DllCall("WLDAP32\ldap_stop_tls_s"
, "Ptr", ExternalHandle ; LDAP* in/out
, "Cdecl Char") ; return: BOOLEAN●ldap_stop_tls_s(ExternalHandle) = DLL("WLDAP32.dll", "byte ldap_stop_tls_s(void*)")
# 呼び出し: ldap_stop_tls_s(ExternalHandle)
# ExternalHandle : LDAP* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。const std = @import("std");
extern "wldap32" fn ldap_stop_tls_s(
ExternalHandle: [*c]LDAP // LDAP* in/out
) callconv(.c) u8;proc ldap_stop_tls_s(
ExternalHandle: ptr LDAP # LDAP* in/out
): uint8 {.importc: "ldap_stop_tls_s", cdecl, dynlib: "WLDAP32.dll".}pragma(lib, "wldap32");
extern(C)
ubyte ldap_stop_tls_s(
LDAP* ExternalHandle // LDAP* in/out
);ccall((:ldap_stop_tls_s, "WLDAP32.dll"), UInt8,
(Ptr{LDAP},),
ExternalHandle)
# ExternalHandle : LDAP* in/out -> Ptr{LDAP}local ffi = require("ffi")
ffi.cdef[[
uint8_t ldap_stop_tls_s(
void* ExternalHandle);
]]
local wldap32 = ffi.load("wldap32")
-- wldap32.ldap_stop_tls_s(ExternalHandle)
-- ExternalHandle : LDAP* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('WLDAP32.dll');
const ldap_stop_tls_s = lib.func('__cdecl', 'ldap_stop_tls_s', 'uint8_t', ['void *']);
// ldap_stop_tls_s(ExternalHandle)
// ExternalHandle : LDAP* in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("WLDAP32.dll", {
ldap_stop_tls_s: { parameters: ["pointer"], result: "u8" },
});
// lib.symbols.ldap_stop_tls_s(ExternalHandle)
// ExternalHandle : LDAP* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint8_t ldap_stop_tls_s(
void* ExternalHandle);
C, "WLDAP32.dll");
// $ffi->ldap_stop_tls_s(ExternalHandle);
// ExternalHandle : LDAP* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Wldap32 extends Library {
Wldap32 INSTANCE = Native.load("wldap32", Wldap32.class);
byte ldap_stop_tls_s(
Pointer ExternalHandle // LDAP* in/out
);
}@[Link("wldap32")]
lib LibWLDAP32
fun ldap_stop_tls_s = ldap_stop_tls_s(
ExternalHandle : LDAP* # LDAP* in/out
) : UInt8
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef ldap_stop_tls_sNative = Uint8 Function(Pointer<Void>);
typedef ldap_stop_tls_sDart = int Function(Pointer<Void>);
final ldap_stop_tls_s = DynamicLibrary.open('WLDAP32.dll')
.lookupFunction<ldap_stop_tls_sNative, ldap_stop_tls_sDart>('ldap_stop_tls_s');
// ExternalHandle : LDAP* in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function ldap_stop_tls_s(
ExternalHandle: Pointer // LDAP* in/out
): ByteBool; cdecl;
external 'WLDAP32.dll' name 'ldap_stop_tls_s';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "ldap_stop_tls_s"
c_ldap_stop_tls_s :: Ptr () -> IO Word8
-- ExternalHandle : LDAP* in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let ldap_stop_tls_s =
foreign "ldap_stop_tls_s"
((ptr void) @-> returning uint8_t)
(* ExternalHandle : LDAP* in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wldap32 (t "WLDAP32.dll"))
(cffi:use-foreign-library wldap32)
(cffi:defcfun ("ldap_stop_tls_s" ldap-stop-tls-s :convention :cdecl) :uint8
(external-handle :pointer)) ; LDAP* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $ldap_stop_tls_s = Win32::API::More->new('WLDAP32',
'BYTE ldap_stop_tls_s(LPVOID ExternalHandle)');
# my $ret = $ldap_stop_tls_s->Call($ExternalHandle);
# ExternalHandle : LDAP* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型