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