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