Win32 API 日本語リファレンス
ホームGraphics.Printing › DRIVER_INFO_6W

DRIVER_INFO_6W

構造体
サイズx64: 136 バイト / x86: 80 バイト

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

フィールド

フィールドサイズx64x86説明
cVersionDWORD4+0+0ドライバのバージョン番号。
pNameLPWSTR8/4+8+4プリンタドライバ名(Unicode)へのポインタ。
pEnvironmentLPWSTR8/4+16+8ドライバの対象環境名(Unicode)。
pDriverPathLPWSTR8/4+24+12ドライバ本体ファイルのパス(Unicode)へのポインタ。
pDataFileLPWSTR8/4+32+16ドライバデータファイルのパス(Unicode)へのポインタ。
pConfigFileLPWSTR8/4+40+20構成用DLLのパス(Unicode)へのポインタ。
pHelpFileLPWSTR8/4+48+24ヘルプファイルのパス(Unicode)へのポインタ。NULL可。
pDependentFilesLPWSTR8/4+56+28依存ファイルのパスをNULL区切りで連結した文字列(Unicode)へのポインタ。
pMonitorNameLPWSTR8/4+64+32言語モニタ名(Unicode)へのポインタ。NULL可。
pDefaultDataTypeLPWSTR8/4+72+36既定の印刷データ型(Unicode)へのポインタ。NULL可。
pszzPreviousNamesLPWSTR8/4+80+40このドライバの旧名称をNULL区切りで連結した文字列(Unicode)へのポインタ。
ftDriverDateFILETIME8+88+44ドライバの日付を示すFILETIME。
dwlDriverVersionULONGLONG8+96+56ドライバのバージョンを示す64ビット値。
pszMfgNameLPWSTR8/4+104+64ドライバ製造元名(Unicode)へのポインタ。
pszOEMUrlLPWSTR8/4+112+68製造元のWeb URL(Unicode)へのポインタ。
pszHardwareIDLPWSTR8/4+120+72ドライバのハードウェアID(Unicode)へのポインタ。
pszProviderLPWSTR8/4+128+76ドライバの提供元名(Unicode)へのポインタ。

各言語での定義

#include <windows.h>

// FILETIME  (x64 8 / x86 8 バイト)
typedef struct FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
} FILETIME;

