ホーム › Graphics.Printing › DRIVER_INFO_3A
DRIVER_INFO_3A
構造体サイズ=各フィールドのバイト数(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)へのポインタ。 |
| pHelpFile | LPSTR | 8/4 | +48 | +24 | ヘルプファイルのパス(ANSI)へのポインタ。NULL可。 |
| pDependentFiles | LPSTR | 8/4 | +56 | +28 | 依存ファイルのパスをNULL区切りで連結した文字列(ANSI)へのポインタ。 |
| pMonitorName | LPSTR | 8/4 | +64 | +32 | 言語モニタ名(ANSI)へのポインタ。NULL可。 |
| pDefaultDataType | LPSTR | 8/4 | +72 | +36 | 既定の印刷データ型(ANSI)へのポインタ。NULL可。 |
各言語での定義
#include <windows.h>
// DRIVER_INFO_3A (x64 80 / x86 40 バイト)
typedef struct DRIVER_INFO_3A {
DWORD cVersion;
LPSTR pName;
LPSTR pEnvironment;
LPSTR pDriverPath;
LPSTR pDataFile;
LPSTR pConfigFile;
LPSTR pHelpFile;
LPSTR pDependentFiles;
LPSTR pMonitorName;
LPSTR pDefaultDataType;
} DRIVER_INFO_3A;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DRIVER_INFO_3A
{
public uint cVersion;
public IntPtr pName;
public IntPtr pEnvironment;
public IntPtr pDriverPath;
public IntPtr pDataFile;
public IntPtr pConfigFile;
public IntPtr pHelpFile;
public IntPtr pDependentFiles;
public IntPtr pMonitorName;
public IntPtr pDefaultDataType;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DRIVER_INFO_3A
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 pHelpFile As IntPtr
Public pDependentFiles As IntPtr
Public pMonitorName As IntPtr
Public pDefaultDataType As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class DRIVER_INFO_3A(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),
("pHelpFile", ctypes.c_void_p),
("pDependentFiles", ctypes.c_void_p),
("pMonitorName", ctypes.c_void_p),
("pDefaultDataType", ctypes.c_void_p),
]#[repr(C)]
pub struct DRIVER_INFO_3A {
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 pHelpFile: *mut core::ffi::c_void,
pub pDependentFiles: *mut core::ffi::c_void,
pub pMonitorName: *mut core::ffi::c_void,
pub pDefaultDataType: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type DRIVER_INFO_3A struct {
cVersion uint32
pName uintptr
pEnvironment uintptr
pDriverPath uintptr
pDataFile uintptr
pConfigFile uintptr
pHelpFile uintptr
pDependentFiles uintptr
pMonitorName uintptr
pDefaultDataType uintptr
}type
DRIVER_INFO_3A = record
cVersion: DWORD;
pName: Pointer;
pEnvironment: Pointer;
pDriverPath: Pointer;
pDataFile: Pointer;
pConfigFile: Pointer;
pHelpFile: Pointer;
pDependentFiles: Pointer;
pMonitorName: Pointer;
pDefaultDataType: Pointer;
end;const DRIVER_INFO_3A = extern struct {
cVersion: u32,
pName: ?*anyopaque,
pEnvironment: ?*anyopaque,
pDriverPath: ?*anyopaque,
pDataFile: ?*anyopaque,
pConfigFile: ?*anyopaque,
pHelpFile: ?*anyopaque,
pDependentFiles: ?*anyopaque,
pMonitorName: ?*anyopaque,
pDefaultDataType: ?*anyopaque,
};type
DRIVER_INFO_3A {.bycopy.} = object
cVersion: uint32
pName: pointer
pEnvironment: pointer
pDriverPath: pointer
pDataFile: pointer
pConfigFile: pointer
pHelpFile: pointer
pDependentFiles: pointer
pMonitorName: pointer
pDefaultDataType: pointerstruct DRIVER_INFO_3A
{
uint cVersion;
void* pName;
void* pEnvironment;
void* pDriverPath;
void* pDataFile;
void* pConfigFile;
void* pHelpFile;
void* pDependentFiles;
void* pMonitorName;
void* pDefaultDataType;
}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_3A サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 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 も可)
; pHelpFile : LPSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; pDependentFiles : LPSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; pMonitorName : LPSTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pDefaultDataType : LPSTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DRIVER_INFO_3A サイズ: 80 バイト(x64)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 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,上位
; pHelpFile : LPSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; pDependentFiles : LPSTR (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; pMonitorName : LPSTR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; pDefaultDataType : LPSTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DRIVER_INFO_3A
#field int cVersion
#field intptr pName
#field intptr pEnvironment
#field intptr pDriverPath
#field intptr pDataFile
#field intptr pConfigFile
#field intptr pHelpFile
#field intptr pDependentFiles
#field intptr pMonitorName
#field intptr pDefaultDataType
#endstruct
stdim st, DRIVER_INFO_3A ; NSTRUCT 変数を確保
st->cVersion = 100
mes "cVersion=" + st->cVersion