ホーム › System.CorrelationVector › RtlValidateCorrelationVector
RtlValidateCorrelationVector
関数相関ベクターの形式が有効かどうかを検証する。
シグネチャ
// ntdll.dll
#include <windows.h>
DWORD RtlValidateCorrelationVector(
CORRELATION_VECTOR* Vector
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| Vector | CORRELATION_VECTOR* | in | 妥当性を検証する対象の相関ベクトル構造体へのポインタ。 |
戻り値の型: DWORD
各言語での呼び出し定義
// ntdll.dll
#include <windows.h>
DWORD RtlValidateCorrelationVector(
CORRELATION_VECTOR* Vector
);[DllImport("ntdll.dll", ExactSpelling = true)]
static extern uint RtlValidateCorrelationVector(
IntPtr Vector // CORRELATION_VECTOR*
);<DllImport("ntdll.dll", ExactSpelling:=True)>
Public Shared Function RtlValidateCorrelationVector(
Vector As IntPtr ' CORRELATION_VECTOR*
) As UInteger
End Function' Vector : CORRELATION_VECTOR*
Declare PtrSafe Function RtlValidateCorrelationVector Lib "ntdll" ( _
ByVal Vector As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RtlValidateCorrelationVector = ctypes.windll.ntdll.RtlValidateCorrelationVector
RtlValidateCorrelationVector.restype = wintypes.DWORD
RtlValidateCorrelationVector.argtypes = [
ctypes.c_void_p, # Vector : CORRELATION_VECTOR*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ntdll.dll')
RtlValidateCorrelationVector = Fiddle::Function.new(
lib['RtlValidateCorrelationVector'],
[
Fiddle::TYPE_VOIDP, # Vector : CORRELATION_VECTOR*
],
-Fiddle::TYPE_INT)#[link(name = "ntdll")]
extern "system" {
fn RtlValidateCorrelationVector(
Vector: *mut CORRELATION_VECTOR // CORRELATION_VECTOR*
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ntdll.dll")]
public static extern uint RtlValidateCorrelationVector(IntPtr Vector);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ntdll_RtlValidateCorrelationVector' -Namespace Win32 -PassThru
# $api::RtlValidateCorrelationVector(Vector)#uselib "ntdll.dll"
#func global RtlValidateCorrelationVector "RtlValidateCorrelationVector" sptr
; RtlValidateCorrelationVector varptr(Vector) ; 戻り値は stat
; Vector : CORRELATION_VECTOR* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "ntdll.dll" #cfunc global RtlValidateCorrelationVector "RtlValidateCorrelationVector" var ; res = RtlValidateCorrelationVector(Vector) ; Vector : CORRELATION_VECTOR* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "ntdll.dll" #cfunc global RtlValidateCorrelationVector "RtlValidateCorrelationVector" sptr ; res = RtlValidateCorrelationVector(varptr(Vector)) ; Vector : CORRELATION_VECTOR* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD RtlValidateCorrelationVector(CORRELATION_VECTOR* Vector) #uselib "ntdll.dll" #cfunc global RtlValidateCorrelationVector "RtlValidateCorrelationVector" var ; res = RtlValidateCorrelationVector(Vector) ; Vector : CORRELATION_VECTOR* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD RtlValidateCorrelationVector(CORRELATION_VECTOR* Vector) #uselib "ntdll.dll" #cfunc global RtlValidateCorrelationVector "RtlValidateCorrelationVector" intptr ; res = RtlValidateCorrelationVector(varptr(Vector)) ; Vector : CORRELATION_VECTOR* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
ntdll = windows.NewLazySystemDLL("ntdll.dll")
procRtlValidateCorrelationVector = ntdll.NewProc("RtlValidateCorrelationVector")
)
// Vector (CORRELATION_VECTOR*)
r1, _, err := procRtlValidateCorrelationVector.Call(
uintptr(Vector),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction RtlValidateCorrelationVector(
Vector: Pointer // CORRELATION_VECTOR*
): DWORD; stdcall;
external 'ntdll.dll' name 'RtlValidateCorrelationVector';result := DllCall("ntdll\RtlValidateCorrelationVector"
, "Ptr", Vector ; CORRELATION_VECTOR*
, "UInt") ; return: DWORD●RtlValidateCorrelationVector(Vector) = DLL("ntdll.dll", "dword RtlValidateCorrelationVector(void*)")
# 呼び出し: RtlValidateCorrelationVector(Vector)
# Vector : CORRELATION_VECTOR* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "ntdll" fn RtlValidateCorrelationVector(
Vector: [*c]CORRELATION_VECTOR // CORRELATION_VECTOR*
) callconv(std.os.windows.WINAPI) u32;proc RtlValidateCorrelationVector(
Vector: ptr CORRELATION_VECTOR # CORRELATION_VECTOR*
): uint32 {.importc: "RtlValidateCorrelationVector", stdcall, dynlib: "ntdll.dll".}pragma(lib, "ntdll");
extern(Windows)
uint RtlValidateCorrelationVector(
CORRELATION_VECTOR* Vector // CORRELATION_VECTOR*
);ccall((:RtlValidateCorrelationVector, "ntdll.dll"), stdcall, UInt32,
(Ptr{CORRELATION_VECTOR},),
Vector)
# Vector : CORRELATION_VECTOR* -> Ptr{CORRELATION_VECTOR}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t RtlValidateCorrelationVector(
void* Vector);
]]
local ntdll = ffi.load("ntdll")
-- ntdll.RtlValidateCorrelationVector(Vector)
-- Vector : CORRELATION_VECTOR*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('ntdll.dll');
const RtlValidateCorrelationVector = lib.func('__stdcall', 'RtlValidateCorrelationVector', 'uint32_t', ['void *']);
// RtlValidateCorrelationVector(Vector)
// Vector : CORRELATION_VECTOR* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("ntdll.dll", {
RtlValidateCorrelationVector: { parameters: ["pointer"], result: "u32" },
});
// lib.symbols.RtlValidateCorrelationVector(Vector)
// Vector : CORRELATION_VECTOR* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t RtlValidateCorrelationVector(
void* Vector);
C, "ntdll.dll");
// $ffi->RtlValidateCorrelationVector(Vector);
// Vector : CORRELATION_VECTOR*
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Ntdll extends StdCallLibrary {
Ntdll INSTANCE = Native.load("ntdll", Ntdll.class);
int RtlValidateCorrelationVector(
Pointer Vector // CORRELATION_VECTOR*
);
}@[Link("ntdll")]
lib Libntdll
fun RtlValidateCorrelationVector = RtlValidateCorrelationVector(
Vector : CORRELATION_VECTOR* # CORRELATION_VECTOR*
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef RtlValidateCorrelationVectorNative = Uint32 Function(Pointer<Void>);
typedef RtlValidateCorrelationVectorDart = int Function(Pointer<Void>);
final RtlValidateCorrelationVector = DynamicLibrary.open('ntdll.dll')
.lookupFunction<RtlValidateCorrelationVectorNative, RtlValidateCorrelationVectorDart>('RtlValidateCorrelationVector');
// Vector : CORRELATION_VECTOR* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function RtlValidateCorrelationVector(
Vector: Pointer // CORRELATION_VECTOR*
): DWORD; stdcall;
external 'ntdll.dll' name 'RtlValidateCorrelationVector';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "RtlValidateCorrelationVector"
c_RtlValidateCorrelationVector :: Ptr () -> IO Word32
-- Vector : CORRELATION_VECTOR* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let rtlvalidatecorrelationvector =
foreign "RtlValidateCorrelationVector"
((ptr void) @-> returning uint32_t)
(* Vector : CORRELATION_VECTOR* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library ntdll (t "ntdll.dll"))
(cffi:use-foreign-library ntdll)
(cffi:defcfun ("RtlValidateCorrelationVector" rtl-validate-correlation-vector :convention :stdcall) :uint32
(vector :pointer)) ; CORRELATION_VECTOR*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $RtlValidateCorrelationVector = Win32::API::More->new('ntdll',
'DWORD RtlValidateCorrelationVector(LPVOID Vector)');
# my $ret = $RtlValidateCorrelationVector->Call($Vector);
# Vector : CORRELATION_VECTOR* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型