ホーム › Security.Authentication.Identity › SspiExcludePackage
SspiExcludePackage
関数指定したセキュリティパッケージを除外した認証アイデンティティを生成する。
シグネチャ
// SECUR32.dll
#include <windows.h>
HRESULT SspiExcludePackage(
void* AuthIdentity, // optional
LPCWSTR pszPackageName,
void** ppNewAuthIdentity
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| AuthIdentity | void* | inoptional |
| pszPackageName | LPCWSTR | in |
| ppNewAuthIdentity | void** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// SECUR32.dll
#include <windows.h>
HRESULT SspiExcludePackage(
void* AuthIdentity, // optional
LPCWSTR pszPackageName,
void** ppNewAuthIdentity
);[DllImport("SECUR32.dll", ExactSpelling = true)]
static extern int SspiExcludePackage(
IntPtr AuthIdentity, // void* optional
[MarshalAs(UnmanagedType.LPWStr)] string pszPackageName, // LPCWSTR
IntPtr ppNewAuthIdentity // void** out
);<DllImport("SECUR32.dll", ExactSpelling:=True)>
Public Shared Function SspiExcludePackage(
AuthIdentity As IntPtr, ' void* optional
<MarshalAs(UnmanagedType.LPWStr)> pszPackageName As String, ' LPCWSTR
ppNewAuthIdentity As IntPtr ' void** out
) As Integer
End Function' AuthIdentity : void* optional
' pszPackageName : LPCWSTR
' ppNewAuthIdentity : void** out
Declare PtrSafe Function SspiExcludePackage Lib "secur32" ( _
ByVal AuthIdentity As LongPtr, _
ByVal pszPackageName As LongPtr, _
ByVal ppNewAuthIdentity As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SspiExcludePackage = ctypes.windll.secur32.SspiExcludePackage
SspiExcludePackage.restype = ctypes.c_int
SspiExcludePackage.argtypes = [
ctypes.POINTER(None), # AuthIdentity : void* optional
wintypes.LPCWSTR, # pszPackageName : LPCWSTR
ctypes.c_void_p, # ppNewAuthIdentity : void** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SECUR32.dll')
SspiExcludePackage = Fiddle::Function.new(
lib['SspiExcludePackage'],
[
Fiddle::TYPE_VOIDP, # AuthIdentity : void* optional
Fiddle::TYPE_VOIDP, # pszPackageName : LPCWSTR
Fiddle::TYPE_VOIDP, # ppNewAuthIdentity : void** out
],
Fiddle::TYPE_INT)#[link(name = "secur32")]
extern "system" {
fn SspiExcludePackage(
AuthIdentity: *mut (), // void* optional
pszPackageName: *const u16, // LPCWSTR
ppNewAuthIdentity: *mut *mut () // void** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SECUR32.dll")]
public static extern int SspiExcludePackage(IntPtr AuthIdentity, [MarshalAs(UnmanagedType.LPWStr)] string pszPackageName, IntPtr ppNewAuthIdentity);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SECUR32_SspiExcludePackage' -Namespace Win32 -PassThru
# $api::SspiExcludePackage(AuthIdentity, pszPackageName, ppNewAuthIdentity)#uselib "SECUR32.dll"
#func global SspiExcludePackage "SspiExcludePackage" sptr, sptr, sptr
; SspiExcludePackage AuthIdentity, pszPackageName, ppNewAuthIdentity ; 戻り値は stat
; AuthIdentity : void* optional -> "sptr"
; pszPackageName : LPCWSTR -> "sptr"
; ppNewAuthIdentity : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "SECUR32.dll"
#cfunc global SspiExcludePackage "SspiExcludePackage" sptr, wstr, sptr
; res = SspiExcludePackage(AuthIdentity, pszPackageName, ppNewAuthIdentity)
; AuthIdentity : void* optional -> "sptr"
; pszPackageName : LPCWSTR -> "wstr"
; ppNewAuthIdentity : void** out -> "sptr"; HRESULT SspiExcludePackage(void* AuthIdentity, LPCWSTR pszPackageName, void** ppNewAuthIdentity)
#uselib "SECUR32.dll"
#cfunc global SspiExcludePackage "SspiExcludePackage" intptr, wstr, intptr
; res = SspiExcludePackage(AuthIdentity, pszPackageName, ppNewAuthIdentity)
; AuthIdentity : void* optional -> "intptr"
; pszPackageName : LPCWSTR -> "wstr"
; ppNewAuthIdentity : void** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
secur32 = windows.NewLazySystemDLL("SECUR32.dll")
procSspiExcludePackage = secur32.NewProc("SspiExcludePackage")
)
// AuthIdentity (void* optional), pszPackageName (LPCWSTR), ppNewAuthIdentity (void** out)
r1, _, err := procSspiExcludePackage.Call(
uintptr(AuthIdentity),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszPackageName))),
uintptr(ppNewAuthIdentity),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction SspiExcludePackage(
AuthIdentity: Pointer; // void* optional
pszPackageName: PWideChar; // LPCWSTR
ppNewAuthIdentity: Pointer // void** out
): Integer; stdcall;
external 'SECUR32.dll' name 'SspiExcludePackage';result := DllCall("SECUR32\SspiExcludePackage"
, "Ptr", AuthIdentity ; void* optional
, "WStr", pszPackageName ; LPCWSTR
, "Ptr", ppNewAuthIdentity ; void** out
, "Int") ; return: HRESULT●SspiExcludePackage(AuthIdentity, pszPackageName, ppNewAuthIdentity) = DLL("SECUR32.dll", "int SspiExcludePackage(void*, char*, void*)")
# 呼び出し: SspiExcludePackage(AuthIdentity, pszPackageName, ppNewAuthIdentity)
# AuthIdentity : void* optional -> "void*"
# pszPackageName : LPCWSTR -> "char*"
# ppNewAuthIdentity : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。