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

NeedReboot

関数
インストールに再起動が必要かを判定する。
DLLADVPACK.dll呼出規約winapi

シグネチャ

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

BOOL NeedReboot(
    DWORD dwRebootCheck
);

パラメーター

名前方向
dwRebootCheckDWORDin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL NeedReboot(
    DWORD dwRebootCheck
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ADVPACK.dll", ExactSpelling = true)]
static extern bool NeedReboot(
    uint dwRebootCheck   // DWORD
);
<DllImport("ADVPACK.dll", ExactSpelling:=True)>
Public Shared Function NeedReboot(
    dwRebootCheck As UInteger   ' DWORD
) As Boolean
End Function
' dwRebootCheck : DWORD
Declare PtrSafe Function NeedReboot Lib "advpack" ( _
    ByVal dwRebootCheck As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

NeedReboot = ctypes.windll.advpack.NeedReboot
NeedReboot.restype = wintypes.BOOL
NeedReboot.argtypes = [
    wintypes.DWORD,  # dwRebootCheck : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	advpack = windows.NewLazySystemDLL("ADVPACK.dll")
	procNeedReboot = advpack.NewProc("NeedReboot")
)

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