ホーム › Networking.WinInet › AppCacheGetManifestUrl
AppCacheGetManifestUrl
関数アプリケーションキャッシュのマニフェストURLを取得する。
シグネチャ
// WININET.dll
#include <windows.h>
DWORD AppCacheGetManifestUrl(
void* hAppCache,
LPWSTR* ppwszManifestUrl
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hAppCache | void* | in | 対象アプリケーションキャッシュのハンドル。 |
| ppwszManifestUrl | LPWSTR* | out | マニフェストURL文字列のポインタを受け取るLPWSTR*。 |
戻り値の型: DWORD
各言語での呼び出し定義
// WININET.dll
#include <windows.h>
DWORD AppCacheGetManifestUrl(
void* hAppCache,
LPWSTR* ppwszManifestUrl
);[DllImport("WININET.dll", ExactSpelling = true)]
static extern uint AppCacheGetManifestUrl(
IntPtr hAppCache, // void*
IntPtr ppwszManifestUrl // LPWSTR* out
);<DllImport("WININET.dll", ExactSpelling:=True)>
Public Shared Function AppCacheGetManifestUrl(
hAppCache As IntPtr, ' void*
ppwszManifestUrl As IntPtr ' LPWSTR* out
) As UInteger
End Function' hAppCache : void*
' ppwszManifestUrl : LPWSTR* out
Declare PtrSafe Function AppCacheGetManifestUrl Lib "wininet" ( _
ByVal hAppCache As LongPtr, _
ByVal ppwszManifestUrl As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
AppCacheGetManifestUrl = ctypes.windll.wininet.AppCacheGetManifestUrl
AppCacheGetManifestUrl.restype = wintypes.DWORD
AppCacheGetManifestUrl.argtypes = [
ctypes.POINTER(None), # hAppCache : void*
ctypes.c_void_p, # ppwszManifestUrl : LPWSTR* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WININET.dll')
AppCacheGetManifestUrl = Fiddle::Function.new(
lib['AppCacheGetManifestUrl'],
[
Fiddle::TYPE_VOIDP, # hAppCache : void*
Fiddle::TYPE_VOIDP, # ppwszManifestUrl : LPWSTR* out
],
-Fiddle::TYPE_INT)#[link(name = "wininet")]
extern "system" {
fn AppCacheGetManifestUrl(
hAppCache: *mut (), // void*
ppwszManifestUrl: *mut *mut u16 // LPWSTR* out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WININET.dll")]
public static extern uint AppCacheGetManifestUrl(IntPtr hAppCache, IntPtr ppwszManifestUrl);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_AppCacheGetManifestUrl' -Namespace Win32 -PassThru
# $api::AppCacheGetManifestUrl(hAppCache, ppwszManifestUrl)#uselib "WININET.dll"
#func global AppCacheGetManifestUrl "AppCacheGetManifestUrl" sptr, sptr
; AppCacheGetManifestUrl hAppCache, varptr(ppwszManifestUrl) ; 戻り値は stat
; hAppCache : void* -> "sptr"
; ppwszManifestUrl : LPWSTR* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WININET.dll" #cfunc global AppCacheGetManifestUrl "AppCacheGetManifestUrl" sptr, var ; res = AppCacheGetManifestUrl(hAppCache, ppwszManifestUrl) ; hAppCache : void* -> "sptr" ; ppwszManifestUrl : LPWSTR* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WININET.dll" #cfunc global AppCacheGetManifestUrl "AppCacheGetManifestUrl" sptr, sptr ; res = AppCacheGetManifestUrl(hAppCache, varptr(ppwszManifestUrl)) ; hAppCache : void* -> "sptr" ; ppwszManifestUrl : LPWSTR* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD AppCacheGetManifestUrl(void* hAppCache, LPWSTR* ppwszManifestUrl) #uselib "WININET.dll" #cfunc global AppCacheGetManifestUrl "AppCacheGetManifestUrl" intptr, var ; res = AppCacheGetManifestUrl(hAppCache, ppwszManifestUrl) ; hAppCache : void* -> "intptr" ; ppwszManifestUrl : LPWSTR* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD AppCacheGetManifestUrl(void* hAppCache, LPWSTR* ppwszManifestUrl) #uselib "WININET.dll" #cfunc global AppCacheGetManifestUrl "AppCacheGetManifestUrl" intptr, intptr ; res = AppCacheGetManifestUrl(hAppCache, varptr(ppwszManifestUrl)) ; hAppCache : void* -> "intptr" ; ppwszManifestUrl : LPWSTR* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wininet = windows.NewLazySystemDLL("WININET.dll")
procAppCacheGetManifestUrl = wininet.NewProc("AppCacheGetManifestUrl")
)
// hAppCache (void*), ppwszManifestUrl (LPWSTR* out)
r1, _, err := procAppCacheGetManifestUrl.Call(
uintptr(hAppCache),
uintptr(ppwszManifestUrl),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction AppCacheGetManifestUrl(
hAppCache: Pointer; // void*
ppwszManifestUrl: PPWideChar // LPWSTR* out
): DWORD; stdcall;
external 'WININET.dll' name 'AppCacheGetManifestUrl';result := DllCall("WININET\AppCacheGetManifestUrl"
, "Ptr", hAppCache ; void*
, "Ptr", ppwszManifestUrl ; LPWSTR* out
, "UInt") ; return: DWORD●AppCacheGetManifestUrl(hAppCache, ppwszManifestUrl) = DLL("WININET.dll", "dword AppCacheGetManifestUrl(void*, void*)")
# 呼び出し: AppCacheGetManifestUrl(hAppCache, ppwszManifestUrl)
# hAppCache : void* -> "void*"
# ppwszManifestUrl : LPWSTR* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "wininet" fn AppCacheGetManifestUrl(
hAppCache: ?*anyopaque, // void*
ppwszManifestUrl: [*c][*c]u16 // LPWSTR* out
) callconv(std.os.windows.WINAPI) u32;proc AppCacheGetManifestUrl(
hAppCache: pointer, # void*
ppwszManifestUrl: ptr WideCString # LPWSTR* out
): uint32 {.importc: "AppCacheGetManifestUrl", stdcall, dynlib: "WININET.dll".}pragma(lib, "wininet");
extern(Windows)
uint AppCacheGetManifestUrl(
void* hAppCache, // void*
wchar** ppwszManifestUrl // LPWSTR* out
);ccall((:AppCacheGetManifestUrl, "WININET.dll"), stdcall, UInt32,
(Ptr{Cvoid}, Ptr{Ptr{UInt16}}),
hAppCache, ppwszManifestUrl)
# hAppCache : void* -> Ptr{Cvoid}
# ppwszManifestUrl : LPWSTR* out -> Ptr{Ptr{UInt16}}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t AppCacheGetManifestUrl(
void* hAppCache,
uint16_t** ppwszManifestUrl);
]]
local wininet = ffi.load("wininet")
-- wininet.AppCacheGetManifestUrl(hAppCache, ppwszManifestUrl)
-- hAppCache : void*
-- ppwszManifestUrl : LPWSTR* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('WININET.dll');
const AppCacheGetManifestUrl = lib.func('__stdcall', 'AppCacheGetManifestUrl', 'uint32_t', ['void *', 'void *']);
// AppCacheGetManifestUrl(hAppCache, ppwszManifestUrl)
// hAppCache : void* -> 'void *'
// ppwszManifestUrl : LPWSTR* out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("WININET.dll", {
AppCacheGetManifestUrl: { parameters: ["pointer", "pointer"], result: "u32" },
});
// lib.symbols.AppCacheGetManifestUrl(hAppCache, ppwszManifestUrl)
// hAppCache : void* -> "pointer"
// ppwszManifestUrl : LPWSTR* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t AppCacheGetManifestUrl(
void* hAppCache,
uint16_t** ppwszManifestUrl);
C, "WININET.dll");
// $ffi->AppCacheGetManifestUrl(hAppCache, ppwszManifestUrl);
// hAppCache : void*
// ppwszManifestUrl : LPWSTR* 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 AppCacheGetManifestUrl(
Pointer hAppCache, // void*
PointerByReference ppwszManifestUrl // LPWSTR* out
);
}@[Link("wininet")]
lib LibWININET
fun AppCacheGetManifestUrl = AppCacheGetManifestUrl(
hAppCache : Void*, # void*
ppwszManifestUrl : UInt16** # LPWSTR* out
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef AppCacheGetManifestUrlNative = Uint32 Function(Pointer<Void>, Pointer<Pointer<Utf16>>);
typedef AppCacheGetManifestUrlDart = int Function(Pointer<Void>, Pointer<Pointer<Utf16>>);
final AppCacheGetManifestUrl = DynamicLibrary.open('WININET.dll')
.lookupFunction<AppCacheGetManifestUrlNative, AppCacheGetManifestUrlDart>('AppCacheGetManifestUrl');
// hAppCache : void* -> Pointer<Void>
// ppwszManifestUrl : LPWSTR* out -> Pointer<Pointer<Utf16>>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function AppCacheGetManifestUrl(
hAppCache: Pointer; // void*
ppwszManifestUrl: PPWideChar // LPWSTR* out
): DWORD; stdcall;
external 'WININET.dll' name 'AppCacheGetManifestUrl';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "AppCacheGetManifestUrl"
c_AppCacheGetManifestUrl :: Ptr () -> Ptr CWString -> IO Word32
-- hAppCache : void* -> Ptr ()
-- ppwszManifestUrl : LPWSTR* out -> Ptr CWString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let appcachegetmanifesturl =
foreign "AppCacheGetManifestUrl"
((ptr void) @-> (ptr (ptr uint16_t)) @-> returning uint32_t)
(* hAppCache : void* -> (ptr void) *)
(* ppwszManifestUrl : LPWSTR* out -> (ptr (ptr uint16_t)) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wininet (t "WININET.dll"))
(cffi:use-foreign-library wininet)
(cffi:defcfun ("AppCacheGetManifestUrl" app-cache-get-manifest-url :convention :stdcall) :uint32
(h-app-cache :pointer) ; void*
(ppwsz-manifest-url :pointer)) ; LPWSTR* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $AppCacheGetManifestUrl = Win32::API::More->new('WININET',
'DWORD AppCacheGetManifestUrl(LPVOID hAppCache, LPVOID ppwszManifestUrl)');
# my $ret = $AppCacheGetManifestUrl->Call($hAppCache, $ppwszManifestUrl);
# hAppCache : void* -> LPVOID
# ppwszManifestUrl : LPWSTR* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。