ホーム › System.RemoteDesktop › pluginResource2
pluginResource2
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| resourceV1 | pluginResource | 2096/2076 | +0 | +0 | バージョン1のリソース基本情報。 |
| pceFileAssocListSize | DWORD | 4 | +2096 | +2076 | fileAssocList配列に含まれる要素数。 |
| fileAssocList | pluginResource2FileAssociation* | 8/4 | +2104 | +2080 | ファイル関連付け情報の配列へのポインタ。 |
| securityDescriptor | LPWSTR | 8/4 | +2112 | +2084 | リソースのセキュリティ記述子(SDDL文字列)。 |
| pceFolderListSize | DWORD | 4 | +2120 | +2088 | folderList配列に含まれる要素数。 |
| folderList | WORD** | 8/4 | +2128 | +2092 | フォルダ名文字列の配列へのポインタ。 |
各言語での定義
#include <windows.h>
// pluginResource (x64 2096 / x86 2076 バイト)
typedef struct pluginResource {
WCHAR alias[256];
WCHAR name[256];
LPWSTR resourceFileContents;
WCHAR fileExtension[256];
WCHAR resourcePluginType[256];
BYTE isDiscoverable;
INT resourceType;
DWORD pceIconSize;
BYTE* iconContents;
DWORD pcePluginBlobSize;
BYTE* blobContents;
} pluginResource;
// pluginResource2 (x64 2136 / x86 2096 バイト)
typedef struct pluginResource2 {
pluginResource resourceV1;
DWORD pceFileAssocListSize;
pluginResource2FileAssociation* fileAssocList;
LPWSTR securityDescriptor;
DWORD pceFolderListSize;
WORD** folderList;
} pluginResource2;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct pluginResource
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string alias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string name;
public IntPtr resourceFileContents;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string fileExtension;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string resourcePluginType;
public byte isDiscoverable;
public int resourceType;
public uint pceIconSize;
public IntPtr iconContents;
public uint pcePluginBlobSize;
public IntPtr blobContents;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct pluginResource2
{
public pluginResource resourceV1;
public uint pceFileAssocListSize;
public IntPtr fileAssocList;
public IntPtr securityDescriptor;
public uint pceFolderListSize;
public IntPtr folderList;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure pluginResource
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public alias As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public name As String
Public resourceFileContents As IntPtr
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public fileExtension As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public resourcePluginType As String
Public isDiscoverable As Byte
Public resourceType As Integer
Public pceIconSize As UInteger
Public iconContents As IntPtr
Public pcePluginBlobSize As UInteger
Public blobContents As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure pluginResource2
Public resourceV1 As pluginResource
Public pceFileAssocListSize As UInteger
Public fileAssocList As IntPtr
Public securityDescriptor As IntPtr
Public pceFolderListSize As UInteger
Public folderList As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class pluginResource(ctypes.Structure):
_fields_ = [
("alias", ctypes.c_wchar * 256),
("name", ctypes.c_wchar * 256),
("resourceFileContents", ctypes.c_void_p),
("fileExtension", ctypes.c_wchar * 256),
("resourcePluginType", ctypes.c_wchar * 256),
("isDiscoverable", ctypes.c_ubyte),
("resourceType", ctypes.c_int),
("pceIconSize", wintypes.DWORD),
("iconContents", ctypes.c_void_p),
("pcePluginBlobSize", wintypes.DWORD),
("blobContents", ctypes.c_void_p),
]
class pluginResource2(ctypes.Structure):
_fields_ = [
("resourceV1", pluginResource),
("pceFileAssocListSize", wintypes.DWORD),
("fileAssocList", ctypes.c_void_p),
("securityDescriptor", ctypes.c_void_p),
("pceFolderListSize", wintypes.DWORD),
("folderList", ctypes.c_void_p),
]#[repr(C)]
pub struct pluginResource {
pub alias: [u16; 256],
pub name: [u16; 256],
pub resourceFileContents: *mut core::ffi::c_void,
pub fileExtension: [u16; 256],
pub resourcePluginType: [u16; 256],
pub isDiscoverable: u8,
pub resourceType: i32,
pub pceIconSize: u32,
pub iconContents: *mut core::ffi::c_void,
pub pcePluginBlobSize: u32,
pub blobContents: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct pluginResource2 {
pub resourceV1: pluginResource,
pub pceFileAssocListSize: u32,
pub fileAssocList: *mut core::ffi::c_void,
pub securityDescriptor: *mut core::ffi::c_void,
pub pceFolderListSize: u32,
pub folderList: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type pluginResource struct {
alias [256]uint16
name [256]uint16
resourceFileContents uintptr
fileExtension [256]uint16
resourcePluginType [256]uint16
isDiscoverable byte
resourceType int32
pceIconSize uint32
iconContents uintptr
pcePluginBlobSize uint32
blobContents uintptr
}
type pluginResource2 struct {
resourceV1 pluginResource
pceFileAssocListSize uint32
fileAssocList uintptr
securityDescriptor uintptr
pceFolderListSize uint32
folderList uintptr
}type
pluginResource = record
alias: array[0..255] of WideChar;
name: array[0..255] of WideChar;
resourceFileContents: Pointer;
fileExtension: array[0..255] of WideChar;
resourcePluginType: array[0..255] of WideChar;
isDiscoverable: Byte;
resourceType: Integer;
pceIconSize: DWORD;
iconContents: Pointer;
pcePluginBlobSize: DWORD;
blobContents: Pointer;
end;
pluginResource2 = record
resourceV1: pluginResource;
pceFileAssocListSize: DWORD;
fileAssocList: Pointer;
securityDescriptor: Pointer;
pceFolderListSize: DWORD;
folderList: Pointer;
end;const pluginResource = extern struct {
alias: [256]u16,
name: [256]u16,
resourceFileContents: ?*anyopaque,
fileExtension: [256]u16,
resourcePluginType: [256]u16,
isDiscoverable: u8,
resourceType: i32,
pceIconSize: u32,
iconContents: ?*anyopaque,
pcePluginBlobSize: u32,
blobContents: ?*anyopaque,
};
const pluginResource2 = extern struct {
resourceV1: pluginResource,
pceFileAssocListSize: u32,
fileAssocList: ?*anyopaque,
securityDescriptor: ?*anyopaque,
pceFolderListSize: u32,
folderList: ?*anyopaque,
};type
pluginResource {.bycopy.} = object
alias: array[256, uint16]
name: array[256, uint16]
resourceFileContents: pointer
fileExtension: array[256, uint16]
resourcePluginType: array[256, uint16]
isDiscoverable: uint8
resourceType: int32
pceIconSize: uint32
iconContents: pointer
pcePluginBlobSize: uint32
blobContents: pointer
pluginResource2 {.bycopy.} = object
resourceV1: pluginResource
pceFileAssocListSize: uint32
fileAssocList: pointer
securityDescriptor: pointer
pceFolderListSize: uint32
folderList: pointerstruct pluginResource
{
wchar[256] alias;
wchar[256] name;
void* resourceFileContents;
wchar[256] fileExtension;
wchar[256] resourcePluginType;
ubyte isDiscoverable;
int resourceType;
uint pceIconSize;
void* iconContents;
uint pcePluginBlobSize;
void* blobContents;
}
struct pluginResource2
{
pluginResource resourceV1;
uint pceFileAssocListSize;
void* fileAssocList;
void* securityDescriptor;
uint pceFolderListSize;
void* folderList;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; pluginResource2 サイズ: 2096 バイト(x86)
dim st, 524 ; 4byte整数×524(構造体サイズ 2096 / 4 切り上げ)
; resourceV1 : pluginResource (+0, 2076byte) varptr(st)+0 を基点に操作(2076byte:入れ子/配列)
; pceFileAssocListSize : DWORD (+2076, 4byte) st.519 = 値 / 値 = st.519 (lpoke/lpeek も可)
; fileAssocList : pluginResource2FileAssociation* (+2080, 4byte) varptr(st)+2080 を基点に操作(4byte:入れ子/配列)
; securityDescriptor : LPWSTR (+2084, 4byte) st.521 = 値 / 値 = st.521 (lpoke/lpeek も可)
; pceFolderListSize : DWORD (+2088, 4byte) st.522 = 値 / 値 = st.522 (lpoke/lpeek も可)
; folderList : WORD** (+2092, 4byte) st.523 = 値 / 値 = st.523 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; pluginResource2 サイズ: 2136 バイト(x64)
dim st, 534 ; 4byte整数×534(構造体サイズ 2136 / 4 切り上げ)
; resourceV1 : pluginResource (+0, 2096byte) varptr(st)+0 を基点に操作(2096byte:入れ子/配列)
; pceFileAssocListSize : DWORD (+2096, 4byte) st.524 = 値 / 値 = st.524 (lpoke/lpeek も可)
; fileAssocList : pluginResource2FileAssociation* (+2104, 8byte) varptr(st)+2104 を基点に操作(8byte:入れ子/配列)
; securityDescriptor : LPWSTR (+2112, 8byte) qpoke st,2112,値 / qpeek(st,2112) ※IronHSPのみ。3.7/3.8は lpoke st,2112,下位 : lpoke st,2116,上位
; pceFolderListSize : DWORD (+2120, 4byte) st.530 = 値 / 値 = st.530 (lpoke/lpeek も可)
; folderList : WORD** (+2128, 8byte) qpoke st,2128,値 / qpeek(st,2128) ※IronHSPのみ。3.7/3.8は lpoke st,2128,下位 : lpoke st,2132,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global pluginResource
#field wchar alias 256
#field wchar name 256
#field intptr resourceFileContents
#field wchar fileExtension 256
#field wchar resourcePluginType 256
#field byte isDiscoverable
#field int resourceType
#field int pceIconSize
#field intptr iconContents
#field int pcePluginBlobSize
#field intptr blobContents
#endstruct
#defstruct global pluginResource2
#field pluginResource resourceV1
#field int pceFileAssocListSize
#field intptr fileAssocList
#field intptr securityDescriptor
#field int pceFolderListSize
#field intptr folderList
#endstruct
stdim st, pluginResource2 ; NSTRUCT 変数を確保
st->pceFileAssocListSize = 100
mes "pceFileAssocListSize=" + st->pceFileAssocListSize