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

WldpQueryWindowsLockdownRestriction

関数
Windowsロックダウン制限の設定を問い合わせる。
DLLWldp.dll呼出規約winapi

シグネチャ

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

HRESULT WldpQueryWindowsLockdownRestriction(
    WLDP_WINDOWS_LOCKDOWN_RESTRICTION* LockdownRestriction
);

パラメーター

名前方向
LockdownRestrictionWLDP_WINDOWS_LOCKDOWN_RESTRICTION*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT WldpQueryWindowsLockdownRestriction(
    WLDP_WINDOWS_LOCKDOWN_RESTRICTION* LockdownRestriction
);
[DllImport("Wldp.dll", ExactSpelling = true)]
static extern int WldpQueryWindowsLockdownRestriction(
    out int LockdownRestriction   // WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
);
<DllImport("Wldp.dll", ExactSpelling:=True)>
Public Shared Function WldpQueryWindowsLockdownRestriction(
    <Out> ByRef LockdownRestriction As Integer   ' WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
) As Integer
End Function
' LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
Declare PtrSafe Function WldpQueryWindowsLockdownRestriction Lib "wldp" ( _
    ByRef LockdownRestriction As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WldpQueryWindowsLockdownRestriction = ctypes.windll.wldp.WldpQueryWindowsLockdownRestriction
WldpQueryWindowsLockdownRestriction.restype = ctypes.c_int
WldpQueryWindowsLockdownRestriction.argtypes = [
    ctypes.c_void_p,  # LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	wldp = windows.NewLazySystemDLL("Wldp.dll")
	procWldpQueryWindowsLockdownRestriction = wldp.NewProc("WldpQueryWindowsLockdownRestriction")
)

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