ホーム › Security.Cryptography › NCryptStreamClose
NCryptStreamClose
関数保護/復号ストリームのハンドルを閉じる。
シグネチャ
// ncrypt.dll
#include <windows.h>
HRESULT NCryptStreamClose(
NCRYPT_STREAM_HANDLE hStream
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hStream | NCRYPT_STREAM_HANDLE | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// ncrypt.dll
#include <windows.h>
HRESULT NCryptStreamClose(
NCRYPT_STREAM_HANDLE hStream
);[DllImport("ncrypt.dll", ExactSpelling = true)]
static extern int NCryptStreamClose(
IntPtr hStream // NCRYPT_STREAM_HANDLE
);<DllImport("ncrypt.dll", ExactSpelling:=True)>
Public Shared Function NCryptStreamClose(
hStream As IntPtr ' NCRYPT_STREAM_HANDLE
) As Integer
End Function' hStream : NCRYPT_STREAM_HANDLE
Declare PtrSafe Function NCryptStreamClose Lib "ncrypt" ( _
ByVal hStream As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
NCryptStreamClose = ctypes.windll.ncrypt.NCryptStreamClose
NCryptStreamClose.restype = ctypes.c_int
NCryptStreamClose.argtypes = [
wintypes.HANDLE, # hStream : NCRYPT_STREAM_HANDLE
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ncrypt.dll')
NCryptStreamClose = Fiddle::Function.new(
lib['NCryptStreamClose'],
[
Fiddle::TYPE_VOIDP, # hStream : NCRYPT_STREAM_HANDLE
],
Fiddle::TYPE_INT)#[link(name = "ncrypt")]
extern "system" {
fn NCryptStreamClose(
hStream: *mut core::ffi::c_void // NCRYPT_STREAM_HANDLE
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ncrypt.dll")]
public static extern int NCryptStreamClose(IntPtr hStream);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ncrypt_NCryptStreamClose' -Namespace Win32 -PassThru
# $api::NCryptStreamClose(hStream)#uselib "ncrypt.dll"
#func global NCryptStreamClose "NCryptStreamClose" sptr
; NCryptStreamClose hStream ; 戻り値は stat
; hStream : NCRYPT_STREAM_HANDLE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "ncrypt.dll"
#cfunc global NCryptStreamClose "NCryptStreamClose" sptr
; res = NCryptStreamClose(hStream)
; hStream : NCRYPT_STREAM_HANDLE -> "sptr"; HRESULT NCryptStreamClose(NCRYPT_STREAM_HANDLE hStream)
#uselib "ncrypt.dll"
#cfunc global NCryptStreamClose "NCryptStreamClose" intptr
; res = NCryptStreamClose(hStream)
; hStream : NCRYPT_STREAM_HANDLE -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
ncrypt = windows.NewLazySystemDLL("ncrypt.dll")
procNCryptStreamClose = ncrypt.NewProc("NCryptStreamClose")
)
// hStream (NCRYPT_STREAM_HANDLE)
r1, _, err := procNCryptStreamClose.Call(
uintptr(hStream),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction NCryptStreamClose(
hStream: THandle // NCRYPT_STREAM_HANDLE
): Integer; stdcall;
external 'ncrypt.dll' name 'NCryptStreamClose';result := DllCall("ncrypt\NCryptStreamClose"
, "Ptr", hStream ; NCRYPT_STREAM_HANDLE
, "Int") ; return: HRESULT●NCryptStreamClose(hStream) = DLL("ncrypt.dll", "int NCryptStreamClose(void*)")
# 呼び出し: NCryptStreamClose(hStream)
# hStream : NCRYPT_STREAM_HANDLE -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。