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ユーザーが実行できる同時操作の最大数を指定します。カウントされるのは最上位の操作のみです。get、put、delete などの単純な操作は、それぞれ 1 つの操作としてカウントされます。より複雑な操作も 1 つとしてカウントされます。たとえば、列挙操作と、それに関連する一連の操作は、まとめて 1 つの操作としてカウントされます。
timeslotSizeDWORD4+8+8タイム スロットあたりの最大操作数を判定するためのタイム スロットの長さです。この値は秒単位で指定します。
maxAllowedOperationsPerTimeslotDWORD4+12+121 つのタイム スロットあたりに許可される操作の最大数を指定します。この値は、最上位の操作と後続の操作の両方を調整(スロットル)するために使用されます。

公式ドキュメント

認可プラグインに対して、ユーザー単位のクォータ情報を報告します。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#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