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