ホーム › Devices.AllJoyn › alljoyn_credentials_setpassword
alljoyn_credentials_setpassword
関数資格情報にパスワードを設定する。
シグネチャ
// MSAJApi.dll
#include <windows.h>
void alljoyn_credentials_setpassword(
alljoyn_credentials cred,
LPCSTR pwd
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| cred | alljoyn_credentials | in |
| pwd | LPCSTR | in |
戻り値の型: void
各言語での呼び出し定義
// MSAJApi.dll
#include <windows.h>
void alljoyn_credentials_setpassword(
alljoyn_credentials cred,
LPCSTR pwd
);[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern void alljoyn_credentials_setpassword(
IntPtr cred, // alljoyn_credentials
[MarshalAs(UnmanagedType.LPStr)] string pwd // LPCSTR
);<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Sub alljoyn_credentials_setpassword(
cred As IntPtr, ' alljoyn_credentials
<MarshalAs(UnmanagedType.LPStr)> pwd As String ' LPCSTR
)
End Sub' cred : alljoyn_credentials
' pwd : LPCSTR
Declare PtrSafe Sub alljoyn_credentials_setpassword Lib "msajapi" ( _
ByVal cred As LongPtr, _
ByVal pwd As String)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
alljoyn_credentials_setpassword = ctypes.windll.msajapi.alljoyn_credentials_setpassword
alljoyn_credentials_setpassword.restype = None
alljoyn_credentials_setpassword.argtypes = [
ctypes.c_ssize_t, # cred : alljoyn_credentials
wintypes.LPCSTR, # pwd : LPCSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_credentials_setpassword = Fiddle::Function.new(
lib['alljoyn_credentials_setpassword'],
[
Fiddle::TYPE_INTPTR_T, # cred : alljoyn_credentials
Fiddle::TYPE_VOIDP, # pwd : LPCSTR
],
Fiddle::TYPE_VOID)#[link(name = "msajapi")]
extern "system" {
fn alljoyn_credentials_setpassword(
cred: isize, // alljoyn_credentials
pwd: *const u8 // LPCSTR
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSAJApi.dll")]
public static extern void alljoyn_credentials_setpassword(IntPtr cred, [MarshalAs(UnmanagedType.LPStr)] string pwd);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_credentials_setpassword' -Namespace Win32 -PassThru
# $api::alljoyn_credentials_setpassword(cred, pwd)#uselib "MSAJApi.dll"
#func global alljoyn_credentials_setpassword "alljoyn_credentials_setpassword" sptr, sptr
; alljoyn_credentials_setpassword cred, pwd
; cred : alljoyn_credentials -> "sptr"
; pwd : LPCSTR -> "sptr"#uselib "MSAJApi.dll"
#func global alljoyn_credentials_setpassword "alljoyn_credentials_setpassword" sptr, str
; alljoyn_credentials_setpassword cred, pwd
; cred : alljoyn_credentials -> "sptr"
; pwd : LPCSTR -> "str"; void alljoyn_credentials_setpassword(alljoyn_credentials cred, LPCSTR pwd)
#uselib "MSAJApi.dll"
#func global alljoyn_credentials_setpassword "alljoyn_credentials_setpassword" intptr, str
; alljoyn_credentials_setpassword cred, pwd
; cred : alljoyn_credentials -> "intptr"
; pwd : LPCSTR -> "str"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
procalljoyn_credentials_setpassword = msajapi.NewProc("alljoyn_credentials_setpassword")
)
// cred (alljoyn_credentials), pwd (LPCSTR)
r1, _, err := procalljoyn_credentials_setpassword.Call(
uintptr(cred),
uintptr(unsafe.Pointer(windows.BytePtrFromString(pwd))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure alljoyn_credentials_setpassword(
cred: NativeInt; // alljoyn_credentials
pwd: PAnsiChar // LPCSTR
); stdcall;
external 'MSAJApi.dll' name 'alljoyn_credentials_setpassword';result := DllCall("MSAJApi\alljoyn_credentials_setpassword"
, "Ptr", cred ; alljoyn_credentials
, "AStr", pwd ; LPCSTR
, "Int") ; return: void●alljoyn_credentials_setpassword(cred, pwd) = DLL("MSAJApi.dll", "int alljoyn_credentials_setpassword(int, char*)")
# 呼び出し: alljoyn_credentials_setpassword(cred, pwd)
# cred : alljoyn_credentials -> "int"
# pwd : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。