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

PxeSendReply

関数
PXEクライアント要求に対して応答パケットを送信する。
DLLWDSPXE.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

DWORD PxeSendReply(
    HANDLE hClientRequest,
    void* pPacket,
    DWORD uPacketLen,
    PXE_ADDRESS* pAddress
);

パラメーター

名前方向
hClientRequestHANDLEin
pPacketvoid*in
uPacketLenDWORDin
pAddressPXE_ADDRESS*in

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD PxeSendReply(
    HANDLE hClientRequest,
    void* pPacket,
    DWORD uPacketLen,
    PXE_ADDRESS* pAddress
);
[DllImport("WDSPXE.dll", ExactSpelling = true)]
static extern uint PxeSendReply(
    IntPtr hClientRequest,   // HANDLE
    IntPtr pPacket,   // void*
    uint uPacketLen,   // DWORD
    IntPtr pAddress   // PXE_ADDRESS*
);
<DllImport("WDSPXE.dll", ExactSpelling:=True)>
Public Shared Function PxeSendReply(
    hClientRequest As IntPtr,   ' HANDLE
    pPacket As IntPtr,   ' void*
    uPacketLen As UInteger,   ' DWORD
    pAddress As IntPtr   ' PXE_ADDRESS*
) As UInteger
End Function
' hClientRequest : HANDLE
' pPacket : void*
' uPacketLen : DWORD
' pAddress : PXE_ADDRESS*
Declare PtrSafe Function PxeSendReply Lib "wdspxe" ( _
    ByVal hClientRequest As LongPtr, _
    ByVal pPacket As LongPtr, _
    ByVal uPacketLen As Long, _
    ByVal pAddress As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

PxeSendReply = ctypes.windll.wdspxe.PxeSendReply
PxeSendReply.restype = wintypes.DWORD
PxeSendReply.argtypes = [
    wintypes.HANDLE,  # hClientRequest : HANDLE
    ctypes.POINTER(None),  # pPacket : void*
    wintypes.DWORD,  # uPacketLen : DWORD
    ctypes.c_void_p,  # pAddress : PXE_ADDRESS*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	wdspxe = windows.NewLazySystemDLL("WDSPXE.dll")
	procPxeSendReply = wdspxe.NewProc("PxeSendReply")
)

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