ReactOS  0.4.15-dev-1201-gb2cf5a4
kdx64.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for kdx64.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define UNIMPLEMENTED   KdpDprintf("%s is unimplemented\n", __FUNCTION__)
 

Functions

VOID NTAPI KdpGetStateChange (IN PDBGKD_MANIPULATE_STATE64 State, IN PCONTEXT Context)
 
VOID NTAPI KdpSetContextState (IN PDBGKD_ANY_WAIT_STATE_CHANGE WaitStateChange, IN PCONTEXT Context)
 
NTSTATUS NTAPI KdpSysReadMsr (IN ULONG Msr, OUT PLARGE_INTEGER MsrValue)
 
NTSTATUS NTAPI KdpSysWriteMsr (IN ULONG Msr, IN PLARGE_INTEGER MsrValue)
 
NTSTATUS NTAPI KdpSysReadBusData (IN ULONG BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN ULONG Offset, IN PVOID Buffer, IN ULONG Length, OUT PULONG ActualLength)
 
NTSTATUS NTAPI KdpSysWriteBusData (IN ULONG BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN ULONG Offset, IN PVOID Buffer, IN ULONG Length, OUT PULONG ActualLength)
 
NTSTATUS NTAPI KdpSysReadControlSpace (IN ULONG Processor, IN ULONG64 BaseAddress, IN PVOID Buffer, IN ULONG Length, OUT PULONG ActualLength)
 
NTSTATUS NTAPI KdpSysWriteControlSpace (IN ULONG Processor, IN ULONG64 BaseAddress, IN PVOID Buffer, IN ULONG Length, OUT PULONG ActualLength)
 
NTSTATUS NTAPI KdpSysReadIoSpace (IN ULONG InterfaceType, IN ULONG BusNumber, IN ULONG AddressSpace, IN ULONG64 IoAddress, OUT PVOID DataValue, IN ULONG DataSize, OUT PULONG ActualDataSize)
 
NTSTATUS NTAPI KdpSysWriteIoSpace (IN ULONG InterfaceType, IN ULONG BusNumber, IN ULONG AddressSpace, IN ULONG64 IoAddress, IN PVOID DataValue, IN ULONG DataSize, OUT PULONG ActualDataSize)
 
NTSTATUS NTAPI KdpSysCheckLowMemory (IN ULONG Flags)
 
NTSTATUS NTAPI KdpAllowDisable (VOID)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file kdx64.c.

◆ UNIMPLEMENTED

#define UNIMPLEMENTED   KdpDprintf("%s is unimplemented\n", __FUNCTION__)

Definition at line 16 of file kdx64.c.

Function Documentation

◆ KdpAllowDisable()

NTSTATUS NTAPI KdpAllowDisable ( VOID  )

Definition at line 364 of file kdx64.c.

365 {
367  return STATUS_ACCESS_DENIED;
368 }
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ KdpGetStateChange()

VOID NTAPI KdpGetStateChange ( IN PDBGKD_MANIPULATE_STATE64  State,
IN PCONTEXT  Context 
)

Definition at line 22 of file kdx64.c.

24 {
25  PKPRCB Prcb;
26  ULONG i;
27 
28  /* Check for success */
29  if (NT_SUCCESS(State->u.Continue2.ContinueStatus))
30  {
31  /* Check if we're tracing */
32  if (State->u.Continue2.ControlSet.TraceFlag)
33  {
34  /* Enable TF */
35  Context->EFlags |= EFLAGS_TF;
36  }
37  else
38  {
39  /* Remove it */
40  Context->EFlags &= ~EFLAGS_TF;
41  }
42 
43  /* Loop all processors */
44  for (i = 0; i < KeNumberProcessors; i++)
45  {
46  /* Get the PRCB and update DR7 and DR6 */
47  Prcb = KiProcessorBlock[i];
49  State->u.Continue2.ControlSet.Dr7;
51  }
52 
53  /* Check if we have new symbol information */
54  if (State->u.Continue2.ControlSet.CurrentSymbolStart != 1)
55  {
56  /* Update it */
58  State->u.Continue2.ControlSet.CurrentSymbolStart;
59  KdpCurrentSymbolEnd= State->u.Continue2.ControlSet.CurrentSymbolEnd;
60  }
61  }
62 }
ULONG64 KernelDr7
Definition: ketypes.h:505
KSPECIAL_REGISTERS SpecialRegisters
Definition: ketypes.h:530
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
ULONG_PTR KdpCurrentSymbolEnd
Definition: kddata.c:109
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
KPROCESSOR_STATE ProcessorState
Definition: ketypes.h:579
ULONG_PTR KdpCurrentSymbolStart
Definition: kddata.c:109
#define EFLAGS_TF
Definition: ketypes.h:125
CCHAR KeNumberProcessors
Definition: krnlinit.c:35
PKPRCB KiProcessorBlock[]
Definition: krnlinit.c:32
unsigned int ULONG
Definition: retypes.h:1
ULONG64 KernelDr6
Definition: ketypes.h:504

