Win32 API 日本語リファレンス
ホームNetworking.HttpServer › HttpWaitForDemandStart

HttpWaitForDemandStart

関数
オンデマンド起動の要求を待機する。
DLLHTTPAPI.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD HttpWaitForDemandStart(
    HANDLE RequestQueueHandle,
    OVERLAPPED* Overlapped   // optional
);

パラメーター

名前方向
RequestQueueHandleHANDLEin
OverlappedOVERLAPPED*inoutoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD HttpWaitForDemandStart(
    HANDLE RequestQueueHandle,
    OVERLAPPED* Overlapped   // optional
);
[DllImport("HTTPAPI.dll", ExactSpelling = true)]
static extern uint HttpWaitForDemandStart(
    IntPtr RequestQueueHandle,   // HANDLE
    IntPtr Overlapped   // OVERLAPPED* optional, in/out
);
<DllImport("HTTPAPI.dll", ExactSpelling:=True)>
Public Shared Function HttpWaitForDemandStart(
    RequestQueueHandle As IntPtr,   ' HANDLE
    Overlapped As IntPtr   ' OVERLAPPED* optional, in/out
) As UInteger
End Function
' RequestQueueHandle : HANDLE
' Overlapped : OVERLAPPED* optional, in/out
Declare PtrSafe Function HttpWaitForDemandStart Lib "httpapi" ( _
    ByVal RequestQueueHandle As LongPtr, _
    ByVal Overlapped As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HttpWaitForDemandStart = ctypes.windll.httpapi.HttpWaitForDemandStart
HttpWaitForDemandStart.restype = wintypes.DWORD
HttpWaitForDemandStart.argtypes = [
    wintypes.HANDLE,  # RequestQueueHandle : HANDLE
    ctypes.c_void_p,  # Overlapped : OVERLAPPED* optional, in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	httpapi = windows.NewLazySystemDLL("HTTPAPI.dll")
	procHttpWaitForDemandStart = httpapi.NewProc("HttpWaitForDemandStart")
)

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