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

FileSaveMarkNotExistA

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

シグネチャ

// ADVPACK.dll  (ANSI / -A)
#include <windows.h>

HRESULT FileSaveMarkNotExistA(
    LPCSTR lpFileList,   // optional
    LPCSTR lpDir,   // optional
    LPCSTR lpBaseName   // optional
);

パラメーター

名前方向説明
lpFileListLPCSTRinoptional存在しないものとして記録するファイル名リストを指す。
lpDirLPCSTRinoptional対象ファイルのディレクトリを指す。
lpBaseNameLPCSTRinoptionalバックアップを識別するベース名を指す。

戻り値の型: HRESULT

各言語での呼び出し定義

// ADVPACK.dll  (ANSI / -A)
#include <windows.h>

HRESULT FileSaveMarkNotExistA(
    LPCSTR lpFileList,   // optional
    LPCSTR lpDir,   // optional
    LPCSTR lpBaseName   // optional
);
[DllImport("ADVPACK.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int FileSaveMarkNotExistA(
    [MarshalAs(UnmanagedType.LPStr)] string lpFileList,   // LPCSTR optional
    [MarshalAs(UnmanagedType.LPStr)] string lpDir,   // LPCSTR optional
    [MarshalAs(UnmanagedType.LPStr)] string lpBaseName   // LPCSTR optional
);
<DllImport("ADVPACK.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function FileSaveMarkNotExistA(
    <MarshalAs(UnmanagedType.LPStr)> lpFileList As String,   ' LPCSTR optional
    <MarshalAs(UnmanagedType.LPStr)> lpDir As String,   ' LPCSTR optional
    <MarshalAs(UnmanagedType.LPStr)> lpBaseName As String   ' LPCSTR optional
) As Integer
End Function
' lpFileList : LPCSTR optional
' lpDir : LPCSTR optional
' lpBaseName : LPCSTR optional
Declare PtrSafe Function FileSaveMarkNotExistA Lib "advpack" ( _
    ByVal lpFileList As String, _
    ByVal lpDir As String, _
    ByVal lpBaseName As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

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

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

var (
	advpack = windows.NewLazySystemDLL("ADVPACK.dll")
	procFileSaveMarkNotExistA = advpack.NewProc("FileSaveMarkNotExistA")
)

// lpFileList (LPCSTR optional), lpDir (LPCSTR optional), lpBaseName (LPCSTR optional)
r1, _, err := procFileSaveMarkNotExistA.Call(
	uintptr(unsafe.Pointer(windows.BytePtrFromString(lpFileList))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(lpDir))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(lpBaseName))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function FileSaveMarkNotExistA(
  lpFileList: PAnsiChar;   // LPCSTR optional
  lpDir: PAnsiChar;   // LPCSTR optional
  lpBaseName: PAnsiChar   // LPCSTR optional
): Integer; stdcall;
  external 'ADVPACK.dll' name 'FileSaveMarkNotExistA';
result := DllCall("ADVPACK\FileSaveMarkNotExistA"
    , "AStr", lpFileList   ; LPCSTR optional
    , "AStr", lpDir   ; LPCSTR optional
    , "AStr", lpBaseName   ; LPCSTR optional
    , "Int")   ; return: HRESULT
●FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName) = DLL("ADVPACK.dll", "int FileSaveMarkNotExistA(char*, char*, char*)")
# 呼び出し: FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName)
# lpFileList : LPCSTR optional -> "char*"
# lpDir : LPCSTR optional -> "char*"
# lpBaseName : LPCSTR optional -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "advpack" fn FileSaveMarkNotExistA(
    lpFileList: [*c]const u8, // LPCSTR optional
    lpDir: [*c]const u8, // LPCSTR optional
    lpBaseName: [*c]const u8 // LPCSTR optional
) callconv(std.os.windows.WINAPI) i32;
proc FileSaveMarkNotExistA(
    lpFileList: cstring,  # LPCSTR optional
    lpDir: cstring,  # LPCSTR optional
    lpBaseName: cstring  # LPCSTR optional
): int32 {.importc: "FileSaveMarkNotExistA", stdcall, dynlib: "ADVPACK.dll".}
pragma(lib, "advpack");
extern(Windows)
int FileSaveMarkNotExistA(
    const(char)* lpFileList,   // LPCSTR optional
    const(char)* lpDir,   // LPCSTR optional
    const(char)* lpBaseName   // LPCSTR optional
);
ccall((:FileSaveMarkNotExistA, "ADVPACK.dll"), stdcall, Int32,
      (Cstring, Cstring, Cstring),
      lpFileList, lpDir, lpBaseName)
