ホーム › Networking.WinInet › HttpPushWait
HttpPushWait
関数HTTPプッシュ通知の到着を待機する。
シグネチャ
// WININET.dll
#include <windows.h>
DWORD HttpPushWait(
HTTP_PUSH_WAIT_HANDLE hWait,
HTTP_PUSH_WAIT_TYPE eType,
HTTP_PUSH_NOTIFICATION_STATUS* pNotificationStatus // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hWait | HTTP_PUSH_WAIT_HANDLE | in |
| eType | HTTP_PUSH_WAIT_TYPE | in |
| pNotificationStatus | HTTP_PUSH_NOTIFICATION_STATUS* | outoptional |
戻り値の型: DWORD
各言語での呼び出し定義
// WININET.dll
#include <windows.h>
DWORD HttpPushWait(
HTTP_PUSH_WAIT_HANDLE hWait,
HTTP_PUSH_WAIT_TYPE eType,
HTTP_PUSH_NOTIFICATION_STATUS* pNotificationStatus // optional
);[DllImport("WININET.dll", ExactSpelling = true)]
static extern uint HttpPushWait(
IntPtr hWait, // HTTP_PUSH_WAIT_HANDLE
int eType, // HTTP_PUSH_WAIT_TYPE
IntPtr pNotificationStatus // HTTP_PUSH_NOTIFICATION_STATUS* optional, out
);<DllImport("WININET.dll", ExactSpelling:=True)>
Public Shared Function HttpPushWait(
hWait As IntPtr, ' HTTP_PUSH_WAIT_HANDLE
eType As Integer, ' HTTP_PUSH_WAIT_TYPE
pNotificationStatus As IntPtr ' HTTP_PUSH_NOTIFICATION_STATUS* optional, out
) As UInteger
End Function' hWait : HTTP_PUSH_WAIT_HANDLE
' eType : HTTP_PUSH_WAIT_TYPE
' pNotificationStatus : HTTP_PUSH_NOTIFICATION_STATUS* optional, out
Declare PtrSafe Function HttpPushWait Lib "wininet" ( _
ByVal hWait As LongPtr, _
ByVal eType As Long, _
ByVal pNotificationStatus As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
HttpPushWait = ctypes.windll.wininet.HttpPushWait
HttpPushWait.restype = wintypes.DWORD
HttpPushWait.argtypes = [
wintypes.HANDLE, # hWait : HTTP_PUSH_WAIT_HANDLE
ctypes.c_int, # eType : HTTP_PUSH_WAIT_TYPE
ctypes.c_void_p, # pNotificationStatus : HTTP_PUSH_NOTIFICATION_STATUS* optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WININET.dll')
HttpPushWait = Fiddle::Function.new(
lib['HttpPushWait'],
[
Fiddle::TYPE_VOIDP, # hWait : HTTP_PUSH_WAIT_HANDLE
Fiddle::TYPE_INT, # eType : HTTP_PUSH_WAIT_TYPE
Fiddle::TYPE_VOIDP, # pNotificationStatus : HTTP_PUSH_NOTIFICATION_STATUS* optional, out
],
-Fiddle::TYPE_INT)#[link(name = "wininet")]
extern "system" {
fn HttpPushWait(
hWait: *mut core::ffi::c_void, // HTTP_PUSH_WAIT_HANDLE
eType: i32, // HTTP_PUSH_WAIT_TYPE
pNotificationStatus: *mut HTTP_PUSH_NOTIFICATION_STATUS // HTTP_PUSH_NOTIFICATION_STATUS* optional, out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WININET.dll")]
public static extern uint HttpPushWait(IntPtr hWait, int eType, IntPtr pNotificationStatus);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_HttpPushWait' -Namespace Win32 -PassThru
# $api::HttpPushWait(hWait, eType, pNotificationStatus)#uselib "WININET.dll"
#func global HttpPushWait "HttpPushWait" sptr, sptr, sptr
; HttpPushWait hWait, eType, varptr(pNotificationStatus) ; 戻り値は stat
; hWait : HTTP_PUSH_WAIT_HANDLE -> "sptr"
; eType : HTTP_PUSH_WAIT_TYPE -> "sptr"
; pNotificationStatus : HTTP_PUSH_NOTIFICATION_STATUS* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WININET.dll" #cfunc global HttpPushWait "HttpPushWait" sptr, int, var ; res = HttpPushWait(hWait, eType, pNotificationStatus) ; hWait : HTTP_PUSH_WAIT_HANDLE -> "sptr" ; eType : HTTP_PUSH_WAIT_TYPE -> "int" ; pNotificationStatus : HTTP_PUSH_NOTIFICATION_STATUS* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WININET.dll" #cfunc global HttpPushWait "HttpPushWait" sptr, int, sptr ; res = HttpPushWait(hWait, eType, varptr(pNotificationStatus)) ; hWait : HTTP_PUSH_WAIT_HANDLE -> "sptr" ; eType : HTTP_PUSH_WAIT_TYPE -> "int" ; pNotificationStatus : HTTP_PUSH_NOTIFICATION_STATUS* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD HttpPushWait(HTTP_PUSH_WAIT_HANDLE hWait, HTTP_PUSH_WAIT_TYPE eType, HTTP_PUSH_NOTIFICATION_STATUS* pNotificationStatus) #uselib "WININET.dll" #cfunc global HttpPushWait "HttpPushWait" intptr, int, var ; res = HttpPushWait(hWait, eType, pNotificationStatus) ; hWait : HTTP_PUSH_WAIT_HANDLE -> "intptr" ; eType : HTTP_PUSH_WAIT_TYPE -> "int" ; pNotificationStatus : HTTP_PUSH_NOTIFICATION_STATUS* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD HttpPushWait(HTTP_PUSH_WAIT_HANDLE hWait, HTTP_PUSH_WAIT_TYPE eType, HTTP_PUSH_NOTIFICATION_STATUS* pNotificationStatus) #uselib "WININET.dll" #cfunc global HttpPushWait "HttpPushWait" intptr, int, intptr ; res = HttpPushWait(hWait, eType, varptr(pNotificationStatus)) ; hWait : HTTP_PUSH_WAIT_HANDLE -> "intptr" ; eType : HTTP_PUSH_WAIT_TYPE -> "int" ; pNotificationStatus : HTTP_PUSH_NOTIFICATION_STATUS* optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wininet = windows.NewLazySystemDLL("WININET.dll")
procHttpPushWait = wininet.NewProc("HttpPushWait")
)
// hWait (HTTP_PUSH_WAIT_HANDLE), eType (HTTP_PUSH_WAIT_TYPE), pNotificationStatus (HTTP_PUSH_NOTIFICATION_STATUS* optional, out)
r1, _, err := procHttpPushWait.Call(
uintptr(hWait),
uintptr(eType),
uintptr(pNotificationStatus),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction HttpPushWait(
hWait: THandle; // HTTP_PUSH_WAIT_HANDLE
eType: Integer; // HTTP_PUSH_WAIT_TYPE
pNotificationStatus: Pointer // HTTP_PUSH_NOTIFICATION_STATUS* optional, out
): DWORD; stdcall;
external 'WININET.dll' name 'HttpPushWait';result := DllCall("WININET\HttpPushWait"
, "Ptr", hWait ; HTTP_PUSH_WAIT_HANDLE
, "Int", eType ; HTTP_PUSH_WAIT_TYPE
, "Ptr", pNotificationStatus ; HTTP_PUSH_NOTIFICATION_STATUS* optional, out
, "UInt") ; return: DWORD●HttpPushWait(hWait, eType, pNotificationStatus) = DLL("WININET.dll", "dword HttpPushWait(void*, int, void*)")
# 呼び出し: HttpPushWait(hWait, eType, pNotificationStatus)
# hWait : HTTP_PUSH_WAIT_HANDLE -> "void*"
# eType : HTTP_PUSH_WAIT_TYPE -> "int"
# pNotificationStatus : HTTP_PUSH_NOTIFICATION_STATUS* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。