ホーム › NetworkManagement.NetManagement › OBO_TOKEN
OBO_TOKEN
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Type | OBO_TOKEN_TYPE | 4 | +0 | +0 | 代理(on-behalf-of)トークンの発行元種別を示す列挙値。 |
| pncc | INetCfgComponent* | 8/4 | +8 | +4 | 関連するネットワーク構成コンポーネントのINetCfgComponentへのポインタ。 |
| pszwManufacturer | LPWSTR | 8/4 | +16 | +8 | コンポーネント製造元名を表す文字列へのポインタ。 |
| pszwProduct | LPWSTR | 8/4 | +24 | +12 | コンポーネント製品名を表す文字列へのポインタ。 |
| pszwDisplayName | LPWSTR | 8/4 | +32 | +16 | コンポーネントの表示名を表す文字列へのポインタ。 |
| fRegistered | BOOL | 4 | +40 | +20 | このコンポーネントが登録済みかを示すフラグ。 |
各言語での定義
#include <windows.h>
// OBO_TOKEN (x64 48 / x86 24 バイト)
typedef struct OBO_TOKEN {
OBO_TOKEN_TYPE Type;
INetCfgComponent* pncc;
LPWSTR pszwManufacturer;
LPWSTR pszwProduct;
LPWSTR pszwDisplayName;
BOOL fRegistered;
} OBO_TOKEN;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OBO_TOKEN
{
public int Type;
public IntPtr pncc;
public IntPtr pszwManufacturer;
public IntPtr pszwProduct;
public IntPtr pszwDisplayName;
[MarshalAs(UnmanagedType.Bool)] public bool fRegistered;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OBO_TOKEN
Public Type As Integer
Public pncc As IntPtr
Public pszwManufacturer As IntPtr
Public pszwProduct As IntPtr
Public pszwDisplayName As IntPtr
<MarshalAs(UnmanagedType.Bool)> Public fRegistered As Boolean
End Structureimport ctypes
from ctypes import wintypes
class OBO_TOKEN(ctypes.Structure):
_fields_ = [
("Type", ctypes.c_int),
("pncc", ctypes.c_void_p),
("pszwManufacturer", ctypes.c_void_p),
("pszwProduct", ctypes.c_void_p),
("pszwDisplayName", ctypes.c_void_p),
("fRegistered", wintypes.BOOL),
]#[repr(C)]
pub struct OBO_TOKEN {
pub Type: i32,
pub pncc: *mut core::ffi::c_void,
pub pszwManufacturer: *mut core::ffi::c_void,
pub pszwProduct: *mut core::ffi::c_void,
pub pszwDisplayName: *mut core::ffi::c_void,
pub fRegistered: i32,
}import "golang.org/x/sys/windows"
type OBO_TOKEN struct {
Type int32
pncc uintptr
pszwManufacturer uintptr
pszwProduct uintptr
pszwDisplayName uintptr
fRegistered int32
}type
OBO_TOKEN = record
Type: Integer;
pncc: Pointer;
pszwManufacturer: Pointer;
pszwProduct: Pointer;
pszwDisplayName: Pointer;
fRegistered: BOOL;
end;const OBO_TOKEN = extern struct {
Type: i32,
pncc: ?*anyopaque,
pszwManufacturer: ?*anyopaque,
pszwProduct: ?*anyopaque,
pszwDisplayName: ?*anyopaque,
fRegistered: i32,
};type
OBO_TOKEN {.bycopy.} = object
Type: int32
pncc: pointer
pszwManufacturer: pointer
pszwProduct: pointer
pszwDisplayName: pointer
fRegistered: int32struct OBO_TOKEN
{
int Type;
void* pncc;
void* pszwManufacturer;
void* pszwProduct;
void* pszwDisplayName;
int fRegistered;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; OBO_TOKEN サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Type : OBO_TOKEN_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pncc : INetCfgComponent* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pszwManufacturer : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pszwProduct : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pszwDisplayName : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; fRegistered : BOOL (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OBO_TOKEN サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; Type : OBO_TOKEN_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pncc : INetCfgComponent* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pszwManufacturer : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pszwProduct : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pszwDisplayName : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; fRegistered : BOOL (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global OBO_TOKEN
#field int Type
#field intptr pncc
#field intptr pszwManufacturer
#field intptr pszwProduct
#field intptr pszwDisplayName
#field bool fRegistered
#endstruct
stdim st, OBO_TOKEN ; NSTRUCT 変数を確保
st->Type = 100
mes "Type=" + st->Type