◆ KdpSetContextState()

VOID NTAPI KdpSetContextState ( IN PDBGKD_ANY_WAIT_STATE_CHANGE  WaitStateChange,
IN PCONTEXT  Context 
)

Definition at line 66 of file kdx64.c.

68 {
69  PKPRCB Prcb = KeGetCurrentPrcb();
70 
71  /* Copy i386 specific debug registers */
72  WaitStateChange->ControlReport.Dr6 = Prcb->ProcessorState.SpecialRegisters.
73  KernelDr6;
74  WaitStateChange->ControlReport.Dr7 = Prcb->ProcessorState.SpecialRegisters.
75  KernelDr7;
76 
77  /* Copy i386 specific segments */
78  WaitStateChange->ControlReport.SegCs = (USHORT)Context->SegCs;
79  WaitStateChange->ControlReport.SegDs = (USHORT)Context->SegDs;
80  WaitStateChange->ControlReport.SegEs = (USHORT)Context->SegEs;
81  WaitStateChange->ControlReport.SegFs = (USHORT)Context->SegFs;
82 
83  /* Copy EFlags */
84  WaitStateChange->ControlReport.EFlags = Context->EFlags;
85 
86  /* Set Report Flags */
87  WaitStateChange->ControlReport.ReportFlags = REPORT_INCLUDES_SEGS;
88  if (WaitStateChange->ControlReport.SegCs == KGDT64_R0_CODE)
89  {
90  WaitStateChange->ControlReport.ReportFlags |= REPORT_STANDARD_CS;
91  }
92 }
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1063
KSPECIAL_REGISTERS SpecialRegisters
Definition: ketypes.h:530
#define REPORT_STANDARD_CS
Definition: windbgkd.h:148
#define KGDT64_R0_CODE
Definition: ketypes.h:72
KPROCESSOR_STATE ProcessorState
Definition: ketypes.h:579
#define REPORT_INCLUDES_SEGS
Definition: windbgkd.h:147
unsigned short USHORT
Definition: pedump.c:61

◆ KdpSysCheckLowMemory()

NTSTATUS NTAPI KdpSysCheckLowMemory ( IN ULONG  Flags)

Definition at line 356 of file kdx64.c.

357 {
359  return STATUS_UNSUCCESSFUL;
360 }
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ KdpSysReadBusData()

NTSTATUS NTAPI KdpSysReadBusData ( IN ULONG  BusDataType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN ULONG  Offset,
IN PVOID  Buffer,
IN ULONG  Length,
OUT PULONG  ActualLength 
)

Definition at line 134 of file kdx64.c.

141 {
143  return STATUS_UNSUCCESSFUL;
144 }
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ KdpSysReadControlSpace()

NTSTATUS NTAPI KdpSysReadControlSpace ( IN ULONG  Processor,
IN ULONG64  BaseAddress,
IN PVOID  Buffer,
IN ULONG  Length,
OUT PULONG  ActualLength 
)

Definition at line 162 of file kdx64.c.

