ホーム › System.Rpc › NdrRpcSmClientAllocate
NdrRpcSmClientAllocate
関数NDRクライアントのRPCメモリ管理でメモリを割り当てる。
シグネチャ
// RPCRT4.dll
#include <windows.h>
void* NdrRpcSmClientAllocate(
UINT_PTR Size
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Size | UINT_PTR | in |
戻り値の型: void*
各言語での呼び出し定義
// RPCRT4.dll
#include <windows.h>
void* NdrRpcSmClientAllocate(
UINT_PTR Size
);[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern IntPtr NdrRpcSmClientAllocate(
UIntPtr Size // UINT_PTR
);<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function NdrRpcSmClientAllocate(
Size As UIntPtr ' UINT_PTR
) As IntPtr
End Function' Size : UINT_PTR
Declare PtrSafe Function NdrRpcSmClientAllocate Lib "rpcrt4" ( _
ByVal Size As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
NdrRpcSmClientAllocate = ctypes.windll.rpcrt4.NdrRpcSmClientAllocate
NdrRpcSmClientAllocate.restype = ctypes.c_void_p
NdrRpcSmClientAllocate.argtypes = [
ctypes.c_size_t, # Size : UINT_PTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
NdrRpcSmClientAllocate = Fiddle::Function.new(
lib['NdrRpcSmClientAllocate'],
[
Fiddle::TYPE_UINTPTR_T, # Size : UINT_PTR
],
Fiddle::TYPE_VOIDP)#[link(name = "rpcrt4")]
extern "system" {
fn NdrRpcSmClientAllocate(
Size: usize // UINT_PTR
) -> *mut ();
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll")]
public static extern IntPtr NdrRpcSmClientAllocate(UIntPtr Size);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_NdrRpcSmClientAllocate' -Namespace Win32 -PassThru
# $api::NdrRpcSmClientAllocate(Size)#uselib "RPCRT4.dll"
#func global NdrRpcSmClientAllocate "NdrRpcSmClientAllocate" sptr
; NdrRpcSmClientAllocate Size ; 戻り値は stat
; Size : UINT_PTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "RPCRT4.dll"
#cfunc global NdrRpcSmClientAllocate "NdrRpcSmClientAllocate" sptr
; res = NdrRpcSmClientAllocate(Size)
; Size : UINT_PTR -> "sptr"; void* NdrRpcSmClientAllocate(UINT_PTR Size)
#uselib "RPCRT4.dll"
#cfunc global NdrRpcSmClientAllocate "NdrRpcSmClientAllocate" intptr
; res = NdrRpcSmClientAllocate(Size)
; Size : UINT_PTR -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procNdrRpcSmClientAllocate = rpcrt4.NewProc("NdrRpcSmClientAllocate")
)
// Size (UINT_PTR)
r1, _, err := procNdrRpcSmClientAllocate.Call(
uintptr(Size),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // void*function NdrRpcSmClientAllocate(
Size: NativeUInt // UINT_PTR
): Pointer; stdcall;
external 'RPCRT4.dll' name 'NdrRpcSmClientAllocate';result := DllCall("RPCRT4\NdrRpcSmClientAllocate"
, "UPtr", Size ; UINT_PTR
, "Ptr") ; return: void*●NdrRpcSmClientAllocate(Size) = DLL("RPCRT4.dll", "void* NdrRpcSmClientAllocate(int)")
# 呼び出し: NdrRpcSmClientAllocate(Size)
# Size : UINT_PTR -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。