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

EnclaveVerifyAttestationReport

関数
エンクレーブのアテステーションレポートを検証する。
DLLvertdll.dll呼出規約winapi対応OSWindows 10 以降

シグネチャ

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

HRESULT EnclaveVerifyAttestationReport(
    DWORD EnclaveType,
    const void* Report,
    DWORD ReportSize
);

パラメーター

名前方向
EnclaveTypeDWORDin
Reportvoid*in
ReportSizeDWORDin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT EnclaveVerifyAttestationReport(
    DWORD EnclaveType,
    const void* Report,
    DWORD ReportSize
);
[DllImport("vertdll.dll", ExactSpelling = true)]
static extern int EnclaveVerifyAttestationReport(
    uint EnclaveType,   // DWORD
    IntPtr Report,   // void*
    uint ReportSize   // DWORD
);
<DllImport("vertdll.dll", ExactSpelling:=True)>
Public Shared Function EnclaveVerifyAttestationReport(
    EnclaveType As UInteger,   ' DWORD
    Report As IntPtr,   ' void*
    ReportSize As UInteger   ' DWORD
) As Integer
End Function
' EnclaveType : DWORD
' Report : void*
' ReportSize : DWORD
Declare PtrSafe Function EnclaveVerifyAttestationReport Lib "vertdll" ( _
    ByVal EnclaveType As Long, _
    ByVal Report As LongPtr, _
    ByVal ReportSize As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

EnclaveVerifyAttestationReport = ctypes.windll.vertdll.EnclaveVerifyAttestationReport
EnclaveVerifyAttestationReport.restype = ctypes.c_int
EnclaveVerifyAttestationReport.argtypes = [
    wintypes.DWORD,  # EnclaveType : DWORD
    ctypes.POINTER(None),  # Report : void*
    wintypes.DWORD,  # ReportSize : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	vertdll = windows.NewLazySystemDLL("vertdll.dll")
	procEnclaveVerifyAttestationReport = vertdll.NewProc("EnclaveVerifyAttestationReport")
)

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