ホーム › Security.Authentication.Identity › SL_AD_ACTIVATION_INFO
SL_AD_ACTIVATION_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| header | SL_ACTIVATION_INFO_HEADER | 8 | +0 | +0 | アクティベーション情報の共通ヘッダ(SL_ACTIVATION_INFO_HEADER)。 |
| pwszProductKey | LPWSTR | 8/4 | +8 | +8 | アクティベーションに使用するプロダクトキー文字列へのポインタ。 |
| pwszActivationObjectName | LPWSTR | 8/4 | +16 | +12 | Active Directory上のアクティベーションオブジェクト名へのポインタ。 |
各言語での定義
#include <windows.h>
// SL_ACTIVATION_INFO_HEADER (x64 8 / x86 8 バイト)
typedef struct SL_ACTIVATION_INFO_HEADER {
DWORD cbSize;
SL_ACTIVATION_TYPE type;
} SL_ACTIVATION_INFO_HEADER;
// SL_AD_ACTIVATION_INFO (x64 24 / x86 16 バイト)
typedef struct SL_AD_ACTIVATION_INFO {
SL_ACTIVATION_INFO_HEADER header;
LPWSTR pwszProductKey;
LPWSTR pwszActivationObjectName;
} SL_AD_ACTIVATION_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SL_ACTIVATION_INFO_HEADER
{
public uint cbSize;
public int type;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SL_AD_ACTIVATION_INFO
{
public SL_ACTIVATION_INFO_HEADER header;
public IntPtr pwszProductKey;
public IntPtr pwszActivationObjectName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SL_ACTIVATION_INFO_HEADER
Public cbSize As UInteger
Public type As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SL_AD_ACTIVATION_INFO
Public header As SL_ACTIVATION_INFO_HEADER
Public pwszProductKey As IntPtr
Public pwszActivationObjectName As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class SL_ACTIVATION_INFO_HEADER(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("type", ctypes.c_int),
]
class SL_AD_ACTIVATION_INFO(ctypes.Structure):
_fields_ = [
("header", SL_ACTIVATION_INFO_HEADER),
("pwszProductKey", ctypes.c_void_p),
("pwszActivationObjectName", ctypes.c_void_p),
]#[repr(C)]
pub struct SL_ACTIVATION_INFO_HEADER {
pub cbSize: u32,
pub type: i32,
}
#[repr(C)]
pub struct SL_AD_ACTIVATION_INFO {
pub header: SL_ACTIVATION_INFO_HEADER,
pub pwszProductKey: *mut core::ffi::c_void,
pub pwszActivationObjectName: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type SL_ACTIVATION_INFO_HEADER struct {
cbSize uint32
type int32
}
type SL_AD_ACTIVATION_INFO struct {
header SL_ACTIVATION_INFO_HEADER
pwszProductKey uintptr
pwszActivationObjectName uintptr
}type
SL_ACTIVATION_INFO_HEADER = record
cbSize: DWORD;
type: Integer;
end;
SL_AD_ACTIVATION_INFO = record
header: SL_ACTIVATION_INFO_HEADER;
pwszProductKey: Pointer;
pwszActivationObjectName: Pointer;
end;const SL_ACTIVATION_INFO_HEADER = extern struct {
cbSize: u32,
type: i32,
};
const SL_AD_ACTIVATION_INFO = extern struct {
header: SL_ACTIVATION_INFO_HEADER,
pwszProductKey: ?*anyopaque,
pwszActivationObjectName: ?*anyopaque,
};type
SL_ACTIVATION_INFO_HEADER {.bycopy.} = object
cbSize: uint32
type: int32
SL_AD_ACTIVATION_INFO {.bycopy.} = object
header: SL_ACTIVATION_INFO_HEADER
pwszProductKey: pointer
pwszActivationObjectName: pointerstruct SL_ACTIVATION_INFO_HEADER
{
uint cbSize;
int type;
}
struct SL_AD_ACTIVATION_INFO
{
SL_ACTIVATION_INFO_HEADER header;
void* pwszProductKey;
void* pwszActivationObjectName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SL_AD_ACTIVATION_INFO サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; header : SL_ACTIVATION_INFO_HEADER (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; pwszProductKey : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pwszActivationObjectName : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SL_AD_ACTIVATION_INFO サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; header : SL_ACTIVATION_INFO_HEADER (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; pwszProductKey : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pwszActivationObjectName : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SL_ACTIVATION_INFO_HEADER
#field int cbSize
#field int type
#endstruct
#defstruct global SL_AD_ACTIVATION_INFO
#field SL_ACTIVATION_INFO_HEADER header
#field intptr pwszProductKey
#field intptr pwszActivationObjectName
#endstruct
stdim st, SL_AD_ACTIVATION_INFO ; NSTRUCT 変数を確保