Win32 API 日本語リファレンス
ホームStorage.FileSystem › Wow64RevertWow64FsRedirection

Wow64RevertWow64FsRedirection

関数
WOW64ファイルシステムリダイレクトを保存済み状態へ復元する。
DLLKERNEL32.dll呼出規約winapiSetLastErrorあり対応OSWindows Vista 以降

シグネチャ

// KERNEL32.dll
#include <windows.h>

BOOL Wow64RevertWow64FsRedirection(
    void* OlValue
);

パラメーター

名前方向
OlValuevoid*in

戻り値の型: BOOL

各言語での呼び出し定義

// KERNEL32.dll
#include <windows.h>

BOOL Wow64RevertWow64FsRedirection(
    void* OlValue
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool Wow64RevertWow64FsRedirection(
    IntPtr OlValue   // void*
);
<DllImport("KERNEL32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function Wow64RevertWow64FsRedirection(
    OlValue As IntPtr   ' void*
) As Boolean
End Function
' OlValue : void*
Declare PtrSafe Function Wow64RevertWow64FsRedirection Lib "kernel32" ( _
    ByVal OlValue As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

Wow64RevertWow64FsRedirection = ctypes.windll.kernel32.Wow64RevertWow64FsRedirection
Wow64RevertWow64FsRedirection.restype = wintypes.BOOL
Wow64RevertWow64FsRedirection.argtypes = [
    ctypes.POINTER(None),  # OlValue : void*
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('KERNEL32.dll')
Wow64RevertWow64FsRedirection = Fiddle::Function.new(
  lib['Wow64RevertWow64FsRedirection'],
  [
    Fiddle::TYPE_VOIDP,  # OlValue : void*
  ],
  Fiddle::TYPE_INT)
#[link(name = "kernel32")]
extern "system" {
    fn Wow64RevertWow64FsRedirection(
        OlValue: *mut ()  // void*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll", SetLastError = true)]
public static extern bool Wow64RevertWow64FsRedirection(IntPtr OlValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_Wow64RevertWow64FsRedirection' -Namespace Win32 -PassThru
# $api::Wow64RevertWow64FsRedirection(OlValue)
#uselib "KERNEL32.dll"
#func global Wow64RevertWow64FsRedirection "Wow64RevertWow64FsRedirection" sptr
; Wow64RevertWow64FsRedirection OlValue   ; 戻り値は stat
; OlValue : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "KERNEL32.dll"
#cfunc global Wow64RevertWow64FsRedirection "Wow64RevertWow64FsRedirection" sptr
; res = Wow64RevertWow64FsRedirection(OlValue)
; OlValue : void* -> "sptr"
; BOOL Wow64RevertWow64FsRedirection(void* OlValue)
#uselib "KERNEL32.dll"
#cfunc global Wow64RevertWow64FsRedirection "Wow64RevertWow64FsRedirection" intptr
; res = Wow64RevertWow64FsRedirection(OlValue)
; OlValue : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procWow64RevertWow64FsRedirection = kernel32.NewProc("Wow64RevertWow64FsRedirection")
)

// OlValue (void*)
r1, _, err := procWow64RevertWow64FsRedirection.Call(
	uintptr(OlValue),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function Wow64RevertWow64FsRedirection(
  OlValue: Pointer   // void*
): BOOL; stdcall;
  external 'KERNEL32.dll' name 'Wow64RevertWow64FsRedirection';
result := DllCall("KERNEL32\Wow64RevertWow64FsRedirection"
    , "Ptr", OlValue   ; void*
    , "Int")   ; return: BOOL
●Wow64RevertWow64FsRedirection(OlValue) = DLL("KERNEL32.dll", "bool Wow64RevertWow64FsRedirection(void*)")
# 呼び出し: Wow64RevertWow64FsRedirection(OlValue)
# OlValue : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。