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