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