Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

  1. //
  2. // MODULE: APIwraps.h
  3. //
  4. // PURPOSE: Encapsulate common blocks of API functionality within a class.
  5. //
  6. // COMPANY: Saltmine Creative, Inc. (206)-284-7511 [email protected]
  7. //
  8. // AUTHOR: Randy Biley
  9. //
  10. // ORIGINAL DATE: 9-30-98
  11. //
  12. // NOTES:
  13. //
  14. // Version Date By Comments
  15. //--------------------------------------------------------------------
  16. // V3.0 09-30-98 RAB
  17. //
  18. #include<windows.h>
  19. class APIwraps
  20. {
  21. public:
  22. APIwraps();
  23. ~APIwraps();
  24. public:
  25. static bool WaitAndLogIfSlow(
  26. HANDLE hndl, // Handle of object to be waited on.
  27. LPCSTR srcFile, // Calling source file (__FILE__), used for logging.
  28. // LPCSTR, not LPCTSTR, because __FILE__ is a char*, not a TCHAR*
  29. int srcLine, // Calling source line (__LINE__), used for logging.
  30. DWORD TimeOutVal = 60000 // Time-out interval in milliseconds, after
  31. // which we log error & wait infinitely.
  32. );
  33. } ;
  34. // these must be macros, because otherwise __FILE__ and __LINE__ won't indicate the
  35. // calling location.
  36. #define WAIT_INFINITE(hndl) APIwraps::WaitAndLogIfSlow(hndl, __FILE__, __LINE__)
  37. #define WAIT_INFINITE_EX(hndl, TimeOutVal) APIwraps::WaitAndLogIfSlow(hndl, __FILE__, __LINE__, TimeOutVal)
  38. //
  39. // EOF.
  40. //