ホーム › System.ComponentServices › GetManagedExtensions
GetManagedExtensions
関数利用可能なマネージドCOM+拡張の種類を取得する。
シグネチャ
// comsvcs.dll
#include <windows.h>
HRESULT GetManagedExtensions(
DWORD* dwExts
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| dwExts | DWORD* | inout |
戻り値の型: HRESULT
各言語での呼び出し定義
// comsvcs.dll
#include <windows.h>
HRESULT GetManagedExtensions(
DWORD* dwExts
);[DllImport("comsvcs.dll", ExactSpelling = true)]
static extern int GetManagedExtensions(
ref uint dwExts // DWORD* in/out
);<DllImport("comsvcs.dll", ExactSpelling:=True)>
Public Shared Function GetManagedExtensions(
ByRef dwExts As UInteger ' DWORD* in/out
) As Integer
End Function' dwExts : DWORD* in/out
Declare PtrSafe Function GetManagedExtensions Lib "comsvcs" ( _
ByRef dwExts As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetManagedExtensions = ctypes.windll.comsvcs.GetManagedExtensions
GetManagedExtensions.restype = ctypes.c_int
GetManagedExtensions.argtypes = [
ctypes.POINTER(wintypes.DWORD), # dwExts : DWORD* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('comsvcs.dll')
GetManagedExtensions = Fiddle::Function.new(
lib['GetManagedExtensions'],
[
Fiddle::TYPE_VOIDP, # dwExts : DWORD* in/out
],
Fiddle::TYPE_INT)#[link(name = "comsvcs")]
extern "system" {
fn GetManagedExtensions(
dwExts: *mut u32 // DWORD* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("comsvcs.dll")]
public static extern int GetManagedExtensions(ref uint dwExts);
"@
$api = Add-Type -MemberDefinition $sig -Name 'comsvcs_GetManagedExtensions' -Namespace Win32 -PassThru
# $api::GetManagedExtensions(dwExts)#uselib "comsvcs.dll"
#func global GetManagedExtensions "GetManagedExtensions" sptr
; GetManagedExtensions varptr(dwExts) ; 戻り値は stat
; dwExts : DWORD* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "comsvcs.dll" #cfunc global GetManagedExtensions "GetManagedExtensions" var ; res = GetManagedExtensions(dwExts) ; dwExts : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "comsvcs.dll" #cfunc global GetManagedExtensions "GetManagedExtensions" sptr ; res = GetManagedExtensions(varptr(dwExts)) ; dwExts : DWORD* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT GetManagedExtensions(DWORD* dwExts) #uselib "comsvcs.dll" #cfunc global GetManagedExtensions "GetManagedExtensions" var ; res = GetManagedExtensions(dwExts) ; dwExts : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT GetManagedExtensions(DWORD* dwExts) #uselib "comsvcs.dll" #cfunc global GetManagedExtensions "GetManagedExtensions" intptr ; res = GetManagedExtensions(varptr(dwExts)) ; dwExts : DWORD* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
comsvcs = windows.NewLazySystemDLL("comsvcs.dll")
procGetManagedExtensions = comsvcs.NewProc("GetManagedExtensions")
)
// dwExts (DWORD* in/out)
r1, _, err := procGetManagedExtensions.Call(
uintptr(dwExts),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction GetManagedExtensions(
dwExts: Pointer // DWORD* in/out
): Integer; stdcall;
external 'comsvcs.dll' name 'GetManagedExtensions';result := DllCall("comsvcs\GetManagedExtensions"
, "Ptr", dwExts ; DWORD* in/out
, "Int") ; return: HRESULT●GetManagedExtensions(dwExts) = DLL("comsvcs.dll", "int GetManagedExtensions(void*)")
# 呼び出し: GetManagedExtensions(dwExts)
# dwExts : DWORD* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。