Win32 API 日本語リファレンス
ホームNetworkManagement.NetManagement › AE_SERVICESTAT

AE_SERVICESTAT

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

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

フィールド

フィールドサイズx64x86説明
ae_ss_compnameDWORD4+0+0サービス状態変化に関わるコンピューター名へのオフセットを示す。
ae_ss_usernameDWORD4+4+4サービスを操作したユーザー名へのオフセットを示す。
ae_ss_svcnameDWORD4+8+8対象サービス名へのオフセットを示す。
ae_ss_statusDWORD4+12+12サービスの状態を示すコード。
ae_ss_codeDWORD4+16+16サービス操作の進行コードを示す。
ae_ss_textDWORD4+20+20サービス状態に付随するテキストへのオフセットを示す。
ae_ss_returnvalDWORD4+24+24サービス操作のリターン値を保持する。

各言語での定義

#include <windows.h>

// AE_SERVICESTAT  (x64 28 / x86 28 バイト)
typedef struct AE_SERVICESTAT {
    DWORD ae_ss_compname;
    DWORD ae_ss_username;
    DWORD ae_ss_svcname;
    DWORD ae_ss_status;
    DWORD ae_ss_code;
    DWORD ae_ss_text;
    DWORD ae_ss_returnval;
} AE_SERVICESTAT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AE_SERVICESTAT
{
    public uint ae_ss_compname;
    public uint ae_ss_username;
    public uint ae_ss_svcname;
    public uint ae_ss_status;
    public uint ae_ss_code;
    public uint ae_ss_text;
    public uint ae_ss_returnval;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AE_SERVICESTAT
    Public ae_ss_compname As UInteger
    Public ae_ss_username As UInteger
    Public ae_ss_svcname As UInteger
    Public ae_ss_status As UInteger
    Public ae_ss_code As UInteger
    Public ae_ss_text As UInteger
    Public ae_ss_returnval As UInteger
End Structure
import ctypes
from ctypes import wintypes

class AE_SERVICESTAT(ctypes.Structure):
    _fields_ = [
        ("ae_ss_compname", wintypes.DWORD),
        ("ae_ss_username", wintypes.DWORD),
        ("ae_ss_svcname", wintypes.DWORD),
        ("ae_ss_status", wintypes.DWORD),
        ("ae_ss_code", wintypes.DWORD),
        ("ae_ss_text", wintypes.DWORD),
        ("ae_ss_returnval", wintypes.DWORD),
    ]
#[repr(C)]
pub struct AE_SERVICESTAT {
    pub ae_ss_compname: u32,
    pub ae_ss_username: u32,
    pub ae_ss_svcname: u32,
    pub ae_ss_status: u32,
    pub ae_ss_code: u32,
    pub ae_ss_text: u32,
    pub ae_ss_returnval: u32,
}
import "golang.org/x/sys/windows"

type AE_SERVICESTAT struct {
	ae_ss_compname uint32
	ae_ss_username uint32
	ae_ss_svcname uint32
	ae_ss_status uint32
	ae_ss_code uint32
	ae_ss_text uint32
	ae_ss_returnval uint32
}
type
  AE_SERVICESTAT = record
    ae_ss_compname: DWORD;
    ae_ss_username: DWORD;
    ae_ss_svcname: DWORD;
    ae_ss_status: DWORD;
    ae_ss_code: DWORD;
    ae_ss_text: DWORD;
    ae_ss_returnval: DWORD;
  end;
const AE_SERVICESTAT = extern struct {
    ae_ss_compname: u32,
    ae_ss_username: u32,
    ae_ss_svcname: u32,
    ae_ss_status: u32,
    ae_ss_code: u32,
    ae_ss_text: u32,
    ae_ss_returnval: u32,
};
type
  AE_SERVICESTAT {.bycopy.} = object
    ae_ss_compname: uint32
    ae_ss_username: uint32
    ae_ss_svcname: uint32
    ae_ss_status: uint32
    ae_ss_code: uint32
    ae_ss_text: uint32
    ae_ss_returnval: uint32
struct AE_SERVICESTAT
{
    uint ae_ss_compname;
    uint ae_ss_username;
    uint ae_ss_svcname;
    uint ae_ss_status;
    uint ae_ss_code;
    uint ae_ss_text;
    uint ae_ss_returnval;
}

HSP用 定義

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

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

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