HyperDbg Debugger
Loading...
Searching...
No Matches
win11sdk.h File Reference

Go to the source code of this file.

Functions

 __declspec (dllexport) void HviGetDebugDeviceOptions()
 
void HviGetDebugDeviceOptions ()
 
void HviGetHypervisorFeatures ()
 
void HviIsHypervisorVendorMicrosoft ()
 
BOOLEAN UsifInitializePort (_In_opt_ _Null_terminated_ PCHAR LoadOptions, _Inout_ PCPPORT Port, BOOLEAN MemoryMapped, UCHAR AccessSize, UCHAR BitWidth)
 
BOOLEAN UsifSetBaud (_Inout_ PCPPORT Port, ULONG Rate)
 
UART_STATUS UsifGetByte (_Inout_ PCPPORT Port, _Out_ PUCHAR Byte)
 
UART_STATUS UsifPutByte (_Inout_ PCPPORT Port, UCHAR Byte, BOOLEAN BusyWait)
 
BOOLEAN UsifRxReady (_Inout_ PCPPORT Port)
 

Function Documentation

◆ __declspec()

__declspec ( dllexport )
17{
18 UNREFERENCED_PARAMETER(RegistryPath);
19 return STATUS_SUCCESS;
20}

◆ HviGetDebugDeviceOptions()

void HviGetDebugDeviceOptions ( )
inline
9{
10 return;
11}

◆ HviGetHypervisorFeatures()

void HviGetHypervisorFeatures ( )
inline
14{
15 return;
16}

◆ HviIsHypervisorVendorMicrosoft()

void HviIsHypervisorVendorMicrosoft ( )
inline
19{
20 return;
21}

◆ UsifGetByte()

UART_STATUS UsifGetByte ( _Inout_ PCPPORT Port,
_Out_ PUCHAR Byte )
138{
139 ULONG Stat;
140 ULONG Value;
141
142 *Byte = 0;
143
144 if ((Port == NULL) || (Port->Address == NULL))
145 {
146 return UartNotReady;
147 }
148
149 //
150 // Get FIFO status.
151 //
152
153 Stat = READ_REGISTER_ULONG((PULONG)(Port->Address + USIF_FIFO_STAT));
154
155 //
156 // Is at least one character available?
157 //
158
159 if ((Stat & USIF_FIFO_STAT_RXFFS) != 0)
160 {
161 //
162 // Fetch the data byte.
163 //
164
165 Value = READ_REGISTER_ULONG((PULONG)(Port->Address + USIF_RXD));
166 *Byte = Value & (UCHAR)0xFF;
167 return UartSuccess;
168 }
169
170 return UartNoData;
171}
unsigned char UCHAR
Definition BasicTypes.h:35
unsigned long ULONG
Definition BasicTypes.h:37
RequestedActionOfThePacket Value(0x1) 00000000
#define READ_REGISTER_ULONG
Definition uartp.h:41
#define USIF_RXD
Definition usif.c:25
#define USIF_FIFO_STAT_RXFFS
Definition usif.c:23
#define USIF_FIFO_STAT
Definition usif.c:21

◆ UsifInitializePort()

BOOLEAN UsifInitializePort ( _In_opt_ _Null_terminated_ PCHAR LoadOptions,
_Inout_ PCPPORT Port,
BOOLEAN MemoryMapped,
UCHAR AccessSize,
UCHAR BitWidth )
64{
65 UNREFERENCED_PARAMETER(LoadOptions);
66 UNREFERENCED_PARAMETER(AccessSize);
67 UNREFERENCED_PARAMETER(BitWidth);
68
69 if (MemoryMapped == FALSE)
70 {
71 return FALSE;
72 }
73
74 Port->Flags = 0;
75 return TRUE;
76}
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54

◆ UsifPutByte()

UART_STATUS UsifPutByte ( _Inout_ PCPPORT Port,
UCHAR Byte,
BOOLEAN BusyWait )
200{
201 if ((Port == NULL) || (Port->Address == NULL))
202 {
203 return UartNotReady;
204 }
205
206 //
207 // Wait for port to be free and FIFO not full.
208 //
209
210 if (BusyWait != FALSE)
211 {
212 while (READ_REGISTER_ULONG((PULONG)(Port->Address + USIF_FIFO_STAT)) &
214 ;
215 }
216 else if (READ_REGISTER_ULONG((PULONG)(Port->Address + USIF_FIFO_STAT)) &
218 {
219 return UartNotReady;
220 }
221
222 //
223 // Send the byte.
224 //
225
226 WRITE_REGISTER_ULONG((PULONG)(Port->Address + USIF_TXD), (ULONG)Byte);
227 return UartSuccess;
228}
#define WRITE_REGISTER_ULONG
Definition uartp.h:42
#define USIF_FIFO_STAT_TXFFS
Definition usif.c:22
#define USIF_TXD
Definition usif.c:24

◆ UsifRxReady()

BOOLEAN UsifRxReady ( _Inout_ PCPPORT Port)
250{
251 ULONG Stat;
252
253 if ((Port == NULL) || (Port->Address == NULL))
254 {
255 return FALSE;
256 }
257
258 //
259 // Read the STAT Register to determine if there is any pending
260 // data to read.
261 //
262
263 Stat = READ_REGISTER_ULONG((PULONG)(Port->Address + USIF_FIFO_STAT));
264 if ((Stat & USIF_FIFO_STAT_RXFFS) != 0)
265 {
266 return TRUE;
267 }
268
269 return FALSE;
270}

◆ UsifSetBaud()

BOOLEAN UsifSetBaud ( _Inout_ PCPPORT Port,
ULONG Rate )
101{
102 if ((Port == NULL) || (Port->Address == NULL))
103 {
104 return FALSE;
105 }
106
107 //
108 // Remember the baud rate.
109 //
110
111 Port->BaudRate = Rate;
112 return TRUE;
113}