ReactOS 0.4.17-dev-1321-g5c122a9
main.c File Reference
#include "ndissys.h"
Include dependency graph for main.c:

Go to the source code of this file.

Functions

static VOID NdisReadRegistryEntries (VOID)
 
VOID NTAPI MainUnload (PDRIVER_OBJECT DriverObject)
 
NTSTATUS NTAPI DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
 
VOID _cdecl NdisWriteErrorLogEntry (IN NDIS_HANDLE NdisAdapterHandle, IN NDIS_ERROR_CODE ErrorCode, IN ULONG NumberOfErrorValues,...)
 
NDIS_STATUS EXPORT NdisWriteEventLogEntry (IN PVOID LogHandle, IN NDIS_STATUS EventCode, IN ULONG UniqueEventValue, IN USHORT NumStrings, IN PVOID StringsList OPTIONAL, IN ULONG DataSize, IN PVOID Data OPTIONAL)
 

Variables

LONG CancelId
 
ULONG NdisEnableTxRxFlowControl
 

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( PDRIVER_OBJECT  DriverObject,
PUNICODE_STRING  RegistryPath 
)

Definition at line 80 of file main.c.

91{
92 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
93
96
99
102
103 DriverObject->DriverUnload = MainUnload;
104
105 CancelId = 0;
106
108
109 return STATUS_SUCCESS;
110}
#define MAX_TRACE
Definition: debug.h:16
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
LIST_ENTRY AdapterListHead
Definition: miniport.c:57
LIST_ENTRY MiniportListHead
Definition: miniport.c:53
KSPIN_LOCK AdapterListLock
Definition: miniport.c:58
KSPIN_LOCK MiniportListLock
Definition: miniport.c:54
LIST_ENTRY ProtocolListHead
Definition: protocol.c:19
KSPIN_LOCK ProtocolListLock
Definition: protocol.c:20
static VOID NdisReadRegistryEntries(VOID)
Definition: main.c:30
LONG CancelId
Definition: main.c:23
VOID NTAPI MainUnload(PDRIVER_OBJECT DriverObject)
Definition: main.c:66
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
#define STATUS_SUCCESS
Definition: shellext.h:65
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213

◆ MainUnload()

VOID NTAPI MainUnload ( PDRIVER_OBJECT  DriverObject)

Definition at line 66 of file main.c.

73{
74 NDIS_DbgPrint(MAX_TRACE, ("Leaving.\n"));
75}

Referenced by DriverEntry().

◆ NdisReadRegistryEntries()

static VOID NdisReadRegistryEntries ( VOID  )
static

Definition at line 30 of file main.c.

31{
33 ULONG AllowFlowControlUnderDebugger;
34
35 /* Set defaults */
37 AllowFlowControlUnderDebugger = FALSE;
38
40
42 QueryTable[0].Name = L"AllowFlowControlUnderDebugger";
43 QueryTable[0].EntryContext = &AllowFlowControlUnderDebugger;
45 QueryTable[0].DefaultData = &AllowFlowControlUnderDebugger;
46 QueryTable[0].DefaultLength = sizeof(ULONG);
47
49 L"NDIS\\Parameters",
51 NULL,
52 NULL);
53
54 /*
55 * Disable flow control when a Kernel Debugger is attached.
56 *
57 * When the debugger stops at a breakpoint the NIC keeps frame reception,
58 * which could eventually cause the receiver to run out of buffers.
59 * At this point, the NIC may start spamming pause frames.
60 * This is undesirable for some use cases.
61 */
63 NdisEnableTxRxFlowControl = AllowFlowControlUnderDebugger;
64}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define L(x)
Definition: resources.c:13
ULONG NdisEnableTxRxFlowControl
Definition: main.c:25
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
Definition: rtlfuncs.h:4231
#define RTL_QUERY_REGISTRY_DIRECT
Definition: nt_native.h:144
#define RTL_REGISTRY_SERVICES
Definition: nt_native.h:162
#define REG_DWORD
Definition: sdbapi.c:615
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
#define RTL_QUERY_REGISTRY_TYPECHECK
Definition: winternl.h:3589
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
#define RTL_QUERY_REGISTRY_TYPECHECK_SHIFT
Definition: winternl.h:3591
#define KD_DEBUGGER_ENABLED
Definition: kdfuncs.h:130

Referenced by DriverEntry().

◆ NdisWriteErrorLogEntry()

VOID _cdecl NdisWriteErrorLogEntry ( IN NDIS_HANDLE  NdisAdapterHandle,
IN NDIS_ERROR_CODE  ErrorCode,
IN ULONG  NumberOfErrorValues,
  ... 
)

Definition at line 118 of file main.c.

135{
136 NDIS_DbgPrint(MIN_TRACE, ("ERROR: ErrorCode 0x%x\n", ErrorCode));
137 /* ASSERT(0); */
138}
#define MIN_TRACE
Definition: debug.h:14
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4438

Referenced by DcHandleSystemError(), DcHandleTxJabberTimeout(), DcReadEeprom(), and DcSetupAdapter().

◆ NdisWriteEventLogEntry()

NDIS_STATUS EXPORT NdisWriteEventLogEntry ( IN PVOID  LogHandle,
IN NDIS_STATUS  EventCode,
IN ULONG  UniqueEventValue,
IN USHORT  NumStrings,
IN PVOID StringsList  OPTIONAL,
IN ULONG  DataSize,
IN PVOID Data  OPTIONAL 
)

Definition at line 146 of file main.c.

168{
169 /*
170 * just returning true until we have an event log
171 */
172 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
173 return NDIS_STATUS_SUCCESS;
174}
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346

Variable Documentation

◆ CancelId

◆ NdisEnableTxRxFlowControl

ULONG NdisEnableTxRxFlowControl

Definition at line 25 of file main.c.

Referenced by NdisReadConfiguration(), and NdisReadRegistryEntries().