KdChangeOption function (wdm.h)

The KdChangeOption routine accesses and changes state in the kernel that is related to kernel debugging.

Syntax

NTSTATUS KdChangeOption(
  [in]            KD_OPTION Option,
  [in, optional]  ULONG     InBufferBytes,
  [in]            PVOID     InBuffer,
  [in, optional]  ULONG     OutBufferBytes,
  [out]           PVOID     OutBuffer,
  [out, optional] PULONG    OutBufferNeeded
);

Parameters

[in] Option

A value from the KD_OPTION enumeration that indicates the kernel state to access and change. The value of this parameter determines the format and required length of the InBuffer and OutBuffer. Currently, the only valid value is KD_OPTION_SET_BLOCK_ENABLE.

[in, optional] InBufferBytes

The size, in bytes, of the buffer at InBuffer. This value is optional.

[in] InBuffer

A pointer to a caller-allocated input buffer that contains information about the kernel state to change. If Option specifies a kernel state that does not require input data, this pointer can be NULL.

[in, optional] OutBufferBytes

The size, in bytes, of the buffer at OutBuffer. This value is optional.

[out] OutBuffer

A pointer to a caller-allocated output buffer in which information that pertains to the kernel state is returned. If Option specifies a kernel state that does not produce output data, this pointer can be NULL.

[out, optional] OutBufferNeeded

Return value

KdChangeOption returns STATUS_SUCCESS if it successfully carried out the requested operation. Otherwise, the return value can be one of the following error status codes:

STATUS_ACCESS_DENIED

STATUS_INVALID_INFO_CLASS

STATUS_INVALID_PARAMETER

STATUS_DEBUGGER_INACTIVE

Remarks

If the operating system was booted with no debug controls, KdChangeOption returns STATUS_DEBUGGER_INACTIVE.

Currently, the only valid value for the Option parameter is KD_OPTION_SET_BLOCK_ENABLE. If Option is set to any other value, KdChangeOption returns STATUS_INVALID_INFO_CLASS. When Option is KD_OPTION_SET_BLOCK_ENABLE, the caller must set the InBufferBytes parameter to sizeof(BOOLEAN), the OutBufferBytes parameter to zero, and the OutBuffer parameter to NULL; otherwise, KdChangeOption returns STATUS_INVALID_PARAMETER. If the high bit (0x80) in the KdBlockEnable system variable is set to one, the debugger can never be re-enabled, and KdChangeOption returns STATUS_ACCESS_DENIED. Otherwise, KdChangeOption sets the KdBlockEnable system variable to the BOOLEAN value that InBuffer points to.

Requirements

Requirement Value
Minimum supported client Available in Microsoft Windows Server 2003 with Service Pack 1 (SP1) and later versions of Windows and Windows Server.
Target Platform Universal
Header wdm.h (include Wdm.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL Any level