ReactOS  0.4.14-dev-831-gef8c9239
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 
39 NTAPI
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 
64 
65  CancelId = 0;
66 
67  return STATUS_SUCCESS;
68 }
69 
70 
71 /*
72  * @implemented
73  */
74 VOID
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  */
103 EXPORT
110  IN ULONG DataSize,
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 */
_In_ NDIS_ERROR_CODE _In_ ULONG NumberOfErrorValues
Definition: ndis.h:4436
#define IN
Definition: typedefs.h:38
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
_In_ NDIS_STATUS EventCode
Definition: ndis.h:4751
LIST_ENTRY MiniportListHead
Definition: miniport.c:53
#define NDIS_ERROR_CODE
Definition: ndis.h:560
LIST_ENTRY ProtocolListHead
Definition: protocol.c:19
LONG NTSTATUS
Definition: precomp.h:26
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
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID StringsList
Definition: ndis.h:4751
LONG CancelId
Definition: main.c:23
int NDIS_STATUS
Definition: ntddndis.h:471
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT NumStrings
Definition: ndis.h:4751
long LONG
Definition: pedump.c:60
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
_In_ NDIS_STATUS _In_ ULONG UniqueEventValue
Definition: ndis.h:4751
LIST_ENTRY AdapterListHead
Definition: miniport.c:57
ULONG DebugTraceLevel
Definition: ndis.c:13
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2180
VOID NTAPI MainUnload(PDRIVER_OBJECT DriverObject)
Definition: main.c:26
KSPIN_LOCK AdapterListLock
Definition: miniport.c:58
#define MAX_TRACE
Definition: debug.h:16
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
Definition: main.c:690
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
KSPIN_LOCK MiniportListLock
Definition: miniport.c:54
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
VOID _cdecl NdisWriteErrorLogEntry(IN NDIS_HANDLE NdisAdapterHandle, IN NDIS_ERROR_CODE ErrorCode, IN ULONG NumberOfErrorValues,...)
Definition: main.c:76
unsigned int ULONG
Definition: retypes.h:1
#define MIN_TRACE
Definition: debug.h:14
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
_In_ UINT _Out_ PNDIS_HANDLE LogHandle
Definition: ndis.h:5381
KSPIN_LOCK ProtocolListLock
Definition: protocol.c:20
return STATUS_SUCCESS
Definition: btrfs.c:2938
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68