Win32 API 日本語リファレンス
ホームSystem.ApplicationInstallationAndServicing › MsiSummaryInfoPersist

MsiSummaryInfoPersist

関数
変更したサマリ情報をデータベースに書き込んで保存する。
DLLmsi.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

DWORD MsiSummaryInfoPersist(
    MSIHANDLE hSummaryInfo
);

パラメーター

名前方向説明
hSummaryInfoMSIHANDLEinサマリー情報へのハンドル。

戻り値の型: DWORD

公式ドキュメント

MsiSummaryInfoPersist 関数は、変更されたサマリー情報をサマリー情報ストリームに書き戻します。

戻り値

この関数は UINT を返します。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での呼び出し定義

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

DWORD MsiSummaryInfoPersist(
    MSIHANDLE hSummaryInfo
);
[DllImport("msi.dll", ExactSpelling = true)]
static extern uint MsiSummaryInfoPersist(
    uint hSummaryInfo   // MSIHANDLE
);
<DllImport("msi.dll", ExactSpelling:=True)>
Public Shared Function MsiSummaryInfoPersist(
    hSummaryInfo As UInteger   ' MSIHANDLE
) As UInteger
End Function
' hSummaryInfo : MSIHANDLE
Declare PtrSafe Function MsiSummaryInfoPersist Lib "msi" ( _
    ByVal hSummaryInfo As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MsiSummaryInfoPersist = ctypes.windll.msi.MsiSummaryInfoPersist
MsiSummaryInfoPersist.restype = wintypes.DWORD
MsiSummaryInfoPersist.argtypes = [
    wintypes.DWORD,  # hSummaryInfo : MSIHANDLE
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('msi.dll')
MsiSummaryInfoPersist = Fiddle::Function.new(
  lib['MsiSummaryInfoPersist'],
  [
    -Fiddle::TYPE_INT,  # hSummaryInfo : MSIHANDLE
  ],
  -Fiddle::TYPE_INT)
#[link(name = "msi")]
extern "system" {
    fn MsiSummaryInfoPersist(
        hSummaryInfo: u32  // MSIHANDLE
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("msi.dll")]
public static extern uint MsiSummaryInfoPersist(uint hSummaryInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msi_MsiSummaryInfoPersist' -Namespace Win32 -PassThru
# $api::MsiSummaryInfoPersist(hSummaryInfo)
#uselib "msi.dll"
#func global MsiSummaryInfoPersist "MsiSummaryInfoPersist" sptr
; MsiSummaryInfoPersist hSummaryInfo   ; 戻り値は stat
; hSummaryInfo : MSIHANDLE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "msi.dll"
#cfunc global MsiSummaryInfoPersist "MsiSummaryInfoPersist" int
; res = MsiSummaryInfoPersist(hSummaryInfo)
; hSummaryInfo : MSIHANDLE -> "int"
; DWORD MsiSummaryInfoPersist(MSIHANDLE hSummaryInfo)
#uselib "msi.dll"
#cfunc global MsiSummaryInfoPersist "MsiSummaryInfoPersist" int
; res = MsiSummaryInfoPersist(hSummaryInfo)
; hSummaryInfo : MSIHANDLE -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msi = windows.NewLazySystemDLL("msi.dll")
	procMsiSummaryInfoPersist = msi.NewProc("MsiSummaryInfoPersist")
)

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

extern "msi" fn MsiSummaryInfoPersist(
    hSummaryInfo: u32 // MSIHANDLE
) callconv(std.os.windows.WINAPI) u32;
proc MsiSummaryInfoPersist(
    hSummaryInfo: uint32  # MSIHANDLE
): uint32 {.importc: "MsiSummaryInfoPersist", stdcall, dynlib: "msi.dll".}
pragma(lib, "msi");
extern(Windows)
uint MsiSummaryInfoPersist(
    uint hSummaryInfo   // MSIHANDLE
);
ccall((:MsiSummaryInfoPersist, "msi.dll"), stdcall, UInt32,
      (UInt32,),
      hSummaryInfo)
# hSummaryInfo : MSIHANDLE -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t MsiSummaryInfoPersist(
    uint32_t hSummaryInfo);
]]
local msi = ffi.load("msi")
-- msi.MsiSummaryInfoPersist(hSummaryInfo)
-- hSummaryInfo : MSIHANDLE
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('msi.dll');
const MsiSummaryInfoPersist = lib.func('__stdcall', 'MsiSummaryInfoPersist', 'uint32_t', ['uint32_t']);
// MsiSummaryInfoPersist(hSummaryInfo)
// hSummaryInfo : MSIHANDLE -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("msi.dll", {
  MsiSummaryInfoPersist: { parameters: ["u32"], result: "u32" },
});
// lib.symbols.MsiSummaryInfoPersist(hSummaryInfo)
// hSummaryInfo : MSIHANDLE -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t MsiSummaryInfoPersist(
    uint32_t hSummaryInfo);
C, "msi.dll");
// $ffi->MsiSummaryInfoPersist(hSummaryInfo);
// hSummaryInfo : MSIHANDLE
// 構造体/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 Msi extends StdCallLibrary {
    Msi INSTANCE = Native.load("msi", Msi.class);
    int MsiSummaryInfoPersist(
        int hSummaryInfo   // MSIHANDLE
    );
}
@[Link("msi")]
lib Libmsi
  fun MsiSummaryInfoPersist = MsiSummaryInfoPersist(
    hSummaryInfo : UInt32   # MSIHANDLE
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef MsiSummaryInfoPersistNative = Uint32 Function(Uint32);
typedef MsiSummaryInfoPersistDart = int Function(int);
final MsiSummaryInfoPersist = DynamicLibrary.open('msi.dll')
    .lookupFunction<MsiSummaryInfoPersistNative, MsiSummaryInfoPersistDart>('MsiSummaryInfoPersist');
// hSummaryInfo : MSIHANDLE -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function MsiSummaryInfoPersist(
  hSummaryInfo: DWORD   // MSIHANDLE
): DWORD; stdcall;
  external 'msi.dll' name 'MsiSummaryInfoPersist';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "MsiSummaryInfoPersist"
  c_MsiSummaryInfoPersist :: Word32 -> IO Word32
-- hSummaryInfo : MSIHANDLE -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let msisummaryinfopersist =
  foreign "MsiSummaryInfoPersist"
    (uint32_t @-> returning uint32_t)
(* hSummaryInfo : MSIHANDLE -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library msi (t "msi.dll"))
(cffi:use-foreign-library msi)

(cffi:defcfun ("MsiSummaryInfoPersist" msi-summary-info-persist :convention :stdcall) :uint32
  (h-summary-info :uint32))   ; MSIHANDLE
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $MsiSummaryInfoPersist = Win32::API::More->new('msi',
    'DWORD MsiSummaryInfoPersist(DWORD hSummaryInfo)');
# my $ret = $MsiSummaryInfoPersist->Call($hSummaryInfo);
# hSummaryInfo : MSIHANDLE -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。