ホーム › NetworkManagement.NetManagement › USE_INFO_3
USE_INFO_3
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ui3_ui2 | USE_INFO_2 | 56/36 | +0 | +0 | ユーザー名・ドメイン名を含むUSE_INFO_2構造体を埋め込む。基本接続情報を保持する。 |
| ui3_flags | DWORD | 4 | +56 | +36 | 接続の動作を制御するフラグ。CONNECT_UPDATE_PROFILE等のビットを組み合わせる。 |
各言語での定義
#include <windows.h>
// USE_INFO_2 (x64 56 / x86 36 バイト)
typedef struct USE_INFO_2 {
LPWSTR ui2_local;
LPWSTR ui2_remote;
LPWSTR ui2_password;
DWORD ui2_status;
USE_INFO_ASG_TYPE ui2_asg_type;
DWORD ui2_refcount;
DWORD ui2_usecount;
LPWSTR ui2_username;
LPWSTR ui2_domainname;
} USE_INFO_2;
// USE_INFO_3 (x64 64 / x86 40 バイト)
typedef struct USE_INFO_3 {
USE_INFO_2 ui3_ui2;
DWORD ui3_flags;
} USE_INFO_3;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct USE_INFO_2
{
public IntPtr ui2_local;
public IntPtr ui2_remote;
public IntPtr ui2_password;
public uint ui2_status;
public uint ui2_asg_type;
public uint ui2_refcount;
public uint ui2_usecount;
public IntPtr ui2_username;
public IntPtr ui2_domainname;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct USE_INFO_3
{
public USE_INFO_2 ui3_ui2;
public uint ui3_flags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure USE_INFO_2
Public ui2_local As IntPtr
Public ui2_remote As IntPtr
Public ui2_password As IntPtr
Public ui2_status As UInteger
Public ui2_asg_type As UInteger
Public ui2_refcount As UInteger
Public ui2_usecount As UInteger
Public ui2_username As IntPtr
Public ui2_domainname As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure USE_INFO_3
Public ui3_ui2 As USE_INFO_2
Public ui3_flags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class USE_INFO_2(ctypes.Structure):
_fields_ = [
("ui2_local", ctypes.c_void_p),
("ui2_remote", ctypes.c_void_p),
("ui2_password", ctypes.c_void_p),
("ui2_status", wintypes.DWORD),
("ui2_asg_type", wintypes.DWORD),
("ui2_refcount", wintypes.DWORD),
("ui2_usecount", wintypes.DWORD),
("ui2_username", ctypes.c_void_p),
("ui2_domainname", ctypes.c_void_p),
]
class USE_INFO_3(ctypes.Structure):
_fields_ = [
("ui3_ui2", USE_INFO_2),
("ui3_flags", wintypes.DWORD),
]#[repr(C)]
pub struct USE_INFO_2 {
pub ui2_local: *mut core::ffi::c_void,
pub ui2_remote: *mut core::ffi::c_void,
pub ui2_password: *mut core::ffi::c_void,
pub ui2_status: u32,
pub ui2_asg_type: u32,
pub ui2_refcount: u32,
pub ui2_usecount: u32,
pub ui2_username: *mut core::ffi::c_void,
pub ui2_domainname: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct USE_INFO_3 {
pub ui3_ui2: USE_INFO_2,
pub ui3_flags: u32,
}import "golang.org/x/sys/windows"
type USE_INFO_2 struct {
ui2_local uintptr
ui2_remote uintptr
ui2_password uintptr
ui2_status uint32
ui2_asg_type uint32
ui2_refcount uint32
ui2_usecount uint32
ui2_username uintptr
ui2_domainname uintptr
}
type USE_INFO_3 struct {
ui3_ui2 USE_INFO_2
ui3_flags uint32
}type
USE_INFO_2 = record
ui2_local: Pointer;
ui2_remote: Pointer;
ui2_password: Pointer;
ui2_status: DWORD;
ui2_asg_type: DWORD;
ui2_refcount: DWORD;
ui2_usecount: DWORD;
ui2_username: Pointer;
ui2_domainname: Pointer;
end;
USE_INFO_3 = record
ui3_ui2: USE_INFO_2;
ui3_flags: DWORD;
end;const USE_INFO_2 = extern struct {
ui2_local: ?*anyopaque,
ui2_remote: ?*anyopaque,
ui2_password: ?*anyopaque,
ui2_status: u32,
ui2_asg_type: u32,
ui2_refcount: u32,
ui2_usecount: u32,
ui2_username: ?*anyopaque,
ui2_domainname: ?*anyopaque,
};
const USE_INFO_3 = extern struct {
ui3_ui2: USE_INFO_2,
ui3_flags: u32,
};type
USE_INFO_2 {.bycopy.} = object
ui2_local: pointer
ui2_remote: pointer
ui2_password: pointer
ui2_status: uint32
ui2_asg_type: uint32
ui2_refcount: uint32
ui2_usecount: uint32
ui2_username: pointer
ui2_domainname: pointer
USE_INFO_3 {.bycopy.} = object
ui3_ui2: USE_INFO_2
ui3_flags: uint32struct USE_INFO_2
{
void* ui2_local;
void* ui2_remote;
void* ui2_password;
uint ui2_status;
uint ui2_asg_type;
uint ui2_refcount;
uint ui2_usecount;
void* ui2_username;
void* ui2_domainname;
}
struct USE_INFO_3
{
USE_INFO_2 ui3_ui2;
uint ui3_flags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; USE_INFO_3 サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; ui3_ui2 : USE_INFO_2 (+0, 36byte) varptr(st)+0 を基点に操作(36byte:入れ子/配列)
; ui3_flags : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; USE_INFO_3 サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; ui3_ui2 : USE_INFO_2 (+0, 56byte) varptr(st)+0 を基点に操作(56byte:入れ子/配列)
; ui3_flags : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global USE_INFO_2
#field intptr ui2_local
#field intptr ui2_remote
#field intptr ui2_password
#field int ui2_status
#field int ui2_asg_type
#field int ui2_refcount
#field int ui2_usecount
#field intptr ui2_username
#field intptr ui2_domainname
#endstruct
#defstruct global USE_INFO_3
#field USE_INFO_2 ui3_ui2
#field int ui3_flags
#endstruct
stdim st, USE_INFO_3 ; NSTRUCT 変数を確保
st->ui3_flags = 100
mes "ui3_flags=" + st->ui3_flags