ホーム › System.Memory › SetProcessValidCallTargetsForMappedView
SetProcessValidCallTargetsForMappedView
関数マップビューに対しCFG有効呼び出しターゲットを設定する。
シグネチャ
// api-ms-win-core-memory-l1-1-7.dll
#include <windows.h>
BOOL SetProcessValidCallTargetsForMappedView(
HANDLE Process,
void* VirtualAddress,
UINT_PTR RegionSize,
DWORD NumberOfOffsets,
CFG_CALL_TARGET_INFO* OffsetInformation,
HANDLE Section,
ULONGLONG ExpectedFileOffset
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Process | HANDLE | in |
| VirtualAddress | void* | in |
| RegionSize | UINT_PTR | in |
| NumberOfOffsets | DWORD | in |
| OffsetInformation | CFG_CALL_TARGET_INFO* | inout |
| Section | HANDLE | in |
| ExpectedFileOffset | ULONGLONG | in |
戻り値の型: BOOL
各言語での呼び出し定義
// api-ms-win-core-memory-l1-1-7.dll
#include <windows.h>
BOOL SetProcessValidCallTargetsForMappedView(
HANDLE Process,
void* VirtualAddress,
UINT_PTR RegionSize,
DWORD NumberOfOffsets,
CFG_CALL_TARGET_INFO* OffsetInformation,
HANDLE Section,
ULONGLONG ExpectedFileOffset
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("api-ms-win-core-memory-l1-1-7.dll", ExactSpelling = true)]
static extern bool SetProcessValidCallTargetsForMappedView(
IntPtr Process, // HANDLE
IntPtr VirtualAddress, // void*
UIntPtr RegionSize, // UINT_PTR
uint NumberOfOffsets, // DWORD
IntPtr OffsetInformation, // CFG_CALL_TARGET_INFO* in/out
IntPtr Section, // HANDLE
ulong ExpectedFileOffset // ULONGLONG
);<DllImport("api-ms-win-core-memory-l1-1-7.dll", ExactSpelling:=True)>
Public Shared Function SetProcessValidCallTargetsForMappedView(
Process As IntPtr, ' HANDLE
VirtualAddress As IntPtr, ' void*
RegionSize As UIntPtr, ' UINT_PTR
NumberOfOffsets As UInteger, ' DWORD
OffsetInformation As IntPtr, ' CFG_CALL_TARGET_INFO* in/out
Section As IntPtr, ' HANDLE
ExpectedFileOffset As ULong ' ULONGLONG
) As Boolean
End Function' Process : HANDLE
' VirtualAddress : void*
' RegionSize : UINT_PTR
' NumberOfOffsets : DWORD
' OffsetInformation : CFG_CALL_TARGET_INFO* in/out
' Section : HANDLE
' ExpectedFileOffset : ULONGLONG
Declare PtrSafe Function SetProcessValidCallTargetsForMappedView Lib "api-ms-win-core-memory-l1-1-7" ( _
ByVal Process As LongPtr, _
ByVal VirtualAddress As LongPtr, _
ByVal RegionSize As LongPtr, _
ByVal NumberOfOffsets As Long, _
ByVal OffsetInformation As LongPtr, _
ByVal Section As LongPtr, _
ByVal ExpectedFileOffset As LongLong) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SetProcessValidCallTargetsForMappedView = ctypes.windll.LoadLibrary("api-ms-win-core-memory-l1-1-7.dll").SetProcessValidCallTargetsForMappedView
SetProcessValidCallTargetsForMappedView.restype = wintypes.BOOL
SetProcessValidCallTargetsForMappedView.argtypes = [
wintypes.HANDLE, # Process : HANDLE
ctypes.POINTER(None), # VirtualAddress : void*
ctypes.c_size_t, # RegionSize : UINT_PTR
wintypes.DWORD, # NumberOfOffsets : DWORD
ctypes.c_void_p, # OffsetInformation : CFG_CALL_TARGET_INFO* in/out
wintypes.HANDLE, # Section : HANDLE
ctypes.c_ulonglong, # ExpectedFileOffset : ULONGLONG
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('api-ms-win-core-memory-l1-1-7.dll')
SetProcessValidCallTargetsForMappedView = Fiddle::Function.new(
lib['SetProcessValidCallTargetsForMappedView'],
[
Fiddle::TYPE_VOIDP, # Process : HANDLE
Fiddle::TYPE_VOIDP, # VirtualAddress : void*
Fiddle::TYPE_UINTPTR_T, # RegionSize : UINT_PTR
-Fiddle::TYPE_INT, # NumberOfOffsets : DWORD
Fiddle::TYPE_VOIDP, # OffsetInformation : CFG_CALL_TARGET_INFO* in/out
Fiddle::TYPE_VOIDP, # Section : HANDLE
-Fiddle::TYPE_LONG_LONG, # ExpectedFileOffset : ULONGLONG
],
Fiddle::TYPE_INT)#[link(name = "api-ms-win-core-memory-l1-1-7")]
extern "system" {
fn SetProcessValidCallTargetsForMappedView(
Process: *mut core::ffi::c_void, // HANDLE
VirtualAddress: *mut (), // void*
RegionSize: usize, // UINT_PTR
NumberOfOffsets: u32, // DWORD
OffsetInformation: *mut CFG_CALL_TARGET_INFO, // CFG_CALL_TARGET_INFO* in/out
Section: *mut core::ffi::c_void, // HANDLE
ExpectedFileOffset: u64 // ULONGLONG
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("api-ms-win-core-memory-l1-1-7.dll")]
public static extern bool SetProcessValidCallTargetsForMappedView(IntPtr Process, IntPtr VirtualAddress, UIntPtr RegionSize, uint NumberOfOffsets, IntPtr OffsetInformation, IntPtr Section, ulong ExpectedFileOffset);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-memory-l1-1-7_SetProcessValidCallTargetsForMappedView' -Namespace Win32 -PassThru
# $api::SetProcessValidCallTargetsForMappedView(Process, VirtualAddress, RegionSize, NumberOfOffsets, OffsetInformation, Section, ExpectedFileOffset)#uselib "api-ms-win-core-memory-l1-1-7.dll"
#func global SetProcessValidCallTargetsForMappedView "SetProcessValidCallTargetsForMappedView" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; SetProcessValidCallTargetsForMappedView Process, VirtualAddress, RegionSize, NumberOfOffsets, varptr(OffsetInformation), Section, ExpectedFileOffset ; 戻り値は stat
; Process : HANDLE -> "sptr"
; VirtualAddress : void* -> "sptr"
; RegionSize : UINT_PTR -> "sptr"
; NumberOfOffsets : DWORD -> "sptr"
; OffsetInformation : CFG_CALL_TARGET_INFO* in/out -> "sptr"
; Section : HANDLE -> "sptr"
; ExpectedFileOffset : ULONGLONG -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "api-ms-win-core-memory-l1-1-7.dll" #cfunc global SetProcessValidCallTargetsForMappedView "SetProcessValidCallTargetsForMappedView" sptr, sptr, sptr, int, var, sptr, int64 ; res = SetProcessValidCallTargetsForMappedView(Process, VirtualAddress, RegionSize, NumberOfOffsets, OffsetInformation, Section, ExpectedFileOffset) ; Process : HANDLE -> "sptr" ; VirtualAddress : void* -> "sptr" ; RegionSize : UINT_PTR -> "sptr" ; NumberOfOffsets : DWORD -> "int" ; OffsetInformation : CFG_CALL_TARGET_INFO* in/out -> "var" ; Section : HANDLE -> "sptr" ; ExpectedFileOffset : ULONGLONG -> "int64" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。 ; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。#uselib "api-ms-win-core-memory-l1-1-7.dll" #cfunc global SetProcessValidCallTargetsForMappedView "SetProcessValidCallTargetsForMappedView" sptr, sptr, sptr, int, sptr, sptr, int64 ; res = SetProcessValidCallTargetsForMappedView(Process, VirtualAddress, RegionSize, NumberOfOffsets, varptr(OffsetInformation), Section, ExpectedFileOffset) ; Process : HANDLE -> "sptr" ; VirtualAddress : void* -> "sptr" ; RegionSize : UINT_PTR -> "sptr" ; NumberOfOffsets : DWORD -> "int" ; OffsetInformation : CFG_CALL_TARGET_INFO* in/out -> "sptr" ; Section : HANDLE -> "sptr" ; ExpectedFileOffset : ULONGLONG -> "int64" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
出力引数:
; BOOL SetProcessValidCallTargetsForMappedView(HANDLE Process, void* VirtualAddress, UINT_PTR RegionSize, DWORD NumberOfOffsets, CFG_CALL_TARGET_INFO* OffsetInformation, HANDLE Section, ULONGLONG ExpectedFileOffset) #uselib "api-ms-win-core-memory-l1-1-7.dll" #cfunc global SetProcessValidCallTargetsForMappedView "SetProcessValidCallTargetsForMappedView" intptr, intptr, intptr, int, var, intptr, int64 ; res = SetProcessValidCallTargetsForMappedView(Process, VirtualAddress, RegionSize, NumberOfOffsets, OffsetInformation, Section, ExpectedFileOffset) ; Process : HANDLE -> "intptr" ; VirtualAddress : void* -> "intptr" ; RegionSize : UINT_PTR -> "intptr" ; NumberOfOffsets : DWORD -> "int" ; OffsetInformation : CFG_CALL_TARGET_INFO* in/out -> "var" ; Section : HANDLE -> "intptr" ; ExpectedFileOffset : ULONGLONG -> "int64" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL SetProcessValidCallTargetsForMappedView(HANDLE Process, void* VirtualAddress, UINT_PTR RegionSize, DWORD NumberOfOffsets, CFG_CALL_TARGET_INFO* OffsetInformation, HANDLE Section, ULONGLONG ExpectedFileOffset) #uselib "api-ms-win-core-memory-l1-1-7.dll" #cfunc global SetProcessValidCallTargetsForMappedView "SetProcessValidCallTargetsForMappedView" intptr, intptr, intptr, int, intptr, intptr, int64 ; res = SetProcessValidCallTargetsForMappedView(Process, VirtualAddress, RegionSize, NumberOfOffsets, varptr(OffsetInformation), Section, ExpectedFileOffset) ; Process : HANDLE -> "intptr" ; VirtualAddress : void* -> "intptr" ; RegionSize : UINT_PTR -> "intptr" ; NumberOfOffsets : DWORD -> "int" ; OffsetInformation : CFG_CALL_TARGET_INFO* in/out -> "intptr" ; Section : HANDLE -> "intptr" ; ExpectedFileOffset : ULONGLONG -> "int64" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
api_ms_win_core_memory_l1_1_7 = windows.NewLazySystemDLL("api-ms-win-core-memory-l1-1-7.dll")
procSetProcessValidCallTargetsForMappedView = api_ms_win_core_memory_l1_1_7.NewProc("SetProcessValidCallTargetsForMappedView")
)
// Process (HANDLE), VirtualAddress (void*), RegionSize (UINT_PTR), NumberOfOffsets (DWORD), OffsetInformation (CFG_CALL_TARGET_INFO* in/out), Section (HANDLE), ExpectedFileOffset (ULONGLONG)
r1, _, err := procSetProcessValidCallTargetsForMappedView.Call(
uintptr(Process),
uintptr(VirtualAddress),
uintptr(RegionSize),
uintptr(NumberOfOffsets),
uintptr(OffsetInformation),
uintptr(Section),
uintptr(ExpectedFileOffset),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction SetProcessValidCallTargetsForMappedView(
Process: THandle; // HANDLE
VirtualAddress: Pointer; // void*
RegionSize: NativeUInt; // UINT_PTR
NumberOfOffsets: DWORD; // DWORD
OffsetInformation: Pointer; // CFG_CALL_TARGET_INFO* in/out
Section: THandle; // HANDLE
ExpectedFileOffset: UInt64 // ULONGLONG
): BOOL; stdcall;
external 'api-ms-win-core-memory-l1-1-7.dll' name 'SetProcessValidCallTargetsForMappedView';result := DllCall("api-ms-win-core-memory-l1-1-7\SetProcessValidCallTargetsForMappedView"
, "Ptr", Process ; HANDLE
, "Ptr", VirtualAddress ; void*
, "UPtr", RegionSize ; UINT_PTR
, "UInt", NumberOfOffsets ; DWORD
, "Ptr", OffsetInformation ; CFG_CALL_TARGET_INFO* in/out
, "Ptr", Section ; HANDLE
, "Int64", ExpectedFileOffset ; ULONGLONG
, "Int") ; return: BOOL●SetProcessValidCallTargetsForMappedView(Process, VirtualAddress, RegionSize, NumberOfOffsets, OffsetInformation, Section, ExpectedFileOffset) = DLL("api-ms-win-core-memory-l1-1-7.dll", "bool SetProcessValidCallTargetsForMappedView(void*, void*, int, dword, void*, void*, qword)")
# 呼び出し: SetProcessValidCallTargetsForMappedView(Process, VirtualAddress, RegionSize, NumberOfOffsets, OffsetInformation, Section, ExpectedFileOffset)
# Process : HANDLE -> "void*"
# VirtualAddress : void* -> "void*"
# RegionSize : UINT_PTR -> "int"
# NumberOfOffsets : DWORD -> "dword"
# OffsetInformation : CFG_CALL_TARGET_INFO* in/out -> "void*"
# Section : HANDLE -> "void*"
# ExpectedFileOffset : ULONGLONG -> "qword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。