Win32 API 日本語リファレンス
ホームNetworkManagement.NetManagement › OBO_TOKEN

OBO_TOKEN

構造体
サイズx64: 48 バイト / x86: 24 バイト

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

フィールド

フィールドサイズx64x86説明
TypeOBO_TOKEN_TYPE4+0+0代理(on-behalf-of)トークンの発行元種別を示す列挙値。
pnccINetCfgComponent*8/4+8+4関連するネットワーク構成コンポーネントのINetCfgComponentへのポインタ。
pszwManufacturerLPWSTR8/4+16+8コンポーネント製造元名を表す文字列へのポインタ。
pszwProductLPWSTR8/4+24+12コンポーネント製品名を表す文字列へのポインタ。
pszwDisplayNameLPWSTR8/4+32+16コンポーネントの表示名を表す文字列へのポインタ。
fRegisteredBOOL4+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 Structure
import 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: int32
struct 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