EXP_SPECIAL_FOLDER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | EXP_SPECIAL_FOLDER 構造体のサイズです。 |
| dwSignature | DWORD | 4 | +4 | +4 | この構造体のシグネチャです。EXP_SPECIAL_FOLDER_SIG を設定してください。 |
| idSpecialFolder | DWORD | 4 | +8 | +8 | リンクが指す先の特殊フォルダーの ID です。 |
| cbOffset | DWORD | 4 | +12 | +12 | 保存された PIDL 内のオフセットです。 |
公式ドキュメント
IShellLinkDataList が使用する追加データブロックを保持します。特殊フォルダーの情報を保持します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// EXP_SPECIAL_FOLDER (x64 16 / x86 16 バイト)
#pragma pack(push, 1)
typedef struct EXP_SPECIAL_FOLDER {
DWORD cbSize;
DWORD dwSignature;
DWORD idSpecialFolder;
DWORD cbOffset;
} EXP_SPECIAL_FOLDER;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct EXP_SPECIAL_FOLDER
{
public uint cbSize;
public uint dwSignature;
public uint idSpecialFolder;
public uint cbOffset;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure EXP_SPECIAL_FOLDER
Public cbSize As UInteger
Public dwSignature As UInteger
Public idSpecialFolder As UInteger
Public cbOffset As UInteger
End Structureimport ctypes
from ctypes import wintypes
class EXP_SPECIAL_FOLDER(ctypes.Structure):
_pack_ = 1
_fields_ = [
("cbSize", wintypes.DWORD),
("dwSignature", wintypes.DWORD),
("idSpecialFolder", wintypes.DWORD),
("cbOffset", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct EXP_SPECIAL_FOLDER {
pub cbSize: u32,
pub dwSignature: u32,
pub idSpecialFolder: u32,
pub cbOffset: u32,
}import "golang.org/x/sys/windows"
type EXP_SPECIAL_FOLDER struct {
cbSize uint32
dwSignature uint32
idSpecialFolder uint32
cbOffset uint32
}type
EXP_SPECIAL_FOLDER = packed record
cbSize: DWORD;
dwSignature: DWORD;
idSpecialFolder: DWORD;
cbOffset: DWORD;
end;const EXP_SPECIAL_FOLDER = extern struct {
cbSize: u32,
dwSignature: u32,
idSpecialFolder: u32,
cbOffset: u32,
};type
EXP_SPECIAL_FOLDER {.packed.} = object
cbSize: uint32
dwSignature: uint32
idSpecialFolder: uint32
cbOffset: uint32align(1)
struct EXP_SPECIAL_FOLDER
{
uint cbSize;
uint dwSignature;
uint idSpecialFolder;
uint cbOffset;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EXP_SPECIAL_FOLDER サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwSignature : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; idSpecialFolder : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; cbOffset : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EXP_SPECIAL_FOLDER, pack=1
#field int cbSize
#field int dwSignature
#field int idSpecialFolder
#field int cbOffset
#endstruct
stdim st, EXP_SPECIAL_FOLDER ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize