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

COOKIE_DLG_INFO

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

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

フィールド

フィールドサイズx64x86説明
pszServerLPWSTR8/4+0+0Cookie発行元サーバ名の文字列である。
picINTERNET_COOKIE*8/4+8+4対象となるINTERNET_COOKIE構造体へのポインタである。
dwStopWarningDWORD4+16+8警告表示を停止するかどうかを示すフラグである。
cxINT4+20+12ダイアログの幅をピクセル単位で示す。
cyINT4+24+16ダイアログの高さをピクセル単位で示す。
pszHeaderLPWSTR8/4+32+20ダイアログに表示するヘッダ文字列である。
dwOperationDWORD4+40+24対象とするCookie操作の種類を示す値である。

各言語での定義

#include <windows.h>

// COOKIE_DLG_INFO  (x64 48 / x86 28 バイト)
typedef struct COOKIE_DLG_INFO {
    LPWSTR pszServer;
    INTERNET_COOKIE* pic;
    DWORD dwStopWarning;
    INT cx;
    INT cy;
    LPWSTR pszHeader;
    DWORD dwOperation;
} COOKIE_DLG_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct COOKIE_DLG_INFO
{
    public IntPtr pszServer;
    public IntPtr pic;
    public uint dwStopWarning;
    public int cx;
    public int cy;
    public IntPtr pszHeader;
    public uint dwOperation;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure COOKIE_DLG_INFO
    Public pszServer As IntPtr
    Public pic As IntPtr
    Public dwStopWarning As UInteger
    Public cx As Integer
    Public cy As Integer
    Public pszHeader As IntPtr
    Public dwOperation As UInteger
End Structure
import ctypes
from ctypes import wintypes

class COOKIE_DLG_INFO(ctypes.Structure):
    _fields_ = [
        ("pszServer", ctypes.c_void_p),
        ("pic", ctypes.c_void_p),
        ("dwStopWarning", wintypes.DWORD),
        ("cx", ctypes.c_int),
        ("cy", ctypes.c_int),
        ("pszHeader", ctypes.c_void_p),
        ("dwOperation", wintypes.DWORD),
    ]
#[repr(C)]
pub struct COOKIE_DLG_INFO {
    pub pszServer: *mut core::ffi::c_void,
    pub pic: *mut core::ffi::c_void,
    pub dwStopWarning: u32,
    pub cx: i32,
    pub cy: i32,
    pub pszHeader: *mut core::ffi::c_void,
    pub dwOperation: u32,
}
import "golang.org/x/sys/windows"

type COOKIE_DLG_INFO struct {
	pszServer uintptr
	pic uintptr
	dwStopWarning uint32
	cx int32
	cy int32
	pszHeader uintptr
	dwOperation uint32
}
type
  COOKIE_DLG_INFO = record
    pszServer: Pointer;
    pic: Pointer;
    dwStopWarning: DWORD;
    cx: Integer;
    cy: Integer;
    pszHeader: Pointer;
    dwOperation: DWORD;
  end;
const COOKIE_DLG_INFO = extern struct {
    pszServer: ?*anyopaque,
    pic: ?*anyopaque,
    dwStopWarning: u32,
    cx: i32,
    cy: i32,
    pszHeader: ?*anyopaque,
    dwOperation: u32,
};
type
  COOKIE_DLG_INFO {.bycopy.} = object
    pszServer: pointer
    pic: pointer
    dwStopWarning: uint32
    cx: int32
    cy: int32
    pszHeader: pointer
    dwOperation: uint32
struct COOKIE_DLG_INFO
{
    void* pszServer;
    void* pic;
    uint dwStopWarning;
    int cx;
    int cy;
    void* pszHeader;
    uint dwOperation;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; COOKIE_DLG_INFO サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; pszServer : LPWSTR (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pic : INTERNET_COOKIE* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; dwStopWarning : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cx : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; cy : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pszHeader : LPWSTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwOperation : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; COOKIE_DLG_INFO サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; pszServer : LPWSTR (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; pic : INTERNET_COOKIE* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; dwStopWarning : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; cx : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; cy : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; pszHeader : LPWSTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; dwOperation : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global COOKIE_DLG_INFO
    #field intptr pszServer
    #field intptr pic
    #field int dwStopWarning
    #field int cx
    #field int cy
    #field intptr pszHeader
    #field int dwOperation
#endstruct

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