ホーム › System.Time › GetDynamicTimeZoneInformationEffectiveYears
GetDynamicTimeZoneInformationEffectiveYears
関数動的タイムゾーン情報が有効な最初と最後の年を取得する。
シグネチャ
// ADVAPI32.dll
#include <windows.h>
DWORD GetDynamicTimeZoneInformationEffectiveYears(
const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation,
DWORD* FirstYear,
DWORD* LastYear
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lpTimeZoneInformation | DYNAMIC_TIME_ZONE_INFORMATION* | in |
| FirstYear | DWORD* | out |
| LastYear | DWORD* | out |
戻り値の型: DWORD
各言語での呼び出し定義
// ADVAPI32.dll
#include <windows.h>
DWORD GetDynamicTimeZoneInformationEffectiveYears(
const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation,
DWORD* FirstYear,
DWORD* LastYear
);[DllImport("ADVAPI32.dll", ExactSpelling = true)]
static extern uint GetDynamicTimeZoneInformationEffectiveYears(
IntPtr lpTimeZoneInformation, // DYNAMIC_TIME_ZONE_INFORMATION*
out uint FirstYear, // DWORD* out
out uint LastYear // DWORD* out
);<DllImport("ADVAPI32.dll", ExactSpelling:=True)>
Public Shared Function GetDynamicTimeZoneInformationEffectiveYears(
lpTimeZoneInformation As IntPtr, ' DYNAMIC_TIME_ZONE_INFORMATION*
<Out> ByRef FirstYear As UInteger, ' DWORD* out
<Out> ByRef LastYear As UInteger ' DWORD* out
) As UInteger
End Function' lpTimeZoneInformation : DYNAMIC_TIME_ZONE_INFORMATION*
' FirstYear : DWORD* out
' LastYear : DWORD* out
Declare PtrSafe Function GetDynamicTimeZoneInformationEffectiveYears Lib "advapi32" ( _
ByVal lpTimeZoneInformation As LongPtr, _
ByRef FirstYear As Long, _
ByRef LastYear As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetDynamicTimeZoneInformationEffectiveYears = ctypes.windll.advapi32.GetDynamicTimeZoneInformationEffectiveYears
GetDynamicTimeZoneInformationEffectiveYears.restype = wintypes.DWORD
GetDynamicTimeZoneInformationEffectiveYears.argtypes = [
ctypes.c_void_p, # lpTimeZoneInformation : DYNAMIC_TIME_ZONE_INFORMATION*
ctypes.POINTER(wintypes.DWORD), # FirstYear : DWORD* out
ctypes.POINTER(wintypes.DWORD), # LastYear : DWORD* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ADVAPI32.dll')
GetDynamicTimeZoneInformationEffectiveYears = Fiddle::Function.new(
lib['GetDynamicTimeZoneInformationEffectiveYears'],
[
Fiddle::TYPE_VOIDP, # lpTimeZoneInformation : DYNAMIC_TIME_ZONE_INFORMATION*
Fiddle::TYPE_VOIDP, # FirstYear : DWORD* out
Fiddle::TYPE_VOIDP, # LastYear : DWORD* out
],
-Fiddle::TYPE_INT)#[link(name = "advapi32")]
extern "system" {
fn GetDynamicTimeZoneInformationEffectiveYears(
lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, // DYNAMIC_TIME_ZONE_INFORMATION*
FirstYear: *mut u32, // DWORD* out
LastYear: *mut u32 // DWORD* out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ADVAPI32.dll")]
public static extern uint GetDynamicTimeZoneInformationEffectiveYears(IntPtr lpTimeZoneInformation, out uint FirstYear, out uint LastYear);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ADVAPI32_GetDynamicTimeZoneInformationEffectiveYears' -Namespace Win32 -PassThru
# $api::GetDynamicTimeZoneInformationEffectiveYears(lpTimeZoneInformation, FirstYear, LastYear)#uselib "ADVAPI32.dll"
#func global GetDynamicTimeZoneInformationEffectiveYears "GetDynamicTimeZoneInformationEffectiveYears" sptr, sptr, sptr
; GetDynamicTimeZoneInformationEffectiveYears varptr(lpTimeZoneInformation), varptr(FirstYear), varptr(LastYear) ; 戻り値は stat
; lpTimeZoneInformation : DYNAMIC_TIME_ZONE_INFORMATION* -> "sptr"
; FirstYear : DWORD* out -> "sptr"
; LastYear : DWORD* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "ADVAPI32.dll" #cfunc global GetDynamicTimeZoneInformationEffectiveYears "GetDynamicTimeZoneInformationEffectiveYears" var, var, var ; res = GetDynamicTimeZoneInformationEffectiveYears(lpTimeZoneInformation, FirstYear, LastYear) ; lpTimeZoneInformation : DYNAMIC_TIME_ZONE_INFORMATION* -> "var" ; FirstYear : DWORD* out -> "var" ; LastYear : DWORD* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "ADVAPI32.dll" #cfunc global GetDynamicTimeZoneInformationEffectiveYears "GetDynamicTimeZoneInformationEffectiveYears" sptr, sptr, sptr ; res = GetDynamicTimeZoneInformationEffectiveYears(varptr(lpTimeZoneInformation), varptr(FirstYear), varptr(LastYear)) ; lpTimeZoneInformation : DYNAMIC_TIME_ZONE_INFORMATION* -> "sptr" ; FirstYear : DWORD* out -> "sptr" ; LastYear : DWORD* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD GetDynamicTimeZoneInformationEffectiveYears(DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation, DWORD* FirstYear, DWORD* LastYear) #uselib "ADVAPI32.dll" #cfunc global GetDynamicTimeZoneInformationEffectiveYears "GetDynamicTimeZoneInformationEffectiveYears" var, var, var ; res = GetDynamicTimeZoneInformationEffectiveYears(lpTimeZoneInformation, FirstYear, LastYear) ; lpTimeZoneInformation : DYNAMIC_TIME_ZONE_INFORMATION* -> "var" ; FirstYear : DWORD* out -> "var" ; LastYear : DWORD* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD GetDynamicTimeZoneInformationEffectiveYears(DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation, DWORD* FirstYear, DWORD* LastYear) #uselib "ADVAPI32.dll" #cfunc global GetDynamicTimeZoneInformationEffectiveYears "GetDynamicTimeZoneInformationEffectiveYears" intptr, intptr, intptr ; res = GetDynamicTimeZoneInformationEffectiveYears(varptr(lpTimeZoneInformation), varptr(FirstYear), varptr(LastYear)) ; lpTimeZoneInformation : DYNAMIC_TIME_ZONE_INFORMATION* -> "intptr" ; FirstYear : DWORD* out -> "intptr" ; LastYear : DWORD* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
advapi32 = windows.NewLazySystemDLL("ADVAPI32.dll")
procGetDynamicTimeZoneInformationEffectiveYears = advapi32.NewProc("GetDynamicTimeZoneInformationEffectiveYears")
)
// lpTimeZoneInformation (DYNAMIC_TIME_ZONE_INFORMATION*), FirstYear (DWORD* out), LastYear (DWORD* out)
r1, _, err := procGetDynamicTimeZoneInformationEffectiveYears.Call(
uintptr(lpTimeZoneInformation),
uintptr(FirstYear),
uintptr(LastYear),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction GetDynamicTimeZoneInformationEffectiveYears(
lpTimeZoneInformation: Pointer; // DYNAMIC_TIME_ZONE_INFORMATION*
FirstYear: Pointer; // DWORD* out
LastYear: Pointer // DWORD* out
): DWORD; stdcall;
external 'ADVAPI32.dll' name 'GetDynamicTimeZoneInformationEffectiveYears';result := DllCall("ADVAPI32\GetDynamicTimeZoneInformationEffectiveYears"
, "Ptr", lpTimeZoneInformation ; DYNAMIC_TIME_ZONE_INFORMATION*
, "Ptr", FirstYear ; DWORD* out
, "Ptr", LastYear ; DWORD* out
, "UInt") ; return: DWORD●GetDynamicTimeZoneInformationEffectiveYears(lpTimeZoneInformation, FirstYear, LastYear) = DLL("ADVAPI32.dll", "dword GetDynamicTimeZoneInformationEffectiveYears(void*, void*, void*)")
# 呼び出し: GetDynamicTimeZoneInformationEffectiveYears(lpTimeZoneInformation, FirstYear, LastYear)
# lpTimeZoneInformation : DYNAMIC_TIME_ZONE_INFORMATION* -> "void*"
# FirstYear : DWORD* out -> "void*"
# LastYear : DWORD* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。