Win32 API 日本語リファレンス
ホームSystem.Rpc › NDR64_BIND_AND_NOTIFY_EXTENSION

NDR64_BIND_AND_NOTIFY_EXTENSION

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

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

フィールド

フィールドサイズx64x86説明
BindingNDR64_BIND_CONTEXT6+0+0コンテキストバインド情報(NDR64_BIND_CONTEXT)。
NotifyIndexWORD2+6+6通知ルーチンテーブル内のインデックス(WORD)。[notify]属性に対応。

各言語での定義

#include <windows.h>

// NDR64_BIND_CONTEXT  (x64 6 / x86 6 バイト)
typedef struct NDR64_BIND_CONTEXT {
    BYTE HandleType;
    BYTE Flags;
    WORD StackOffset;
    BYTE RoutineIndex;
    BYTE Ordinal;
} NDR64_BIND_CONTEXT;

// NDR64_BIND_AND_NOTIFY_EXTENSION  (x64 8 / x86 8 バイト)
typedef struct NDR64_BIND_AND_NOTIFY_EXTENSION {
    NDR64_BIND_CONTEXT Binding;
    WORD NotifyIndex;
} NDR64_BIND_AND_NOTIFY_EXTENSION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDR64_BIND_CONTEXT
{
    public byte HandleType;
    public byte Flags;
    public ushort StackOffset;
    public byte RoutineIndex;
    public byte Ordinal;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDR64_BIND_AND_NOTIFY_EXTENSION
{
    public NDR64_BIND_CONTEXT Binding;
    public ushort NotifyIndex;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDR64_BIND_CONTEXT
    Public HandleType As Byte
    Public Flags As Byte
    Public StackOffset As UShort
    Public RoutineIndex As Byte
    Public Ordinal As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDR64_BIND_AND_NOTIFY_EXTENSION
    Public Binding As NDR64_BIND_CONTEXT
    Public NotifyIndex As UShort
End Structure
import ctypes
from ctypes import wintypes

class NDR64_BIND_CONTEXT(ctypes.Structure):
    _fields_ = [
        ("HandleType", ctypes.c_ubyte),
        ("Flags", ctypes.c_ubyte),
        ("StackOffset", ctypes.c_ushort),
        ("RoutineIndex", ctypes.c_ubyte),
        ("Ordinal", ctypes.c_ubyte),
    ]

class NDR64_BIND_AND_NOTIFY_EXTENSION(ctypes.Structure):
    _fields_ = [
        ("Binding", NDR64_BIND_CONTEXT),
        ("NotifyIndex", ctypes.c_ushort),
    ]
#[repr(C)]
pub struct NDR64_BIND_CONTEXT {
    pub HandleType: u8,
    pub Flags: u8,
    pub StackOffset: u16,
    pub RoutineIndex: u8,
    pub Ordinal: u8,
}

#[repr(C)]
pub struct NDR64_BIND_AND_NOTIFY_EXTENSION {
    pub Binding: NDR64_BIND_CONTEXT,
    pub NotifyIndex: u16,
}
import "golang.org/x/sys/windows"

type NDR64_BIND_CONTEXT struct {
	HandleType byte
	Flags byte
	StackOffset uint16
	RoutineIndex byte
	Ordinal byte
}

type NDR64_BIND_AND_NOTIFY_EXTENSION struct {
	Binding NDR64_BIND_CONTEXT
	NotifyIndex uint16
}
type
  NDR64_BIND_CONTEXT = record
    HandleType: Byte;
    Flags: Byte;
    StackOffset: Word;
    RoutineIndex: Byte;
    Ordinal: Byte;
  end;

  NDR64_BIND_AND_NOTIFY_EXTENSION = record
    Binding: NDR64_BIND_CONTEXT;
    NotifyIndex: Word;
  end;
const NDR64_BIND_CONTEXT = extern struct {
    HandleType: u8,
    Flags: u8,
    StackOffset: u16,
    RoutineIndex: u8,
    Ordinal: u8,
};

const NDR64_BIND_AND_NOTIFY_EXTENSION = extern struct {
    Binding: NDR64_BIND_CONTEXT,
    NotifyIndex: u16,
};
type
  NDR64_BIND_CONTEXT {.bycopy.} = object
    HandleType: uint8
    Flags: uint8
    StackOffset: uint16
    RoutineIndex: uint8
    Ordinal: uint8

  NDR64_BIND_AND_NOTIFY_EXTENSION {.bycopy.} = object
    Binding: NDR64_BIND_CONTEXT
    NotifyIndex: uint16
struct NDR64_BIND_CONTEXT
{
    ubyte HandleType;
    ubyte Flags;
    ushort StackOffset;
    ubyte RoutineIndex;
    ubyte Ordinal;
}

struct NDR64_BIND_AND_NOTIFY_EXTENSION
{
    NDR64_BIND_CONTEXT Binding;
    ushort NotifyIndex;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NDR64_BIND_AND_NOTIFY_EXTENSION サイズ: 8 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; Binding : NDR64_BIND_CONTEXT (+0, 6byte)  varptr(st)+0 を基点に操作(6byte:入れ子/配列)
; NotifyIndex : WORD (+6, 2byte)  wpoke st,6,値  /  値 = wpeek(st,6)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global NDR64_BIND_CONTEXT
    #field byte HandleType
    #field byte Flags
    #field short StackOffset
    #field byte RoutineIndex
    #field byte Ordinal
#endstruct

#defstruct global NDR64_BIND_AND_NOTIFY_EXTENSION
    #field NDR64_BIND_CONTEXT Binding
    #field short NotifyIndex
#endstruct

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