ホーム › System.Rpc › NdrCorrelationInitialize
NdrCorrelationInitialize
関数NDRの相関記述子処理を初期化する。
シグネチャ
// RPCRT4.dll
#include <windows.h>
void NdrCorrelationInitialize(
MIDL_STUB_MESSAGE* pStubMsg,
void* pMemory,
DWORD CacheSize,
DWORD flags
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pStubMsg | MIDL_STUB_MESSAGE* | inout |
| pMemory | void* | inout |
| CacheSize | DWORD | in |
| flags | DWORD | in |
戻り値の型: void
各言語での呼び出し定義
// RPCRT4.dll
#include <windows.h>
void NdrCorrelationInitialize(
MIDL_STUB_MESSAGE* pStubMsg,
void* pMemory,
DWORD CacheSize,
DWORD flags
);[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern void NdrCorrelationInitialize(
IntPtr pStubMsg, // MIDL_STUB_MESSAGE* in/out
IntPtr pMemory, // void* in/out
uint CacheSize, // DWORD
uint flags // DWORD
);<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Sub NdrCorrelationInitialize(
pStubMsg As IntPtr, ' MIDL_STUB_MESSAGE* in/out
pMemory As IntPtr, ' void* in/out
CacheSize As UInteger, ' DWORD
flags As UInteger ' DWORD
)
End Sub' pStubMsg : MIDL_STUB_MESSAGE* in/out
' pMemory : void* in/out
' CacheSize : DWORD
' flags : DWORD
Declare PtrSafe Sub NdrCorrelationInitialize Lib "rpcrt4" ( _
ByVal pStubMsg As LongPtr, _
ByVal pMemory As LongPtr, _
ByVal CacheSize As Long, _
ByVal flags As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
NdrCorrelationInitialize = ctypes.windll.rpcrt4.NdrCorrelationInitialize
NdrCorrelationInitialize.restype = None
NdrCorrelationInitialize.argtypes = [
ctypes.c_void_p, # pStubMsg : MIDL_STUB_MESSAGE* in/out
ctypes.POINTER(None), # pMemory : void* in/out
wintypes.DWORD, # CacheSize : DWORD
wintypes.DWORD, # flags : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
NdrCorrelationInitialize = Fiddle::Function.new(
lib['NdrCorrelationInitialize'],
[
Fiddle::TYPE_VOIDP, # pStubMsg : MIDL_STUB_MESSAGE* in/out
Fiddle::TYPE_VOIDP, # pMemory : void* in/out
-Fiddle::TYPE_INT, # CacheSize : DWORD
-Fiddle::TYPE_INT, # flags : DWORD
],
Fiddle::TYPE_VOID)#[link(name = "rpcrt4")]
extern "system" {
fn NdrCorrelationInitialize(
pStubMsg: *mut MIDL_STUB_MESSAGE, // MIDL_STUB_MESSAGE* in/out
pMemory: *mut (), // void* in/out
CacheSize: u32, // DWORD
flags: u32 // DWORD
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll")]
public static extern void NdrCorrelationInitialize(IntPtr pStubMsg, IntPtr pMemory, uint CacheSize, uint flags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_NdrCorrelationInitialize' -Namespace Win32 -PassThru
# $api::NdrCorrelationInitialize(pStubMsg, pMemory, CacheSize, flags)#uselib "RPCRT4.dll"
#func global NdrCorrelationInitialize "NdrCorrelationInitialize" sptr, sptr, sptr, sptr
; NdrCorrelationInitialize varptr(pStubMsg), pMemory, CacheSize, flags
; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "sptr"
; pMemory : void* in/out -> "sptr"
; CacheSize : DWORD -> "sptr"
; flags : DWORD -> "sptr"出力引数:
#uselib "RPCRT4.dll" #func global NdrCorrelationInitialize "NdrCorrelationInitialize" var, sptr, int, int ; NdrCorrelationInitialize pStubMsg, pMemory, CacheSize, flags ; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "var" ; pMemory : void* in/out -> "sptr" ; CacheSize : DWORD -> "int" ; flags : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #func global NdrCorrelationInitialize "NdrCorrelationInitialize" sptr, sptr, int, int ; NdrCorrelationInitialize varptr(pStubMsg), pMemory, CacheSize, flags ; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "sptr" ; pMemory : void* in/out -> "sptr" ; CacheSize : DWORD -> "int" ; flags : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void NdrCorrelationInitialize(MIDL_STUB_MESSAGE* pStubMsg, void* pMemory, DWORD CacheSize, DWORD flags) #uselib "RPCRT4.dll" #func global NdrCorrelationInitialize "NdrCorrelationInitialize" var, intptr, int, int ; NdrCorrelationInitialize pStubMsg, pMemory, CacheSize, flags ; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "var" ; pMemory : void* in/out -> "intptr" ; CacheSize : DWORD -> "int" ; flags : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void NdrCorrelationInitialize(MIDL_STUB_MESSAGE* pStubMsg, void* pMemory, DWORD CacheSize, DWORD flags) #uselib "RPCRT4.dll" #func global NdrCorrelationInitialize "NdrCorrelationInitialize" intptr, intptr, int, int ; NdrCorrelationInitialize varptr(pStubMsg), pMemory, CacheSize, flags ; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "intptr" ; pMemory : void* in/out -> "intptr" ; CacheSize : DWORD -> "int" ; flags : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procNdrCorrelationInitialize = rpcrt4.NewProc("NdrCorrelationInitialize")
)
// pStubMsg (MIDL_STUB_MESSAGE* in/out), pMemory (void* in/out), CacheSize (DWORD), flags (DWORD)
r1, _, err := procNdrCorrelationInitialize.Call(
uintptr(pStubMsg),
uintptr(pMemory),
uintptr(CacheSize),
uintptr(flags),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure NdrCorrelationInitialize(
pStubMsg: Pointer; // MIDL_STUB_MESSAGE* in/out
pMemory: Pointer; // void* in/out
CacheSize: DWORD; // DWORD
flags: DWORD // DWORD
); stdcall;
external 'RPCRT4.dll' name 'NdrCorrelationInitialize';result := DllCall("RPCRT4\NdrCorrelationInitialize"
, "Ptr", pStubMsg ; MIDL_STUB_MESSAGE* in/out
, "Ptr", pMemory ; void* in/out
, "UInt", CacheSize ; DWORD
, "UInt", flags ; DWORD
, "Int") ; return: void●NdrCorrelationInitialize(pStubMsg, pMemory, CacheSize, flags) = DLL("RPCRT4.dll", "int NdrCorrelationInitialize(void*, void*, dword, dword)")
# 呼び出し: NdrCorrelationInitialize(pStubMsg, pMemory, CacheSize, flags)
# pStubMsg : MIDL_STUB_MESSAGE* in/out -> "void*"
# pMemory : void* in/out -> "void*"
# CacheSize : DWORD -> "dword"
# flags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。