Win32 API 日本語リファレンス
ホームNetworking.WinInet › IncomingCookieState

IncomingCookieState

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

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

フィールド

フィールドサイズx64x86説明
cSessionINT4+0+0受信したセッションクッキーの数。
cPersistentINT4+4+4受信した永続クッキーの数。
cAcceptedINT4+8+8受け入れられたクッキーの数。
cLeashedINT4+12+12リーシュ(同一サイト制限)されたクッキーの数。
cDowngradedINT4+16+16セッションへ格下げされたクッキーの数。
cBlockedINT4+20+20ブロックされたクッキーの数。
pszLocationLPSTR8/4+24+24クッキー処理に関連する場所(URL等)の文字列(ANSI)。

各言語での定義

#include <windows.h>

// IncomingCookieState  (x64 32 / x86 28 バイト)
typedef struct IncomingCookieState {
    INT cSession;
    INT cPersistent;
    INT cAccepted;
    INT cLeashed;
    INT cDowngraded;
    INT cBlocked;
    LPSTR pszLocation;
} IncomingCookieState;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IncomingCookieState
{
    public int cSession;
    public int cPersistent;
    public int cAccepted;
    public int cLeashed;
    public int cDowngraded;
    public int cBlocked;
    public IntPtr pszLocation;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IncomingCookieState
    Public cSession As Integer
    Public cPersistent As Integer
    Public cAccepted As Integer
    Public cLeashed As Integer
    Public cDowngraded As Integer
    Public cBlocked As Integer
    Public pszLocation As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class IncomingCookieState(ctypes.Structure):
    _fields_ = [
        ("cSession", ctypes.c_int),
        ("cPersistent", ctypes.c_int),
        ("cAccepted", ctypes.c_int),
        ("cLeashed", ctypes.c_int),
        ("cDowngraded", ctypes.c_int),
        ("cBlocked", ctypes.c_int),
        ("pszLocation", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct IncomingCookieState {
    pub cSession: i32,
    pub cPersistent: i32,
    pub cAccepted: i32,
    pub cLeashed: i32,
    pub cDowngraded: i32,
    pub cBlocked: i32,
    pub pszLocation: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type IncomingCookieState struct {
	cSession int32
	cPersistent int32
	cAccepted int32
	cLeashed int32
	cDowngraded int32
	cBlocked int32
	pszLocation uintptr
}
type
  IncomingCookieState = record
    cSession: Integer;
    cPersistent: Integer;
    cAccepted: Integer;
    cLeashed: Integer;
    cDowngraded: Integer;
    cBlocked: Integer;
    pszLocation: Pointer;
  end;
const IncomingCookieState = extern struct {
    cSession: i32,
    cPersistent: i32,
    cAccepted: i32,
    cLeashed: i32,
    cDowngraded: i32,
    cBlocked: i32,
    pszLocation: ?*anyopaque,
};
type
  IncomingCookieState {.bycopy.} = object
    cSession: int32
    cPersistent: int32
    cAccepted: int32
    cLeashed: int32
    cDowngraded: int32
    cBlocked: int32
    pszLocation: pointer
struct IncomingCookieState
{
    int cSession;
    int cPersistent;
    int cAccepted;
    int cLeashed;
    int cDowngraded;
    int cBlocked;
    void* pszLocation;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; IncomingCookieState サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; cSession : INT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cPersistent : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cAccepted : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cLeashed : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; cDowngraded : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; cBlocked : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; pszLocation : LPSTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IncomingCookieState サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cSession : INT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cPersistent : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cAccepted : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cLeashed : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; cDowngraded : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; cBlocked : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; pszLocation : LPSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IncomingCookieState
    #field int cSession
    #field int cPersistent
    #field int cAccepted
    #field int cLeashed
    #field int cDowngraded
    #field int cBlocked
    #field intptr pszLocation
#endstruct

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