ホーム › Networking.ActiveDirectory › DSDISPLAYSPECOPTIONS
DSDISPLAYSPECOPTIONS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | 本構造体のバイトサイズ。バージョン互換性の判定に用いる。 |
| dwFlags | DWORD | 4 | +4 | +4 | 表示指定子の取得オプションを示すフラグ。 |
| offsetAttribPrefix | DWORD | 4 | +8 | +8 | 構造体先頭から属性プレフィックス文字列までのバイトオフセット。 |
| offsetUserName | DWORD | 4 | +12 | +12 | 構造体先頭からユーザ名文字列までのバイトオフセット。 |
| offsetPassword | DWORD | 4 | +16 | +16 | 構造体先頭からパスワード文字列までのバイトオフセット。 |
| offsetServer | DWORD | 4 | +20 | +20 | 構造体先頭からサーバ名文字列までのバイトオフセット。 |
| offsetServerConfigPath | DWORD | 4 | +24 | +24 | 構造体先頭からサーバ構成パス文字列までのバイトオフセット。 |
各言語での定義
#include <windows.h>
// DSDISPLAYSPECOPTIONS (x64 28 / x86 28 バイト)
typedef struct DSDISPLAYSPECOPTIONS {
DWORD dwSize;
DWORD dwFlags;
DWORD offsetAttribPrefix;
DWORD offsetUserName;
DWORD offsetPassword;
DWORD offsetServer;
DWORD offsetServerConfigPath;
} DSDISPLAYSPECOPTIONS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DSDISPLAYSPECOPTIONS
{
public uint dwSize;
public uint dwFlags;
public uint offsetAttribPrefix;
public uint offsetUserName;
public uint offsetPassword;
public uint offsetServer;
public uint offsetServerConfigPath;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DSDISPLAYSPECOPTIONS
Public dwSize As UInteger
Public dwFlags As UInteger
Public offsetAttribPrefix As UInteger
Public offsetUserName As UInteger
Public offsetPassword As UInteger
Public offsetServer As UInteger
Public offsetServerConfigPath As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DSDISPLAYSPECOPTIONS(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("offsetAttribPrefix", wintypes.DWORD),
("offsetUserName", wintypes.DWORD),
("offsetPassword", wintypes.DWORD),
("offsetServer", wintypes.DWORD),
("offsetServerConfigPath", wintypes.DWORD),
]#[repr(C)]
pub struct DSDISPLAYSPECOPTIONS {
pub dwSize: u32,
pub dwFlags: u32,
pub offsetAttribPrefix: u32,
pub offsetUserName: u32,
pub offsetPassword: u32,
pub offsetServer: u32,
pub offsetServerConfigPath: u32,
}import "golang.org/x/sys/windows"
type DSDISPLAYSPECOPTIONS struct {
dwSize uint32
dwFlags uint32
offsetAttribPrefix uint32
offsetUserName uint32
offsetPassword uint32
offsetServer uint32
offsetServerConfigPath uint32
}type
DSDISPLAYSPECOPTIONS = record
dwSize: DWORD;
dwFlags: DWORD;
offsetAttribPrefix: DWORD;
offsetUserName: DWORD;
offsetPassword: DWORD;
offsetServer: DWORD;
offsetServerConfigPath: DWORD;
end;const DSDISPLAYSPECOPTIONS = extern struct {
dwSize: u32,
dwFlags: u32,
offsetAttribPrefix: u32,
offsetUserName: u32,
offsetPassword: u32,
offsetServer: u32,
offsetServerConfigPath: u32,
};type
DSDISPLAYSPECOPTIONS {.bycopy.} = object
dwSize: uint32
dwFlags: uint32
offsetAttribPrefix: uint32
offsetUserName: uint32
offsetPassword: uint32
offsetServer: uint32
offsetServerConfigPath: uint32struct DSDISPLAYSPECOPTIONS
{
uint dwSize;
uint dwFlags;
uint offsetAttribPrefix;
uint offsetUserName;
uint offsetPassword;
uint offsetServer;
uint offsetServerConfigPath;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DSDISPLAYSPECOPTIONS サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; offsetAttribPrefix : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; offsetUserName : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; offsetPassword : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; offsetServer : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; offsetServerConfigPath : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DSDISPLAYSPECOPTIONS
#field int dwSize
#field int dwFlags
#field int offsetAttribPrefix
#field int offsetUserName
#field int offsetPassword
#field int offsetServer
#field int offsetServerConfigPath
#endstruct
stdim st, DSDISPLAYSPECOPTIONS ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize