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

FileSaveMarkNotExistW

関数
存在しないファイルとしてバックアップに記録する(Unicode版)。
DLLADVPACK.dll文字セットUnicode (-W)呼出規約winapi

シグネチャ

// ADVPACK.dll  (Unicode / -W)
#include <windows.h>

HRESULT FileSaveMarkNotExistW(
    LPCWSTR lpFileList,   // optional
    LPCWSTR lpDir,   // optional
    LPCWSTR lpBaseName   // optional
);

パラメーター

名前方向
lpFileListLPCWSTRinoptional
lpDirLPCWSTRinoptional
lpBaseNameLPCWSTRinoptional

戻り値の型: HRESULT

各言語での呼び出し定義

// ADVPACK.dll  (Unicode / -W)
#include <windows.h>

HRESULT FileSaveMarkNotExistW(
    LPCWSTR lpFileList,   // optional
    LPCWSTR lpDir,   // optional
    LPCWSTR lpBaseName   // optional
);
[DllImport("ADVPACK.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int FileSaveMarkNotExistW(
    [MarshalAs(UnmanagedType.LPWStr)] string lpFileList,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string lpDir,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string lpBaseName   // LPCWSTR optional
);
<DllImport("ADVPACK.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function FileSaveMarkNotExistW(
    <MarshalAs(UnmanagedType.LPWStr)> lpFileList As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> lpDir As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> lpBaseName As String   ' LPCWSTR optional
) As Integer
End Function
' lpFileList : LPCWSTR optional
' lpDir : LPCWSTR optional
' lpBaseName : LPCWSTR optional
Declare PtrSafe Function FileSaveMarkNotExistW Lib "advpack" ( _
    ByVal lpFileList As LongPtr, _
    ByVal lpDir As LongPtr, _
    ByVal lpBaseName As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

FileSaveMarkNotExistW = ctypes.windll.advpack.FileSaveMarkNotExistW
FileSaveMarkNotExistW.restype = ctypes.c_int
FileSaveMarkNotExistW.argtypes = [
    wintypes.LPCWSTR,  # lpFileList : LPCWSTR optional
    wintypes.LPCWSTR,  # lpDir : LPCWSTR optional
    wintypes.LPCWSTR,  # lpBaseName : LPCWSTR optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ADVPACK.dll')
FileSaveMarkNotExistW = Fiddle::Function.new(
  lib['FileSaveMarkNotExistW'],
  [
    Fiddle::TYPE_VOIDP,  # lpFileList : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # lpDir : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # lpBaseName : LPCWSTR optional
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "advpack")]
extern "system" {
    fn FileSaveMarkNotExistW(
        lpFileList: *const u16,  // LPCWSTR optional
        lpDir: *const u16,  // LPCWSTR optional
        lpBaseName: *const u16  // LPCWSTR optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ADVPACK.dll", CharSet = CharSet.Unicode)]
public static extern int FileSaveMarkNotExistW([MarshalAs(UnmanagedType.LPWStr)] string lpFileList, [MarshalAs(UnmanagedType.LPWStr)] string lpDir, [MarshalAs(UnmanagedType.LPWStr)] string lpBaseName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ADVPACK_FileSaveMarkNotExistW' -Namespace Win32 -PassThru
# $api::FileSaveMarkNotExistW(lpFileList, lpDir, lpBaseName)
#uselib "ADVPACK.dll"
#func global FileSaveMarkNotExistW "FileSaveMarkNotExistW" wptr, wptr, wptr
; FileSaveMarkNotExistW lpFileList, lpDir, lpBaseName   ; 戻り値は stat
; lpFileList : LPCWSTR optional -> "wptr"
; lpDir : LPCWSTR optional -> "wptr"
; lpBaseName : LPCWSTR optional -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ADVPACK.dll"
#cfunc global FileSaveMarkNotExistW "FileSaveMarkNotExistW" wstr, wstr, wstr
; res = FileSaveMarkNotExistW(lpFileList, lpDir, lpBaseName)
; lpFileList : LPCWSTR optional -> "wstr"
; lpDir : LPCWSTR optional -> "wstr"
; lpBaseName : LPCWSTR optional -> "wstr"
; HRESULT FileSaveMarkNotExistW(LPCWSTR lpFileList, LPCWSTR lpDir, LPCWSTR lpBaseName)
#uselib "ADVPACK.dll"
#cfunc global FileSaveMarkNotExistW "FileSaveMarkNotExistW" wstr, wstr, wstr
; res = FileSaveMarkNotExistW(lpFileList, lpDir, lpBaseName)
; lpFileList : LPCWSTR optional -> "wstr"
; lpDir : LPCWSTR optional -> "wstr"
; lpBaseName : LPCWSTR optional -> "wstr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	advpack = windows.NewLazySystemDLL("ADVPACK.dll")
	procFileSaveMarkNotExistW = advpack.NewProc("FileSaveMarkNotExistW")
)

// lpFileList (LPCWSTR optional), lpDir (LPCWSTR optional), lpBaseName (LPCWSTR optional)
r1, _, err := procFileSaveMarkNotExistW.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpFileList))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpDir))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpBaseName))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function FileSaveMarkNotExistW(
  lpFileList: PWideChar;   // LPCWSTR optional
  lpDir: PWideChar;   // LPCWSTR optional
  lpBaseName: PWideChar   // LPCWSTR optional
): Integer; stdcall;
  external 'ADVPACK.dll' name 'FileSaveMarkNotExistW';
result := DllCall("ADVPACK\FileSaveMarkNotExistW"
    , "WStr", lpFileList   ; LPCWSTR optional
    , "WStr", lpDir   ; LPCWSTR optional
    , "WStr", lpBaseName   ; LPCWSTR optional
    , "Int")   ; return: HRESULT
●FileSaveMarkNotExistW(lpFileList, lpDir, lpBaseName) = DLL("ADVPACK.dll", "int FileSaveMarkNotExistW(char*, char*, char*)")
# 呼び出し: FileSaveMarkNotExistW(lpFileList, lpDir, lpBaseName)
# lpFileList : LPCWSTR optional -> "char*"
# lpDir : LPCWSTR optional -> "char*"
# lpBaseName : LPCWSTR optional -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。