ホーム › System.Threading › Wow64SetThreadDefaultGuestMachine
Wow64SetThreadDefaultGuestMachine
関数WOW64スレッドの既定ゲストマシンタイプを設定する。
シグネチャ
// api-ms-win-core-wow64-l1-1-1.dll
#include <windows.h>
WORD Wow64SetThreadDefaultGuestMachine(
WORD Machine
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Machine | WORD | in |
戻り値の型: WORD
各言語での呼び出し定義
// api-ms-win-core-wow64-l1-1-1.dll
#include <windows.h>
WORD Wow64SetThreadDefaultGuestMachine(
WORD Machine
);[DllImport("api-ms-win-core-wow64-l1-1-1.dll", ExactSpelling = true)]
static extern ushort Wow64SetThreadDefaultGuestMachine(
ushort Machine // WORD
);<DllImport("api-ms-win-core-wow64-l1-1-1.dll", ExactSpelling:=True)>
Public Shared Function Wow64SetThreadDefaultGuestMachine(
Machine As UShort ' WORD
) As UShort
End Function' Machine : WORD
Declare PtrSafe Function Wow64SetThreadDefaultGuestMachine Lib "api-ms-win-core-wow64-l1-1-1" ( _
ByVal Machine As Integer) As Integer
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
Wow64SetThreadDefaultGuestMachine = ctypes.windll.LoadLibrary("api-ms-win-core-wow64-l1-1-1.dll").Wow64SetThreadDefaultGuestMachine
Wow64SetThreadDefaultGuestMachine.restype = ctypes.c_ushort
Wow64SetThreadDefaultGuestMachine.argtypes = [
ctypes.c_ushort, # Machine : WORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('api-ms-win-core-wow64-l1-1-1.dll')
Wow64SetThreadDefaultGuestMachine = Fiddle::Function.new(
lib['Wow64SetThreadDefaultGuestMachine'],
[
-Fiddle::TYPE_SHORT, # Machine : WORD
],
-Fiddle::TYPE_SHORT)#[link(name = "api-ms-win-core-wow64-l1-1-1")]
extern "system" {
fn Wow64SetThreadDefaultGuestMachine(
Machine: u16 // WORD
) -> u16;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("api-ms-win-core-wow64-l1-1-1.dll")]
public static extern ushort Wow64SetThreadDefaultGuestMachine(ushort Machine);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-wow64-l1-1-1_Wow64SetThreadDefaultGuestMachine' -Namespace Win32 -PassThru
# $api::Wow64SetThreadDefaultGuestMachine(Machine)#uselib "api-ms-win-core-wow64-l1-1-1.dll"
#func global Wow64SetThreadDefaultGuestMachine "Wow64SetThreadDefaultGuestMachine" sptr
; Wow64SetThreadDefaultGuestMachine Machine ; 戻り値は stat
; Machine : WORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "api-ms-win-core-wow64-l1-1-1.dll"
#cfunc global Wow64SetThreadDefaultGuestMachine "Wow64SetThreadDefaultGuestMachine" int
; res = Wow64SetThreadDefaultGuestMachine(Machine)
; Machine : WORD -> "int"; WORD Wow64SetThreadDefaultGuestMachine(WORD Machine)
#uselib "api-ms-win-core-wow64-l1-1-1.dll"
#cfunc global Wow64SetThreadDefaultGuestMachine "Wow64SetThreadDefaultGuestMachine" int
; res = Wow64SetThreadDefaultGuestMachine(Machine)
; Machine : WORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
api_ms_win_core_wow64_l1_1_1 = windows.NewLazySystemDLL("api-ms-win-core-wow64-l1-1-1.dll")
procWow64SetThreadDefaultGuestMachine = api_ms_win_core_wow64_l1_1_1.NewProc("Wow64SetThreadDefaultGuestMachine")
)
// Machine (WORD)
r1, _, err := procWow64SetThreadDefaultGuestMachine.Call(
uintptr(Machine),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // WORDfunction Wow64SetThreadDefaultGuestMachine(
Machine: Word // WORD
): Word; stdcall;
external 'api-ms-win-core-wow64-l1-1-1.dll' name 'Wow64SetThreadDefaultGuestMachine';result := DllCall("api-ms-win-core-wow64-l1-1-1\Wow64SetThreadDefaultGuestMachine"
, "UShort", Machine ; WORD
, "UShort") ; return: WORD●Wow64SetThreadDefaultGuestMachine(Machine) = DLL("api-ms-win-core-wow64-l1-1-1.dll", "int Wow64SetThreadDefaultGuestMachine(int)")
# 呼び出し: Wow64SetThreadDefaultGuestMachine(Machine)
# Machine : WORD -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。