ReactOS 0.4.15-dev-8076-g06e89b2
main.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS NDIS library
4 * FILE: ndis/main.c
5 * PURPOSE: Driver entry point
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * Vizzini (vizzini@plasmic.com)
8 * REVISIONS:
9 * CSH 01/08-2000 Created
10 * 20 Aug 2003 Vizzini - NDIS4/5 revisions
11 * 3 Oct 2003 Vizzini - formatting and minor bugfixing
12 */
13
14#include "ndissys.h"
15
16#if DBG
17
18/* See debug.h for debug/trace constants */
20
21#endif /* DBG */
22
24
25
28/*
29 * FUNCTION: Unloads the driver
30 * ARGUMENTS:
31 * DriverObject = Pointer to driver object created by the system
32 */
33{
34 NDIS_DbgPrint(MAX_TRACE, ("Leaving.\n"));
35}
36
37
43/*
44 * FUNCTION: Main driver entry point
45 * ARGUMENTS:
46 * DriverObject = Pointer to a driver object for this driver
47 * RegistryPath = Registry node for configuration parameters
48 * RETURNS:
49 * Status of driver initialization
50 */
51{
52 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
53
56
59
62
63 DriverObject->DriverUnload = MainUnload;
64
65 CancelId = 0;
66
67 return STATUS_SUCCESS;
68}
69
70
71/*
72 * @implemented
73 */
74VOID
75_cdecl
77 IN NDIS_HANDLE NdisAdapterHandle,
80 ...)
81/*
82 * FUNCTION: Write a syslog error
83 * ARGUMENTS:
84 * NdisAdapterHandle: Handle passed into MiniportInitialize
85 * ErrorCode: 32-bit error code to be logged
86 * NumberOfErrorValues: number of errors to log
87 * Variable: list of log items
88 * NOTES:
89 * - THIS IS >CDECL<
90 * - This needs to be fixed to do var args
91 * - FIXME - this needs to be properly implemented once we have an event log
92 */
93{
94 NDIS_DbgPrint(MIN_TRACE, ("ERROR: ErrorCode 0x%x\n", ErrorCode));
95 /* ASSERT(0); */
96}
97
98
99/*
100 * @implemented
101 */
103EXPORT
112/*
113 * FUNCTION: Log an event in the system event log
114 * ARGUMENTS:
115 * LogHandle: pointer to the driver object of the protocol logging the event
116 * EventCode: NDIS_STATUS_XXX describing the event
117 * UniqueEventValue: identifies this instance of the error value
118 * NumStrings: number of strings in StringList
119 * StringList: list of strings to log
120 * DataSize: number of bytes in Data
121 * Data: binary dump data to help analyzing the event
122 * NOTES:
123 * - NTAPI, not CDECL like WriteError...
124 * - FIXME Needs to use the real log interface, once there is one
125 */
126{
127 /*
128 * just returning true until we have an event log
129 */
130 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
131 return NDIS_STATUS_SUCCESS;
132}
133
134/* EOF */
LONG NTSTATUS
Definition: precomp.h:26
#define MIN_TRACE
Definition: debug.h:14
#define MAX_TRACE
Definition: debug.h:16
DRIVER_INITIALIZE DriverEntry
Definition: main.c:9
#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
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: main.c:104
LONG CancelId
Definition: main.c:23
VOID _cdecl NdisWriteErrorLogEntry(IN NDIS_HANDLE NdisAdapterHandle, IN NDIS_ERROR_CODE ErrorCode, IN ULONG NumberOfErrorValues,...)
Definition: main.c:76
VOID NTAPI MainUnload(PDRIVER_OBJECT DriverObject)
Definition: main.c:26
ULONG DebugTraceLevel
Definition: ndis.c:13
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID StringsList
Definition: ndis.h:4754
_In_ NDIS_ERROR_CODE _In_ ULONG NumberOfErrorValues
Definition: ndis.h:4437
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4755
_In_ UINT _Out_ PNDIS_HANDLE LogHandle
Definition: ndis.h:5382
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT NumStrings
Definition: ndis.h:4753
_In_ NDIS_STATUS EventCode
Definition: ndis.h:4751
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define NDIS_ERROR_CODE
Definition: ndis.h:560
_In_ NDIS_STATUS _In_ ULONG UniqueEventValue
Definition: ndis.h:4752
int NDIS_STATUS
Definition: ntddndis.h:475
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213