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

AppCacheGetDownloadList

関数
アプリケーションキャッシュのダウンロード一覧を取得する。
DLLWININET.dll呼出規約winapi

シグネチャ

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

DWORD AppCacheGetDownloadList(
    void* hAppCache,
    APP_CACHE_DOWNLOAD_LIST* pDownloadList
);

パラメーター

名前方向説明
hAppCachevoid*in対象アプリケーションキャッシュのハンドル。
pDownloadListAPP_CACHE_DOWNLOAD_LIST*outダウンロード対象リソース一覧を受け取るAPP_CACHE_DOWNLOAD_LIST構造体へのポインタ。

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD AppCacheGetDownloadList(
    void* hAppCache,
    APP_CACHE_DOWNLOAD_LIST* pDownloadList
);
[DllImport("WININET.dll", ExactSpelling = true)]
static extern uint AppCacheGetDownloadList(
    IntPtr hAppCache,   // void*
    IntPtr pDownloadList   // APP_CACHE_DOWNLOAD_LIST* out
);
<DllImport("WININET.dll", ExactSpelling:=True)>
Public Shared Function AppCacheGetDownloadList(
    hAppCache As IntPtr,   ' void*
    pDownloadList As IntPtr   ' APP_CACHE_DOWNLOAD_LIST* out
) As UInteger
End Function
' hAppCache : void*
' pDownloadList : APP_CACHE_DOWNLOAD_LIST* out
Declare PtrSafe Function AppCacheGetDownloadList Lib "wininet" ( _
    ByVal hAppCache As LongPtr, _
    ByVal pDownloadList As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

AppCacheGetDownloadList = ctypes.windll.wininet.AppCacheGetDownloadList
AppCacheGetDownloadList.restype = wintypes.DWORD
AppCacheGetDownloadList.argtypes = [
    ctypes.POINTER(None),  # hAppCache : void*
    ctypes.c_void_p,  # pDownloadList : APP_CACHE_DOWNLOAD_LIST* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	wininet = windows.NewLazySystemDLL("WININET.dll")
	procAppCacheGetDownloadList = wininet.NewProc("AppCacheGetDownloadList")
)

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

extern "wininet" fn AppCacheGetDownloadList(
    hAppCache: ?*anyopaque, // void*
    pDownloadList: [*c]APP_CACHE_DOWNLOAD_LIST // APP_CACHE_DOWNLOAD_LIST* out
) callconv(std.os.windows.WINAPI) u32;
proc AppCacheGetDownloadList(
    hAppCache: pointer,  # void*
    pDownloadList: ptr APP_CACHE_DOWNLOAD_LIST  # APP_CACHE_DOWNLOAD_LIST* out
): uint32 {.importc: "AppCacheGetDownloadList", stdcall, dynlib: "WININET.dll".}
pragma(lib, "wininet");
extern(Windows)
uint AppCacheGetDownloadList(
    void* hAppCache,   // void*
    APP_CACHE_DOWNLOAD_LIST* pDownloadList   // APP_CACHE_DOWNLOAD_LIST* out
);
ccall((:AppCacheGetDownloadList, "WININET.dll"), stdcall, UInt32,
      (Ptr{Cvoid}, Ptr{APP_CACHE_DOWNLOAD_LIST}),
      hAppCache, pDownloadList)
# hAppCache : void* -> Ptr{Cvoid}
# pDownloadList : APP_CACHE_DOWNLOAD_LIST* out -> Ptr{APP_CACHE_DOWNLOAD_LIST}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t AppCacheGetDownloadList(
    void* hAppCache,
    void* pDownloadList);
]]
local wininet = ffi.load("wininet")
-- wininet.AppCacheGetDownloadList(hAppCache, pDownloadList)
-- hAppCache : void*
-- pDownloadList : APP_CACHE_DOWNLOAD_LIST* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('WININET.dll');
const AppCacheGetDownloadList = lib.func('__stdcall', 'AppCacheGetDownloadList', 'uint32_t', ['void *', 'void *']);
// AppCacheGetDownloadList(hAppCache, pDownloadList)
// hAppCache : void* -> 'void *'
// pDownloadList : APP_CACHE_DOWNLOAD_LIST* out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("WININET.dll", {
  AppCacheGetDownloadList: { parameters: ["pointer", "pointer"], result: "u32" },
});
// lib.symbols.AppCacheGetDownloadList(hAppCache, pDownloadList)
// hAppCache : void* -> "pointer"
// pDownloadList : APP_CACHE_DOWNLOAD_LIST* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t AppCacheGetDownloadList(
    void* hAppCache,
    void* pDownloadList);
C, "WININET.dll");
// $ffi->AppCacheGetDownloadList(hAppCache, pDownloadList);
// hAppCache : void*
// pDownloadList : APP_CACHE_DOWNLOAD_LIST* out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Wininet extends StdCallLibrary {
    Wininet INSTANCE = Native.load("wininet", Wininet.class);
    int AppCacheGetDownloadList(
        Pointer hAppCache,   // void*
        Pointer pDownloadList   // APP_CACHE_DOWNLOAD_LIST* out
    );
}
@[Link("wininet")]
lib LibWININET
  fun AppCacheGetDownloadList = AppCacheGetDownloadList(
    hAppCache : Void*,   # void*
    pDownloadList : APP_CACHE_DOWNLOAD_LIST*   # APP_CACHE_DOWNLOAD_LIST* out
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef AppCacheGetDownloadListNative = Uint32 Function(Pointer<Void>, Pointer<Void>);
typedef AppCacheGetDownloadListDart = int Function(Pointer<Void>, Pointer<Void>);
final AppCacheGetDownloadList = DynamicLibrary.open('WININET.dll')
    .lookupFunction<AppCacheGetDownloadListNative, AppCacheGetDownloadListDart>('AppCacheGetDownloadList');
// hAppCache : void* -> Pointer<Void>
// pDownloadList : APP_CACHE_DOWNLOAD_LIST* out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function AppCacheGetDownloadList(
  hAppCache: Pointer;   // void*
  pDownloadList: Pointer   // APP_CACHE_DOWNLOAD_LIST* out
): DWORD; stdcall;
  external 'WININET.dll' name 'AppCacheGetDownloadList';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "AppCacheGetDownloadList"
  c_AppCacheGetDownloadList :: Ptr () -> Ptr () -> IO Word32
-- hAppCache : void* -> Ptr ()
-- pDownloadList : APP_CACHE_DOWNLOAD_LIST* out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let appcachegetdownloadlist =
  foreign "AppCacheGetDownloadList"
    ((ptr void) @-> (ptr void) @-> returning uint32_t)
(* hAppCache : void* -> (ptr void) *)
(* pDownloadList : APP_CACHE_DOWNLOAD_LIST* out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library wininet (t "WININET.dll"))
(cffi:use-foreign-library wininet)

(cffi:defcfun ("AppCacheGetDownloadList" app-cache-get-download-list :convention :stdcall) :uint32
  (h-app-cache :pointer)   ; void*
  (p-download-list :pointer))   ; APP_CACHE_DOWNLOAD_LIST* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $AppCacheGetDownloadList = Win32::API::More->new('WININET',
    'DWORD AppCacheGetDownloadList(LPVOID hAppCache, LPVOID pDownloadList)');
# my $ret = $AppCacheGetDownloadList->Call($hAppCache, $pDownloadList);
# hAppCache : void* -> LPVOID
# pDownloadList : APP_CACHE_DOWNLOAD_LIST* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型