Win32 API 日本語リファレンス
ホームSystem.Rpc › RpcMgmtSetServerStackSize

RpcMgmtSetServerStackSize

関数
サーバースレッドのスタックサイズを設定する。
DLLRPCRT4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcMgmtSetServerStackSize(
    DWORD ThreadStackSize
);

パラメーター

名前方向
ThreadStackSizeDWORDin

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

RPC_STATUS RpcMgmtSetServerStackSize(
    DWORD ThreadStackSize
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int RpcMgmtSetServerStackSize(
    uint ThreadStackSize   // DWORD
);
<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function RpcMgmtSetServerStackSize(
    ThreadStackSize As UInteger   ' DWORD
) As Integer
End Function
' ThreadStackSize : DWORD
Declare PtrSafe Function RpcMgmtSetServerStackSize Lib "rpcrt4" ( _
    ByVal ThreadStackSize As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RpcMgmtSetServerStackSize = ctypes.windll.rpcrt4.RpcMgmtSetServerStackSize
RpcMgmtSetServerStackSize.restype = ctypes.c_int
RpcMgmtSetServerStackSize.argtypes = [
    wintypes.DWORD,  # ThreadStackSize : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
RpcMgmtSetServerStackSize = Fiddle::Function.new(
  lib['RpcMgmtSetServerStackSize'],
  [
    -Fiddle::TYPE_INT,  # ThreadStackSize : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "rpcrt4")]
extern "system" {
    fn RpcMgmtSetServerStackSize(
        ThreadStackSize: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RPCRT4.dll")]
public static extern int RpcMgmtSetServerStackSize(uint ThreadStackSize);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcMgmtSetServerStackSize' -Namespace Win32 -PassThru
# $api::RpcMgmtSetServerStackSize(ThreadStackSize)
#uselib "RPCRT4.dll"
#func global RpcMgmtSetServerStackSize "RpcMgmtSetServerStackSize" sptr
; RpcMgmtSetServerStackSize ThreadStackSize   ; 戻り値は stat
; ThreadStackSize : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "RPCRT4.dll"
#cfunc global RpcMgmtSetServerStackSize "RpcMgmtSetServerStackSize" int
; res = RpcMgmtSetServerStackSize(ThreadStackSize)
; ThreadStackSize : DWORD -> "int"
; RPC_STATUS RpcMgmtSetServerStackSize(DWORD ThreadStackSize)
#uselib "RPCRT4.dll"
#cfunc global RpcMgmtSetServerStackSize "RpcMgmtSetServerStackSize" int
; res = RpcMgmtSetServerStackSize(ThreadStackSize)
; ThreadStackSize : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcMgmtSetServerStackSize = rpcrt4.NewProc("RpcMgmtSetServerStackSize")
)

// ThreadStackSize (DWORD)
r1, _, err := procRpcMgmtSetServerStackSize.Call(
	uintptr(ThreadStackSize),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function RpcMgmtSetServerStackSize(
  ThreadStackSize: DWORD   // DWORD
): Integer; stdcall;
  external 'RPCRT4.dll' name 'RpcMgmtSetServerStackSize';
result := DllCall("RPCRT4\RpcMgmtSetServerStackSize"
    , "UInt", ThreadStackSize   ; DWORD
    , "Int")   ; return: RPC_STATUS
●RpcMgmtSetServerStackSize(ThreadStackSize) = DLL("RPCRT4.dll", "int RpcMgmtSetServerStackSize(dword)")
# 呼び出し: RpcMgmtSetServerStackSize(ThreadStackSize)
# ThreadStackSize : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。