Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

util.h File Reference

Some utility helpers. More...

Go to the source code of this file.

Defines

#define SECONDS(_x_)   MILLISECONDS((_x_)*1000)
#define MILLISECONDS(_x_)   MICROSECONDS((_x_)*1000)
#define MICROSECONDS(_x_)   ((_x_) * 10)
#define LogErrorOnly(_Fdo_, _UniqueErrorValue_)   LogError(_Fdo_, _UniqueErrorValue_, NULL, NULL)
#define LogErrorString(_Fdo_, _UniqueErrorValue_, _String1_, _String2_)   LogError(_Fdo_, _UniqueErrorValue_, _String1_, _String2_)

Functions

VOID LogError (IN PDEVICE_OBJECT Fdo, IN NTSTATUS ErrorCode, const WCHAR *String1, const WCHAR *String2)
 Log an error entry in the system log.


Detailed Description

Some utility helpers.

**************************************************************

Author:
Spiro Trikaliotis
Version:
Id
util.h,v 1.3 2006/04/08 13:40:02 trikalio Exp


Definition in file util.h.


Define Documentation

#define LogErrorOnly _Fdo_,
_UniqueErrorValue_   )     LogError(_Fdo_, _UniqueErrorValue_, NULL, NULL)
 

Log without giving any strings

Definition at line 36 of file util.h.

Referenced by AddDeviceCommonInit(), and ParPortAllocInterrupt().

#define LogErrorString _Fdo_,
_UniqueErrorValue_,
_String1_,
_String2_   )     LogError(_Fdo_, _UniqueErrorValue_, _String1_, _String2_)
 

Log, giving up to 2 strings

Definition at line 40 of file util.h.

Referenced by AddDevice(), AddDeviceCommonInit(), and cbm_start_thread().

#define MICROSECONDS _x_   )     ((_x_) * 10)
 

1us is 10 * 100ns

Definition at line 30 of file util.h.

#define MILLISECONDS _x_   )     MICROSECONDS((_x_)*1000)
 

1ms is 1000us

Definition at line 27 of file util.h.

#define SECONDS _x_   )     MILLISECONDS((_x_)*1000)
 

1s is 1000ms

Definition at line 24 of file util.h.


Function Documentation

VOID LogError IN PDEVICE_OBJECT  Fdo,
IN NTSTATUS  ErrorCode,
const WCHAR *  String1,
const WCHAR *  String2
 

Log an error entry in the system log.

Log an error entry in the system log.

Parameters:
Fdo Pointer to a DEVICE_OBJECT structure. This is the device object for the target device, previously created by the driver's AddDevice routine.
ErrorCode The NTSTATUS code which should be reported on behalf of this error log entry
String1 Pointer to the 1st (WCHAR) string which has to be included into the error log entry. This can be NULL if no string is to be inserted.
String2 Pointer to the 2nd (WCHAR) string which has to be included into the error log entry. This can be NULL if no string is to be inserted.
Todo:
Would it make sense to short the strings if the error log entry would be too big?

Definition at line 47 of file libcommon/util.c.

References DBG_ASSERT, FUNC_ENTER, and FUNC_LEAVE.


Generated on Sun Apr 30 18:46:16 2006 for opencbm by  doxygen 1.4.2