ホーム › Graphics.Printing › SPLCLIENT_INFO_3_VISTA
SPLCLIENT_INFO_3_VISTA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。 |
| dwFlags | DWORD | 4 | +4 | +4 | クライアント情報処理を制御するフラグ。 |
| dwSize | DWORD | 4 | +8 | +8 | 構造体のサイズを示す追加フィールド。 |
| pMachineName | LPWSTR | 8/4 | +16 | +12 | クライアントのマシン名を指すUnicode文字列。 |
| pUserName | LPWSTR | 8/4 | +24 | +16 | クライアントのユーザー名を指すUnicode文字列。 |
| dwBuildNum | DWORD | 4 | +32 | +20 | クライアントOSのビルド番号。 |
| dwMajorVersion | DWORD | 4 | +36 | +24 | クライアントOSのメジャーバージョン番号。 |
| dwMinorVersion | DWORD | 4 | +40 | +28 | クライアントOSのマイナーバージョン番号。 |
| wProcessorArchitecture | WORD | 2 | +44 | +32 | クライアントのプロセッサアーキテクチャを示す値。 |
| hSplPrinter | ULONGLONG | 8 | +48 | +40 | スプーラープリンターのハンドル(64ビット)。 |
各言語での定義
#include <windows.h>
// SPLCLIENT_INFO_3_VISTA (x64 56 / x86 48 バイト)
typedef struct SPLCLIENT_INFO_3_VISTA {
DWORD cbSize;
DWORD dwFlags;
DWORD dwSize;
LPWSTR pMachineName;
LPWSTR pUserName;
DWORD dwBuildNum;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
WORD wProcessorArchitecture;
ULONGLONG hSplPrinter;
} SPLCLIENT_INFO_3_VISTA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SPLCLIENT_INFO_3_VISTA
{
public uint cbSize;
public uint dwFlags;
public uint dwSize;
public IntPtr pMachineName;
public IntPtr pUserName;
public uint dwBuildNum;
public uint dwMajorVersion;
public uint dwMinorVersion;
public ushort wProcessorArchitecture;
public ulong hSplPrinter;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SPLCLIENT_INFO_3_VISTA
Public cbSize As UInteger
Public dwFlags As UInteger
Public dwSize As UInteger
Public pMachineName As IntPtr
Public pUserName As IntPtr
Public dwBuildNum As UInteger
Public dwMajorVersion As UInteger
Public dwMinorVersion As UInteger
Public wProcessorArchitecture As UShort
Public hSplPrinter As ULong
End Structureimport ctypes
from ctypes import wintypes
class SPLCLIENT_INFO_3_VISTA(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("dwSize", wintypes.DWORD),
("pMachineName", ctypes.c_void_p),
("pUserName", ctypes.c_void_p),
("dwBuildNum", wintypes.DWORD),
("dwMajorVersion", wintypes.DWORD),
("dwMinorVersion", wintypes.DWORD),
("wProcessorArchitecture", ctypes.c_ushort),
("hSplPrinter", ctypes.c_ulonglong),
]#[repr(C)]
pub struct SPLCLIENT_INFO_3_VISTA {
pub cbSize: u32,
pub dwFlags: u32,
pub dwSize: u32,
pub pMachineName: *mut core::ffi::c_void,
pub pUserName: *mut core::ffi::c_void,
pub dwBuildNum: u32,
pub dwMajorVersion: u32,
pub dwMinorVersion: u32,
pub wProcessorArchitecture: u16,
pub hSplPrinter: u64,
}import "golang.org/x/sys/windows"
type SPLCLIENT_INFO_3_VISTA struct {
cbSize uint32
dwFlags uint32
dwSize uint32
pMachineName uintptr
pUserName uintptr
dwBuildNum uint32
dwMajorVersion uint32
dwMinorVersion uint32
wProcessorArchitecture uint16
hSplPrinter uint64
}type
SPLCLIENT_INFO_3_VISTA = record
cbSize: DWORD;
dwFlags: DWORD;
dwSize: DWORD;
pMachineName: Pointer;
pUserName: Pointer;
dwBuildNum: DWORD;
dwMajorVersion: DWORD;
dwMinorVersion: DWORD;
wProcessorArchitecture: Word;
hSplPrinter: UInt64;
end;const SPLCLIENT_INFO_3_VISTA = extern struct {
cbSize: u32,
dwFlags: u32,
dwSize: u32,
pMachineName: ?*anyopaque,
pUserName: ?*anyopaque,
dwBuildNum: u32,
dwMajorVersion: u32,
dwMinorVersion: u32,
wProcessorArchitecture: u16,
hSplPrinter: u64,
};type
SPLCLIENT_INFO_3_VISTA {.bycopy.} = object
cbSize: uint32
dwFlags: uint32
dwSize: uint32
pMachineName: pointer
pUserName: pointer
dwBuildNum: uint32
dwMajorVersion: uint32
dwMinorVersion: uint32
wProcessorArchitecture: uint16
hSplPrinter: uint64struct SPLCLIENT_INFO_3_VISTA
{
uint cbSize;
uint dwFlags;
uint dwSize;
void* pMachineName;
void* pUserName;
uint dwBuildNum;
uint dwMajorVersion;
uint dwMinorVersion;
ushort wProcessorArchitecture;
ulong hSplPrinter;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SPLCLIENT_INFO_3_VISTA サイズ: 48 バイト(x86)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwSize : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pMachineName : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pUserName : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwBuildNum : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwMajorVersion : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwMinorVersion : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; wProcessorArchitecture : WORD (+32, 2byte) wpoke st,32,値 / 値 = wpeek(st,32)
; hSplPrinter : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SPLCLIENT_INFO_3_VISTA サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwSize : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pMachineName : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pUserName : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwBuildNum : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwMajorVersion : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwMinorVersion : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; wProcessorArchitecture : WORD (+44, 2byte) wpoke st,44,値 / 値 = wpeek(st,44)
; hSplPrinter : ULONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SPLCLIENT_INFO_3_VISTA
#field int cbSize
#field int dwFlags
#field int dwSize
#field intptr pMachineName
#field intptr pUserName
#field int dwBuildNum
#field int dwMajorVersion
#field int dwMinorVersion
#field short wProcessorArchitecture
#field int64 hSplPrinter
#endstruct
stdim st, SPLCLIENT_INFO_3_VISTA ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize