Source code of Windows XP (NT5)
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.

91 lines
2.6 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // Common.h
  7. //
  8. // Description:
  9. // Common definitions.
  10. //
  11. // Maintained By:
  12. // David Potter (DavidP) 14-DEC-1999
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. #pragma once
  16. //////////////////////////////////////////////////////////////////////////////
  17. // Macro Definitions
  18. //////////////////////////////////////////////////////////////////////////////
  19. #if ! defined( StrLen )
  20. #define StrLen( _sz ) lstrlen( _sz ) // why isn't this in SHLWAPI?
  21. #define StrLenA( _sz ) lstrlenA( _sz ) // why isn't this in SHLWAPI?
  22. #define StrLenW( _sz ) lstrlenW( _sz ) // why isn't this in SHLWAPI?
  23. #endif // ! defined( StrLen )
  24. #if !defined( ARRAYSIZE )
  25. #define ARRAYSIZE( _x ) ((UINT) ( sizeof( _x ) / sizeof( _x[ 0 ] ) ))
  26. #endif // ! defined( ARRAYSIZE )
  27. #if !defined( PtrToByteOffset )
  28. #define PtrToByteOffset(base, offset) (((LPBYTE)base)+offset)
  29. #endif // !defined( PtrToByteOffset )
  30. //
  31. // COM Macros to gain type checking.
  32. //
  33. #if !defined( TypeSafeParams )
  34. #define TypeSafeParams( _interface, _ppunk ) \
  35. IID_##_interface, reinterpret_cast< void ** >( static_cast< _interface ** >( _ppunk ) )
  36. #endif // !defined( TypeSafeParams )
  37. #if !defined( TypeSafeQI )
  38. #define TypeSafeQI( _interface, _ppunk ) \
  39. QueryInterface( TypeSafeParams( _interface, _ppunk ) )
  40. #endif // !defined( TypeSafeQI )
  41. #if !defined( TypeSafeQS )
  42. #define TypeSafeQS( _clsid, _interface, _ppunk ) \
  43. QueryService( _clsid, TypeSafeParams( _interface, _ppunk ) )
  44. #endif // !defined( TypeSafeQS )
  45. /////////////////////////////////////////////////////////////////////////////
  46. // Global Functions from FormatErrorMessage.cpp
  47. /////////////////////////////////////////////////////////////////////////////
  48. HRESULT
  49. WINAPI
  50. HrFormatErrorMessage(
  51. LPWSTR pszErrorOut,
  52. UINT nMxErrorIn,
  53. DWORD scIn
  54. );
  55. HRESULT
  56. __cdecl
  57. HrFormatErrorMessageBoxText(
  58. LPWSTR pszMessageOut,
  59. UINT nMxMessageIn,
  60. HRESULT hrIn,
  61. LPCWSTR pszOperationIn,
  62. ...
  63. );
  64. HRESULT
  65. WINAPI
  66. HrGetComputerName(
  67. COMPUTER_NAME_FORMAT cnfIn,
  68. BSTR * pbstrComputerNameOut
  69. );
  70. /////////////////////////////////////////////////////////////////////////////
  71. // Global Functions from DirectoryUtils.cpp
  72. /////////////////////////////////////////////////////////////////////////////
  73. HRESULT
  74. HrCreateDirectoryPath( LPWSTR pszDirectoryPath );
  75. DWORD
  76. DwRemoveDirectory( const WCHAR * pcszTargetDirIn, signed int iMaxDepthIn = 32 );