ホーム › Storage.Packaging.Appx › CheckIsMSIXPackage
CheckIsMSIXPackage
関数指定パッケージがMSIX形式かどうかを判定する。
シグネチャ
// KERNEL32.dll
#include <windows.h>
HRESULT CheckIsMSIXPackage(
LPCWSTR packageFullName,
BOOL* isMSIXPackage
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| packageFullName | LPCWSTR | in |
| isMSIXPackage | BOOL* | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// KERNEL32.dll
#include <windows.h>
HRESULT CheckIsMSIXPackage(
LPCWSTR packageFullName,
BOOL* isMSIXPackage
);[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern int CheckIsMSIXPackage(
[MarshalAs(UnmanagedType.LPWStr)] string packageFullName, // LPCWSTR
out int isMSIXPackage // BOOL* out
);<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function CheckIsMSIXPackage(
<MarshalAs(UnmanagedType.LPWStr)> packageFullName As String, ' LPCWSTR
<Out> ByRef isMSIXPackage As Integer ' BOOL* out
) As Integer
End Function' packageFullName : LPCWSTR
' isMSIXPackage : BOOL* out
Declare PtrSafe Function CheckIsMSIXPackage Lib "kernel32" ( _
ByVal packageFullName As LongPtr, _
ByRef isMSIXPackage As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CheckIsMSIXPackage = ctypes.windll.kernel32.CheckIsMSIXPackage
CheckIsMSIXPackage.restype = ctypes.c_int
CheckIsMSIXPackage.argtypes = [
wintypes.LPCWSTR, # packageFullName : LPCWSTR
ctypes.c_void_p, # isMSIXPackage : BOOL* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('KERNEL32.dll')
CheckIsMSIXPackage = Fiddle::Function.new(
lib['CheckIsMSIXPackage'],
[
Fiddle::TYPE_VOIDP, # packageFullName : LPCWSTR
Fiddle::TYPE_VOIDP, # isMSIXPackage : BOOL* out
],
Fiddle::TYPE_INT)#[link(name = "kernel32")]
extern "system" {
fn CheckIsMSIXPackage(
packageFullName: *const u16, // LPCWSTR
isMSIXPackage: *mut i32 // BOOL* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("KERNEL32.dll")]
public static extern int CheckIsMSIXPackage([MarshalAs(UnmanagedType.LPWStr)] string packageFullName, out int isMSIXPackage);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_CheckIsMSIXPackage' -Namespace Win32 -PassThru
# $api::CheckIsMSIXPackage(packageFullName, isMSIXPackage)#uselib "KERNEL32.dll"
#func global CheckIsMSIXPackage "CheckIsMSIXPackage" sptr, sptr
; CheckIsMSIXPackage packageFullName, isMSIXPackage ; 戻り値は stat
; packageFullName : LPCWSTR -> "sptr"
; isMSIXPackage : BOOL* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "KERNEL32.dll"
#cfunc global CheckIsMSIXPackage "CheckIsMSIXPackage" wstr, int
; res = CheckIsMSIXPackage(packageFullName, isMSIXPackage)
; packageFullName : LPCWSTR -> "wstr"
; isMSIXPackage : BOOL* out -> "int"; HRESULT CheckIsMSIXPackage(LPCWSTR packageFullName, BOOL* isMSIXPackage)
#uselib "KERNEL32.dll"
#cfunc global CheckIsMSIXPackage "CheckIsMSIXPackage" wstr, int
; res = CheckIsMSIXPackage(packageFullName, isMSIXPackage)
; packageFullName : LPCWSTR -> "wstr"
; isMSIXPackage : BOOL* out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
procCheckIsMSIXPackage = kernel32.NewProc("CheckIsMSIXPackage")
)
// packageFullName (LPCWSTR), isMSIXPackage (BOOL* out)
r1, _, err := procCheckIsMSIXPackage.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(packageFullName))),
uintptr(isMSIXPackage),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction CheckIsMSIXPackage(
packageFullName: PWideChar; // LPCWSTR
isMSIXPackage: Pointer // BOOL* out
): Integer; stdcall;
external 'KERNEL32.dll' name 'CheckIsMSIXPackage';result := DllCall("KERNEL32\CheckIsMSIXPackage"
, "WStr", packageFullName ; LPCWSTR
, "Ptr", isMSIXPackage ; BOOL* out
, "Int") ; return: HRESULT●CheckIsMSIXPackage(packageFullName, isMSIXPackage) = DLL("KERNEL32.dll", "int CheckIsMSIXPackage(char*, void*)")
# 呼び出し: CheckIsMSIXPackage(packageFullName, isMSIXPackage)
# packageFullName : LPCWSTR -> "char*"
# isMSIXPackage : BOOL* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。