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

JsStopProfiling

関数
スクリプトエンジンのプロファイリングを停止する。
DLLchakra.dll呼出規約winapi

シグネチャ

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

JsErrorCode JsStopProfiling(
    HRESULT reason
);

パラメーター

名前方向
reasonHRESULTin

戻り値の型: JsErrorCode

各言語での呼び出し定義

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

JsErrorCode JsStopProfiling(
    HRESULT reason
);
[DllImport("chakra.dll", ExactSpelling = true)]
static extern uint JsStopProfiling(
    int reason   // HRESULT
);
<DllImport("chakra.dll", ExactSpelling:=True)>
Public Shared Function JsStopProfiling(
    reason As Integer   ' HRESULT
) As UInteger
End Function
' reason : HRESULT
Declare PtrSafe Function JsStopProfiling Lib "chakra" ( _
    ByVal reason As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

JsStopProfiling = ctypes.windll.chakra.JsStopProfiling
JsStopProfiling.restype = wintypes.DWORD
JsStopProfiling.argtypes = [
    ctypes.c_int,  # reason : HRESULT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	chakra = windows.NewLazySystemDLL("chakra.dll")
	procJsStopProfiling = chakra.NewProc("JsStopProfiling")
)

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