ホーム › Storage.CloudFilters › CfUnregisterSyncRoot
CfUnregisterSyncRoot
関数指定パスの同期ルート登録を解除する。
シグネチャ
// cldapi.dll
#include <windows.h>
HRESULT CfUnregisterSyncRoot(
LPCWSTR SyncRootPath
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| SyncRootPath | LPCWSTR | in | 登録解除する同期ルートディレクトリのフルパスを示すワイド文字列。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// cldapi.dll
#include <windows.h>
HRESULT CfUnregisterSyncRoot(
LPCWSTR SyncRootPath
);[DllImport("cldapi.dll", ExactSpelling = true)]
static extern int CfUnregisterSyncRoot(
[MarshalAs(UnmanagedType.LPWStr)] string SyncRootPath // LPCWSTR
);<DllImport("cldapi.dll", ExactSpelling:=True)>
Public Shared Function CfUnregisterSyncRoot(
<MarshalAs(UnmanagedType.LPWStr)> SyncRootPath As String ' LPCWSTR
) As Integer
End Function' SyncRootPath : LPCWSTR
Declare PtrSafe Function CfUnregisterSyncRoot Lib "cldapi" ( _
ByVal SyncRootPath As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CfUnregisterSyncRoot = ctypes.windll.cldapi.CfUnregisterSyncRoot
CfUnregisterSyncRoot.restype = ctypes.c_int
CfUnregisterSyncRoot.argtypes = [
wintypes.LPCWSTR, # SyncRootPath : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('cldapi.dll')
CfUnregisterSyncRoot = Fiddle::Function.new(
lib['CfUnregisterSyncRoot'],
[
Fiddle::TYPE_VOIDP, # SyncRootPath : LPCWSTR
],
Fiddle::TYPE_INT)#[link(name = "cldapi")]
extern "system" {
fn CfUnregisterSyncRoot(
SyncRootPath: *const u16 // LPCWSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("cldapi.dll")]
public static extern int CfUnregisterSyncRoot([MarshalAs(UnmanagedType.LPWStr)] string SyncRootPath);
"@
$api = Add-Type -MemberDefinition $sig -Name 'cldapi_CfUnregisterSyncRoot' -Namespace Win32 -PassThru
# $api::CfUnregisterSyncRoot(SyncRootPath)#uselib "cldapi.dll"
#func global CfUnregisterSyncRoot "CfUnregisterSyncRoot" sptr
; CfUnregisterSyncRoot SyncRootPath ; 戻り値は stat
; SyncRootPath : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "cldapi.dll"
#cfunc global CfUnregisterSyncRoot "CfUnregisterSyncRoot" wstr
; res = CfUnregisterSyncRoot(SyncRootPath)
; SyncRootPath : LPCWSTR -> "wstr"; HRESULT CfUnregisterSyncRoot(LPCWSTR SyncRootPath)
#uselib "cldapi.dll"
#cfunc global CfUnregisterSyncRoot "CfUnregisterSyncRoot" wstr
; res = CfUnregisterSyncRoot(SyncRootPath)
; SyncRootPath : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
cldapi = windows.NewLazySystemDLL("cldapi.dll")
procCfUnregisterSyncRoot = cldapi.NewProc("CfUnregisterSyncRoot")
)
// SyncRootPath (LPCWSTR)
r1, _, err := procCfUnregisterSyncRoot.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(SyncRootPath))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction CfUnregisterSyncRoot(
SyncRootPath: PWideChar // LPCWSTR
): Integer; stdcall;
external 'cldapi.dll' name 'CfUnregisterSyncRoot';result := DllCall("cldapi\CfUnregisterSyncRoot"
, "WStr", SyncRootPath ; LPCWSTR
, "Int") ; return: HRESULT●CfUnregisterSyncRoot(SyncRootPath) = DLL("cldapi.dll", "int CfUnregisterSyncRoot(char*)")
# 呼び出し: CfUnregisterSyncRoot(SyncRootPath)
# SyncRootPath : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "cldapi" fn CfUnregisterSyncRoot(
SyncRootPath: [*c]const u16 // LPCWSTR
) callconv(std.os.windows.WINAPI) i32;proc CfUnregisterSyncRoot(
SyncRootPath: WideCString # LPCWSTR
): int32 {.importc: "CfUnregisterSyncRoot", stdcall, dynlib: "cldapi.dll".}pragma(lib, "cldapi");
extern(Windows)
int CfUnregisterSyncRoot(
const(wchar)* SyncRootPath // LPCWSTR
);ccall((:CfUnregisterSyncRoot, "cldapi.dll"), stdcall, Int32,
(Cwstring,),
SyncRootPath)
# SyncRootPath : LPCWSTR -> Cwstring
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t CfUnregisterSyncRoot(
const uint16_t* SyncRootPath);
]]
local cldapi = ffi.load("cldapi")
-- cldapi.CfUnregisterSyncRoot(SyncRootPath)
-- SyncRootPath : LPCWSTR
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('cldapi.dll');
const CfUnregisterSyncRoot = lib.func('__stdcall', 'CfUnregisterSyncRoot', 'int32_t', ['str16']);
// CfUnregisterSyncRoot(SyncRootPath)
// SyncRootPath : LPCWSTR -> 'str16'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("cldapi.dll", {
CfUnregisterSyncRoot: { parameters: ["buffer"], result: "i32" },
});
// lib.symbols.CfUnregisterSyncRoot(SyncRootPath)
// SyncRootPath : LPCWSTR -> "buffer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t CfUnregisterSyncRoot(
const uint16_t* SyncRootPath);
C, "cldapi.dll");
// $ffi->CfUnregisterSyncRoot(SyncRootPath);
// SyncRootPath : LPCWSTR
// 構造体/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 Cldapi extends StdCallLibrary {
Cldapi INSTANCE = Native.load("cldapi", Cldapi.class);
int CfUnregisterSyncRoot(
WString SyncRootPath // LPCWSTR
);
}@[Link("cldapi")]
lib Libcldapi
fun CfUnregisterSyncRoot = CfUnregisterSyncRoot(
SyncRootPath : UInt16* # LPCWSTR
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef CfUnregisterSyncRootNative = Int32 Function(Pointer<Utf16>);
typedef CfUnregisterSyncRootDart = int Function(Pointer<Utf16>);
final CfUnregisterSyncRoot = DynamicLibrary.open('cldapi.dll')
.lookupFunction<CfUnregisterSyncRootNative, CfUnregisterSyncRootDart>('CfUnregisterSyncRoot');
// SyncRootPath : LPCWSTR -> Pointer<Utf16>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function CfUnregisterSyncRoot(
SyncRootPath: PWideChar // LPCWSTR
): Integer; stdcall;
external 'cldapi.dll' name 'CfUnregisterSyncRoot';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "CfUnregisterSyncRoot"
c_CfUnregisterSyncRoot :: CWString -> IO Int32
-- SyncRootPath : LPCWSTR -> CWString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let cfunregistersyncroot =
foreign "CfUnregisterSyncRoot"
((ptr uint16_t) @-> returning int32_t)
(* SyncRootPath : LPCWSTR -> (ptr uint16_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library cldapi (t "cldapi.dll"))
(cffi:use-foreign-library cldapi)
(cffi:defcfun ("CfUnregisterSyncRoot" cf-unregister-sync-root :convention :stdcall) :int32
(sync-root-path (:string :encoding :utf-16le))) ; LPCWSTR
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $CfUnregisterSyncRoot = Win32::API::More->new('cldapi',
'int CfUnregisterSyncRoot(LPCWSTR SyncRootPath)');
# my $ret = $CfUnregisterSyncRoot->Call($SyncRootPath);
# SyncRootPath : LPCWSTR -> LPCWSTR
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。