140{
142 WCHAR DeviceNameBuffer[32];
144 WCHAR LinkNameBuffer[32];
146 WCHAR ComPortBuffer[32];
160
162
164
166 {
167 WARN_(SERIAL,
"No allocated resources sent to driver\n");
169 }
171 {
172 WARN_(SERIAL,
"Wrong number of allocated resources sent to driver\n");
174 }
175 if (
ResourceList->List[0].PartialResourceList.Version != 1
176 ||
ResourceList->List[0].PartialResourceList.Revision != 1
177 || ResourceListTranslated->List[0].PartialResourceList.Version != 1
178 || ResourceListTranslated->List[0].PartialResourceList.Revision != 1)
179 {
180 WARN_(SERIAL,
"Revision mismatch: %u.%u != 1.1 or %u.%u != 1.1\n",
183 ResourceListTranslated->List[0].PartialResourceList.Version,
184 ResourceListTranslated->List[0].PartialResourceList.Revision);
186 }
187
190 Dirql = 0;
192 {
195 switch (PartialDescriptor->
Type)
196 {
198 if (PartialDescriptor->
u.
Port.Length < 7)
203 break;
210 else
213 break;
214 }
215 }
216 INFO_(SERIAL,
"New COM port. Base = 0x%lx, Irql = %u\n",
220 if (!Dirql)
223
224
225 INFO_(SERIAL,
"Comparing addresses: KdComPortInUse: %p, ComPortBase: %p\n",
KdComPortInUse, ComPortBase);
227 {
228 INFO_(SERIAL,
"Failing IRP_MN_START_DEVICE as this serial port is used for debugging\n");
230 }
231
234
235
239
240
243 {
244 WARN_(SERIAL,
"SerialSetBaudRate() failed with status 0x%08x\n",
Status);
246 }
247
248
254 {
255 WARN_(SERIAL,
"SerialSetLineControl() failed with status 0x%08x\n",
Status);
257 }
258
259
261 {
262
265 }
266
267
269 swprintf(LinkNameBuffer,
L"\\DosDevices\\COM%lu", DeviceExtension->
ComPort);
276 {
277 WARN_(SERIAL,
"IoCreateSymbolicLink() failed with status 0x%08x\n",
Status);
279 }
280
281
289 {
290 WARN_(SERIAL,
"IoConnectInterrupt() failed with status 0x%08x\n",
Status);
294 }
295
296
297
302 {
303
306 }
307
309
310
314
315
318
319
321
322
324}
UART_TYPE SerialDetectUartType(IN PUCHAR BaseAddress)
#define SR_IER_LSR_CHANGE
#define SR_FCR_CLEAR_RCVR
#define SR_FCR_CLEAR_XMIT
#define SR_IER_DATA_RECEIVED
KSERVICE_ROUTINE SerialInterruptService
#define SR_IER_MSR_CHANGE
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
#define CmResourceTypePort
#define CmResourceTypeInterrupt
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
#define InitializeObjectAttributes(p, n, a, r, s)
#define CM_RESOURCE_INTERRUPT_LATCHED
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define REG_OPTION_VOLATILE
NTSTATUS NTAPI IoSetDeviceInterfaceState(IN PUNICODE_STRING SymbolicLinkName, IN BOOLEAN Enable)
NTSTATUS NTAPI IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject, IN PKSERVICE_ROUTINE ServiceRoutine, IN PVOID ServiceContext, IN PKSPIN_LOCK SpinLock, IN ULONG Vector, IN KIRQL Irql, IN KIRQL SynchronizeIrql, IN KINTERRUPT_MODE InterruptMode, IN BOOLEAN ShareVector, IN KAFFINITY ProcessorEnableMask, IN BOOLEAN FloatingSave)
NTSTATUS NTAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
NTSTATUS NTAPI IoDeleteSymbolicLink(IN PUNICODE_STRING SymbolicLinkName)
#define STATUS_REVISION_MISMATCH
#define READ_PORT_UCHAR(p)
#define WRITE_PORT_UCHAR(p, d)
enum _KINTERRUPT_MODE KINTERRUPT_MODE
NTSTATUS NTAPI SerialSetBaudRate(IN PSERIAL_DEVICE_EXTENSION DeviceExtension, IN ULONG NewBaudRate)
NTSTATUS NTAPI SerialSetLineControl(IN PSERIAL_DEVICE_EXTENSION DeviceExtension, IN PSERIAL_LINE_CONTROL NewSettings)
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@393 Port
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@394 Interrupt
SERIAL_LINE_CONTROL SerialLineControl
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE InterruptMode