# lpFileList : LPCSTR optional -> Cstring
# lpDir : LPCSTR optional -> Cstring
# lpBaseName : LPCSTR optional -> Cstring
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t FileSaveMarkNotExistA(
    const char* lpFileList,
    const char* lpDir,
    const char* lpBaseName);
]]
local advpack = ffi.load("advpack")
-- advpack.FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName)
-- lpFileList : LPCSTR optional
-- lpDir : LPCSTR optional
-- lpBaseName : LPCSTR optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('ADVPACK.dll');
const FileSaveMarkNotExistA = lib.func('__stdcall', 'FileSaveMarkNotExistA', 'int32_t', ['str', 'str', 'str']);
// FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName)
// lpFileList : LPCSTR optional -> 'str'
// lpDir : LPCSTR optional -> 'str'
// lpBaseName : LPCSTR optional -> 'str'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("ADVPACK.dll", {
  FileSaveMarkNotExistA: { parameters: ["buffer", "buffer", "buffer"], result: "i32" },
});
// lib.symbols.FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName)
// lpFileList : LPCSTR optional -> "buffer"
// lpDir : LPCSTR optional -> "buffer"
// lpBaseName : LPCSTR optional -> "buffer"
// 文字列は "buffer"。ANSI(-A) は new TextEncoder() で UTF-8/ANSI バイト列(末尾に \x00)を渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t FileSaveMarkNotExistA(
    const char* lpFileList,
    const char* lpDir,
    const char* lpBaseName);
C, "ADVPACK.dll");
// $ffi->FileSaveMarkNotExistA(lpFileList, lpDir, lpBaseName);
// lpFileList : LPCSTR optional
// lpDir : LPCSTR optional
// lpBaseName : LPCSTR optional
// 構造体/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 Advpack extends StdCallLibrary {
    Advpack INSTANCE = Native.load("advpack", Advpack.class, W32APIOptions.ASCII_OPTIONS);
    int FileSaveMarkNotExistA(
        String lpFileList,   // LPCSTR optional
        String lpDir,   // LPCSTR optional
        String lpBaseName   // LPCSTR optional
    );
}
@[Link("advpack")]
lib LibADVPACK
  fun FileSaveMarkNotExistA = FileSaveMarkNotExistA(
    lpFileList : UInt8*,   # LPCSTR optional
    lpDir : UInt8*,   # LPCSTR optional
    lpBaseName : UInt8*   # LPCSTR optional
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef FileSaveMarkNotExistANative = Int32 Function(Pointer<Utf8>, Pointer<Utf8>, Pointer<Utf8>);
typedef FileSaveMarkNotExistADart = int Function(Pointer<Utf8>, Pointer<Utf8>, Pointer<Utf8>);
final FileSaveMarkNotExistA = DynamicLibrary.open('ADVPACK.dll')
    .lookupFunction<FileSaveMarkNotExistANative, FileSaveMarkNotExistADart>('FileSaveMarkNotExistA');
// lpFileList : LPCSTR optional -> Pointer<Utf8>
// lpDir : LPCSTR optional -> Pointer<Utf8>
// lpBaseName : LPCSTR optional -> Pointer<Utf8>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function FileSaveMarkNotExistA(
  lpFileList: PAnsiChar;   // LPCSTR optional
  lpDir: PAnsiChar;   // LPCSTR optional
  lpBaseName: PAnsiChar   // LPCSTR optional
): Integer; stdcall;
  external 'ADVPACK.dll' name 'FileSaveMarkNotExistA';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "FileSaveMarkNotExistA"
  c_FileSaveMarkNotExistA :: CString -> CString -> CString -> IO Int32
-- lpFileList : LPCSTR optional -> CString
-- lpDir : LPCSTR optional -> CString
-- lpBaseName : LPCSTR optional -> CString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let filesavemarknotexista =
  foreign "FileSaveMarkNotExistA"
    (string @-> string @-> string @-> returning int32_t)
(* lpFileList : LPCSTR optional -> string *)
(* lpDir : LPCSTR optional -> string *)
(* lpBaseName : LPCSTR optional -> string *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library advpack (t "ADVPACK.dll"))
(cffi:use-foreign-library advpack)

(cffi:defcfun ("FileSaveMarkNotExistA" file-save-mark-not-exist-a :convention :stdcall) :int32
  (lp-file-list :string)   ; LPCSTR optional
  (lp-dir :string)   ; LPCSTR optional
  (lp-base-name :string))   ; LPCSTR optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $FileSaveMarkNotExistA = Win32::API::More->new('ADVPACK',
    'int FileSaveMarkNotExistA(LPCSTR lpFileList, LPCSTR lpDir, LPCSTR lpBaseName)');
# my $ret = $FileSaveMarkNotExistA->Call($lpFileList, $lpDir, $lpBaseName);
# lpFileList : LPCSTR optional -> LPCSTR
# lpDir : LPCSTR optional -> LPCSTR
# lpBaseName : LPCSTR optional -> LPCSTR
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

文字セット違い