Win32 API 日本語リファレンス
ホームSecurity.Authentication.Identity › SspiIsAuthIdentityEncrypted

SspiIsAuthIdentityEncrypted

関数
認証情報構造体が暗号化されているかどうかを判定する。
DLLSECUR32.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

BOOLEAN SspiIsAuthIdentityEncrypted(
    void* EncryptedAuthData
);

パラメーター

名前方向説明
EncryptedAuthDatavoid*in暗号化状態を判定する対象の認証ID構造体へのポインタ。

戻り値の型: BOOLEAN

各言語での呼び出し定義

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

BOOLEAN SspiIsAuthIdentityEncrypted(
    void* EncryptedAuthData
);
[return: MarshalAs(UnmanagedType.U1)]
[DllImport("SECUR32.dll", ExactSpelling = true)]
static extern bool SspiIsAuthIdentityEncrypted(
    IntPtr EncryptedAuthData   // void*
);
<DllImport("SECUR32.dll", ExactSpelling:=True)>
Public Shared Function SspiIsAuthIdentityEncrypted(
    EncryptedAuthData As IntPtr   ' void*
) As <MarshalAs(UnmanagedType.U1)> Boolean
End Function
' EncryptedAuthData : void*
Declare PtrSafe Function SspiIsAuthIdentityEncrypted Lib "secur32" ( _
    ByVal EncryptedAuthData As LongPtr) As Byte
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SspiIsAuthIdentityEncrypted = ctypes.windll.secur32.SspiIsAuthIdentityEncrypted
SspiIsAuthIdentityEncrypted.restype = wintypes.BOOLEAN
SspiIsAuthIdentityEncrypted.argtypes = [
    ctypes.POINTER(None),  # EncryptedAuthData : void*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SECUR32.dll')
SspiIsAuthIdentityEncrypted = Fiddle::Function.new(
  lib['SspiIsAuthIdentityEncrypted'],
  [
    Fiddle::TYPE_VOIDP,  # EncryptedAuthData : void*
  ],
  Fiddle::TYPE_CHAR)
#[link(name = "secur32")]
extern "system" {
    fn SspiIsAuthIdentityEncrypted(
        EncryptedAuthData: *mut ()  // void*
    ) -> u8;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.U1)]
[DllImport("SECUR32.dll")]
public static extern bool SspiIsAuthIdentityEncrypted(IntPtr EncryptedAuthData);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SECUR32_SspiIsAuthIdentityEncrypted' -Namespace Win32 -PassThru
# $api::SspiIsAuthIdentityEncrypted(EncryptedAuthData)
#uselib "SECUR32.dll"
#func global SspiIsAuthIdentityEncrypted "SspiIsAuthIdentityEncrypted" sptr
; SspiIsAuthIdentityEncrypted EncryptedAuthData   ; 戻り値は stat
; EncryptedAuthData : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "SECUR32.dll"
#cfunc global SspiIsAuthIdentityEncrypted "SspiIsAuthIdentityEncrypted" sptr
; res = SspiIsAuthIdentityEncrypted(EncryptedAuthData)
; EncryptedAuthData : void* -> "sptr"
; BOOLEAN SspiIsAuthIdentityEncrypted(void* EncryptedAuthData)
#uselib "SECUR32.dll"
#cfunc global SspiIsAuthIdentityEncrypted "SspiIsAuthIdentityEncrypted" intptr
; res = SspiIsAuthIdentityEncrypted(EncryptedAuthData)
; EncryptedAuthData : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	secur32 = windows.NewLazySystemDLL("SECUR32.dll")
	procSspiIsAuthIdentityEncrypted = secur32.NewProc("SspiIsAuthIdentityEncrypted")
)

