Partager via


OEMKDIoControl

This function is implemented by the OEM to support requests from the kernel debugger.

BOOL OEMKDIoControl(
  DWORD dwIoControlCode, 
  LPVOID lpBuf, 
  DWORD nBufSize 
);

Parameters

  • dwIoControlCode
    [in] Specifies the function requested by the kernel debugger. This parameter can be set to one of the values listed in the following table.
    Value Description
    KD_IOCTL_SET_CBP Sets a code breakpoint. The ulAddress member of the KD_BPINFO structure is set to the address to write the breakpoint. The OEM sets the ulHandle member to the handle of the breakpoint.
    KD_IOCTL_CLEAR_CBP Clears a code breakpoint. The OEM sets the ulHandle member of KD_BPINFO to the handle of the breakpoint to be cleared.
    KD_IOCTL_QUERY_CBP Queries the number of code breakpoints available. The OEM sets the ulCount member of KD_BPINFO to the number of code breakpoints available.
    KD_IOCTL_ENUM_CBP Enumerates the code breakpoints that are set. The ulCount member of KD_BPINFO is incremented from 0 to n, where n is the number of available breakpoints.
    KD_IOCTL_SET_DBP Sets a data breakpoint. The ulAddress member of KD_BPINFO is set to the address to write the breakpoint. The OEM sets the ulHandle member of KD_BPINFO to the handle of the breakpoint.
    KD_IOCTL_CLEAR_DBP Clears a data breakpoint. The OEM sets the ulHandle member of KD_BPINFO to the handle of the breakpoint to be cleared.
    KD_IOCTL_QUERY_DBP Queries the number of data breakpoints available. The OEM sets the ulCount parameter to the number of code breakpoints available.
    KD_IOCTL_ENUM_DBP Enumerates the data breakpoints that are set. The ulCount parameter is incremented from 0 to n, where n is the number of available breakpoints.
    KD_IOCTL_REBOOT Enables the kernel debugger to request a reboot when it is in a break condition.
  • lpBuf
    [out] Pointer to a buffer that allocates space for a KD_BPINFO structure.
  • nBufSize
    [in] Size of the buffer pointed to by lpInBuf. This is set to the size of the KD_BPINFO structure.

Return Values

If this function succeeds, it returns TRUE. If this function fails, it returns FALSE.

Remarks

This is a restrictive form of the KernelIoControl routine. The context in which the kernel debugger calls this function requires that the OEM operates on the hardware only and does not perform system calls. The kernel debugger exports a function pointer called pKDIoControl. The OEM must assign the address of the function that handles the IOCTL to this pointer. The assignment must occur immediately when OEMInit is called.

The OEMKDIoControl function is not exposed to any application. The functionality is currently restricted to the kernel debugger. The following code example shows OEMKDIoControl in the SHx platform code.

extern pKDIoControl;

BOOL OEMKDIoControl(
DWORD dwIoControlCode, 
LPVOID lpBuf, 
DWORD nBufSize,
)
switch ( dwIoControlCode ) {
case KD_IOCTL_SET_CBP:
case KD_IOCTL_CLEAR_CBP:
case KD_IOCTL_QUERY_CBP:
case KD_IOCTL_ENUM_CBP:
case KD_IOCTL_SET_DBP:
case KD_IOCTL_CLEAR_DBP:
case KD_IOCTL_QUERY_DBP:
case KD_IOCTL_ENUM_DBP:
{
PKD_BPINFO *pbp = (PKD_BPINFO)lpBuf;
}
default:
return(FALSE);
}
}

void OEMinit()
{
...
pKDIoControl = OEMKDIoControl;
}

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Pkfuncs.h.
Link Library: Nk.lib.

See Also

KernelIoControl | OEMInit | KD_BPINFO

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.