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

UMS_SCHEDULER_STARTUP_INFO

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

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

フィールド

フィールドサイズx64x86説明
UmsVersionDWORD4+0+0ユーザーモードスケジューリング(UMS)のバージョン。UMS_VERSIONを指定する。
CompletionListvoid*8/4+8+4UMSワーカースレッドの完了リストへのポインタ。
SchedulerProcPRTL_UMS_SCHEDULER_ENTRY_POINT8/4+16+8スケジューライベント発生時に呼ばれるスケジューラエントリポイント関数。
SchedulerParamvoid*8/4+24+12スケジューラ関数に渡される任意のパラメータ。

各言語での定義

#include <windows.h>

// UMS_SCHEDULER_STARTUP_INFO  (x64 32 / x86 16 バイト)
typedef struct UMS_SCHEDULER_STARTUP_INFO {
    DWORD UmsVersion;
    void* CompletionList;
    PRTL_UMS_SCHEDULER_ENTRY_POINT SchedulerProc;
    void* SchedulerParam;
} UMS_SCHEDULER_STARTUP_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct UMS_SCHEDULER_STARTUP_INFO
{
    public uint UmsVersion;
    public IntPtr CompletionList;
    public IntPtr SchedulerProc;
    public IntPtr SchedulerParam;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure UMS_SCHEDULER_STARTUP_INFO
    Public UmsVersion As UInteger
    Public CompletionList As IntPtr
    Public SchedulerProc As IntPtr
    Public SchedulerParam As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class UMS_SCHEDULER_STARTUP_INFO(ctypes.Structure):
    _fields_ = [
        ("UmsVersion", wintypes.DWORD),
        ("CompletionList", ctypes.c_void_p),
        ("SchedulerProc", ctypes.c_void_p),
        ("SchedulerParam", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct UMS_SCHEDULER_STARTUP_INFO {
    pub UmsVersion: u32,
    pub CompletionList: *mut core::ffi::c_void,
    pub SchedulerProc: *mut core::ffi::c_void,
    pub SchedulerParam: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type UMS_SCHEDULER_STARTUP_INFO struct {
	UmsVersion uint32
	CompletionList uintptr
	SchedulerProc uintptr
	SchedulerParam uintptr
}
type
  UMS_SCHEDULER_STARTUP_INFO = record
    UmsVersion: DWORD;
    CompletionList: Pointer;
    SchedulerProc: Pointer;
    SchedulerParam: Pointer;
  end;
const UMS_SCHEDULER_STARTUP_INFO = extern struct {
    UmsVersion: u32,
    CompletionList: ?*anyopaque,
    SchedulerProc: ?*anyopaque,
    SchedulerParam: ?*anyopaque,
};
type
  UMS_SCHEDULER_STARTUP_INFO {.bycopy.} = object
    UmsVersion: uint32
    CompletionList: pointer
    SchedulerProc: pointer
    SchedulerParam: pointer
struct UMS_SCHEDULER_STARTUP_INFO
{
    uint UmsVersion;
    void* CompletionList;
    void* SchedulerProc;
    void* SchedulerParam;
}

HSP用 定義

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

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

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