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

MapiRecipDescW

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

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

フィールド

フィールドサイズx64x86説明
ulReservedDWORD4+0+0予約フィールド。0を設定する。
ulRecipClassDWORD4+4+4受信者の種別(MAPI_TO/CC/BCC/ORIG)。
lpszNameLPWSTR8/4+8+8受信者の表示名(Unicode)。
lpszAddressLPWSTR8/4+16+12受信者のアドレス(プロバイダー:アドレス形式、Unicode)。NULL可。
ulEIDSizeDWORD4+24+16lpEntryIDが指すエントリ識別子のバイト数。
lpEntryIDvoid*8/4+32+20アドレス帳エントリ識別子へのポインター。NULL可。

各言語での定義

#include <windows.h>

// MapiRecipDescW  (x64 40 / x86 24 バイト)
typedef struct MapiRecipDescW {
    DWORD ulReserved;
    DWORD ulRecipClass;
    LPWSTR lpszName;
    LPWSTR lpszAddress;
    DWORD ulEIDSize;
    void* lpEntryID;
} MapiRecipDescW;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MapiRecipDescW
{
    public uint ulReserved;
    public uint ulRecipClass;
    public IntPtr lpszName;
    public IntPtr lpszAddress;
    public uint ulEIDSize;
    public IntPtr lpEntryID;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MapiRecipDescW
    Public ulReserved As UInteger
    Public ulRecipClass As UInteger
    Public lpszName As IntPtr
    Public lpszAddress As IntPtr
    Public ulEIDSize As UInteger
    Public lpEntryID As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class MapiRecipDescW(ctypes.Structure):
    _fields_ = [
        ("ulReserved", wintypes.DWORD),
        ("ulRecipClass", wintypes.DWORD),
        ("lpszName", ctypes.c_void_p),
        ("lpszAddress", ctypes.c_void_p),
        ("ulEIDSize", wintypes.DWORD),
        ("lpEntryID", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct MapiRecipDescW {
    pub ulReserved: u32,
    pub ulRecipClass: u32,
    pub lpszName: *mut core::ffi::c_void,
    pub lpszAddress: *mut core::ffi::c_void,
    pub ulEIDSize: u32,
    pub lpEntryID: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type MapiRecipDescW struct {
	ulReserved uint32
	ulRecipClass uint32
	lpszName uintptr
	lpszAddress uintptr
	ulEIDSize uint32
	lpEntryID uintptr
}
type
  MapiRecipDescW = record
    ulReserved: DWORD;
    ulRecipClass: DWORD;
    lpszName: Pointer;
    lpszAddress: Pointer;
    ulEIDSize: DWORD;
    lpEntryID: Pointer;
  end;
const MapiRecipDescW = extern struct {
    ulReserved: u32,
    ulRecipClass: u32,
    lpszName: ?*anyopaque,
    lpszAddress: ?*anyopaque,
    ulEIDSize: u32,
    lpEntryID: ?*anyopaque,
};
type
  MapiRecipDescW {.bycopy.} = object
    ulReserved: uint32
    ulRecipClass: uint32
    lpszName: pointer
    lpszAddress: pointer
    ulEIDSize: uint32
    lpEntryID: pointer
struct MapiRecipDescW
{
    uint ulReserved;
    uint ulRecipClass;
    void* lpszName;
    void* lpszAddress;
    uint ulEIDSize;
    void* lpEntryID;
}

HSP用 定義

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

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

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