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