ホーム › System.DeveloperLicensing › AcquireDeveloperLicense
AcquireDeveloperLicense
関数開発者ライセンスを取得し有効期限を返す。
シグネチャ
// WSClient.dll
#include <windows.h>
HRESULT AcquireDeveloperLicense(
HWND hwndParent, // optional
FILETIME* pExpiration
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hwndParent | HWND | inoptional | 認証UIの親ウィンドウハンドル。 |
| pExpiration | FILETIME* | out | 取得した開発者ライセンスの有効期限を受け取るFILETIMEポインタ。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// WSClient.dll
#include <windows.h>
HRESULT AcquireDeveloperLicense(
HWND hwndParent, // optional
FILETIME* pExpiration
);[DllImport("WSClient.dll", ExactSpelling = true)]
static extern int AcquireDeveloperLicense(
IntPtr hwndParent, // HWND optional
IntPtr pExpiration // FILETIME* out
);<DllImport("WSClient.dll", ExactSpelling:=True)>
Public Shared Function AcquireDeveloperLicense(
hwndParent As IntPtr, ' HWND optional
pExpiration As IntPtr ' FILETIME* out
) As Integer
End Function' hwndParent : HWND optional
' pExpiration : FILETIME* out
Declare PtrSafe Function AcquireDeveloperLicense Lib "wsclient" ( _
ByVal hwndParent As LongPtr, _
ByVal pExpiration As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
AcquireDeveloperLicense = ctypes.windll.wsclient.AcquireDeveloperLicense
AcquireDeveloperLicense.restype = ctypes.c_int
AcquireDeveloperLicense.argtypes = [
wintypes.HANDLE, # hwndParent : HWND optional
ctypes.c_void_p, # pExpiration : FILETIME* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WSClient.dll')
AcquireDeveloperLicense = Fiddle::Function.new(
lib['AcquireDeveloperLicense'],
[
Fiddle::TYPE_VOIDP, # hwndParent : HWND optional
Fiddle::TYPE_VOIDP, # pExpiration : FILETIME* out
],
Fiddle::TYPE_INT)#[link(name = "wsclient")]
extern "system" {
fn AcquireDeveloperLicense(
hwndParent: *mut core::ffi::c_void, // HWND optional
pExpiration: *mut FILETIME // FILETIME* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WSClient.dll")]
public static extern int AcquireDeveloperLicense(IntPtr hwndParent, IntPtr pExpiration);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WSClient_AcquireDeveloperLicense' -Namespace Win32 -PassThru
# $api::AcquireDeveloperLicense(hwndParent, pExpiration)#uselib "WSClient.dll"
#func global AcquireDeveloperLicense "AcquireDeveloperLicense" sptr, sptr
; AcquireDeveloperLicense hwndParent, varptr(pExpiration) ; 戻り値は stat
; hwndParent : HWND optional -> "sptr"
; pExpiration : FILETIME* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WSClient.dll" #cfunc global AcquireDeveloperLicense "AcquireDeveloperLicense" sptr, var ; res = AcquireDeveloperLicense(hwndParent, pExpiration) ; hwndParent : HWND optional -> "sptr" ; pExpiration : FILETIME* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WSClient.dll" #cfunc global AcquireDeveloperLicense "AcquireDeveloperLicense" sptr, sptr ; res = AcquireDeveloperLicense(hwndParent, varptr(pExpiration)) ; hwndParent : HWND optional -> "sptr" ; pExpiration : FILETIME* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT AcquireDeveloperLicense(HWND hwndParent, FILETIME* pExpiration) #uselib "WSClient.dll" #cfunc global AcquireDeveloperLicense "AcquireDeveloperLicense" intptr, var ; res = AcquireDeveloperLicense(hwndParent, pExpiration) ; hwndParent : HWND optional -> "intptr" ; pExpiration : FILETIME* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT AcquireDeveloperLicense(HWND hwndParent, FILETIME* pExpiration) #uselib "WSClient.dll" #cfunc global AcquireDeveloperLicense "AcquireDeveloperLicense" intptr, intptr ; res = AcquireDeveloperLicense(hwndParent, varptr(pExpiration)) ; hwndParent : HWND optional -> "intptr" ; pExpiration : FILETIME* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wsclient = windows.NewLazySystemDLL("WSClient.dll")
procAcquireDeveloperLicense = wsclient.NewProc("AcquireDeveloperLicense")
)
// hwndParent (HWND optional), pExpiration (FILETIME* out)
r1, _, err := procAcquireDeveloperLicense.Call(
uintptr(hwndParent),
uintptr(pExpiration),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction AcquireDeveloperLicense(
hwndParent: THandle; // HWND optional
pExpiration: Pointer // FILETIME* out
): Integer; stdcall;
external 'WSClient.dll' name 'AcquireDeveloperLicense';result := DllCall("WSClient\AcquireDeveloperLicense"
, "Ptr", hwndParent ; HWND optional
, "Ptr", pExpiration ; FILETIME* out
, "Int") ; return: HRESULT●AcquireDeveloperLicense(hwndParent, pExpiration) = DLL("WSClient.dll", "int AcquireDeveloperLicense(void*, void*)")
# 呼び出し: AcquireDeveloperLicense(hwndParent, pExpiration)
# hwndParent : HWND optional -> "void*"
# pExpiration : FILETIME* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "wsclient" fn AcquireDeveloperLicense(
hwndParent: ?*anyopaque, // HWND optional
pExpiration: [*c]FILETIME // FILETIME* out
) callconv(std.os.windows.WINAPI) i32;proc AcquireDeveloperLicense(
hwndParent: pointer, # HWND optional
pExpiration: ptr FILETIME # FILETIME* out
): int32 {.importc: "AcquireDeveloperLicense", stdcall, dynlib: "WSClient.dll".}pragma(lib, "wsclient");
extern(Windows)
int AcquireDeveloperLicense(
void* hwndParent, // HWND optional
FILETIME* pExpiration // FILETIME* out
);ccall((:AcquireDeveloperLicense, "WSClient.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{FILETIME}),
hwndParent, pExpiration)
# hwndParent : HWND optional -> Ptr{Cvoid}
# pExpiration : FILETIME* out -> Ptr{FILETIME}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t AcquireDeveloperLicense(
void* hwndParent,
void* pExpiration);
]]
local wsclient = ffi.load("wsclient")
-- wsclient.AcquireDeveloperLicense(hwndParent, pExpiration)
-- hwndParent : HWND optional
-- pExpiration : FILETIME* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('WSClient.dll');
const AcquireDeveloperLicense = lib.func('__stdcall', 'AcquireDeveloperLicense', 'int32_t', ['void *', 'void *']);
// AcquireDeveloperLicense(hwndParent, pExpiration)
// hwndParent : HWND optional -> 'void *'
// pExpiration : FILETIME* out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("WSClient.dll", {
AcquireDeveloperLicense: { parameters: ["pointer", "pointer"], result: "i32" },
});
// lib.symbols.AcquireDeveloperLicense(hwndParent, pExpiration)
// hwndParent : HWND optional -> "pointer"
// pExpiration : FILETIME* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t AcquireDeveloperLicense(
void* hwndParent,
void* pExpiration);
C, "WSClient.dll");
// $ffi->AcquireDeveloperLicense(hwndParent, pExpiration);
// hwndParent : HWND optional
// pExpiration : FILETIME* 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 Wsclient extends StdCallLibrary {
Wsclient INSTANCE = Native.load("wsclient", Wsclient.class);
int AcquireDeveloperLicense(
Pointer hwndParent, // HWND optional
Pointer pExpiration // FILETIME* out
);
}@[Link("wsclient")]
lib LibWSClient
fun AcquireDeveloperLicense = AcquireDeveloperLicense(
hwndParent : Void*, # HWND optional
pExpiration : FILETIME* # FILETIME* out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef AcquireDeveloperLicenseNative = Int32 Function(Pointer<Void>, Pointer<Void>);
typedef AcquireDeveloperLicenseDart = int Function(Pointer<Void>, Pointer<Void>);
final AcquireDeveloperLicense = DynamicLibrary.open('WSClient.dll')
.lookupFunction<AcquireDeveloperLicenseNative, AcquireDeveloperLicenseDart>('AcquireDeveloperLicense');
// hwndParent : HWND optional -> Pointer<Void>
// pExpiration : FILETIME* out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function AcquireDeveloperLicense(
hwndParent: THandle; // HWND optional
pExpiration: Pointer // FILETIME* out
): Integer; stdcall;
external 'WSClient.dll' name 'AcquireDeveloperLicense';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "AcquireDeveloperLicense"
c_AcquireDeveloperLicense :: Ptr () -> Ptr () -> IO Int32
-- hwndParent : HWND optional -> Ptr ()
-- pExpiration : FILETIME* out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let acquiredeveloperlicense =
foreign "AcquireDeveloperLicense"
((ptr void) @-> (ptr void) @-> returning int32_t)
(* hwndParent : HWND optional -> (ptr void) *)
(* pExpiration : FILETIME* out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wsclient (t "WSClient.dll"))
(cffi:use-foreign-library wsclient)
(cffi:defcfun ("AcquireDeveloperLicense" acquire-developer-license :convention :stdcall) :int32
(hwnd-parent :pointer) ; HWND optional
(p-expiration :pointer)) ; FILETIME* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $AcquireDeveloperLicense = Win32::API::More->new('WSClient',
'int AcquireDeveloperLicense(HANDLE hwndParent, LPVOID pExpiration)');
# my $ret = $AcquireDeveloperLicense->Call($hwndParent, $pExpiration);
# hwndParent : HWND optional -> HANDLE
# pExpiration : FILETIME* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型