167 {
168  PVOID ControlStart;
170  PKIPCR Pcr = CONTAINING_RECORD(Prcb, KIPCR, Prcb);
171 
172  switch (BaseAddress)
173  {
175  /* Copy a pointer to the Pcr */
176  ControlStart = &Pcr;
177  *ActualLength = sizeof(PVOID);
178  break;
179 
181  /* Copy a pointer to the Prcb */
182  ControlStart = &Prcb;
183  *ActualLength = sizeof(PVOID);
184  break;
185 
187  /* Copy SpecialRegisters */
188  ControlStart = &Prcb->ProcessorState.SpecialRegisters;
189  *ActualLength = sizeof(KSPECIAL_REGISTERS);
190  break;
191 
193  /* Copy a pointer to the current Thread */
194  ControlStart = &Prcb->CurrentThread;
195  *ActualLength = sizeof(PVOID);
196  break;
197 
198  default:
199  *ActualLength = 0;
200  ASSERT(FALSE);
201  return STATUS_UNSUCCESSFUL;
202  }
203 
204  /* Copy the memory */
205  RtlCopyMemory(Buffer, ControlStart, min(Length, *ActualLength));
206 
207  /* Finish up */
208  return STATUS_SUCCESS;
209 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define AMD64_DEBUG_CONTROL_SPACE_KPCR
Definition: windbgkd.h:203
_In_ UCHAR Processor
Definition: kefuncs.h:682
KSPECIAL_REGISTERS SpecialRegisters
Definition: ketypes.h:530
#define AMD64_DEBUG_CONTROL_SPACE_KTHREAD
Definition: windbgkd.h:206
#define FALSE
Definition: types.h:117
struct _KTHREAD * CurrentThread
Definition: ketypes.h:566
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
KPROCESSOR_STATE ProcessorState
Definition: ketypes.h:579
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
struct _KSPECIAL_REGISTERS KSPECIAL_REGISTERS
PKPRCB KiProcessorBlock[]
Definition: krnlinit.c:32
#define min(a, b)
Definition: monoChain.cc:55
#define AMD64_DEBUG_CONTROL_SPACE_KSPECIAL
Definition: windbgkd.h:205
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define AMD64_DEBUG_CONTROL_SPACE_KPRCB
Definition: windbgkd.h:204

◆ KdpSysReadIoSpace()

NTSTATUS NTAPI KdpSysReadIoSpace ( IN ULONG  InterfaceType,
IN ULONG  BusNumber,
IN ULONG  AddressSpace,
IN ULONG64  IoAddress,
OUT PVOID  DataValue,
IN ULONG  DataSize,
OUT PULONG  ActualDataSize 
)

Definition at line 244 of file kdx64.c.

251 {
252  /* Verify parameters */
253  if (InterfaceType != Isa || BusNumber != 0 || AddressSpace != 1)
254  {
255  /* No data was read */
256  *ActualDataSize = 0;
258  }
259 
260  /* Check for correct alignment */
261  if ((IoAddress & (DataSize - 1)))
262  {
263  /* Invalid alignment */
264  *ActualDataSize = 0;
266  }
267 
268  switch (DataSize)
269  {
270  case sizeof(UCHAR):
271  /* Read one UCHAR */
272  *(PUCHAR)DataValue = READ_PORT_UCHAR((PUCHAR)IoAddress);
273  break;
274 
275  case sizeof(USHORT):
276  /* Read one USHORT */
277  *(PUSHORT)DataValue = READ_PORT_USHORT((PUSHORT)IoAddress);
278  break;
279 
280  case sizeof(ULONG):
281  /* Read one ULONG */
282  *(PULONG)DataValue = READ_PORT_ULONG((PULONG)IoAddress);
283  break;
284 
285  default:
286  /* Invalid data size */
287  *ActualDataSize = 0;
289  }
290 
291  /* Return the size of the data */
292  *ActualDataSize = DataSize;
293 
294  /* Success! */
295  return STATUS_SUCCESS;
296 }
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:21
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG NTAPI READ_PORT_ULONG(IN PULONG Port)
Definition: portio.c:70
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
unsigned char UCHAR
Definition: xmlstorage.h:181
_In_ CDROM_DEVICE_INTERFACES InterfaceType
Definition: cdrom.h:1140
unsigned short USHORT
Definition: pedump.c:61
unsigned int * PULONG
Definition: retypes.h:1
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:183
unsigned int ULONG
Definition: retypes.h:1
USHORT NTAPI READ_PORT_USHORT(IN PUSHORT Port)
Definition: portio.c:63
return STATUS_SUCCESS
Definition: btrfs.c:3014
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
unsigned short * PUSHORT
Definition: retypes.h:2

◆ KdpSysReadMsr()

NTSTATUS NTAPI KdpSysReadMsr ( IN ULONG  Msr,
OUT PLARGE_INTEGER  MsrValue 
)

Definition at line 96 of file kdx64.c.

98 {
99  /* Use SEH to protect from invalid MSRs */
100  _SEH2_TRY
101  {
102  MsrValue->QuadPart = __readmsr(Msr);
103  }
105  {
107  }
108  _SEH2_END;
109 
110  return STATUS_SUCCESS;
111 }
_SEH2_TRY
Definition: create.c:4226
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
PPC_QUAL unsigned long long __readmsr()
Definition: intrin_ppc.h:741
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
_SEH2_END
Definition: create.c:4400
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
return STATUS_SUCCESS
Definition: btrfs.c:3014

◆ KdpSysWriteBusData()

NTSTATUS NTAPI KdpSysWriteBusData ( IN ULONG  BusDataType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN ULONG  Offset,
IN PVOID  Buffer,
IN ULONG  Length,
OUT PULONG  ActualLength 
)

Definition at line 148 of file kdx64.c.

155 {
157  return STATUS_UNSUCCESSFUL;
158 }
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ KdpSysWriteControlSpace()

NTSTATUS NTAPI KdpSysWriteControlSpace ( IN ULONG  Processor,
IN ULONG64  BaseAddress,
IN PVOID  Buffer,
IN ULONG  Length,
OUT PULONG  ActualLength 
)

Definition at line 213 of file kdx64.c.

218 {
219  PVOID ControlStart;
221 
222  switch (BaseAddress)
223  {
225  /* Copy SpecialRegisters */
226  ControlStart = &Prcb->ProcessorState.SpecialRegisters;
227  *ActualLength = sizeof(KSPECIAL_REGISTERS);
228  break;
229 
230  default:
231  *ActualLength = 0;
232  ASSERT(FALSE);
233  return STATUS_UNSUCCESSFUL;
234  }
235 
236  /* Copy the memory */
237  RtlCopyMemory(ControlStart, Buffer, min(Length, *ActualLength));
238 
239  return STATUS_SUCCESS;
240 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_In_ UCHAR Processor
Definition: kefuncs.h:682
KSPECIAL_REGISTERS SpecialRegisters
Definition: ketypes.h:530
#define FALSE
Definition: types.h:117
Definition: bufpool.h:45
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
KPROCESSOR_STATE ProcessorState
Definition: ketypes.h:579
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
struct _KSPECIAL_REGISTERS KSPECIAL_REGISTERS
PKPRCB KiProcessorBlock[]
Definition: krnlinit.c:32
#define min(a, b)
Definition: monoChain.cc:55
#define AMD64_DEBUG_CONTROL_SPACE_KSPECIAL
Definition: windbgkd.h:205
return STATUS_SUCCESS
Definition: btrfs.c:3014

◆ KdpSysWriteIoSpace()

NTSTATUS NTAPI KdpSysWriteIoSpace ( IN ULONG  InterfaceType,
IN ULONG  BusNumber,
IN ULONG  AddressSpace,
IN ULONG64  IoAddress,
IN PVOID  DataValue,
IN ULONG  DataSize,
OUT PULONG  ActualDataSize 
)

Definition at line 300 of file kdx64.c.

307 {
308  /* Verify parameters */
309  if (InterfaceType != Isa || BusNumber != 0 || AddressSpace != 1)
310  {
311  /* No data was written */
312  *ActualDataSize = 0;
314  }
315 
316  /* Check for correct alignment */
317  if ((IoAddress & (DataSize - 1)))
318  {
319  /* Invalid alignment */
320  *ActualDataSize = 0;
322  }
323 
324  switch (DataSize)
325  {
326  case sizeof(UCHAR):
327  /* Write one UCHAR */
328  WRITE_PORT_UCHAR((PUCHAR)IoAddress, *(PUCHAR)DataValue);
329  break;
330 
331  case sizeof(USHORT):
332  /* Write one USHORT */
333  WRITE_PORT_USHORT((PUSHORT)IoAddress, *(PUSHORT)DataValue);
334  break;
335 
336  case sizeof(ULONG):
337  /* Write one ULONG */
338  WRITE_PORT_ULONG((PULONG)IoAddress, *(PULONG)DataValue);
339  break;
340 
341  default:
342  /* Invalid data size */
343  *ActualDataSize = 0;
345  }
346 
347  /* Return the size of the data */
348  *ActualDataSize = DataSize;
349 
350  /* Success! */
351  return STATUS_SUCCESS;
352 }
VOID NTAPI WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value)
Definition: portio.c:115
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
unsigned char * PUCHAR
Definition: retypes.h:3
VOID NTAPI WRITE_PORT_ULONG(IN PULONG Port, IN ULONG Value)
Definition: portio.c:123
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
unsigned char UCHAR
Definition: xmlstorage.h:181
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:20
_In_ CDROM_DEVICE_INTERFACES InterfaceType
Definition: cdrom.h:1140
unsigned short USHORT
Definition: pedump.c:61
unsigned int * PULONG
Definition: retypes.h:1
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:183
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:3014
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
unsigned short * PUSHORT
Definition: retypes.h:2

◆ KdpSysWriteMsr()

NTSTATUS NTAPI KdpSysWriteMsr ( IN ULONG  Msr,
IN PLARGE_INTEGER  MsrValue 
)

Definition at line 115 of file kdx64.c.

117 {
118  /* Use SEH to protect from invalid MSRs */
119  _SEH2_TRY
120  {
121  __writemsr(Msr, MsrValue->QuadPart);
122  }
124  {
126  }
127  _SEH2_END;
128 
129  return STATUS_SUCCESS;
130 }
_SEH2_TRY
Definition: create.c:4226
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
PPC_QUAL void __writemsr(const unsigned long Value)
Definition: intrin_ppc.h:748
_SEH2_END
Definition: create.c:4400
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
return STATUS_SUCCESS
Definition: btrfs.c:3014