Win32 API 日本語リファレンス
ホームNetworkManagement.WebDav › DavFlushFile

DavFlushFile

関数
WebDAVファイルのバッファ内容をサーバーへ書き戻す。
DLLNETAPI32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD DavFlushFile(
    HANDLE hFile
);

パラメーター

名前方向
hFileHANDLEin

戻り値の型: DWORD

各言語での呼び出し定義

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

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

DavFlushFile = ctypes.windll.netapi32.DavFlushFile
DavFlushFile.restype = wintypes.DWORD
DavFlushFile.argtypes = [
    wintypes.HANDLE,  # hFile : HANDLE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	netapi32 = windows.NewLazySystemDLL("NETAPI32.dll")
	procDavFlushFile = netapi32.NewProc("DavFlushFile")
)

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