ホーム › Media.DeviceManager › WMDMRIGHTS
WMDMRIGHTS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で示す。 |
| dwContentType | DWORD | 4 | +4 | +4 | コンテンツの種別を示す。 |
| fuFlags | DWORD | 4 | +8 | +8 | 権利に関するフラグを示す。 |
| fuRights | DWORD | 4 | +12 | +12 | 許可される利用権利のフラグ(再生やコピー等)を示す。 |
| dwAppSec | DWORD | 4 | +16 | +16 | アプリケーションのセキュリティレベルを示す。 |
| dwPlaybackCount | DWORD | 4 | +20 | +20 | 許可される再生回数を示す。 |
| ExpirationDate | WMDMDATETIME | 12 | +24 | +24 | 権利の有効期限を示すWMDMDATETIME構造体。 |
各言語での定義
#include <windows.h>
// WMDMDATETIME (x64 12 / x86 12 バイト)
typedef struct WMDMDATETIME {
WORD wYear;
WORD wMonth;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
} WMDMDATETIME;
// WMDMRIGHTS (x64 36 / x86 36 バイト)
typedef struct WMDMRIGHTS {
DWORD cbSize;
DWORD dwContentType;
DWORD fuFlags;
DWORD fuRights;
DWORD dwAppSec;
DWORD dwPlaybackCount;
WMDMDATETIME ExpirationDate;
} WMDMRIGHTS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WMDMDATETIME
{
public ushort wYear;
public ushort wMonth;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WMDMRIGHTS
{
public uint cbSize;
public uint dwContentType;
public uint fuFlags;
public uint fuRights;
public uint dwAppSec;
public uint dwPlaybackCount;
public WMDMDATETIME ExpirationDate;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WMDMDATETIME
Public wYear As UShort
Public wMonth As UShort
Public wDay As UShort
Public wHour As UShort
Public wMinute As UShort
Public wSecond As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WMDMRIGHTS
Public cbSize As UInteger
Public dwContentType As UInteger
Public fuFlags As UInteger
Public fuRights As UInteger
Public dwAppSec As UInteger
Public dwPlaybackCount As UInteger
Public ExpirationDate As WMDMDATETIME
End Structureimport ctypes
from ctypes import wintypes
class WMDMDATETIME(ctypes.Structure):
_fields_ = [
("wYear", ctypes.c_ushort),
("wMonth", ctypes.c_ushort),
("wDay", ctypes.c_ushort),
("wHour", ctypes.c_ushort),
("wMinute", ctypes.c_ushort),
("wSecond", ctypes.c_ushort),
]
class WMDMRIGHTS(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("dwContentType", wintypes.DWORD),
("fuFlags", wintypes.DWORD),
("fuRights", wintypes.DWORD),
("dwAppSec", wintypes.DWORD),
("dwPlaybackCount", wintypes.DWORD),
("ExpirationDate", WMDMDATETIME),
]#[repr(C)]
pub struct WMDMDATETIME {
pub wYear: u16,
pub wMonth: u16,
pub wDay: u16,
pub wHour: u16,
pub wMinute: u16,
pub wSecond: u16,
}
#[repr(C)]
pub struct WMDMRIGHTS {
pub cbSize: u32,
pub dwContentType: u32,
pub fuFlags: u32,
pub fuRights: u32,
pub dwAppSec: u32,
pub dwPlaybackCount: u32,
pub ExpirationDate: WMDMDATETIME,
}import "golang.org/x/sys/windows"
type WMDMDATETIME struct {
wYear uint16
wMonth uint16
wDay uint16
wHour uint16
wMinute uint16
wSecond uint16
}
type WMDMRIGHTS struct {
cbSize uint32
dwContentType uint32
fuFlags uint32
fuRights uint32
dwAppSec uint32
dwPlaybackCount uint32
ExpirationDate WMDMDATETIME
}type
WMDMDATETIME = record
wYear: Word;
wMonth: Word;
wDay: Word;
wHour: Word;
wMinute: Word;
wSecond: Word;
end;
WMDMRIGHTS = record
cbSize: DWORD;
dwContentType: DWORD;
fuFlags: DWORD;
fuRights: DWORD;
dwAppSec: DWORD;
dwPlaybackCount: DWORD;
ExpirationDate: WMDMDATETIME;
end;const WMDMDATETIME = extern struct {
wYear: u16,
wMonth: u16,
wDay: u16,
wHour: u16,
wMinute: u16,
wSecond: u16,
};
const WMDMRIGHTS = extern struct {
cbSize: u32,
dwContentType: u32,
fuFlags: u32,
fuRights: u32,
dwAppSec: u32,
dwPlaybackCount: u32,
ExpirationDate: WMDMDATETIME,
};type
WMDMDATETIME {.bycopy.} = object
wYear: uint16
wMonth: uint16
wDay: uint16
wHour: uint16
wMinute: uint16
wSecond: uint16
WMDMRIGHTS {.bycopy.} = object
cbSize: uint32
dwContentType: uint32
fuFlags: uint32
fuRights: uint32
dwAppSec: uint32
dwPlaybackCount: uint32
ExpirationDate: WMDMDATETIMEstruct WMDMDATETIME
{
ushort wYear;
ushort wMonth;
ushort wDay;
ushort wHour;
ushort wMinute;
ushort wSecond;
}
struct WMDMRIGHTS
{
uint cbSize;
uint dwContentType;
uint fuFlags;
uint fuRights;
uint dwAppSec;
uint dwPlaybackCount;
WMDMDATETIME ExpirationDate;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WMDMRIGHTS サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwContentType : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fuFlags : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fuRights : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwAppSec : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwPlaybackCount : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ExpirationDate : WMDMDATETIME (+24, 12byte) varptr(st)+24 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WMDMDATETIME
#field short wYear
#field short wMonth
#field short wDay
#field short wHour
#field short wMinute
#field short wSecond
#endstruct
#defstruct global WMDMRIGHTS
#field int cbSize
#field int dwContentType
#field int fuFlags
#field int fuRights
#field int dwAppSec
#field int dwPlaybackCount
#field WMDMDATETIME ExpirationDate
#endstruct
stdim st, WMDMRIGHTS ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize