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