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

NotifyBootConfigStatus

関数
起動構成が受理可能かどうかをシステムに通知する。
DLLADVAPI32.dll呼出規約winapiSetLastErrorあり対応OSWindows XP 以降

シグネチャ

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

BOOL NotifyBootConfigStatus(
    BOOL BootAcceptable
);

パラメーター

名前方向
BootAcceptableBOOLin

戻り値の型: BOOL

各言語での呼び出し定義

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

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

NotifyBootConfigStatus = ctypes.windll.advapi32.NotifyBootConfigStatus
NotifyBootConfigStatus.restype = wintypes.BOOL
NotifyBootConfigStatus.argtypes = [
    wintypes.BOOL,  # BootAcceptable : BOOL
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

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

var (
	advapi32 = windows.NewLazySystemDLL("ADVAPI32.dll")
	procNotifyBootConfigStatus = advapi32.NewProc("NotifyBootConfigStatus")
)

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