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

JsSetPrototype

関数
指定オブジェクトのプロトタイプを設定する。
DLLchakra.dll呼出規約winapi

シグネチャ

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

JsErrorCode JsSetPrototype(
    void* object,
    void* prototypeObject
);

パラメーター

名前方向
objectvoid*in
prototypeObjectvoid*in

戻り値の型: JsErrorCode

各言語での呼び出し定義

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

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

JsSetPrototype = ctypes.windll.chakra.JsSetPrototype
JsSetPrototype.restype = wintypes.DWORD
JsSetPrototype.argtypes = [
    ctypes.POINTER(None),  # object : void*
    ctypes.POINTER(None),  # prototypeObject : void*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	chakra = windows.NewLazySystemDLL("chakra.dll")
	procJsSetPrototype = chakra.NewProc("JsSetPrototype")
)

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