Win32 API 日本語リファレンス
ホームSecurity.EnterpriseData › SrpDisablePermissiveModeFileEncryption

SrpDisablePermissiveModeFileEncryption

関数
ファイル暗号化の寛容モードを無効にする。
DLLsrpapi.dll呼出規約winapi対応OSWindows 10 以降

シグネチャ

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

HRESULT SrpDisablePermissiveModeFileEncryption(void);

パラメーターなし。戻り値: HRESULT

各言語での呼び出し定義

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

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

SrpDisablePermissiveModeFileEncryption = ctypes.windll.srpapi.SrpDisablePermissiveModeFileEncryption
SrpDisablePermissiveModeFileEncryption.restype = ctypes.c_int
SrpDisablePermissiveModeFileEncryption.argtypes = []
require 'fiddle'
require 'fiddle/import'

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

var (
	srpapi = windows.NewLazySystemDLL("srpapi.dll")
	procSrpDisablePermissiveModeFileEncryption = srpapi.NewProc("SrpDisablePermissiveModeFileEncryption")
)

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