ホーム › Media.KernelStreaming › KSRTAUDIO_HWREGISTER
KSRTAUDIO_HWREGISTER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Register | void* | 8/4 | +0 | +0 | ハードウェア位置レジスタへのポインタである。 |
| Width | DWORD | 4 | +8 | +4 | レジスタの幅(8/16/32ビット)を示す。 |
| Numerator | ULONGLONG | 8 | +16 | +8 | レジスタ値をバイト数へ換算する分子である。 |
| Denominator | ULONGLONG | 8 | +24 | +16 | レジスタ値をバイト数へ換算する分母である。 |
| Accuracy | DWORD | 4 | +32 | +24 | レジスタ位置の精度をバイト単位で示す。 |
各言語での定義
#include <windows.h>
// KSRTAUDIO_HWREGISTER (x64 40 / x86 32 バイト)
typedef struct KSRTAUDIO_HWREGISTER {
void* Register;
DWORD Width;
ULONGLONG Numerator;
ULONGLONG Denominator;
DWORD Accuracy;
} KSRTAUDIO_HWREGISTER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSRTAUDIO_HWREGISTER
{
public IntPtr Register;
public uint Width;
public ulong Numerator;
public ulong Denominator;
public uint Accuracy;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSRTAUDIO_HWREGISTER
Public Register As IntPtr
Public Width As UInteger
Public Numerator As ULong
Public Denominator As ULong
Public Accuracy As UInteger
End Structureimport ctypes
from ctypes import wintypes
class KSRTAUDIO_HWREGISTER(ctypes.Structure):
_fields_ = [
("Register", ctypes.c_void_p),
("Width", wintypes.DWORD),
("Numerator", ctypes.c_ulonglong),
("Denominator", ctypes.c_ulonglong),
("Accuracy", wintypes.DWORD),
]#[repr(C)]
pub struct KSRTAUDIO_HWREGISTER {
pub Register: *mut core::ffi::c_void,
pub Width: u32,
pub Numerator: u64,
pub Denominator: u64,
pub Accuracy: u32,
}import "golang.org/x/sys/windows"
type KSRTAUDIO_HWREGISTER struct {
Register uintptr
Width uint32
Numerator uint64
Denominator uint64
Accuracy uint32
}type
KSRTAUDIO_HWREGISTER = record
Register: Pointer;
Width: DWORD;
Numerator: UInt64;
Denominator: UInt64;
Accuracy: DWORD;
end;const KSRTAUDIO_HWREGISTER = extern struct {
Register: ?*anyopaque,
Width: u32,
Numerator: u64,
Denominator: u64,
Accuracy: u32,
};type
KSRTAUDIO_HWREGISTER {.bycopy.} = object
Register: pointer
Width: uint32
Numerator: uint64
Denominator: uint64
Accuracy: uint32struct KSRTAUDIO_HWREGISTER
{
void* Register;
uint Width;
ulong Numerator;
ulong Denominator;
uint Accuracy;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; KSRTAUDIO_HWREGISTER サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Register : void* (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Width : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Numerator : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Denominator : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Accuracy : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSRTAUDIO_HWREGISTER サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Register : void* (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Width : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Numerator : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Denominator : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Accuracy : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KSRTAUDIO_HWREGISTER
#field intptr Register
#field int Width
#field int64 Numerator
#field int64 Denominator
#field int Accuracy
#endstruct
stdim st, KSRTAUDIO_HWREGISTER ; NSTRUCT 変数を確保
st->Width = 100
mes "Width=" + st->Width