ホーム › System.WindowsProgramming › WldpQueryWindowsLockdownRestriction
WldpQueryWindowsLockdownRestriction
関数Windowsロックダウン制限の設定を問い合わせる。
シグネチャ
// Wldp.dll
#include <windows.h>
HRESULT WldpQueryWindowsLockdownRestriction(
WLDP_WINDOWS_LOCKDOWN_RESTRICTION* LockdownRestriction
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| LockdownRestriction | WLDP_WINDOWS_LOCKDOWN_RESTRICTION* | out | 出力として現在のロックダウン制限(WLDP_WINDOWS_LOCKDOWN_RESTRICTION)を受け取るポインタ。 |
戻り値の型: 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 varptr(LockdownRestriction) ; 戻り値は stat
; LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "Wldp.dll" #cfunc global WldpQueryWindowsLockdownRestriction "WldpQueryWindowsLockdownRestriction" var ; res = WldpQueryWindowsLockdownRestriction(LockdownRestriction) ; LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "Wldp.dll" #cfunc global WldpQueryWindowsLockdownRestriction "WldpQueryWindowsLockdownRestriction" sptr ; res = WldpQueryWindowsLockdownRestriction(varptr(LockdownRestriction)) ; LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT WldpQueryWindowsLockdownRestriction(WLDP_WINDOWS_LOCKDOWN_RESTRICTION* LockdownRestriction) #uselib "Wldp.dll" #cfunc global WldpQueryWindowsLockdownRestriction "WldpQueryWindowsLockdownRestriction" var ; res = WldpQueryWindowsLockdownRestriction(LockdownRestriction) ; LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT WldpQueryWindowsLockdownRestriction(WLDP_WINDOWS_LOCKDOWN_RESTRICTION* LockdownRestriction) #uselib "Wldp.dll" #cfunc global WldpQueryWindowsLockdownRestriction "WldpQueryWindowsLockdownRestriction" intptr ; res = WldpQueryWindowsLockdownRestriction(varptr(LockdownRestriction)) ; LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
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 // HRESULTfunction 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)。const std = @import("std");
extern "wldp" fn WldpQueryWindowsLockdownRestriction(
LockdownRestriction: [*c]i32 // WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
) callconv(std.os.windows.WINAPI) i32;proc WldpQueryWindowsLockdownRestriction(
LockdownRestriction: ptr int32 # WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
): int32 {.importc: "WldpQueryWindowsLockdownRestriction", stdcall, dynlib: "Wldp.dll".}pragma(lib, "wldp");
extern(Windows)
int WldpQueryWindowsLockdownRestriction(
int* LockdownRestriction // WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
);ccall((:WldpQueryWindowsLockdownRestriction, "Wldp.dll"), stdcall, Int32,
(Ptr{Int32},),
LockdownRestriction)
# LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> Ptr{Int32}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t WldpQueryWindowsLockdownRestriction(
int32_t* LockdownRestriction);
]]
local wldp = ffi.load("wldp")
-- wldp.WldpQueryWindowsLockdownRestriction(LockdownRestriction)
-- LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('Wldp.dll');
const WldpQueryWindowsLockdownRestriction = lib.func('__stdcall', 'WldpQueryWindowsLockdownRestriction', 'int32_t', ['int32_t *']);
// WldpQueryWindowsLockdownRestriction(LockdownRestriction)
// LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("Wldp.dll", {
WldpQueryWindowsLockdownRestriction: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.WldpQueryWindowsLockdownRestriction(LockdownRestriction)
// LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t WldpQueryWindowsLockdownRestriction(
int32_t* LockdownRestriction);
C, "Wldp.dll");
// $ffi->WldpQueryWindowsLockdownRestriction(LockdownRestriction);
// LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
// 構造体/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 Wldp extends StdCallLibrary {
Wldp INSTANCE = Native.load("wldp", Wldp.class);
int WldpQueryWindowsLockdownRestriction(
IntByReference LockdownRestriction // WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
);
}@[Link("wldp")]
lib LibWldp
fun WldpQueryWindowsLockdownRestriction = WldpQueryWindowsLockdownRestriction(
LockdownRestriction : Int32* # WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef WldpQueryWindowsLockdownRestrictionNative = Int32 Function(Pointer<Int32>);
typedef WldpQueryWindowsLockdownRestrictionDart = int Function(Pointer<Int32>);
final WldpQueryWindowsLockdownRestriction = DynamicLibrary.open('Wldp.dll')
.lookupFunction<WldpQueryWindowsLockdownRestrictionNative, WldpQueryWindowsLockdownRestrictionDart>('WldpQueryWindowsLockdownRestriction');
// LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function WldpQueryWindowsLockdownRestriction(
LockdownRestriction: Pointer // WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
): Integer; stdcall;
external 'Wldp.dll' name 'WldpQueryWindowsLockdownRestriction';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "WldpQueryWindowsLockdownRestriction"
c_WldpQueryWindowsLockdownRestriction :: Ptr Int32 -> IO Int32
-- LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> Ptr Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let wldpquerywindowslockdownrestriction =
foreign "WldpQueryWindowsLockdownRestriction"
((ptr int32_t) @-> returning int32_t)
(* LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> (ptr int32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wldp (t "Wldp.dll"))
(cffi:use-foreign-library wldp)
(cffi:defcfun ("WldpQueryWindowsLockdownRestriction" wldp-query-windows-lockdown-restriction :convention :stdcall) :int32
(lockdown-restriction :pointer)) ; WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $WldpQueryWindowsLockdownRestriction = Win32::API::More->new('Wldp',
'int WldpQueryWindowsLockdownRestriction(LPVOID LockdownRestriction)');
# my $ret = $WldpQueryWindowsLockdownRestriction->Call($LockdownRestriction);
# LockdownRestriction : WLDP_WINDOWS_LOCKDOWN_RESTRICTION* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。