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.

28 lines
754 B

  1. #ifndef _MEPADRT_H
  2. #define _MEPADRT_H
  3. // -------------------------------------------------------------------------
  4. // ReplaceInterface - Replaces a member interface with a new interface
  5. // -------------------------------------------------------------------------
  6. #define ReplaceInterface(_pUnk, _pUnkNew) \
  7. { \
  8. if (_pUnk) \
  9. _pUnk->Release(); \
  10. if (_pUnk = _pUnkNew) \
  11. _pUnk->AddRef(); \
  12. }
  13. #define ReleaseObj(_object) (_object) ? (_object)->Release() : 0
  14. #define SafeRelease(_object) \
  15. if (_object) { \
  16. (_object)->Release(); \
  17. (_object) = NULL; \
  18. } else
  19. #define GetWndThisPtr(hwnd) \
  20. GetWindowLong(hwnd, GWL_USERDATA)
  21. #endif // _MEPADRT_H