// DRIVER_INFO_6W  (x64 136 / x86 80 バイト)
typedef struct DRIVER_INFO_6W {
    DWORD cVersion;
    LPWSTR pName;
    LPWSTR pEnvironment;
    LPWSTR pDriverPath;
    LPWSTR pDataFile;
    LPWSTR pConfigFile;
    LPWSTR pHelpFile;
    LPWSTR pDependentFiles;
    LPWSTR pMonitorName;
    LPWSTR pDefaultDataType;
    LPWSTR pszzPreviousNames;
    FILETIME ftDriverDate;
    ULONGLONG dwlDriverVersion;
    LPWSTR pszMfgName;
    LPWSTR pszOEMUrl;
    LPWSTR pszHardwareID;
    LPWSTR pszProvider;
} DRIVER_INFO_6W;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
    public uint dwLowDateTime;
    public uint dwHighDateTime;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DRIVER_INFO_6W
{
    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;
    public FILETIME ftDriverDate;
    public ulong dwlDriverVersion;
    public IntPtr pszMfgName;
    public IntPtr pszOEMUrl;
    public IntPtr pszHardwareID;
    public IntPtr pszProvider;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILETIME
    Public dwLowDateTime As UInteger
    Public dwHighDateTime As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DRIVER_INFO_6W
    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
    Public ftDriverDate As FILETIME
    Public dwlDriverVersion As ULong
    Public pszMfgName As IntPtr
    Public pszOEMUrl As IntPtr
    Public pszHardwareID As IntPtr
    Public pszProvider As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class FILETIME(ctypes.Structure):
    _fields_ = [
        ("dwLowDateTime", wintypes.DWORD),
        ("dwHighDateTime", wintypes.DWORD),
    ]

class DRIVER_INFO_6W(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),
        ("pszzPreviousNames", ctypes.c_void_p),
        ("ftDriverDate", FILETIME),
        ("dwlDriverVersion", ctypes.c_ulonglong),
        ("pszMfgName", ctypes.c_void_p),
        ("pszOEMUrl", ctypes.c_void_p),
        ("pszHardwareID", ctypes.c_void_p),
        ("pszProvider", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct FILETIME {
    pub dwLowDateTime: u32,
    pub dwHighDateTime: u32,
}

#[repr(C)]
pub struct DRIVER_INFO_6W {
    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,
    pub ftDriverDate: FILETIME,
    pub dwlDriverVersion: u64,
    pub pszMfgName: *mut core::ffi::c_void,
    pub pszOEMUrl: *mut core::ffi::c_void,
    pub pszHardwareID: *mut core::ffi::c_void,
    pub pszProvider: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type FILETIME struct {
	dwLowDateTime uint32
	dwHighDateTime uint32
}

type DRIVER_INFO_6W struct {
	cVersion uint32
	pName uintptr
	pEnvironment uintptr
	pDriverPath uintptr
	pDataFile uintptr
	pConfigFile uintptr
	pHelpFile uintptr
	pDependentFiles uintptr
	pMonitorName uintptr
	pDefaultDataType uintptr
	pszzPreviousNames uintptr
	ftDriverDate FILETIME
	dwlDriverVersion uint64
	pszMfgName uintptr
	pszOEMUrl uintptr
	pszHardwareID uintptr
	pszProvider uintptr
}
type
  FILETIME = record
    dwLowDateTime: DWORD;
    dwHighDateTime: DWORD;
  end;

  DRIVER_INFO_6W = record
    cVersion: DWORD;
    pName: Pointer;
    pEnvironment: Pointer;
    pDriverPath: Pointer;
    pDataFile: Pointer;
    pConfigFile: Pointer;
    pHelpFile: Pointer;
    pDependentFiles: Pointer;
    pMonitorName: Pointer;
    pDefaultDataType: Pointer;
    pszzPreviousNames: Pointer;
    ftDriverDate: FILETIME;
    dwlDriverVersion: UInt64;
    pszMfgName: Pointer;
    pszOEMUrl: Pointer;
    pszHardwareID: Pointer;
    pszProvider: Pointer;
  end;
const FILETIME = extern struct {
    dwLowDateTime: u32,
    dwHighDateTime: u32,
};

const DRIVER_INFO_6W = extern struct {
    cVersion: u32,
    pName: ?*anyopaque,
    pEnvironment: ?*anyopaque,
    pDriverPath: ?*anyopaque,
    pDataFile: ?*anyopaque,
    pConfigFile: ?*anyopaque,
    pHelpFile: ?*anyopaque,
    pDependentFiles: ?*anyopaque,
    pMonitorName: ?*anyopaque,
    pDefaultDataType: ?*anyopaque,
    pszzPreviousNames: ?*anyopaque,
    ftDriverDate: FILETIME,
    dwlDriverVersion: u64,
    pszMfgName: ?*anyopaque,
    pszOEMUrl: ?*anyopaque,
    pszHardwareID: ?*anyopaque,
    pszProvider: ?*anyopaque,
};
type
  FILETIME {.bycopy.} = object
    dwLowDateTime: uint32
    dwHighDateTime: uint32

  DRIVER_INFO_6W {.bycopy.} = object
    cVersion: uint32
    pName: pointer
    pEnvironment: pointer
    pDriverPath: pointer
    pDataFile: pointer
    pConfigFile: pointer
    pHelpFile: pointer
    pDependentFiles: pointer
    pMonitorName: pointer
    pDefaultDataType: pointer
    pszzPreviousNames: pointer
    ftDriverDate: FILETIME
    dwlDriverVersion: uint64
    pszMfgName: pointer
    pszOEMUrl: pointer
    pszHardwareID: pointer
    pszProvider: pointer
struct FILETIME
{
    uint dwLowDateTime;
    uint dwHighDateTime;
}

struct DRIVER_INFO_6W
{
    uint cVersion;
    void* pName;
    void* pEnvironment;
    void* pDriverPath;
    void* pDataFile;
    void* pConfigFile;
    void* pHelpFile;
    void* pDependentFiles;
    void* pMonitorName;
    void* pDefaultDataType;
    void* pszzPreviousNames;
    FILETIME ftDriverDate;
    ulong dwlDriverVersion;
    void* pszMfgName;
    void* pszOEMUrl;
    void* pszHardwareID;
    void* pszProvider;
}

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_6W サイズ: 80 バイト(x86)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; cVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pName : LPWSTR (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pEnvironment : LPWSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pDriverPath : LPWSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; pDataFile : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pConfigFile : LPWSTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; pHelpFile : LPWSTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; pDependentFiles : LPWSTR (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; pMonitorName : LPWSTR (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; pDefaultDataType : LPWSTR (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; pszzPreviousNames : LPWSTR (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ftDriverDate : FILETIME (+44, 8byte)  varptr(st)+44 を基点に操作(8byte:入れ子/配列)
; dwlDriverVersion : ULONGLONG (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; pszMfgName : LPWSTR (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; pszOEMUrl : LPWSTR (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; pszHardwareID : LPWSTR (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; pszProvider : LPWSTR (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DRIVER_INFO_6W サイズ: 136 バイト(x64)
dim st, 34    ; 4byte整数×34(構造体サイズ 136 / 4 切り上げ)
; cVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pName : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pEnvironment : LPWSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pDriverPath : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pDataFile : LPWSTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pConfigFile : LPWSTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; pHelpFile : LPWSTR (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; pDependentFiles : LPWSTR (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; pMonitorName : LPWSTR (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; pDefaultDataType : LPWSTR (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; pszzPreviousNames : LPWSTR (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ftDriverDate : FILETIME (+88, 8byte)  varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; dwlDriverVersion : ULONGLONG (+96, 8byte)  qpoke st,96,値 / qpeek(st,96)  ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; pszMfgName : LPWSTR (+104, 8byte)  qpoke st,104,値 / qpeek(st,104)  ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; pszOEMUrl : LPWSTR (+112, 8byte)  qpoke st,112,値 / qpeek(st,112)  ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; pszHardwareID : LPWSTR (+120, 8byte)  qpoke st,120,値 / qpeek(st,120)  ※IronHSPのみ。3.7/3.8は lpoke st,120,下位 : lpoke st,124,上位
; pszProvider : LPWSTR (+128, 8byte)  qpoke st,128,値 / qpeek(st,128)  ※IronHSPのみ。3.7/3.8は lpoke st,128,下位 : lpoke st,132,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FILETIME
    #field int dwLowDateTime
    #field int dwHighDateTime
#endstruct

#defstruct global DRIVER_INFO_6W
    #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
    #field FILETIME ftDriverDate
    #field int64 dwlDriverVersion
    #field intptr pszMfgName
    #field intptr pszOEMUrl
    #field intptr pszHardwareID
    #field intptr pszProvider
#endstruct

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