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