Win32 API 日本語リファレンス
ホームSecurity.Authorization.UI › CreateSecurityPage

CreateSecurityPage

関数
アクセス制御編集用のセキュリティプロパティシートページを作成する。
DLLACLUI.dll呼出規約winapiSetLastErrorあり対応OSWindows XP 以降

シグネチャ

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

HPROPSHEETPAGE CreateSecurityPage(
    ISecurityInformation* psi
);

パラメーター

名前方向
psiISecurityInformation*in

戻り値の型: HPROPSHEETPAGE

各言語での呼び出し定義

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

HPROPSHEETPAGE CreateSecurityPage(
    ISecurityInformation* psi
);
[DllImport("ACLUI.dll", SetLastError = true, ExactSpelling = true)]
static extern IntPtr CreateSecurityPage(
    IntPtr psi   // ISecurityInformation*
);
<DllImport("ACLUI.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function CreateSecurityPage(
    psi As IntPtr   ' ISecurityInformation*
) As IntPtr
End Function
' psi : ISecurityInformation*
Declare PtrSafe Function CreateSecurityPage Lib "aclui" ( _
    ByVal psi As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CreateSecurityPage = ctypes.windll.aclui.CreateSecurityPage
CreateSecurityPage.restype = ctypes.c_void_p
CreateSecurityPage.argtypes = [
    ctypes.c_void_p,  # psi : ISecurityInformation*
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ACLUI.dll')
CreateSecurityPage = Fiddle::Function.new(
  lib['CreateSecurityPage'],
  [
    Fiddle::TYPE_VOIDP,  # psi : ISecurityInformation*
  ],
  Fiddle::TYPE_VOIDP)
#[link(name = "aclui")]
extern "system" {
    fn CreateSecurityPage(
        psi: *mut core::ffi::c_void  // ISecurityInformation*
    ) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ACLUI.dll", SetLastError = true)]
public static extern IntPtr CreateSecurityPage(IntPtr psi);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ACLUI_CreateSecurityPage' -Namespace Win32 -PassThru
# $api::CreateSecurityPage(psi)
#uselib "ACLUI.dll"
#func global CreateSecurityPage "CreateSecurityPage" sptr
; CreateSecurityPage psi   ; 戻り値は stat
; psi : ISecurityInformation* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ACLUI.dll"
#cfunc global CreateSecurityPage "CreateSecurityPage" sptr
; res = CreateSecurityPage(psi)
; psi : ISecurityInformation* -> "sptr"
; HPROPSHEETPAGE CreateSecurityPage(ISecurityInformation* psi)
#uselib "ACLUI.dll"
#cfunc global CreateSecurityPage "CreateSecurityPage" intptr
; res = CreateSecurityPage(psi)
; psi : ISecurityInformation* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	aclui = windows.NewLazySystemDLL("ACLUI.dll")
	procCreateSecurityPage = aclui.NewProc("CreateSecurityPage")
)

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