ホーム › Graphics.Printing › PRINTER_ENUM_VALUESW
PRINTER_ENUM_VALUESW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| pValueName | LPWSTR | 8/4 | +0 | +0 | プリンタデータ値の名前(Unicode)へのポインタ。 |
| cbValueName | DWORD | 4 | +8 | +4 | pValueName文字列のバイト数(終端含む)。 |
| dwType | DWORD | 4 | +12 | +8 | 値のデータ型を示すレジストリ型(REG_SZ/REG_DWORD等)。 |
| pData | BYTE* | 8/4 | +16 | +12 | 値のデータを格納するバッファへのポインタ。 |
| cbData | DWORD | 4 | +24 | +16 | pDataが指すデータのバイト数。 |
各言語での定義
#include <windows.h>
// PRINTER_ENUM_VALUESW (x64 32 / x86 20 バイト)
typedef struct PRINTER_ENUM_VALUESW {
LPWSTR pValueName;
DWORD cbValueName;
DWORD dwType;
BYTE* pData;
DWORD cbData;
} PRINTER_ENUM_VALUESW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PRINTER_ENUM_VALUESW
{
public IntPtr pValueName;
public uint cbValueName;
public uint dwType;
public IntPtr pData;
public uint cbData;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PRINTER_ENUM_VALUESW
Public pValueName As IntPtr
Public cbValueName As UInteger
Public dwType As UInteger
Public pData As IntPtr
Public cbData As UInteger
End Structureimport ctypes
from ctypes import wintypes
class PRINTER_ENUM_VALUESW(ctypes.Structure):
_fields_ = [
("pValueName", ctypes.c_void_p),
("cbValueName", wintypes.DWORD),
("dwType", wintypes.DWORD),
("pData", ctypes.c_void_p),
("cbData", wintypes.DWORD),
]#[repr(C)]
pub struct PRINTER_ENUM_VALUESW {
pub pValueName: *mut core::ffi::c_void,
pub cbValueName: u32,
pub dwType: u32,
pub pData: *mut core::ffi::c_void,
pub cbData: u32,
}import "golang.org/x/sys/windows"
type PRINTER_ENUM_VALUESW struct {
pValueName uintptr
cbValueName uint32
dwType uint32
pData uintptr
cbData uint32
}type
PRINTER_ENUM_VALUESW = record
pValueName: Pointer;
cbValueName: DWORD;
dwType: DWORD;
pData: Pointer;
cbData: DWORD;
end;const PRINTER_ENUM_VALUESW = extern struct {
pValueName: ?*anyopaque,
cbValueName: u32,
dwType: u32,
pData: ?*anyopaque,
cbData: u32,
};type
PRINTER_ENUM_VALUESW {.bycopy.} = object
pValueName: pointer
cbValueName: uint32
dwType: uint32
pData: pointer
cbData: uint32struct PRINTER_ENUM_VALUESW
{
void* pValueName;
uint cbValueName;
uint dwType;
void* pData;
uint cbData;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; PRINTER_ENUM_VALUESW サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; pValueName : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cbValueName : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwType : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pData : BYTE* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cbData : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PRINTER_ENUM_VALUESW サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; pValueName : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; cbValueName : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwType : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pData : BYTE* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; cbData : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PRINTER_ENUM_VALUESW
#field intptr pValueName
#field int cbValueName
#field int dwType
#field intptr pData
#field int cbData
#endstruct
stdim st, PRINTER_ENUM_VALUESW ; NSTRUCT 変数を確保
st->cbValueName = 100
mes "cbValueName=" + st->cbValueName