ホーム › Storage.FileSystem › SHARE_INFO_502
SHARE_INFO_502
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| shi502_netname | LPWSTR | 8/4 | +0 | +0 | 共有リソースのネットワーク名(共有名)を指すUnicode文字列。 |
| shi502_type | SHARE_TYPE | 4 | +8 | +4 | 共有の種類を示す。ディスク/プリンタ/デバイス/IPC等のSHARE_TYPE値。 |
| shi502_remark | LPWSTR | 8/4 | +16 | +8 | 共有に付与されたコメント(備考)文字列。NULL可。 |
| shi502_permissions | SHARE_INFO_PERMISSIONS | 4 | +24 | +12 | 共有レベルのアクセス権ビットマスク。共有レベルセキュリティでのみ有効。 |
| shi502_max_uses | DWORD | 4 | +28 | +16 | 同時接続可能なユーザー数の上限。無制限はSHI_USES_UNLIMITED(-1)。 |
| shi502_current_uses | DWORD | 4 | +32 | +20 | 現在この共有に接続しているユーザー数。 |
| shi502_path | LPWSTR | 8/4 | +40 | +24 | 共有されるローカルパス(ディレクトリ等)を指すUnicode文字列。 |
| shi502_passwd | LPWSTR | 8/4 | +48 | +28 | 共有レベルセキュリティ時のパスワード。現行OSでは未使用。 |
| shi502_reserved | DWORD | 4 | +56 | +32 | 予約フィールド。0を設定する。 |
| shi502_security_descriptor | PSECURITY_DESCRIPTOR | 8/4 | +64 | +36 | 共有に適用されるセキュリティ記述子へのポインタ。NULL可。 |
各言語での定義
#include <windows.h>
// SHARE_INFO_502 (x64 72 / x86 40 バイト)
typedef struct SHARE_INFO_502 {
LPWSTR shi502_netname;
SHARE_TYPE shi502_type;
LPWSTR shi502_remark;
SHARE_INFO_PERMISSIONS shi502_permissions;
DWORD shi502_max_uses;
DWORD shi502_current_uses;
LPWSTR shi502_path;
LPWSTR shi502_passwd;
DWORD shi502_reserved;
PSECURITY_DESCRIPTOR shi502_security_descriptor;
} SHARE_INFO_502;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SHARE_INFO_502
{
public IntPtr shi502_netname;
public uint shi502_type;
public IntPtr shi502_remark;
public uint shi502_permissions;
public uint shi502_max_uses;
public uint shi502_current_uses;
public IntPtr shi502_path;
public IntPtr shi502_passwd;
public uint shi502_reserved;
public IntPtr shi502_security_descriptor;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SHARE_INFO_502
Public shi502_netname As IntPtr
Public shi502_type As UInteger
Public shi502_remark As IntPtr
Public shi502_permissions As UInteger
Public shi502_max_uses As UInteger
Public shi502_current_uses As UInteger
Public shi502_path As IntPtr
Public shi502_passwd As IntPtr
Public shi502_reserved As UInteger
Public shi502_security_descriptor As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class SHARE_INFO_502(ctypes.Structure):
_fields_ = [
("shi502_netname", ctypes.c_void_p),
("shi502_type", wintypes.DWORD),
("shi502_remark", ctypes.c_void_p),
("shi502_permissions", wintypes.DWORD),
("shi502_max_uses", wintypes.DWORD),
("shi502_current_uses", wintypes.DWORD),
("shi502_path", ctypes.c_void_p),
("shi502_passwd", ctypes.c_void_p),
("shi502_reserved", wintypes.DWORD),
("shi502_security_descriptor", ctypes.c_void_p),
]#[repr(C)]
pub struct SHARE_INFO_502 {
pub shi502_netname: *mut core::ffi::c_void,
pub shi502_type: u32,
pub shi502_remark: *mut core::ffi::c_void,
pub shi502_permissions: u32,
pub shi502_max_uses: u32,
pub shi502_current_uses: u32,
pub shi502_path: *mut core::ffi::c_void,
pub shi502_passwd: *mut core::ffi::c_void,
pub shi502_reserved: u32,
pub shi502_security_descriptor: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type SHARE_INFO_502 struct {
shi502_netname uintptr
shi502_type uint32
shi502_remark uintptr
shi502_permissions uint32
shi502_max_uses uint32
shi502_current_uses uint32
shi502_path uintptr
shi502_passwd uintptr
shi502_reserved uint32
shi502_security_descriptor uintptr
}type
SHARE_INFO_502 = record
shi502_netname: Pointer;
shi502_type: DWORD;
shi502_remark: Pointer;
shi502_permissions: DWORD;
shi502_max_uses: DWORD;
shi502_current_uses: DWORD;
shi502_path: Pointer;
shi502_passwd: Pointer;
shi502_reserved: DWORD;
shi502_security_descriptor: Pointer;
end;const SHARE_INFO_502 = extern struct {
shi502_netname: ?*anyopaque,
shi502_type: u32,
shi502_remark: ?*anyopaque,
shi502_permissions: u32,
shi502_max_uses: u32,
shi502_current_uses: u32,
shi502_path: ?*anyopaque,
shi502_passwd: ?*anyopaque,
shi502_reserved: u32,
shi502_security_descriptor: ?*anyopaque,
};type
SHARE_INFO_502 {.bycopy.} = object
shi502_netname: pointer
shi502_type: uint32
shi502_remark: pointer
shi502_permissions: uint32
shi502_max_uses: uint32
shi502_current_uses: uint32
shi502_path: pointer
shi502_passwd: pointer
shi502_reserved: uint32
shi502_security_descriptor: pointerstruct SHARE_INFO_502
{
void* shi502_netname;
uint shi502_type;
void* shi502_remark;
uint shi502_permissions;
uint shi502_max_uses;
uint shi502_current_uses;
void* shi502_path;
void* shi502_passwd;
uint shi502_reserved;
void* shi502_security_descriptor;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SHARE_INFO_502 サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; shi502_netname : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; shi502_type : SHARE_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; shi502_remark : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; shi502_permissions : SHARE_INFO_PERMISSIONS (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; shi502_max_uses : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; shi502_current_uses : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; shi502_path : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; shi502_passwd : LPWSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; shi502_reserved : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; shi502_security_descriptor : PSECURITY_DESCRIPTOR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SHARE_INFO_502 サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; shi502_netname : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; shi502_type : SHARE_TYPE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; shi502_remark : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; shi502_permissions : SHARE_INFO_PERMISSIONS (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; shi502_max_uses : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; shi502_current_uses : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; shi502_path : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; shi502_passwd : LPWSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; shi502_reserved : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; shi502_security_descriptor : PSECURITY_DESCRIPTOR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SHARE_INFO_502
#field intptr shi502_netname
#field int shi502_type
#field intptr shi502_remark
#field int shi502_permissions
#field int shi502_max_uses
#field int shi502_current_uses
#field intptr shi502_path
#field intptr shi502_passwd
#field int shi502_reserved
#field intptr shi502_security_descriptor
#endstruct
stdim st, SHARE_INFO_502 ; NSTRUCT 変数を確保
st->shi502_type = 100
mes "shi502_type=" + st->shi502_type