|
|
1.1 root 1: #ifndef _GIVIT_
2: #define _GIVIT_
3:
4: #include <windows.h>
5: #include <windbgkd.h>
6:
7: #include <stdio.h>
8: #include <memory.h>
9: #include <malloc.h>
10: #include <stdlib.h>
11: #include <assert.h>
12: #include <string.h>
13: #include <io.h>
14: #include <fcntl.h>
15:
16:
17: #define ERROR_INTERRUPTED 95
18: #define ERROR_TIMEOUT 640
19: #define HLDSIG_ENABLE 0
20: #define HLDSIG_DISABLE 1
21:
22: UCHAR DbgKdpPacketLeader[4];
23: HANDLE ConsoleInputHandle;
24: HANDLE ConsoleOutputHandle;
25:
26: UCHAR DbgKdpPacket[];
27: KD_PACKET PacketHeader;
28: UCHAR chLastCommand[256]; // last command executed
29:
30: VOID
31: DbgKdpWritePacket(
32: IN PVOID PacketData,
33: IN USHORT PacketDataLength,
34: IN USHORT PacketType,
35: IN PVOID MorePacketData OPTIONAL,
36: IN USHORT MorePacketDataLength OPTIONAL
37: );
38:
39: BOOLEAN
40: DbgKdpWaitForPacket(
41: IN USHORT PacketType,
42: OUT PVOID Packet
43: );
44:
45: VOID
46: DbgKdpHandlePromptString(
47: IN PDBGKD_DEBUG_IO IoMessage
48: );
49:
50: VOID
51: DbgKdpPrint(
52: IN USHORT Processor,
53: IN PUCHAR String,
54: IN USHORT StringLength
55: );
56:
57: //
58: // Global Data
59: //
60: HANDLE DbgKdpComPort;
61:
62: //
63: // This overlapped structure will be used for all serial read
64: // operations. We only need one structure since the code is
65: // designed so that no more than one serial read operation is
66: // outstanding at any one time.
67: //
68: OVERLAPPED ReadOverlapped;
69:
70: //
71: // This overlapped structure will be used for all serial write
72: // operations. We only need one structure since the code is
73: // designed so that no more than one serial write operation is
74: // outstanding at any one time.
75: //
76: OVERLAPPED WriteOverlapped;
77:
78: //
79: // APIs
80: //
81:
82: VOID
83: DbgKdpStartThreads(VOID);
84:
85: VOID
86: DbgKdpKbdPollThread(VOID);
87:
88: BOOL
89: DbgKdpGetConsoleByte(
90: PVOID pBuf,
91: DWORD cbBuf,
92: LPDWORD pcbBytesRead
93: );
94:
95: VOID
96: DbgKdpInitComPort(
97: IN ULONG ComPort
98: );
99:
100: VOID
101: DbgKdpAsyncControl(
102: IN OUT PVOID Data,
103: IN OUT PVOID Parm,
104: IN USHORT Function
105: );
106:
107: #endif // _DBGNT_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.