ホーム › Devices.DeviceAndDriverInstallation › SetupOpenMasterInf
SetupOpenMasterInf
関数システムのマスターINFファイルを開いてハンドルを取得する。
シグネチャ
// SETUPAPI.dll
#include <windows.h>
void* SetupOpenMasterInf(void);パラメーターなし。戻り値: void*
各言語での呼び出し定義
// SETUPAPI.dll
#include <windows.h>
void* SetupOpenMasterInf(void);[DllImport("SETUPAPI.dll", SetLastError = true, ExactSpelling = true)]
static extern IntPtr SetupOpenMasterInf();<DllImport("SETUPAPI.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function SetupOpenMasterInf() As IntPtr
End FunctionDeclare PtrSafe Function SetupOpenMasterInf Lib "setupapi" () As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SetupOpenMasterInf = ctypes.windll.setupapi.SetupOpenMasterInf
SetupOpenMasterInf.restype = ctypes.c_void_p
SetupOpenMasterInf.argtypes = []
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SETUPAPI.dll')
SetupOpenMasterInf = Fiddle::Function.new(
lib['SetupOpenMasterInf'],
[],
Fiddle::TYPE_VOIDP)#[link(name = "setupapi")]
extern "system" {
fn SetupOpenMasterInf() -> *mut ();
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SETUPAPI.dll", SetLastError = true)]
public static extern IntPtr SetupOpenMasterInf();
"@
$api = Add-Type -MemberDefinition $sig -Name 'SETUPAPI_SetupOpenMasterInf' -Namespace Win32 -PassThru
# $api::SetupOpenMasterInf()#uselib "SETUPAPI.dll"
#func global SetupOpenMasterInf "SetupOpenMasterInf"
; SetupOpenMasterInf ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "SETUPAPI.dll"
#cfunc global SetupOpenMasterInf "SetupOpenMasterInf"
; res = SetupOpenMasterInf(); void* SetupOpenMasterInf()
#uselib "SETUPAPI.dll"
#cfunc global SetupOpenMasterInf "SetupOpenMasterInf"
; res = SetupOpenMasterInf()import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
setupapi = windows.NewLazySystemDLL("SETUPAPI.dll")
procSetupOpenMasterInf = setupapi.NewProc("SetupOpenMasterInf")
)
r1, _, err := procSetupOpenMasterInf.Call()
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // void*function SetupOpenMasterInf: Pointer; stdcall;
external 'SETUPAPI.dll' name 'SetupOpenMasterInf';result := DllCall("SETUPAPI\SetupOpenMasterInf", "Ptr")●SetupOpenMasterInf() = DLL("SETUPAPI.dll", "void* SetupOpenMasterInf()")
# 呼び出し: SetupOpenMasterInf()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。