ホーム › Devices.DeviceAndDriverInstallation › SOURCE_MEDIA_A
SOURCE_MEDIA_A
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Reserved | LPSTR | 8/4 | +0 | +0 | 予約フィールド(ANSI)。通常はNULL。 |
| Tagfile | LPSTR | 8/4 | +8 | +4 | メディアを識別するタグファイル名(ANSI)。NULL可。 |
| Description | LPSTR | 8/4 | +16 | +8 | メディアの説明文字列(ANSI)。プロンプト表示等に用いる。 |
| SourcePath | LPSTR | 8/4 | +24 | +12 | コピー元メディアのパス(ANSI)。 |
| SourceFile | LPSTR | 8/4 | +32 | +16 | コピー元ファイル名(ANSI)。 |
| Flags | DWORD | 4 | +40 | +20 | メディア処理動作を制御するフラグ群(SP_COPY_*)。 |
各言語での定義
#include <windows.h>
// SOURCE_MEDIA_A (x64 44 / x86 24 バイト)
#pragma pack(push, 1)
typedef struct SOURCE_MEDIA_A {
LPSTR Reserved;
LPSTR Tagfile;
LPSTR Description;
LPSTR SourcePath;
LPSTR SourceFile;
DWORD Flags;
} SOURCE_MEDIA_A;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct SOURCE_MEDIA_A
{
public IntPtr Reserved;
public IntPtr Tagfile;
public IntPtr Description;
public IntPtr SourcePath;
public IntPtr SourceFile;
public uint Flags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure SOURCE_MEDIA_A
Public Reserved As IntPtr
Public Tagfile As IntPtr
Public Description As IntPtr
Public SourcePath As IntPtr
Public SourceFile As IntPtr
Public Flags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class SOURCE_MEDIA_A(ctypes.Structure):
_pack_ = 1
_fields_ = [
("Reserved", ctypes.c_void_p),
("Tagfile", ctypes.c_void_p),
("Description", ctypes.c_void_p),
("SourcePath", ctypes.c_void_p),
("SourceFile", ctypes.c_void_p),
("Flags", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct SOURCE_MEDIA_A {
pub Reserved: *mut core::ffi::c_void,
pub Tagfile: *mut core::ffi::c_void,
pub Description: *mut core::ffi::c_void,
pub SourcePath: *mut core::ffi::c_void,
pub SourceFile: *mut core::ffi::c_void,
pub Flags: u32,
}import "golang.org/x/sys/windows"
type SOURCE_MEDIA_A struct {
Reserved uintptr
Tagfile uintptr
Description uintptr
SourcePath uintptr
SourceFile uintptr
Flags uint32
}type
SOURCE_MEDIA_A = packed record
Reserved: Pointer;
Tagfile: Pointer;
Description: Pointer;
SourcePath: Pointer;
SourceFile: Pointer;
Flags: DWORD;
end;const SOURCE_MEDIA_A = extern struct {
Reserved: ?*anyopaque,
Tagfile: ?*anyopaque,
Description: ?*anyopaque,
SourcePath: ?*anyopaque,
SourceFile: ?*anyopaque,
Flags: u32,
};type
SOURCE_MEDIA_A {.packed.} = object
Reserved: pointer
Tagfile: pointer
Description: pointer
SourcePath: pointer
SourceFile: pointer
Flags: uint32align(1)
struct SOURCE_MEDIA_A
{
void* Reserved;
void* Tagfile;
void* Description;
void* SourcePath;
void* SourceFile;
uint Flags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SOURCE_MEDIA_A サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Reserved : LPSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Tagfile : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Description : LPSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; SourcePath : LPSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; SourceFile : LPSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Flags : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SOURCE_MEDIA_A サイズ: 44 バイト(x64)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; Reserved : LPSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Tagfile : LPSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Description : LPSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; SourcePath : LPSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; SourceFile : LPSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; Flags : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SOURCE_MEDIA_A, pack=1
#field intptr Reserved
#field intptr Tagfile
#field intptr Description
#field intptr SourcePath
#field intptr SourceFile
#field int Flags
#endstruct
stdim st, SOURCE_MEDIA_A ; NSTRUCT 変数を確保
st->Flags = 100
mes "Flags=" + st->Flags