Debugging Tools for Windows

Ioctl

The Ioctl function performs a variety of different operations. Much of its functionality mirrors the functionality of other functions in wdbgexts.h.

ULONG 
  Ioctl (
    USHORT IoctlType,
    PVOID lpvData,
    ULONG cbSizeOfContext
    );

Parameters

IoctlType
Specifies which Ioctl operation to perform. For a list of possible IoctlType values, see the Comments section.
lpvData
Points to the address of a data structure. The type of structure that is required depends on the value of IoctlType.
cbSizeOfContext
Specifies the size of the structure that lpvData points to.

Return Value

The meaning of return value depends on IoctlType. See the page for the corresponding Ioctl operation for the meaning of the return value.

Comments

The Ioctl function is the entry point for many of the functionalities supplied for WdbgExts extensions. Many of the other functions in wdbgexts.h are simply wrappers for calls to Ioctl.

The following table lists the possible IoctlType values. If the IoctlType corresponds to another function, that function is provided; otherwise, a link to the page describing the Ioctl operation is provided.

IoctlType constant Equivalent function
IG_KD_CONTEXT GetKdContext
IG_READ_CONTROL_SPACE ReadControlSpace

ReadControlSpace64

IG_WRITE_CONTROL_SPACE WriteControlSpace
IG_READ_IO_SPACE ReadIoSpace

ReadIoSpace64

IG_WRITE_IO_SPACE WriteIoSpace

WriteIoSpace64

IG_READ_PHYSICAL ReadPhysical
IG_WRITE_PHYSICAL WritePhysical
IG_READ_IO_SPACE_EX ReadIoSpaceEx

ReadIoSpaceEx64

IG_WRITE_IO_SPACE_EX WriteIoSpaceEx

WriteIoSpaceEx64

IG_SET_THREAD SetThreadForOperation

SetThreadForOperation64

IG_READ_MSR ReadMsr
IG_WRITE_MSR WriteMsr
IG_GET_DEBUGGER_DATA GetDebuggerData
IG_GET_KERNEL_VERSION
IG_RELOAD_SYMBOLS ReloadSymbols
IG_GET_SET_SYMPATH GetSetSympath
IG_GET_EXCEPTION_RECORD
IG_IS_PTR64 IsPtr64
IG_GET_BUS_DATA
IG_SET_BUS_DATA
IG_DUMP_SYMBOL_INFO
IG_LOWMEM_CHECK
IG_SEARCH_MEMORY SearchMemory
IG_GET_CURRENT_THREAD GetCurrentThreadAddr
IG_GET_CURRENT_PROCESS GetCurrentProcessAddr
IG_GET_TYPE_SIZE GetTypeSize
IG_GET_CURRENT_PROCESS_HANDLE GetCurrentProcessHandle
IG_GET_INPUT_LINE GetInputLine
IG_GET_EXPRESSION_EX GetExpressionEx
IG_TRANSLATE_VIRTUAL_TO_PHYSICAL TranslateVirtualToPhysical
IG_GET_CACHE_SIZE GetDebuggerCacheSize
IG_READ_PHYSICAL_WITH_FLAGS ReadPhysicalWithFlags
IG_WRITE_PHYSICAL_WITH_FLAGS WritePhysicalWithFlags
IG_POINTER_SEARCH_PHYSICAL
IG_GET_THREAD_OS_INFO
IG_GET_CLR_DATA_INTERFACE
IG_GET_TEB_ADDRESS GetTebAddress
IG_GET_PEB_ADDRESS GetPebAddress

Requirements

Headers: Defined in wdbgexts.h. If you are writing a WdbgExts extension, include wdbgexts.h. If you are writing a DbgEng extension that calls this function, include wdbgexts.h before dbgeng.h (see Writing DbgEng Extension Code for details).

Build machine: CAPEBUILD