ホーム › System.Mmc › MMC_RESTORE_VIEW
MMC_RESTORE_VIEW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | この構造体のバイト単位サイズ。 |
| cookie | INT_PTR | 8/4 | +8 | +4 | 復元対象ビューを識別するクッキー値。 |
| pViewType | LPWSTR | 8/4 | +16 | +8 | ビューの種類を示す文字列。 |
| lViewOptions | INT | 4 | +24 | +12 | ビューのオプションフラグ。 |
各言語での定義
#include <windows.h>
// MMC_RESTORE_VIEW (x64 32 / x86 16 バイト)
typedef struct MMC_RESTORE_VIEW {
DWORD dwSize;
INT_PTR cookie;
LPWSTR pViewType;
INT lViewOptions;
} MMC_RESTORE_VIEW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MMC_RESTORE_VIEW
{
public uint dwSize;
public IntPtr cookie;
public IntPtr pViewType;
public int lViewOptions;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MMC_RESTORE_VIEW
Public dwSize As UInteger
Public cookie As IntPtr
Public pViewType As IntPtr
Public lViewOptions As Integer
End Structureimport ctypes
from ctypes import wintypes
class MMC_RESTORE_VIEW(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("cookie", ctypes.c_ssize_t),
("pViewType", ctypes.c_void_p),
("lViewOptions", ctypes.c_int),
]#[repr(C)]
pub struct MMC_RESTORE_VIEW {
pub dwSize: u32,
pub cookie: isize,
pub pViewType: *mut core::ffi::c_void,
pub lViewOptions: i32,
}import "golang.org/x/sys/windows"
type MMC_RESTORE_VIEW struct {
dwSize uint32
cookie uintptr
pViewType uintptr
lViewOptions int32
}type
MMC_RESTORE_VIEW = record
dwSize: DWORD;
cookie: NativeInt;
pViewType: Pointer;
lViewOptions: Integer;
end;const MMC_RESTORE_VIEW = extern struct {
dwSize: u32,
cookie: isize,
pViewType: ?*anyopaque,
lViewOptions: i32,
};type
MMC_RESTORE_VIEW {.bycopy.} = object
dwSize: uint32
cookie: int
pViewType: pointer
lViewOptions: int32struct MMC_RESTORE_VIEW
{
uint dwSize;
ptrdiff_t cookie;
void* pViewType;
int lViewOptions;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MMC_RESTORE_VIEW サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cookie : INT_PTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pViewType : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lViewOptions : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MMC_RESTORE_VIEW サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cookie : INT_PTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pViewType : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lViewOptions : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MMC_RESTORE_VIEW
#field int dwSize
#field intptr cookie
#field intptr pViewType
#field int lViewOptions
#endstruct
stdim st, MMC_RESTORE_VIEW ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize