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