Win32 API 日本語リファレンス
ホームSystem.WindowsSync › SYNC_FILTER_CHANGE

SYNC_FILTER_CHANGE

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

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

フィールド

フィールドサイズx64x86説明
fMoveInBOOL4+0+0アイテムがフィルター内へ移動したか(TRUE)外へ移動したか(FALSE)を示すBOOL値。
moveVersionSYNC_VERSION16+8+8そのフィルター変更が発生したバージョン情報(SYNC_VERSION)。

各言語での定義

#include <windows.h>

// SYNC_VERSION  (x64 16 / x86 16 バイト)
typedef struct SYNC_VERSION {
    DWORD dwLastUpdatingReplicaKey;
    ULONGLONG ullTickCount;
} SYNC_VERSION;

// SYNC_FILTER_CHANGE  (x64 24 / x86 24 バイト)
typedef struct SYNC_FILTER_CHANGE {
    BOOL fMoveIn;
    SYNC_VERSION moveVersion;
} SYNC_FILTER_CHANGE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYNC_VERSION
{
    public uint dwLastUpdatingReplicaKey;
    public ulong ullTickCount;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYNC_FILTER_CHANGE
{
    [MarshalAs(UnmanagedType.Bool)] public bool fMoveIn;
    public SYNC_VERSION moveVersion;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYNC_VERSION
    Public dwLastUpdatingReplicaKey As UInteger
    Public ullTickCount As ULong
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYNC_FILTER_CHANGE
    <MarshalAs(UnmanagedType.Bool)> Public fMoveIn As Boolean
    Public moveVersion As SYNC_VERSION
End Structure
import ctypes
from ctypes import wintypes

class SYNC_VERSION(ctypes.Structure):
    _fields_ = [
        ("dwLastUpdatingReplicaKey", wintypes.DWORD),
        ("ullTickCount", ctypes.c_ulonglong),
    ]

class SYNC_FILTER_CHANGE(ctypes.Structure):
    _fields_ = [
        ("fMoveIn", wintypes.BOOL),
        ("moveVersion", SYNC_VERSION),
    ]
#[repr(C)]
pub struct SYNC_VERSION {
    pub dwLastUpdatingReplicaKey: u32,
    pub ullTickCount: u64,
}

#[repr(C)]
pub struct SYNC_FILTER_CHANGE {
    pub fMoveIn: i32,
    pub moveVersion: SYNC_VERSION,
}
import "golang.org/x/sys/windows"

type SYNC_VERSION struct {
	dwLastUpdatingReplicaKey uint32
	ullTickCount uint64
}

type SYNC_FILTER_CHANGE struct {
	fMoveIn int32
	moveVersion SYNC_VERSION
}
type
  SYNC_VERSION = record
    dwLastUpdatingReplicaKey: DWORD;
    ullTickCount: UInt64;
  end;

  SYNC_FILTER_CHANGE = record
    fMoveIn: BOOL;
    moveVersion: SYNC_VERSION;
  end;
const SYNC_VERSION = extern struct {
    dwLastUpdatingReplicaKey: u32,
    ullTickCount: u64,
};

const SYNC_FILTER_CHANGE = extern struct {
    fMoveIn: i32,
    moveVersion: SYNC_VERSION,
};
type
  SYNC_VERSION {.bycopy.} = object
    dwLastUpdatingReplicaKey: uint32
    ullTickCount: uint64

  SYNC_FILTER_CHANGE {.bycopy.} = object
    fMoveIn: int32
    moveVersion: SYNC_VERSION
struct SYNC_VERSION
{
    uint dwLastUpdatingReplicaKey;
    ulong ullTickCount;
}

struct SYNC_FILTER_CHANGE
{
    int fMoveIn;
    SYNC_VERSION moveVersion;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SYNC_FILTER_CHANGE サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; fMoveIn : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; moveVersion : SYNC_VERSION (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SYNC_VERSION
    #field int dwLastUpdatingReplicaKey
    #field int64 ullTickCount
#endstruct

#defstruct global SYNC_FILTER_CHANGE
    #field bool fMoveIn
    #field SYNC_VERSION moveVersion
#endstruct

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