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

AppCacheCheckManifest

関数
アプリケーションキャッシュのマニフェストを検証する。
DLLWININET.dll呼出規約winapi

シグネチャ

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

DWORD AppCacheCheckManifest(
    LPCWSTR pwszMasterUrl,   // optional
    LPCWSTR pwszManifestUrl,
    const BYTE* pbManifestData,
    DWORD dwManifestDataSize,
    const BYTE* pbManifestResponseHeaders,
    DWORD dwManifestResponseHeadersSize,
    APP_CACHE_STATE* peState,
    void** phNewAppCache
);

パラメーター

名前方向
pwszMasterUrlLPCWSTRinoptional
pwszManifestUrlLPCWSTRin
pbManifestDataBYTE*in
dwManifestDataSizeDWORDin
pbManifestResponseHeadersBYTE*in
dwManifestResponseHeadersSizeDWORDin
peStateAPP_CACHE_STATE*out
phNewAppCachevoid**out

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD AppCacheCheckManifest(
    LPCWSTR pwszMasterUrl,   // optional
    LPCWSTR pwszManifestUrl,
    const BYTE* pbManifestData,
    DWORD dwManifestDataSize,
    const BYTE* pbManifestResponseHeaders,
    DWORD dwManifestResponseHeadersSize,
    APP_CACHE_STATE* peState,
    void** phNewAppCache
);
[DllImport("WININET.dll", ExactSpelling = true)]
static extern uint AppCacheCheckManifest(
    [MarshalAs(UnmanagedType.LPWStr)] string pwszMasterUrl,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string pwszManifestUrl,   // LPCWSTR
    IntPtr pbManifestData,   // BYTE*
    uint dwManifestDataSize,   // DWORD
    IntPtr pbManifestResponseHeaders,   // BYTE*
    uint dwManifestResponseHeadersSize,   // DWORD
    out int peState,   // APP_CACHE_STATE* out
    IntPtr phNewAppCache   // void** out
);
<DllImport("WININET.dll", ExactSpelling:=True)>
Public Shared Function AppCacheCheckManifest(
    <MarshalAs(UnmanagedType.LPWStr)> pwszMasterUrl As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> pwszManifestUrl As String,   ' LPCWSTR
    pbManifestData As IntPtr,   ' BYTE*
    dwManifestDataSize As UInteger,   ' DWORD
    pbManifestResponseHeaders As IntPtr,   ' BYTE*
    dwManifestResponseHeadersSize As UInteger,   ' DWORD
    <Out> ByRef peState As Integer,   ' APP_CACHE_STATE* out
    phNewAppCache As IntPtr   ' void** out
) As UInteger
End Function
' pwszMasterUrl : LPCWSTR optional
' pwszManifestUrl : LPCWSTR
' pbManifestData : BYTE*
' dwManifestDataSize : DWORD
' pbManifestResponseHeaders : BYTE*
' dwManifestResponseHeadersSize : DWORD
' peState : APP_CACHE_STATE* out
' phNewAppCache : void** out
Declare PtrSafe Function AppCacheCheckManifest Lib "wininet" ( _
    ByVal pwszMasterUrl As LongPtr, _
    ByVal pwszManifestUrl As LongPtr, _
    ByVal pbManifestData As LongPtr, _
    ByVal dwManifestDataSize As Long, _
    ByVal pbManifestResponseHeaders As LongPtr, _
    ByVal dwManifestResponseHeadersSize As Long, _
    ByRef peState As Long, _
    ByVal phNewAppCache As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

AppCacheCheckManifest = ctypes.windll.wininet.AppCacheCheckManifest
AppCacheCheckManifest.restype = wintypes.DWORD
AppCacheCheckManifest.argtypes = [
    wintypes.LPCWSTR,  # pwszMasterUrl : LPCWSTR optional
    wintypes.LPCWSTR,  # pwszManifestUrl : LPCWSTR
    ctypes.POINTER(ctypes.c_ubyte),  # pbManifestData : BYTE*
    wintypes.DWORD,  # dwManifestDataSize : DWORD
    ctypes.POINTER(ctypes.c_ubyte),  # pbManifestResponseHeaders : BYTE*
    wintypes.DWORD,  # dwManifestResponseHeadersSize : DWORD
    ctypes.c_void_p,  # peState : APP_CACHE_STATE* out
    ctypes.c_void_p,  # phNewAppCache : void** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WININET.dll')
AppCacheCheckManifest = Fiddle::Function.new(
  lib['AppCacheCheckManifest'],
  [
    Fiddle::TYPE_VOIDP,  # pwszMasterUrl : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # pwszManifestUrl : LPCWSTR
    Fiddle::TYPE_VOIDP,  # pbManifestData : BYTE*
    -Fiddle::TYPE_INT,  # dwManifestDataSize : DWORD
    Fiddle::TYPE_VOIDP,  # pbManifestResponseHeaders : BYTE*
    -Fiddle::TYPE_INT,  # dwManifestResponseHeadersSize : DWORD
    Fiddle::TYPE_VOIDP,  # peState : APP_CACHE_STATE* out
    Fiddle::TYPE_VOIDP,  # phNewAppCache : void** out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "wininet")]
extern "system" {
    fn AppCacheCheckManifest(
        pwszMasterUrl: *const u16,  // LPCWSTR optional
        pwszManifestUrl: *const u16,  // LPCWSTR
        pbManifestData: *const u8,  // BYTE*
        dwManifestDataSize: u32,  // DWORD
        pbManifestResponseHeaders: *const u8,  // BYTE*
        dwManifestResponseHeadersSize: u32,  // DWORD
        peState: *mut i32,  // APP_CACHE_STATE* out
        phNewAppCache: *mut *mut ()  // void** out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WININET.dll")]
public static extern uint AppCacheCheckManifest([MarshalAs(UnmanagedType.LPWStr)] string pwszMasterUrl, [MarshalAs(UnmanagedType.LPWStr)] string pwszManifestUrl, IntPtr pbManifestData, uint dwManifestDataSize, IntPtr pbManifestResponseHeaders, uint dwManifestResponseHeadersSize, out int peState, IntPtr phNewAppCache);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_AppCacheCheckManifest' -Namespace Win32 -PassThru
# $api::AppCacheCheckManifest(pwszMasterUrl, pwszManifestUrl, pbManifestData, dwManifestDataSize, pbManifestResponseHeaders, dwManifestResponseHeadersSize, peState, phNewAppCache)
#uselib "WININET.dll"
#func global AppCacheCheckManifest "AppCacheCheckManifest" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; AppCacheCheckManifest pwszMasterUrl, pwszManifestUrl, varptr(pbManifestData), dwManifestDataSize, varptr(pbManifestResponseHeaders), dwManifestResponseHeadersSize, peState, phNewAppCache   ; 戻り値は stat
; pwszMasterUrl : LPCWSTR optional -> "sptr"
; pwszManifestUrl : LPCWSTR -> "sptr"
; pbManifestData : BYTE* -> "sptr"
; dwManifestDataSize : DWORD -> "sptr"
; pbManifestResponseHeaders : BYTE* -> "sptr"
; dwManifestResponseHeadersSize : DWORD -> "sptr"
; peState : APP_CACHE_STATE* out -> "sptr"
; phNewAppCache : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "WININET.dll"
#cfunc global AppCacheCheckManifest "AppCacheCheckManifest" wstr, wstr, var, int, var, int, int, sptr
; res = AppCacheCheckManifest(pwszMasterUrl, pwszManifestUrl, pbManifestData, dwManifestDataSize, pbManifestResponseHeaders, dwManifestResponseHeadersSize, peState, phNewAppCache)
; pwszMasterUrl : LPCWSTR optional -> "wstr"
; pwszManifestUrl : LPCWSTR -> "wstr"
; pbManifestData : BYTE* -> "var"
; dwManifestDataSize : DWORD -> "int"
; pbManifestResponseHeaders : BYTE* -> "var"
; dwManifestResponseHeadersSize : DWORD -> "int"
; peState : APP_CACHE_STATE* out -> "int"
; phNewAppCache : void** out -> "sptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD AppCacheCheckManifest(LPCWSTR pwszMasterUrl, LPCWSTR pwszManifestUrl, BYTE* pbManifestData, DWORD dwManifestDataSize, BYTE* pbManifestResponseHeaders, DWORD dwManifestResponseHeadersSize, APP_CACHE_STATE* peState, void** phNewAppCache)
#uselib "WININET.dll"
#cfunc global AppCacheCheckManifest "AppCacheCheckManifest" wstr, wstr, var, int, var, int, int, intptr
; res = AppCacheCheckManifest(pwszMasterUrl, pwszManifestUrl, pbManifestData, dwManifestDataSize, pbManifestResponseHeaders, dwManifestResponseHeadersSize, peState, phNewAppCache)
; pwszMasterUrl : LPCWSTR optional -> "wstr"
; pwszManifestUrl : LPCWSTR -> "wstr"
; pbManifestData : BYTE* -> "var"
; dwManifestDataSize : DWORD -> "int"
; pbManifestResponseHeaders : BYTE* -> "var"
; dwManifestResponseHeadersSize : DWORD -> "int"
; peState : APP_CACHE_STATE* out -> "int"
; phNewAppCache : void** out -> "intptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wininet = windows.NewLazySystemDLL("WININET.dll")
	procAppCacheCheckManifest = wininet.NewProc("AppCacheCheckManifest")
)

// pwszMasterUrl (LPCWSTR optional), pwszManifestUrl (LPCWSTR), pbManifestData (BYTE*), dwManifestDataSize (DWORD), pbManifestResponseHeaders (BYTE*), dwManifestResponseHeadersSize (DWORD), peState (APP_CACHE_STATE* out), phNewAppCache (void** out)
r1, _, err := procAppCacheCheckManifest.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwszMasterUrl))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwszManifestUrl))),
	uintptr(pbManifestData),
	uintptr(dwManifestDataSize),
	uintptr(pbManifestResponseHeaders),
	uintptr(dwManifestResponseHeadersSize),
	uintptr(peState),
	uintptr(phNewAppCache),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function AppCacheCheckManifest(
  pwszMasterUrl: PWideChar;   // LPCWSTR optional
  pwszManifestUrl: PWideChar;   // LPCWSTR
  pbManifestData: Pointer;   // BYTE*
  dwManifestDataSize: DWORD;   // DWORD
  pbManifestResponseHeaders: Pointer;   // BYTE*
  dwManifestResponseHeadersSize: DWORD;   // DWORD
  peState: Pointer;   // APP_CACHE_STATE* out
  phNewAppCache: Pointer   // void** out
): DWORD; stdcall;
  external 'WININET.dll' name 'AppCacheCheckManifest';
