Win32 API 日本語リファレンス
ホームNetworking.BackgroundIntelligentTransferService › BITS_JOB_PROPERTY_VALUE

BITS_JOB_PROPERTY_VALUE

共用体
サイズx64: 16 バイト / x86: 16 バイト

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

フィールド

フィールドサイズx64x86説明
DwordDWORD4+0+0DWORD型のプロパティ値を格納するメンバ。
ClsIDGUID16+0+0GUID型のプロパティ値を格納するメンバ。
EnableBOOL4+0+0BOOL型の有効・無効を示すプロパティ値メンバ。
Uint64ULONGLONG8+0+064ビット符号なし整数のプロパティ値を格納するメンバ。
TargetBG_AUTH_TARGET4+0+0BG_AUTH_TARGET型のプロパティ値を格納するメンバ。

各言語での定義

#include <windows.h>

// BITS_JOB_PROPERTY_VALUE  (x64 16 / x86 16 バイト)
typedef struct BITS_JOB_PROPERTY_VALUE {
    DWORD Dword;
    GUID ClsID;
    BOOL Enable;
    ULONGLONG Uint64;
    BG_AUTH_TARGET Target;
} BITS_JOB_PROPERTY_VALUE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct BITS_JOB_PROPERTY_VALUE
{
    public uint Dword;
    public Guid ClsID;
    [MarshalAs(UnmanagedType.Bool)] public bool Enable;
    public ulong Uint64;
    public int Target;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure BITS_JOB_PROPERTY_VALUE
    Public Dword As UInteger
    Public ClsID As Guid
    <MarshalAs(UnmanagedType.Bool)> Public Enable As Boolean
    Public Uint64 As ULong
    Public Target As Integer
End Structure
import ctypes
from ctypes import wintypes

class BITS_JOB_PROPERTY_VALUE(ctypes.Structure):
    _fields_ = [
        ("Dword", wintypes.DWORD),
        ("ClsID", GUID),
        ("Enable", wintypes.BOOL),
        ("Uint64", ctypes.c_ulonglong),
        ("Target", ctypes.c_int),
    ]
#[repr(C)]
pub struct BITS_JOB_PROPERTY_VALUE {
    pub Dword: u32,
    pub ClsID: GUID,
    pub Enable: i32,
    pub Uint64: u64,
    pub Target: i32,
}
import "golang.org/x/sys/windows"

type BITS_JOB_PROPERTY_VALUE struct {
	Dword uint32
	ClsID windows.GUID
	Enable int32
	Uint64 uint64
	Target int32
}
type
  BITS_JOB_PROPERTY_VALUE = record
    Dword: DWORD;
    ClsID: TGUID;
    Enable: BOOL;
    Uint64: UInt64;
    Target: Integer;
  end;
const BITS_JOB_PROPERTY_VALUE = extern struct {
    Dword: u32,
    ClsID: GUID,
    Enable: i32,
    Uint64: u64,
    Target: i32,
};
type
  BITS_JOB_PROPERTY_VALUE {.bycopy.} = object
    Dword: uint32
    ClsID: GUID
    Enable: int32
    Uint64: uint64
    Target: int32
struct BITS_JOB_PROPERTY_VALUE
{
    uint Dword;
    GUID ClsID;
    int Enable;
    ulong Uint64;
    int Target;
}

HSP用 定義

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

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

#defstruct global BITS_JOB_PROPERTY_VALUE
    #field int Dword
    #field GUID ClsID
    #field bool Enable
    #field int64 Uint64
    #field int Target
#endstruct

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