ホーム › System.Com › TLIBATTR
TLIBATTR
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| guid | GUID | 16 | +0 | +0 | タイプライブラリを一意に識別するLIBID(GUID)。 |
| lcid | DWORD | 4 | +16 | +16 | タイプライブラリのロケールID。地域・言語設定を表す。 |
| syskind | SYSKIND | 4 | +20 | +20 | 対象システムの種類を示すSYSKIND列挙値。Win16/Win32/Win64などを区別する。 |
| wMajorVerNum | WORD | 2 | +24 | +24 | タイプライブラリのメジャーバージョン番号。 |
| wMinorVerNum | WORD | 2 | +26 | +26 | タイプライブラリのマイナーバージョン番号。 |
| wLibFlags | WORD | 2 | +28 | +28 | ライブラリのフラグ属性。制限付きや制御対象などの特性をビットで表す。 |
各言語での定義
#include <windows.h>
// TLIBATTR (x64 32 / x86 32 バイト)
typedef struct TLIBATTR {
GUID guid;
DWORD lcid;
SYSKIND syskind;
WORD wMajorVerNum;
WORD wMinorVerNum;
WORD wLibFlags;
} TLIBATTR;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TLIBATTR
{
public Guid guid;
public uint lcid;
public int syskind;
public ushort wMajorVerNum;
public ushort wMinorVerNum;
public ushort wLibFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TLIBATTR
Public guid As Guid
Public lcid As UInteger
Public syskind As Integer
Public wMajorVerNum As UShort
Public wMinorVerNum As UShort
Public wLibFlags As UShort
End Structureimport ctypes
from ctypes import wintypes
class TLIBATTR(ctypes.Structure):
_fields_ = [
("guid", GUID),
("lcid", wintypes.DWORD),
("syskind", ctypes.c_int),
("wMajorVerNum", ctypes.c_ushort),
("wMinorVerNum", ctypes.c_ushort),
("wLibFlags", ctypes.c_ushort),
]#[repr(C)]
pub struct TLIBATTR {
pub guid: GUID,
pub lcid: u32,
pub syskind: i32,
pub wMajorVerNum: u16,
pub wMinorVerNum: u16,
pub wLibFlags: u16,
}import "golang.org/x/sys/windows"
type TLIBATTR struct {
guid windows.GUID
lcid uint32
syskind int32
wMajorVerNum uint16
wMinorVerNum uint16
wLibFlags uint16
}type
TLIBATTR = record
guid: TGUID;
lcid: DWORD;
syskind: Integer;
wMajorVerNum: Word;
wMinorVerNum: Word;
wLibFlags: Word;
end;const TLIBATTR = extern struct {
guid: GUID,
lcid: u32,
syskind: i32,
wMajorVerNum: u16,
wMinorVerNum: u16,
wLibFlags: u16,
};type
TLIBATTR {.bycopy.} = object
guid: GUID
lcid: uint32
syskind: int32
wMajorVerNum: uint16
wMinorVerNum: uint16
wLibFlags: uint16struct TLIBATTR
{
GUID guid;
uint lcid;
int syskind;
ushort wMajorVerNum;
ushort wMinorVerNum;
ushort wLibFlags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TLIBATTR サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; guid : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; lcid : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; syskind : SYSKIND (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; wMajorVerNum : WORD (+24, 2byte) wpoke st,24,値 / 値 = wpeek(st,24)
; wMinorVerNum : WORD (+26, 2byte) wpoke st,26,値 / 値 = wpeek(st,26)
; wLibFlags : WORD (+28, 2byte) wpoke st,28,値 / 値 = wpeek(st,28)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global TLIBATTR
#field GUID guid
#field int lcid
#field int syskind
#field short wMajorVerNum
#field short wMinorVerNum
#field short wLibFlags
#endstruct
stdim st, TLIBATTR ; NSTRUCT 変数を確保
st->lcid = 100
mes "lcid=" + st->lcid