ホーム › Networking.ActiveDirectory › DSCOLUMN
DSCOLUMN
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwFlags | DWORD | 4 | +0 | +0 | 列の表示・動作を制御するフラグ。 |
| fmt | INT | 4 | +4 | +4 | 列ヘッダの配置(左右中央)を示す書式値。 |
| cx | INT | 4 | +8 | +8 | 列の幅をピクセル単位で示す。 |
| idsName | INT | 4 | +12 | +12 | 列見出しの文字列リソースID。 |
| offsetProperty | INT | 4 | +16 | +16 | DSQUERYPARAMS先頭からこの列が表示するプロパティ名までのバイトオフセット。 |
| dwReserved | DWORD | 4 | +20 | +20 | 予約フィールド。0を設定する。 |
各言語での定義
#include <windows.h>
// DSCOLUMN (x64 24 / x86 24 バイト)
typedef struct DSCOLUMN {
DWORD dwFlags;
INT fmt;
INT cx;
INT idsName;
INT offsetProperty;
DWORD dwReserved;
} DSCOLUMN;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DSCOLUMN
{
public uint dwFlags;
public int fmt;
public int cx;
public int idsName;
public int offsetProperty;
public uint dwReserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DSCOLUMN
Public dwFlags As UInteger
Public fmt As Integer
Public cx As Integer
Public idsName As Integer
Public offsetProperty As Integer
Public dwReserved As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DSCOLUMN(ctypes.Structure):
_fields_ = [
("dwFlags", wintypes.DWORD),
("fmt", ctypes.c_int),
("cx", ctypes.c_int),
("idsName", ctypes.c_int),
("offsetProperty", ctypes.c_int),
("dwReserved", wintypes.DWORD),
]#[repr(C)]
pub struct DSCOLUMN {
pub dwFlags: u32,
pub fmt: i32,
pub cx: i32,
pub idsName: i32,
pub offsetProperty: i32,
pub dwReserved: u32,
}import "golang.org/x/sys/windows"
type DSCOLUMN struct {
dwFlags uint32
fmt int32
cx int32
idsName int32
offsetProperty int32
dwReserved uint32
}type
DSCOLUMN = record
dwFlags: DWORD;
fmt: Integer;
cx: Integer;
idsName: Integer;
offsetProperty: Integer;
dwReserved: DWORD;
end;const DSCOLUMN = extern struct {
dwFlags: u32,
fmt: i32,
cx: i32,
idsName: i32,
offsetProperty: i32,
dwReserved: u32,
};type
DSCOLUMN {.bycopy.} = object
dwFlags: uint32
fmt: int32
cx: int32
idsName: int32
offsetProperty: int32
dwReserved: uint32struct DSCOLUMN
{
uint dwFlags;
int fmt;
int cx;
int idsName;
int offsetProperty;
uint dwReserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DSCOLUMN サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fmt : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cx : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; idsName : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; offsetProperty : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwReserved : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DSCOLUMN
#field int dwFlags
#field int fmt
#field int cx
#field int idsName
#field int offsetProperty
#field int dwReserved
#endstruct
stdim st, DSCOLUMN ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags