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

RpcNsBindingLookupDone

関数
ネームサービスのバインディング検索を終了しコンテキストを解放する。
DLLRPCNS4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcNsBindingLookupDone(
    void** LookupContext
);

パラメーター

名前方向説明
LookupContextvoid**inout

解放する名前サービス ハンドルへのポインター。LookupContext が指す名前サービス ハンドルは、 RpcNsBindingLookupBegin 関数を呼び出して作成されます。

引数の値として NULL が返されます。

戻り値の型: RPC_STATUS

公式ドキュメント

RpcNsBindingLookupDone 関数は、クライアントが互換性のあるサーバーの検索を終了したことを示し、ルックアップ コンテキストを削除します。

戻り値

説明
RPC_S_OK
呼び出しは成功しました。
メモ 有効なエラー コードの一覧については、 RPC Return Values を参照してください。

解説(Remarks)

RpcNsBindingLookupDone 関数は、 RpcNsBindingLookupBegin 関数を呼び出して作成されたルックアップ コンテキストを解放します。

通常、クライアント アプリケーションは、 RpcNsBindingLookupNext 関数から返されたバインディング ハンドルを使用してサーバーへのリモート プロシージャ コールを完了した後に、 RpcNsBindingLookupDone を呼び出します。ただし、 RpcNsBindingLookupNext 関数から返された状態や、リモート プロシージャ コールの成否にかかわらず、作成したルックアップ コンテキストごとに RpcNsBindingLookupDone を呼び出す責任はクライアント アプリケーションにあります。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での呼び出し定義

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

RPC_STATUS RpcNsBindingLookupDone(
    void** LookupContext
);
[DllImport("RPCNS4.dll", ExactSpelling = true)]
static extern int RpcNsBindingLookupDone(
    IntPtr LookupContext   // void** in/out
);
<DllImport("RPCNS4.dll", ExactSpelling:=True)>
Public Shared Function RpcNsBindingLookupDone(
    LookupContext As IntPtr   ' void** in/out
) As Integer
End Function
' LookupContext : void** in/out
Declare PtrSafe Function RpcNsBindingLookupDone Lib "rpcns4" ( _
    ByVal LookupContext As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RpcNsBindingLookupDone = ctypes.windll.rpcns4.RpcNsBindingLookupDone
RpcNsBindingLookupDone.restype = ctypes.c_int
RpcNsBindingLookupDone.argtypes = [
    ctypes.c_void_p,  # LookupContext : void** in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcns4 = windows.NewLazySystemDLL("RPCNS4.dll")
	procRpcNsBindingLookupDone = rpcns4.NewProc("RpcNsBindingLookupDone")
)

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

extern "rpcns4" fn RpcNsBindingLookupDone(
    LookupContext: ?*anyopaque // void** in/out
) callconv(std.os.windows.WINAPI) i32;
proc RpcNsBindingLookupDone(
    LookupContext: pointer  # void** in/out
): int32 {.importc: "RpcNsBindingLookupDone", stdcall, dynlib: "RPCNS4.dll".}
pragma(lib, "rpcns4");
extern(Windows)
int RpcNsBindingLookupDone(
    void** LookupContext   // void** in/out
);
ccall((:RpcNsBindingLookupDone, "RPCNS4.dll"), stdcall, Int32,
      (Ptr{Cvoid},),
      LookupContext)
# LookupContext : void** in/out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t RpcNsBindingLookupDone(
    void** LookupContext);
]]
local rpcns4 = ffi.load("rpcns4")
-- rpcns4.RpcNsBindingLookupDone(LookupContext)
-- LookupContext : void** in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('RPCNS4.dll');
const RpcNsBindingLookupDone = lib.func('__stdcall', 'RpcNsBindingLookupDone', 'int32_t', ['void *']);
// RpcNsBindingLookupDone(LookupContext)
// LookupContext : void** in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("RPCNS4.dll", {
  RpcNsBindingLookupDone: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.RpcNsBindingLookupDone(LookupContext)
// LookupContext : void** in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t RpcNsBindingLookupDone(
    void** LookupContext);
C, "RPCNS4.dll");
// $ffi->RpcNsBindingLookupDone(LookupContext);
// LookupContext : void** in/out
// 構造体/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 Rpcns4 extends StdCallLibrary {
    Rpcns4 INSTANCE = Native.load("rpcns4", Rpcns4.class);
    int RpcNsBindingLookupDone(
        Pointer LookupContext   // void** in/out
    );
}
@[Link("rpcns4")]
lib LibRPCNS4
  fun RpcNsBindingLookupDone = RpcNsBindingLookupDone(
    LookupContext : Void**   # void** in/out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef RpcNsBindingLookupDoneNative = Int32 Function(Pointer<Void>);
typedef RpcNsBindingLookupDoneDart = int Function(Pointer<Void>);
final RpcNsBindingLookupDone = DynamicLibrary.open('RPCNS4.dll')
    .lookupFunction<RpcNsBindingLookupDoneNative, RpcNsBindingLookupDoneDart>('RpcNsBindingLookupDone');
// LookupContext : void** in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function RpcNsBindingLookupDone(
  LookupContext: Pointer   // void** in/out
): Integer; stdcall;
  external 'RPCNS4.dll' name 'RpcNsBindingLookupDone';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "RpcNsBindingLookupDone"
  c_RpcNsBindingLookupDone :: Ptr () -> IO Int32
-- LookupContext : void** in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let rpcnsbindinglookupdone =
  foreign "RpcNsBindingLookupDone"
    ((ptr void) @-> returning int32_t)
(* LookupContext : void** in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library rpcns4 (t "RPCNS4.dll"))
(cffi:use-foreign-library rpcns4)

(cffi:defcfun ("RpcNsBindingLookupDone" rpc-ns-binding-lookup-done :convention :stdcall) :int32
  (lookup-context :pointer))   ; void** in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $RpcNsBindingLookupDone = Win32::API::More->new('RPCNS4',
    'int RpcNsBindingLookupDone(LPVOID LookupContext)');
# my $ret = $RpcNsBindingLookupDone->Call($LookupContext);
# LookupContext : void** in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

公式の関連項目
使用する型