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.5 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. #ifndef __UTIL__
  3. #define __UTIL__
  4. #pragma once
  5. #include "comdef.h"
  6. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  7. #define SIZEOF(x) sizeof(x)
  8. #define HIDWORD(_qw) (DWORD)((_qw)>>32)
  9. #define LODWORD(_qw) (DWORD)(_qw)
  10. // Sizes of various string-ized numbers
  11. #define MAX_INT64_SIZE 30 // 2^64 is less than 30 chars long
  12. #define MAX_COMMA_NUMBER_SIZE (MAX_INT64_SIZE + 10)
  13. #define MAX_COMMA_AS_K_SIZE (MAX_COMMA_NUMBER_SIZE + 10)
  14. HRESULT Extract(IDataObject *_DO, wchar_t* fmt, wchar_t* data);
  15. HRESULT Extract(IDataObject *_DO, wchar_t* fmt, bstr_t &data);
  16. INT WINAPI Int64ToString(_int64 n, LPTSTR szOutStr, UINT nSize, BOOL bFormat,
  17. NUMBERFMT *pFmt, DWORD dwNumFmtFlags);
  18. void Int64ToStr( _int64 n, LPTSTR lpBuffer);
  19. LPTSTR WINAPI AddCommas64(_int64 n, LPTSTR pszResult);
  20. LPTSTR WINAPI AddCommas(DWORD dw, LPTSTR pszResult);
  21. long StrToLong(LPTSTR x);
  22. //int StrToInt(LPTSTR x);
  23. //BOOL MyPathCompactPathEx(LPTSTR pszOut,
  24. // LPCTSTR pszSrc,
  25. // UINT cchMax,
  26. // DWORD dwFlags);
  27. #define HINST_THISDLL _Module.GetModuleInstance()
  28. #define NUMFMT_IDIGITS 1
  29. #define NUMFMT_ILZERO 2
  30. #define NUMFMT_SGROUPING 4
  31. #define NUMFMT_SDECIMAL 8
  32. #define NUMFMT_STHOUSAND 16
  33. #define NUMFMT_INEGNUMBER 32
  34. #define NUMFMT_ALL 0xFFFF
  35. #define MAXCOMPUTER_NAME 262 // This is the current size allowed in snapin UI.
  36. #endif __UTIL__