// EncryptedAuthData (void*)
r1, _, err := procSspiIsAuthIdentityEncrypted.Call(
	uintptr(EncryptedAuthData),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOLEAN
function SspiIsAuthIdentityEncrypted(
  EncryptedAuthData: Pointer   // void*
): ByteBool; stdcall;
  external 'SECUR32.dll' name 'SspiIsAuthIdentityEncrypted';
result := DllCall("SECUR32\SspiIsAuthIdentityEncrypted"
    , "Ptr", EncryptedAuthData   ; void*
    , "Char")   ; return: BOOLEAN
●SspiIsAuthIdentityEncrypted(EncryptedAuthData) = DLL("SECUR32.dll", "byte SspiIsAuthIdentityEncrypted(void*)")
# 呼び出し: SspiIsAuthIdentityEncrypted(EncryptedAuthData)
# EncryptedAuthData : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "secur32" fn SspiIsAuthIdentityEncrypted(
    EncryptedAuthData: ?*anyopaque // void*
) callconv(std.os.windows.WINAPI) u8;
proc SspiIsAuthIdentityEncrypted(
    EncryptedAuthData: pointer  # void*
): uint8 {.importc: "SspiIsAuthIdentityEncrypted", stdcall, dynlib: "SECUR32.dll".}
pragma(lib, "secur32");
extern(Windows)
ubyte SspiIsAuthIdentityEncrypted(
    void* EncryptedAuthData   // void*
);
ccall((:SspiIsAuthIdentityEncrypted, "SECUR32.dll"), stdcall, UInt8,
      (Ptr{Cvoid},),
      EncryptedAuthData)
# EncryptedAuthData : void* -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint8_t SspiIsAuthIdentityEncrypted(
    void* EncryptedAuthData);
]]
local secur32 = ffi.load("secur32")
-- secur32.SspiIsAuthIdentityEncrypted(EncryptedAuthData)
-- EncryptedAuthData : void*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('SECUR32.dll');
const SspiIsAuthIdentityEncrypted = lib.func('__stdcall', 'SspiIsAuthIdentityEncrypted', 'uint8_t', ['void *']);
// SspiIsAuthIdentityEncrypted(EncryptedAuthData)
// EncryptedAuthData : void* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("SECUR32.dll", {
  SspiIsAuthIdentityEncrypted: { parameters: ["pointer"], result: "u8" },
});
// lib.symbols.SspiIsAuthIdentityEncrypted(EncryptedAuthData)
// EncryptedAuthData : void* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint8_t SspiIsAuthIdentityEncrypted(
    void* EncryptedAuthData);
C, "SECUR32.dll");
// $ffi->SspiIsAuthIdentityEncrypted(EncryptedAuthData);
// EncryptedAuthData : void*
// 構造体/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 Secur32 extends StdCallLibrary {
    Secur32 INSTANCE = Native.load("secur32", Secur32.class);
    byte SspiIsAuthIdentityEncrypted(
        Pointer EncryptedAuthData   // void*
    );
}
@[Link("secur32")]
lib LibSECUR32
  fun SspiIsAuthIdentityEncrypted = SspiIsAuthIdentityEncrypted(
    EncryptedAuthData : Void*   # void*
  ) : UInt8
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef SspiIsAuthIdentityEncryptedNative = Uint8 Function(Pointer<Void>);
typedef SspiIsAuthIdentityEncryptedDart = int Function(Pointer<Void>);
final SspiIsAuthIdentityEncrypted = DynamicLibrary.open('SECUR32.dll')
    .lookupFunction<SspiIsAuthIdentityEncryptedNative, SspiIsAuthIdentityEncryptedDart>('SspiIsAuthIdentityEncrypted');
// EncryptedAuthData : void* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function SspiIsAuthIdentityEncrypted(
  EncryptedAuthData: Pointer   // void*
): ByteBool; stdcall;
  external 'SECUR32.dll' name 'SspiIsAuthIdentityEncrypted';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "SspiIsAuthIdentityEncrypted"
  c_SspiIsAuthIdentityEncrypted :: Ptr () -> IO Word8
-- EncryptedAuthData : void* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let sspiisauthidentityencrypted =
  foreign "SspiIsAuthIdentityEncrypted"
    ((ptr void) @-> returning uint8_t)
(* EncryptedAuthData : void* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library secur32 (t "SECUR32.dll"))
(cffi:use-foreign-library secur32)

(cffi:defcfun ("SspiIsAuthIdentityEncrypted" sspi-is-auth-identity-encrypted :convention :stdcall) :uint8
  (encrypted-auth-data :pointer))   ; void*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $SspiIsAuthIdentityEncrypted = Win32::API::More->new('SECUR32',
    'BYTE SspiIsAuthIdentityEncrypted(LPVOID EncryptedAuthData)');
# my $ret = $SspiIsAuthIdentityEncrypted->Call($EncryptedAuthData);
# EncryptedAuthData : void* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。