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