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.

94 lines
1.9 KiB

  1. #include <memory.h>
  2. typedef INT X;
  3. typedef INT Y;
  4. typedef INT DX;
  5. typedef INT DY;
  6. #define fTrue 1
  7. #define fFalse 0
  8. /* PoinT structure */
  9. typedef struct _pt
  10. {
  11. X x;
  12. Y y;
  13. } PT;
  14. /* DEL structure */
  15. typedef struct _del
  16. {
  17. DX dx;
  18. DY dy;
  19. } DEL;
  20. /* ReCt structure */
  21. typedef struct _rc
  22. {
  23. X xLeft;
  24. Y yTop;
  25. X xRight;
  26. Y yBot;
  27. } RC;
  28. #ifdef DEBUG
  29. #define VSZASSERT static TCHAR *vszAssert = TEXT(__FILE__);
  30. #define Assert(f) { if (!(f)) { AssertFailed(vszAssert, __LINE__); } }
  31. #define SideAssert(f) { if (!(f)) { AssertFailed(vszAssert, __LINE__); } }
  32. #else
  33. #define Assert(f)
  34. #define SideAssert(f) (f)
  35. #define VSZASSERT
  36. #endif
  37. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  38. VOID *PAlloc(INT cb);
  39. VOID FreeP( VOID * );
  40. TCHAR *PszCopy(TCHAR *pszFrom, TCHAR *rgchTo);
  41. INT CchDecodeInt(TCHAR *rgch, INT_PTR w);
  42. VOID Error(TCHAR *sz);
  43. VOID ErrorIds(INT ids);
  44. INT WMin(INT w1, INT w2);
  45. INT WMax(INT w1, INT w2);
  46. // INT WParseLpch(TCHAR[ ]*FAR[ ]***plpch);
  47. BOOL FInRange(INT w, INT wFirst, INT wLast);
  48. INT PegRange(INT w, INT wFirst, INT wLast);
  49. VOID NYI( VOID );
  50. INT CchString(TCHAR *sz, INT ids, UINT cchBuf);
  51. VOID InvertRc(RC *prc);
  52. VOID OffsetPt(PT *ppt, DEL *pdel, PT *pptDest);
  53. BOOL FRectAllVisible(HDC hdc, RC *prc);
  54. // Removed so it will build on NT...<chriswil>
  55. //
  56. // INT APIENTRY MulDiv( INT, INT, INT );
  57. #ifdef DEBUG
  58. VOID AssertFailed(TCHAR *szFile, INT li);
  59. #endif
  60. #define bltb(pb1, pb2, cb) memcpy(pb2, pb1, cb)
  61. extern HWND hwndApp;
  62. extern HANDLE hinstApp;
  63. BOOL FWriteIniString(INT idsTopic, INT idsItem, TCHAR *szValue);
  64. BOOL FWriteIniInt(INT idsTopic, INT idsItem, DWORD w);
  65. BOOL FGetIniString(INT idsTopic, INT idsItem, TCHAR *sz, TCHAR *szDefault, INT cchMax);
  66. DWORD GetIniInt(INT idsTopic, INT idsItem, DWORD wDefault);
  67. VOID CrdRcFromPt(PT *ppt, RC *prc);