OpenCBM
Macros | Functions
util.h File Reference

Some utility helpers. More...

Go to the source code of this file.

Macros

#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. More...
 

Detailed Description

Some utility helpers.



Author
Spiro Trikaliotis

Definition in file util.h.

Macro Definition Documentation

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

Log without giving any strings

Definition at line 35 of file util.h.

Referenced by AddDeviceCommonInit(), cbmiec_test_irq(), and ParPortAllocInterrupt().

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

Log, giving up to 2 strings

Definition at line 39 of file util.h.

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

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

1us is 10 * 100ns

Definition at line 29 of file util.h.

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

1ms is 1000us

Definition at line 26 of file util.h.

#define SECONDS (   _x_)    MILLISECONDS((_x_)*1000)
Todo:
Currently, these macros are unused!

1s is 1000ms

Definition at line 23 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
FdoPointer to a DEVICE_OBJECT structure. This is the device object for the target device, previously created by the driver's AddDevice routine.
ErrorCodeThe NTSTATUS code which should be reported on behalf of this error log entry
String1Pointer 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.
String2Pointer 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 46 of file libcommon/util.c.

References DBG_ASSERT, FUNC_ENTER, and FUNC_LEAVE.