ホーム › System.HostComputeSystem › HcsGetComputeSystemProperties
HcsGetComputeSystemProperties
関数コンピュートシステムのプロパティを取得する。
シグネチャ
// computecore.dll
#include <windows.h>
HRESULT HcsGetComputeSystemProperties(
HCS_SYSTEM computeSystem,
HCS_OPERATION operation,
LPCWSTR propertyQuery // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| computeSystem | HCS_SYSTEM | in |
| operation | HCS_OPERATION | in |
| propertyQuery | LPCWSTR | inoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// computecore.dll
#include <windows.h>
HRESULT HcsGetComputeSystemProperties(
HCS_SYSTEM computeSystem,
HCS_OPERATION operation,
LPCWSTR propertyQuery // optional
);[DllImport("computecore.dll", ExactSpelling = true)]
static extern int HcsGetComputeSystemProperties(
IntPtr computeSystem, // HCS_SYSTEM
IntPtr operation, // HCS_OPERATION
[MarshalAs(UnmanagedType.LPWStr)] string propertyQuery // LPCWSTR optional
);<DllImport("computecore.dll", ExactSpelling:=True)>
Public Shared Function HcsGetComputeSystemProperties(
computeSystem As IntPtr, ' HCS_SYSTEM
operation As IntPtr, ' HCS_OPERATION
<MarshalAs(UnmanagedType.LPWStr)> propertyQuery As String ' LPCWSTR optional
) As Integer
End Function' computeSystem : HCS_SYSTEM
' operation : HCS_OPERATION
' propertyQuery : LPCWSTR optional
Declare PtrSafe Function HcsGetComputeSystemProperties Lib "computecore" ( _
ByVal computeSystem As LongPtr, _
ByVal operation As LongPtr, _
ByVal propertyQuery As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
HcsGetComputeSystemProperties = ctypes.windll.computecore.HcsGetComputeSystemProperties
HcsGetComputeSystemProperties.restype = ctypes.c_int
HcsGetComputeSystemProperties.argtypes = [
wintypes.HANDLE, # computeSystem : HCS_SYSTEM
wintypes.HANDLE, # operation : HCS_OPERATION
wintypes.LPCWSTR, # propertyQuery : LPCWSTR optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('computecore.dll')
HcsGetComputeSystemProperties = Fiddle::Function.new(
lib['HcsGetComputeSystemProperties'],
[
Fiddle::TYPE_VOIDP, # computeSystem : HCS_SYSTEM
Fiddle::TYPE_VOIDP, # operation : HCS_OPERATION
Fiddle::TYPE_VOIDP, # propertyQuery : LPCWSTR optional
],
Fiddle::TYPE_INT)#[link(name = "computecore")]
extern "system" {
fn HcsGetComputeSystemProperties(
computeSystem: *mut core::ffi::c_void, // HCS_SYSTEM
operation: *mut core::ffi::c_void, // HCS_OPERATION
propertyQuery: *const u16 // LPCWSTR optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("computecore.dll")]
public static extern int HcsGetComputeSystemProperties(IntPtr computeSystem, IntPtr operation, [MarshalAs(UnmanagedType.LPWStr)] string propertyQuery);
"@
$api = Add-Type -MemberDefinition $sig -Name 'computecore_HcsGetComputeSystemProperties' -Namespace Win32 -PassThru
# $api::HcsGetComputeSystemProperties(computeSystem, operation, propertyQuery)#uselib "computecore.dll"
#func global HcsGetComputeSystemProperties "HcsGetComputeSystemProperties" sptr, sptr, sptr
; HcsGetComputeSystemProperties computeSystem, operation, propertyQuery ; 戻り値は stat
; computeSystem : HCS_SYSTEM -> "sptr"
; operation : HCS_OPERATION -> "sptr"
; propertyQuery : LPCWSTR optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "computecore.dll"
#cfunc global HcsGetComputeSystemProperties "HcsGetComputeSystemProperties" sptr, sptr, wstr
; res = HcsGetComputeSystemProperties(computeSystem, operation, propertyQuery)
; computeSystem : HCS_SYSTEM -> "sptr"
; operation : HCS_OPERATION -> "sptr"
; propertyQuery : LPCWSTR optional -> "wstr"; HRESULT HcsGetComputeSystemProperties(HCS_SYSTEM computeSystem, HCS_OPERATION operation, LPCWSTR propertyQuery)
#uselib "computecore.dll"
#cfunc global HcsGetComputeSystemProperties "HcsGetComputeSystemProperties" intptr, intptr, wstr
; res = HcsGetComputeSystemProperties(computeSystem, operation, propertyQuery)
; computeSystem : HCS_SYSTEM -> "intptr"
; operation : HCS_OPERATION -> "intptr"
; propertyQuery : LPCWSTR optional -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
computecore = windows.NewLazySystemDLL("computecore.dll")
procHcsGetComputeSystemProperties = computecore.NewProc("HcsGetComputeSystemProperties")
)
// computeSystem (HCS_SYSTEM), operation (HCS_OPERATION), propertyQuery (LPCWSTR optional)
r1, _, err := procHcsGetComputeSystemProperties.Call(
uintptr(computeSystem),
uintptr(operation),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(propertyQuery))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction HcsGetComputeSystemProperties(
computeSystem: THandle; // HCS_SYSTEM
operation: THandle; // HCS_OPERATION
propertyQuery: PWideChar // LPCWSTR optional
): Integer; stdcall;
external 'computecore.dll' name 'HcsGetComputeSystemProperties';result := DllCall("computecore\HcsGetComputeSystemProperties"
, "Ptr", computeSystem ; HCS_SYSTEM
, "Ptr", operation ; HCS_OPERATION
, "WStr", propertyQuery ; LPCWSTR optional
, "Int") ; return: HRESULT●HcsGetComputeSystemProperties(computeSystem, operation, propertyQuery) = DLL("computecore.dll", "int HcsGetComputeSystemProperties(void*, void*, char*)")
# 呼び出し: HcsGetComputeSystemProperties(computeSystem, operation, propertyQuery)
# computeSystem : HCS_SYSTEM -> "void*"
# operation : HCS_OPERATION -> "void*"
# propertyQuery : LPCWSTR optional -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。