result := DllCall("WININET\AppCacheCheckManifest"
    , "WStr", pwszMasterUrl   ; LPCWSTR optional
    , "WStr", pwszManifestUrl   ; LPCWSTR
    , "Ptr", pbManifestData   ; BYTE*
    , "UInt", dwManifestDataSize   ; DWORD
    , "Ptr", pbManifestResponseHeaders   ; BYTE*
    , "UInt", dwManifestResponseHeadersSize   ; DWORD
    , "Ptr", peState   ; APP_CACHE_STATE* out
    , "Ptr", phNewAppCache   ; void** out
    , "UInt")   ; return: DWORD
●AppCacheCheckManifest(pwszMasterUrl, pwszManifestUrl, pbManifestData, dwManifestDataSize, pbManifestResponseHeaders, dwManifestResponseHeadersSize, peState, phNewAppCache) = DLL("WININET.dll", "dword AppCacheCheckManifest(char*, char*, void*, dword, void*, dword, void*, void*)")
# 呼び出し: AppCacheCheckManifest(pwszMasterUrl, pwszManifestUrl, pbManifestData, dwManifestDataSize, pbManifestResponseHeaders, dwManifestResponseHeadersSize, peState, phNewAppCache)
# pwszMasterUrl : LPCWSTR optional -> "char*"
# pwszManifestUrl : LPCWSTR -> "char*"
# pbManifestData : BYTE* -> "void*"
# dwManifestDataSize : DWORD -> "dword"
# pbManifestResponseHeaders : BYTE* -> "void*"
# dwManifestResponseHeadersSize : DWORD -> "dword"
# peState : APP_CACHE_STATE* out -> "void*"
# phNewAppCache : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。