Win32 API 日本語リファレンス
ホームGraphics.DirectDraw › PROCESS_LIST

PROCESS_LIST

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

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

フィールド

フィールドサイズx64x86説明
lpLinkPROCESS_LIST*8/4+0+0プロセスリストの次ノードへのポインタを示す。
dwProcessIdDWORD4+8+4プロセスの識別子を示す。
dwRefCntDWORD4+12+8このプロセスによる参照カウントを示す。
dwAlphaDepthDWORD4+16+12アルファバッファのビット深度を示す。
dwZDepthDWORD4+20+16Zバッファのビット深度を示す。

各言語での定義

#include <windows.h>

// PROCESS_LIST  (x64 24 / x86 20 バイト)
typedef struct PROCESS_LIST {
    PROCESS_LIST* lpLink;
    DWORD dwProcessId;
    DWORD dwRefCnt;
    DWORD dwAlphaDepth;
    DWORD dwZDepth;
} PROCESS_LIST;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PROCESS_LIST
{
    public IntPtr lpLink;
    public uint dwProcessId;
    public uint dwRefCnt;
    public uint dwAlphaDepth;
    public uint dwZDepth;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PROCESS_LIST
    Public lpLink As IntPtr
    Public dwProcessId As UInteger
    Public dwRefCnt As UInteger
    Public dwAlphaDepth As UInteger
    Public dwZDepth As UInteger
End Structure
import ctypes
from ctypes import wintypes

class PROCESS_LIST(ctypes.Structure):
    _fields_ = [
        ("lpLink", ctypes.c_void_p),
        ("dwProcessId", wintypes.DWORD),
        ("dwRefCnt", wintypes.DWORD),
        ("dwAlphaDepth", wintypes.DWORD),
        ("dwZDepth", wintypes.DWORD),
    ]
#[repr(C)]
pub struct PROCESS_LIST {
    pub lpLink: *mut core::ffi::c_void,
    pub dwProcessId: u32,
    pub dwRefCnt: u32,
    pub dwAlphaDepth: u32,
    pub dwZDepth: u32,
}
import "golang.org/x/sys/windows"

type PROCESS_LIST struct {
	lpLink uintptr
	dwProcessId uint32
	dwRefCnt uint32
	dwAlphaDepth uint32
	dwZDepth uint32
}
type
  PROCESS_LIST = record
    lpLink: Pointer;
    dwProcessId: DWORD;
    dwRefCnt: DWORD;
    dwAlphaDepth: DWORD;
    dwZDepth: DWORD;
  end;
const PROCESS_LIST = extern struct {
    lpLink: ?*anyopaque,
    dwProcessId: u32,
    dwRefCnt: u32,
    dwAlphaDepth: u32,
    dwZDepth: u32,
};
type
  PROCESS_LIST {.bycopy.} = object
    lpLink: pointer
    dwProcessId: uint32
    dwRefCnt: uint32
    dwAlphaDepth: uint32
    dwZDepth: uint32
struct PROCESS_LIST
{
    void* lpLink;
    uint dwProcessId;
    uint dwRefCnt;
    uint dwAlphaDepth;
    uint dwZDepth;
}

HSP用 定義

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

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

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