|
Definition at line 40 of file sysinit.c.
References _LFS_DATA::Buffer1, _LFS_DATA::Buffer2, _LFS_DATA::BufferLock, _LFS_DATA::BufferNotification, ClearFlag, Dbg, DebugTrace, ExInitializeFastMutex, FALSE, FlagOn, _LFS_DATA::Flags, KeInitializeEvent, KeQuerySystemTime(), _LFS_DATA::LfcbLinks, LFS_BUFFER_SIZE, LFS_DATA, LFS_DATA_INIT_FAILED, LFS_DATA_INITIALIZED, LFS_NTC_DATA, LfsAllocatePoolNoRaise, LfsData, _LFS_DATA::LfsDataLock, LfsFreePool, LfsUsaSeqNumber, _LFS_DATA::NodeByteSize, _LFS_DATA::NodeTypeCode, NULL, PAGED_CODE, PagedPool, SetFlag, TRUE, and USHORT.
00045 :
00046
00047 This routine must be called during system initialization before the
00048 first call to logging service, to allow the Log File Service to initialize
00049 its global data structures. This routine has no dependencies on other
00050 system components being initialized.
00051
00052 This routine will initialize the global structures used by the logging
00053 service and start the Lfs worker thread.
00054
00055 Arguments:
00056
00057 None
00058
00059 Return Value:
00060
00061 TRUE if initialization was successful
00062
00063 --*/
00064
00065 {
00066 LARGE_INTEGER CurrentTime;
00067
00068 PAGED_CODE();
00069
00070 DebugTrace( +1, Dbg, "LfsInitializeLogFileService: Enter\n", 0 );
00071
00072
00073
00074
00075
00076
00077 if ( LfsData. NodeTypeCode == LFS_NTC_DATA
00078 && LfsData. NodeByteSize == sizeof( LFS_DATA )
00079 && FlagOn( LfsData. Flags, LFS_DATA_INITIALIZED )) {
00080
00081 DebugTrace( -1, Dbg, "LfsInitializeLogFileService: Exit -> %01x\n", TRUE );
00082
00083 return TRUE;
00084 }
00085
00086
00087
00088
00089
00090 RtlZeroMemory( &LfsData, sizeof( LFS_DATA ));
00091
00092
00093
00094
00095
00096 LfsData. Flags = LFS_DATA_INIT_FAILED;
00097
00098
00099
00100
00101
00102 LfsData. NodeTypeCode = LFS_NTC_DATA;
00103 LfsData. NodeByteSize = sizeof( LFS_DATA );
00104
00105 InitializeListHead( & LfsData. LfcbLinks );
00106
00107
00108
00109
00110
00111 ExInitializeFastMutex( & LfsData. LfsDataLock );
00112
00113
00114
00115
00116
00117
00118 ExInitializeFastMutex( & LfsData. BufferLock );
00119 KeInitializeEvent( & LfsData. BufferNotification, NotificationEvent, TRUE );
00120 LfsData. Buffer1 = LfsAllocatePoolNoRaise( PagedPool, LFS_BUFFER_SIZE );
00121
00122 if ( LfsData. Buffer1 == NULL) {
00123
00124 return FALSE;
00125 }
00126
00127 LfsData. Buffer2 = LfsAllocatePoolNoRaise( PagedPool, LFS_BUFFER_SIZE );
00128
00129
00130
00131
00132
00133 if ( LfsData. Buffer2 == NULL) {
00134
00135 LfsFreePool( LfsData. Buffer1 );
00136 LfsData. Buffer1 = NULL;
00137 return FALSE;
00138 }
00139
00140
00141
00142
00143
00144 ClearFlag( LfsData. Flags, LFS_DATA_INIT_FAILED );
00145 SetFlag( LfsData. Flags, LFS_DATA_INITIALIZED );
00146
00147
00148
00149
00150
00151
00152 KeQuerySystemTime( &CurrentTime );
00153 LfsUsaSeqNumber = ( USHORT) CurrentTime.LowPart;
00154
00155 DebugTrace( -1, Dbg, "LfsInitializeLogFileService: Exit -> %01x\n", TRUE );
00156
00157 return TRUE;
00158 }
}
|