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.

49 lines
1.2 KiB

  1. #pragma once
  2. #ifndef WIN32_LEAN_AND_MEAN
  3. #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
  4. #endif
  5. #ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
  6. #define _WIN32_WINNT 0x0510 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
  7. #endif
  8. #include <windows.h>
  9. #include <tchar.h>
  10. #include <stdio.h>
  11. void MyOutputDebug(TCHAR *fmt, ...);
  12. void ClearLog();
  13. void Log( LPCTSTR fmt, ... );
  14. void LogError( PTCHAR szAction, DWORD dwErrorCode );
  15. bool GetUDDIInstallPath( PTCHAR szInstallPath, DWORD dwLen );
  16. #define ENTER() CFunctionMarker fa( __FUNCTION__ )
  17. class CFunctionMarker
  18. {
  19. private:
  20. TCHAR m_szFunctionName[100];
  21. public:
  22. CFunctionMarker( char *aszFunctionName )
  23. {
  24. #ifdef _UNICODE
  25. int iCount = MultiByteToWideChar(
  26. CP_ACP,
  27. 0,
  28. aszFunctionName,
  29. -1,
  30. m_szFunctionName,
  31. sizeof( m_szFunctionName ) / sizeof( TCHAR ) );
  32. #else
  33. strncpy( m_szFunctionName, aszFunctionName, sizeof( m_szFunctionName ) );
  34. #endif
  35. Log( TEXT( "Entering %s" ), m_szFunctionName );
  36. }
  37. ~CFunctionMarker()
  38. {
  39. Log( TEXT( "Leaving %s" ), m_szFunctionName );
  40. }
  41. };