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