Win32 API 日本語リファレンス
ホームGlobalization › MappingFreeServices

MappingFreeServices

関数
MappingGetServicesで取得したサービス情報を解放する。
DLLelscore.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

HRESULT MappingFreeServices(
    MAPPING_SERVICE_INFO* pServiceInfo
);

パラメーター

名前方向
pServiceInfoMAPPING_SERVICE_INFO*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT MappingFreeServices(
    MAPPING_SERVICE_INFO* pServiceInfo
);
[DllImport("elscore.dll", ExactSpelling = true)]
static extern int MappingFreeServices(
    IntPtr pServiceInfo   // MAPPING_SERVICE_INFO*
);
<DllImport("elscore.dll", ExactSpelling:=True)>
Public Shared Function MappingFreeServices(
    pServiceInfo As IntPtr   ' MAPPING_SERVICE_INFO*
) As Integer
End Function
' pServiceInfo : MAPPING_SERVICE_INFO*
Declare PtrSafe Function MappingFreeServices Lib "elscore" ( _
    ByVal pServiceInfo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MappingFreeServices = ctypes.windll.elscore.MappingFreeServices
MappingFreeServices.restype = ctypes.c_int
MappingFreeServices.argtypes = [
    ctypes.c_void_p,  # pServiceInfo : MAPPING_SERVICE_INFO*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('elscore.dll')
MappingFreeServices = Fiddle::Function.new(
  lib['MappingFreeServices'],
  [
    Fiddle::TYPE_VOIDP,  # pServiceInfo : MAPPING_SERVICE_INFO*
  ],
  Fiddle::TYPE_INT)
#[link(name = "elscore")]
extern "system" {
    fn MappingFreeServices(
        pServiceInfo: *mut MAPPING_SERVICE_INFO  // MAPPING_SERVICE_INFO*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("elscore.dll")]
public static extern int MappingFreeServices(IntPtr pServiceInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'elscore_MappingFreeServices' -Namespace Win32 -PassThru
# $api::MappingFreeServices(pServiceInfo)
#uselib "elscore.dll"
#func global MappingFreeServices "MappingFreeServices" sptr
; MappingFreeServices varptr(pServiceInfo)   ; 戻り値は stat
; pServiceInfo : MAPPING_SERVICE_INFO* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "elscore.dll"
#cfunc global MappingFreeServices "MappingFreeServices" var
; res = MappingFreeServices(pServiceInfo)
; pServiceInfo : MAPPING_SERVICE_INFO* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT MappingFreeServices(MAPPING_SERVICE_INFO* pServiceInfo)
#uselib "elscore.dll"
#cfunc global MappingFreeServices "MappingFreeServices" var
; res = MappingFreeServices(pServiceInfo)
; pServiceInfo : MAPPING_SERVICE_INFO* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	elscore = windows.NewLazySystemDLL("elscore.dll")
	procMappingFreeServices = elscore.NewProc("MappingFreeServices")
)

// pServiceInfo (MAPPING_SERVICE_INFO*)
r1, _, err := procMappingFreeServices.Call(
	uintptr(pServiceInfo),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function MappingFreeServices(
  pServiceInfo: Pointer   // MAPPING_SERVICE_INFO*
): Integer; stdcall;
  external 'elscore.dll' name 'MappingFreeServices';
result := DllCall("elscore\MappingFreeServices"
    , "Ptr", pServiceInfo   ; MAPPING_SERVICE_INFO*
    , "Int")   ; return: HRESULT
●MappingFreeServices(pServiceInfo) = DLL("elscore.dll", "int MappingFreeServices(void*)")
# 呼び出し: MappingFreeServices(pServiceInfo)
# pServiceInfo : MAPPING_SERVICE_INFO* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。