Win32 API 日本語リファレンス
ホームSecurity.Cryptography › CRYPTNET_URL_CACHE_FLUSH_INFO

CRYPTNET_URL_CACHE_FLUSH_INFO

構造体
サイズx64: 16 バイト / x86: 16 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズ(バイト単位)。
dwExemptSecondsDWORD4+4+4フラッシュ免除とする経過秒数。
ExpireTimeFILETIME8+8+8キャッシュエントリの有効期限を示すFILETIME。

各言語での定義

#include <windows.h>

// FILETIME  (x64 8 / x86 8 バイト)
typedef struct FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
} FILETIME;

// CRYPTNET_URL_CACHE_FLUSH_INFO  (x64 16 / x86 16 バイト)
typedef struct CRYPTNET_URL_CACHE_FLUSH_INFO {
    DWORD cbSize;
    DWORD dwExemptSeconds;
    FILETIME ExpireTime;
} CRYPTNET_URL_CACHE_FLUSH_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
    public uint dwLowDateTime;
    public uint dwHighDateTime;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CRYPTNET_URL_CACHE_FLUSH_INFO
{
    public uint cbSize;
    public uint dwExemptSeconds;
    public FILETIME ExpireTime;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILETIME
    Public dwLowDateTime As UInteger
    Public dwHighDateTime As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CRYPTNET_URL_CACHE_FLUSH_INFO
    Public cbSize As UInteger
    Public dwExemptSeconds As UInteger
    Public ExpireTime As FILETIME
End Structure
import ctypes
from ctypes import wintypes

class FILETIME(ctypes.Structure):
    _fields_ = [
        ("dwLowDateTime", wintypes.DWORD),
        ("dwHighDateTime", wintypes.DWORD),
    ]

class CRYPTNET_URL_CACHE_FLUSH_INFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwExemptSeconds", wintypes.DWORD),
        ("ExpireTime", FILETIME),
    ]
#[repr(C)]
pub struct FILETIME {
    pub dwLowDateTime: u32,
    pub dwHighDateTime: u32,
}

#[repr(C)]
pub struct CRYPTNET_URL_CACHE_FLUSH_INFO {
    pub cbSize: u32,
    pub dwExemptSeconds: u32,
    pub ExpireTime: FILETIME,
}
import "golang.org/x/sys/windows"

type FILETIME struct {
	dwLowDateTime uint32
	dwHighDateTime uint32
}

type CRYPTNET_URL_CACHE_FLUSH_INFO struct {
	cbSize uint32
	dwExemptSeconds uint32
	ExpireTime FILETIME
}
type
  FILETIME = record
    dwLowDateTime: DWORD;
    dwHighDateTime: DWORD;
  end;

  CRYPTNET_URL_CACHE_FLUSH_INFO = record
    cbSize: DWORD;
    dwExemptSeconds: DWORD;
    ExpireTime: FILETIME;
  end;
const FILETIME = extern struct {
    dwLowDateTime: u32,
    dwHighDateTime: u32,
};

const CRYPTNET_URL_CACHE_FLUSH_INFO = extern struct {
    cbSize: u32,
    dwExemptSeconds: u32,
    ExpireTime: FILETIME,
};
type
  FILETIME {.bycopy.} = object
    dwLowDateTime: uint32
    dwHighDateTime: uint32

  CRYPTNET_URL_CACHE_FLUSH_INFO {.bycopy.} = object
    cbSize: uint32
    dwExemptSeconds: uint32
    ExpireTime: FILETIME
struct FILETIME
{
    uint dwLowDateTime;
    uint dwHighDateTime;
}

struct CRYPTNET_URL_CACHE_FLUSH_INFO
{
    uint cbSize;
    uint dwExemptSeconds;
    FILETIME ExpireTime;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CRYPTNET_URL_CACHE_FLUSH_INFO サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwExemptSeconds : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ExpireTime : FILETIME (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FILETIME
    #field int dwLowDateTime
    #field int dwHighDateTime
#endstruct

#defstruct global CRYPTNET_URL_CACHE_FLUSH_INFO
    #field int cbSize
    #field int dwExemptSeconds
    #field FILETIME ExpireTime
#endstruct

stdim st, CRYPTNET_URL_CACHE_FLUSH_INFO        ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize