Win32 API 日本語リファレンス
ホームDevices.DeviceAndDriverInstallation › SetupCloseInfFile

SetupCloseInfFile

関数
開いているINFファイルのハンドルを閉じて解放する。
DLLSETUPAPI.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

void SetupCloseInfFile(
    void* InfHandle
);

パラメーター

名前方向
InfHandlevoid*in

戻り値の型: void

各言語での呼び出し定義

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

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

SetupCloseInfFile = ctypes.windll.setupapi.SetupCloseInfFile
SetupCloseInfFile.restype = None
SetupCloseInfFile.argtypes = [
    ctypes.POINTER(None),  # InfHandle : void*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SETUPAPI.dll')
SetupCloseInfFile = Fiddle::Function.new(
  lib['SetupCloseInfFile'],
  [
    Fiddle::TYPE_VOIDP,  # InfHandle : void*
  ],
  Fiddle::TYPE_VOID)
#[link(name = "setupapi")]
extern "system" {
    fn SetupCloseInfFile(
        InfHandle: *mut ()  // void*
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SETUPAPI.dll")]
public static extern void SetupCloseInfFile(IntPtr InfHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SETUPAPI_SetupCloseInfFile' -Namespace Win32 -PassThru
# $api::SetupCloseInfFile(InfHandle)
#uselib "SETUPAPI.dll"
#func global SetupCloseInfFile "SetupCloseInfFile" sptr
; SetupCloseInfFile InfHandle
; InfHandle : void* -> "sptr"
#uselib "SETUPAPI.dll"
#func global SetupCloseInfFile "SetupCloseInfFile" sptr
; SetupCloseInfFile InfHandle
; InfHandle : void* -> "sptr"
; void SetupCloseInfFile(void* InfHandle)
#uselib "SETUPAPI.dll"
#func global SetupCloseInfFile "SetupCloseInfFile" intptr
; SetupCloseInfFile InfHandle
; InfHandle : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	setupapi = windows.NewLazySystemDLL("SETUPAPI.dll")
	procSetupCloseInfFile = setupapi.NewProc("SetupCloseInfFile")
)

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