{ EVENT_TRACE_LOGFILE EventTraceLog; TRACEHANDLE hLogHandle; EventTraceLog.LogFileName= NULL; EventTraceLog.LoggerName = (LPTSTR)LocalAlloc( LPTR,MAX_STRLEN * sizeof(TCHAR)); if( EventTraceLog.LoggerName == NULL ) return (TRACEHANDLE)INVALID_HANDLE_VALUE; strcpy( EventTraceLog.LoggerName,KERNEL_LOGGER_NAME ); EventTraceLog.LogFileMode = EVENT_TRACE_REAL_TIME_MODE; EventTraceLog.BufferCallback = NULL; EventTraceLog.EventCallback = NULL; SetTraceCallback( &RegistryGuid, RegistryEventCallback ); hLogHandle = OpenTrace( &EventTraceLog ); return hLogHandle; }