Win32 API 日本語リファレンス
ホームMedia.Multimedia › MMCKINFO

MMCKINFO

構造体
サイズx64: 20 バイト / x86: 20 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
ckidDWORD4+0+0チャンクID(FOURCC)。RIFFチャンクの種別を示す。
cksizeDWORD4+4+4チャンクのデータサイズ。ヘッダを除くバイト数を示す。
fccTypeDWORD4+8+8RIFF/LISTチャンクのフォームタイプFOURCC。コンテナ種別を示す。
dwDataOffsetDWORD4+12+12チャンクデータ先頭のファイル内オフセット。
dwFlagsDWORD4+16+16チャンクに関するフラグ。MMIO_DIRTY等の状態を示す。

各言語での定義

#include <windows.h>

// MMCKINFO  (x64 20 / x86 20 バイト)
#pragma pack(push, 1)
typedef struct MMCKINFO {
    DWORD ckid;
    DWORD cksize;
    DWORD fccType;
    DWORD dwDataOffset;
    DWORD dwFlags;
} MMCKINFO;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct MMCKINFO
{
    public uint ckid;
    public uint cksize;
    public uint fccType;
    public uint dwDataOffset;
    public uint dwFlags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure MMCKINFO
    Public ckid As UInteger
    Public cksize As UInteger
    Public fccType As UInteger
    Public dwDataOffset As UInteger
    Public dwFlags As UInteger
End Structure
import ctypes
from ctypes import wintypes

class MMCKINFO(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("ckid", wintypes.DWORD),
        ("cksize", wintypes.DWORD),
        ("fccType", wintypes.DWORD),
        ("dwDataOffset", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct MMCKINFO {
    pub ckid: u32,
    pub cksize: u32,
    pub fccType: u32,
    pub dwDataOffset: u32,
    pub dwFlags: u32,
}
import "golang.org/x/sys/windows"

type MMCKINFO struct {
	ckid uint32
	cksize uint32
	fccType uint32
	dwDataOffset uint32
	dwFlags uint32
}
type
  MMCKINFO = packed record
    ckid: DWORD;
    cksize: DWORD;
    fccType: DWORD;
    dwDataOffset: DWORD;
    dwFlags: DWORD;
  end;
const MMCKINFO = extern struct {
    ckid: u32,
    cksize: u32,
    fccType: u32,
    dwDataOffset: u32,
    dwFlags: u32,
};
type
  MMCKINFO {.packed.} = object
    ckid: uint32
    cksize: uint32
    fccType: uint32
    dwDataOffset: uint32
    dwFlags: uint32
align(1)
struct MMCKINFO
{
    uint ckid;
    uint cksize;
    uint fccType;
    uint dwDataOffset;
    uint dwFlags;
}

HSP用 定義

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

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

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