Win32 API 日本語リファレンス
ホームMedia.Audio.DirectMusic › DMUS_COPYRIGHT

DMUS_COPYRIGHT

構造体
サイズx64: 8 バイト / x86: 8 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この著作権情報構造体全体のバイトサイズ。
byCopyrightBYTE4+4+4著作権文字列データの先頭バイト。可変長のテキストデータの開始位置。

各言語での定義

#include <windows.h>

// DMUS_COPYRIGHT  (x64 8 / x86 8 バイト)
typedef struct DMUS_COPYRIGHT {
    DWORD cbSize;
    BYTE byCopyright[4];
} DMUS_COPYRIGHT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DMUS_COPYRIGHT
{
    public uint cbSize;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[] byCopyright;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DMUS_COPYRIGHT
    Public cbSize As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public byCopyright() As Byte
End Structure
import ctypes
from ctypes import wintypes

class DMUS_COPYRIGHT(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("byCopyright", ctypes.c_ubyte * 4),
    ]
#[repr(C)]
pub struct DMUS_COPYRIGHT {
    pub cbSize: u32,
    pub byCopyright: [u8; 4],
}
import "golang.org/x/sys/windows"

type DMUS_COPYRIGHT struct {
	cbSize uint32
	byCopyright [4]byte
}
type
  DMUS_COPYRIGHT = record
    cbSize: DWORD;
    byCopyright: array[0..3] of Byte;
  end;
const DMUS_COPYRIGHT = extern struct {
    cbSize: u32,
    byCopyright: [4]u8,
};
type
  DMUS_COPYRIGHT {.bycopy.} = object
    cbSize: uint32
    byCopyright: array[4, uint8]
struct DMUS_COPYRIGHT
{
    uint cbSize;
    ubyte[4] byCopyright;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DMUS_COPYRIGHT サイズ: 8 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; byCopyright : BYTE (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DMUS_COPYRIGHT
    #field int cbSize
    #field byte byCopyright 4
#endstruct

stdim st, DMUS_COPYRIGHT        ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize