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

RpcSsSetThreadHandle

関数
現在のスレッドにRPCメモリ管理ハンドルを設定する。
DLLRPCRT4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

void RpcSsSetThreadHandle(
    void* Id
);

パラメーター

名前方向
Idvoid*in

戻り値の型: void

各言語での呼び出し定義

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

void RpcSsSetThreadHandle(
    void* Id
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern void RpcSsSetThreadHandle(
    IntPtr Id   // void*
);
<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Sub RpcSsSetThreadHandle(
    Id As IntPtr   ' void*
)
End Sub
' Id : void*
Declare PtrSafe Sub RpcSsSetThreadHandle Lib "rpcrt4" ( _
    ByVal Id As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RpcSsSetThreadHandle = ctypes.windll.rpcrt4.RpcSsSetThreadHandle
RpcSsSetThreadHandle.restype = None
RpcSsSetThreadHandle.argtypes = [
    ctypes.POINTER(None),  # Id : void*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
RpcSsSetThreadHandle = Fiddle::Function.new(
  lib['RpcSsSetThreadHandle'],
  [
    Fiddle::TYPE_VOIDP,  # Id : void*
  ],
  Fiddle::TYPE_VOID)
#[link(name = "rpcrt4")]
extern "system" {
    fn RpcSsSetThreadHandle(
        Id: *mut ()  // void*
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RPCRT4.dll")]
public static extern void RpcSsSetThreadHandle(IntPtr Id);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcSsSetThreadHandle' -Namespace Win32 -PassThru
# $api::RpcSsSetThreadHandle(Id)
#uselib "RPCRT4.dll"
#func global RpcSsSetThreadHandle "RpcSsSetThreadHandle" sptr
; RpcSsSetThreadHandle Id
; Id : void* -> "sptr"
#uselib "RPCRT4.dll"
#func global RpcSsSetThreadHandle "RpcSsSetThreadHandle" sptr
; RpcSsSetThreadHandle Id
; Id : void* -> "sptr"
; void RpcSsSetThreadHandle(void* Id)
#uselib "RPCRT4.dll"
#func global RpcSsSetThreadHandle "RpcSsSetThreadHandle" intptr
; RpcSsSetThreadHandle Id
; Id : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcSsSetThreadHandle = rpcrt4.NewProc("RpcSsSetThreadHandle")
)

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