Win32 API 日本語リファレンス
ホームStorage.FileHistory › FhServiceClosePipe

FhServiceClosePipe

関数
ファイル履歴サービスの制御パイプを閉じる。
DLLfhsvcctl.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

HRESULT FhServiceClosePipe(
    FH_SERVICE_PIPE_HANDLE Pipe
);

パラメーター

名前方向
PipeFH_SERVICE_PIPE_HANDLEin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT FhServiceClosePipe(
    FH_SERVICE_PIPE_HANDLE Pipe
);
[DllImport("fhsvcctl.dll", ExactSpelling = true)]
static extern int FhServiceClosePipe(
    IntPtr Pipe   // FH_SERVICE_PIPE_HANDLE
);
<DllImport("fhsvcctl.dll", ExactSpelling:=True)>
Public Shared Function FhServiceClosePipe(
    Pipe As IntPtr   ' FH_SERVICE_PIPE_HANDLE
) As Integer
End Function
' Pipe : FH_SERVICE_PIPE_HANDLE
Declare PtrSafe Function FhServiceClosePipe Lib "fhsvcctl" ( _
    ByVal Pipe As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

FhServiceClosePipe = ctypes.windll.fhsvcctl.FhServiceClosePipe
FhServiceClosePipe.restype = ctypes.c_int
FhServiceClosePipe.argtypes = [
    wintypes.HANDLE,  # Pipe : FH_SERVICE_PIPE_HANDLE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	fhsvcctl = windows.NewLazySystemDLL("fhsvcctl.dll")
	procFhServiceClosePipe = fhsvcctl.NewProc("FhServiceClosePipe")
)

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