ホーム › AI.MachineLearning.WinML › WINML_MODEL_DESC
WINML_MODEL_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Author | LPWSTR | 8/4 | +0 | +0 | モデルの作者名(ワイド文字列)。 |
| Name | LPWSTR | 8/4 | +8 | +4 | モデルの名前(ワイド文字列)。 |
| Domain | LPWSTR | 8/4 | +16 | +8 | モデルが属するドメイン名(ワイド文字列)。 |
| Description | LPWSTR | 8/4 | +24 | +12 | モデルの説明文(ワイド文字列)。 |
| Version | UINT_PTR | 8/4 | +32 | +16 | モデルのバージョン番号。 |
各言語での定義
#include <windows.h>
// WINML_MODEL_DESC (x64 40 / x86 20 バイト)
typedef struct WINML_MODEL_DESC {
LPWSTR Author;
LPWSTR Name;
LPWSTR Domain;
LPWSTR Description;
UINT_PTR Version;
} WINML_MODEL_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WINML_MODEL_DESC
{
public IntPtr Author;
public IntPtr Name;
public IntPtr Domain;
public IntPtr Description;
public UIntPtr Version;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WINML_MODEL_DESC
Public Author As IntPtr
Public Name As IntPtr
Public Domain As IntPtr
Public Description As IntPtr
Public Version As UIntPtr
End Structureimport ctypes
from ctypes import wintypes
class WINML_MODEL_DESC(ctypes.Structure):
_fields_ = [
("Author", ctypes.c_void_p),
("Name", ctypes.c_void_p),
("Domain", ctypes.c_void_p),
("Description", ctypes.c_void_p),
("Version", ctypes.c_size_t),
]#[repr(C)]
pub struct WINML_MODEL_DESC {
pub Author: *mut core::ffi::c_void,
pub Name: *mut core::ffi::c_void,
pub Domain: *mut core::ffi::c_void,
pub Description: *mut core::ffi::c_void,
pub Version: usize,
}import "golang.org/x/sys/windows"
type WINML_MODEL_DESC struct {
Author uintptr
Name uintptr
Domain uintptr
Description uintptr
Version uintptr
}type
WINML_MODEL_DESC = record
Author: Pointer;
Name: Pointer;
Domain: Pointer;
Description: Pointer;
Version: NativeUInt;
end;const WINML_MODEL_DESC = extern struct {
Author: ?*anyopaque,
Name: ?*anyopaque,
Domain: ?*anyopaque,
Description: ?*anyopaque,
Version: usize,
};type
WINML_MODEL_DESC {.bycopy.} = object
Author: pointer
Name: pointer
Domain: pointer
Description: pointer
Version: uintstruct WINML_MODEL_DESC
{
void* Author;
void* Name;
void* Domain;
void* Description;
size_t Version;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WINML_MODEL_DESC サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Author : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Name : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Domain : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Description : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Version : UINT_PTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WINML_MODEL_DESC サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Author : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Name : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Domain : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Description : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Version : UINT_PTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WINML_MODEL_DESC
#field intptr Author
#field intptr Name
#field intptr Domain
#field intptr Description
#field intptr Version
#endstruct
stdim st, WINML_MODEL_DESC ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version