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

WSMAN_AUTHZ_QUOTA

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

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

フィールド

フィールドサイズx64x86説明
maxAllowedConcurrentShellsDWORD4+0+0同時に許可する最大シェル数。
maxAllowedConcurrentOperationsDWORD4+4+4同時に許可する最大操作数。
timeslotSizeDWORD4+8+8クォータ計測のタイムスロットサイズをミリ秒単位で表す。
maxAllowedOperationsPerTimeslotDWORD4+12+121タイムスロットあたりに許可する最大操作数。

各言語での定義

#include <windows.h>

// WSMAN_AUTHZ_QUOTA  (x64 16 / x86 16 バイト)
typedef struct WSMAN_AUTHZ_QUOTA {
    DWORD maxAllowedConcurrentShells;
    DWORD maxAllowedConcurrentOperations;
    DWORD timeslotSize;
    DWORD maxAllowedOperationsPerTimeslot;
} WSMAN_AUTHZ_QUOTA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WSMAN_AUTHZ_QUOTA
{
    public uint maxAllowedConcurrentShells;
    public uint maxAllowedConcurrentOperations;
    public uint timeslotSize;
    public uint maxAllowedOperationsPerTimeslot;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WSMAN_AUTHZ_QUOTA
    Public maxAllowedConcurrentShells As UInteger
    Public maxAllowedConcurrentOperations As UInteger
    Public timeslotSize As UInteger
    Public maxAllowedOperationsPerTimeslot As UInteger
End Structure
import ctypes
from ctypes import wintypes

class WSMAN_AUTHZ_QUOTA(ctypes.Structure):
    _fields_ = [
        ("maxAllowedConcurrentShells", wintypes.DWORD),
        ("maxAllowedConcurrentOperations", wintypes.DWORD),
        ("timeslotSize", wintypes.DWORD),
        ("maxAllowedOperationsPerTimeslot", wintypes.DWORD),
    ]
#[repr(C)]
pub struct WSMAN_AUTHZ_QUOTA {
    pub maxAllowedConcurrentShells: u32,
    pub maxAllowedConcurrentOperations: u32,
    pub timeslotSize: u32,
    pub maxAllowedOperationsPerTimeslot: u32,
}
import "golang.org/x/sys/windows"

type WSMAN_AUTHZ_QUOTA struct {
	maxAllowedConcurrentShells uint32
	maxAllowedConcurrentOperations uint32
	timeslotSize uint32
	maxAllowedOperationsPerTimeslot uint32
}
type
  WSMAN_AUTHZ_QUOTA = record
    maxAllowedConcurrentShells: DWORD;
    maxAllowedConcurrentOperations: DWORD;
    timeslotSize: DWORD;
    maxAllowedOperationsPerTimeslot: DWORD;
  end;
const WSMAN_AUTHZ_QUOTA = extern struct {
    maxAllowedConcurrentShells: u32,
    maxAllowedConcurrentOperations: u32,
    timeslotSize: u32,
    maxAllowedOperationsPerTimeslot: u32,
};
type
  WSMAN_AUTHZ_QUOTA {.bycopy.} = object
    maxAllowedConcurrentShells: uint32
    maxAllowedConcurrentOperations: uint32
    timeslotSize: uint32
    maxAllowedOperationsPerTimeslot: uint32
struct WSMAN_AUTHZ_QUOTA
{
    uint maxAllowedConcurrentShells;
    uint maxAllowedConcurrentOperations;
    uint timeslotSize;
    uint maxAllowedOperationsPerTimeslot;
}

HSP用 定義

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

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

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