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

PxeDhcpv6Initialize

関数
受信パケットを基にDHCPv6応答パケットを初期化する。
DLLWDSPXE.dll呼出規約winapi対応OSwindows8.0

シグネチャ

// WDSPXE.dll
#include <windows.h>

DWORD PxeDhcpv6Initialize(
    void* pRequest,
    DWORD cbRequest,
    void* pReply,
    DWORD cbReply,
    DWORD* pcbReplyUsed
);

パラメーター

名前方向
pRequestvoid*in
cbRequestDWORDin
pReplyvoid*out
cbReplyDWORDin
pcbReplyUsedDWORD*out

戻り値の型: DWORD

各言語での呼び出し定義

// WDSPXE.dll
#include <windows.h>

DWORD PxeDhcpv6Initialize(
    void* pRequest,
    DWORD cbRequest,
    void* pReply,
    DWORD cbReply,
    DWORD* pcbReplyUsed
);
[DllImport("WDSPXE.dll", ExactSpelling = true)]
static extern uint PxeDhcpv6Initialize(
    IntPtr pRequest,   // void*
    uint cbRequest,   // DWORD
    IntPtr pReply,   // void* out
    uint cbReply,   // DWORD
    out uint pcbReplyUsed   // DWORD* out
);
<DllImport("WDSPXE.dll", ExactSpelling:=True)>
Public Shared Function PxeDhcpv6Initialize(
    pRequest As IntPtr,   ' void*
    cbRequest As UInteger,   ' DWORD
    pReply As IntPtr,   ' void* out
    cbReply As UInteger,   ' DWORD
    <Out> ByRef pcbReplyUsed As UInteger   ' DWORD* out
) As UInteger
End Function
' pRequest : void*
' cbRequest : DWORD
' pReply : void* out
' cbReply : DWORD
' pcbReplyUsed : DWORD* out
Declare PtrSafe Function PxeDhcpv6Initialize Lib "wdspxe" ( _
    ByVal pRequest As LongPtr, _
    ByVal cbRequest As Long, _
    ByVal pReply As LongPtr, _
    ByVal cbReply As Long, _
    ByRef pcbReplyUsed As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

PxeDhcpv6Initialize = ctypes.windll.wdspxe.PxeDhcpv6Initialize
PxeDhcpv6Initialize.restype = wintypes.DWORD
PxeDhcpv6Initialize.argtypes = [
    ctypes.POINTER(None),  # pRequest : void*
    wintypes.DWORD,  # cbRequest : DWORD
    ctypes.POINTER(None),  # pReply : void* out
    wintypes.DWORD,  # cbReply : DWORD
    ctypes.POINTER(wintypes.DWORD),  # pcbReplyUsed : DWORD* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WDSPXE.dll')
PxeDhcpv6Initialize = Fiddle::Function.new(
  lib['PxeDhcpv6Initialize'],
  [
    Fiddle::TYPE_VOIDP,  # pRequest : void*
    -Fiddle::TYPE_INT,  # cbRequest : DWORD
    Fiddle::TYPE_VOIDP,  # pReply : void* out
    -Fiddle::TYPE_INT,  # cbReply : DWORD
    Fiddle::TYPE_VOIDP,  # pcbReplyUsed : DWORD* out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "wdspxe")]
extern "system" {
    fn PxeDhcpv6Initialize(
        pRequest: *mut (),  // void*
        cbRequest: u32,  // DWORD
        pReply: *mut (),  // void* out
        cbReply: u32,  // DWORD
        pcbReplyUsed: *mut u32  // DWORD* out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WDSPXE.dll")]
public static extern uint PxeDhcpv6Initialize(IntPtr pRequest, uint cbRequest, IntPtr pReply, uint cbReply, out uint pcbReplyUsed);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WDSPXE_PxeDhcpv6Initialize' -Namespace Win32 -PassThru
# $api::PxeDhcpv6Initialize(pRequest, cbRequest, pReply, cbReply, pcbReplyUsed)
#uselib "WDSPXE.dll"
#func global PxeDhcpv6Initialize "PxeDhcpv6Initialize" sptr, sptr, sptr, sptr, sptr
; PxeDhcpv6Initialize pRequest, cbRequest, pReply, cbReply, varptr(pcbReplyUsed)   ; 戻り値は stat
; pRequest : void* -> "sptr"
; cbRequest : DWORD -> "sptr"
; pReply : void* out -> "sptr"
; cbReply : DWORD -> "sptr"
; pcbReplyUsed : DWORD* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "WDSPXE.dll"
#cfunc global PxeDhcpv6Initialize "PxeDhcpv6Initialize" sptr, int, sptr, int, var
; res = PxeDhcpv6Initialize(pRequest, cbRequest, pReply, cbReply, pcbReplyUsed)
; pRequest : void* -> "sptr"
; cbRequest : DWORD -> "int"
; pReply : void* out -> "sptr"
; cbReply : DWORD -> "int"
; pcbReplyUsed : DWORD* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD PxeDhcpv6Initialize(void* pRequest, DWORD cbRequest, void* pReply, DWORD cbReply, DWORD* pcbReplyUsed)
#uselib "WDSPXE.dll"
#cfunc global PxeDhcpv6Initialize "PxeDhcpv6Initialize" intptr, int, intptr, int, var
; res = PxeDhcpv6Initialize(pRequest, cbRequest, pReply, cbReply, pcbReplyUsed)
; pRequest : void* -> "intptr"
; cbRequest : DWORD -> "int"
; pReply : void* out -> "intptr"
; cbReply : DWORD -> "int"
; pcbReplyUsed : DWORD* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wdspxe = windows.NewLazySystemDLL("WDSPXE.dll")
	procPxeDhcpv6Initialize = wdspxe.NewProc("PxeDhcpv6Initialize")
)

// pRequest (void*), cbRequest (DWORD), pReply (void* out), cbReply (DWORD), pcbReplyUsed (DWORD* out)
r1, _, err := procPxeDhcpv6Initialize.Call(
	uintptr(pRequest),
	uintptr(cbRequest),
	uintptr(pReply),
	uintptr(cbReply),
	uintptr(pcbReplyUsed),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function PxeDhcpv6Initialize(
  pRequest: Pointer;   // void*
  cbRequest: DWORD;   // DWORD
  pReply: Pointer;   // void* out
  cbReply: DWORD;   // DWORD
  pcbReplyUsed: Pointer   // DWORD* out
): DWORD; stdcall;
  external 'WDSPXE.dll' name 'PxeDhcpv6Initialize';
result := DllCall("WDSPXE\PxeDhcpv6Initialize"
    , "Ptr", pRequest   ; void*
    , "UInt", cbRequest   ; DWORD
    , "Ptr", pReply   ; void* out
    , "UInt", cbReply   ; DWORD
    , "Ptr", pcbReplyUsed   ; DWORD* out
    , "UInt")   ; return: DWORD
●PxeDhcpv6Initialize(pRequest, cbRequest, pReply, cbReply, pcbReplyUsed) = DLL("WDSPXE.dll", "dword PxeDhcpv6Initialize(void*, dword, void*, dword, void*)")
# 呼び出し: PxeDhcpv6Initialize(pRequest, cbRequest, pReply, cbReply, pcbReplyUsed)
# pRequest : void* -> "void*"
# cbRequest : DWORD -> "dword"
# pReply : void* out -> "void*"
# cbReply : DWORD -> "dword"
# pcbReplyUsed : DWORD* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。