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.

51 lines
1.8 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved.
  3. Module Name:
  4. wsbpstbl.h
  5. Abstract:
  6. Abstract classes that provides persistence methods.
  7. Author:
  8. Cat Brant [cbrant] 24-Sep-1997
  9. Revision History:
  10. --*/
  11. #ifndef _WSBSERV_
  12. #define _WSBSERV_
  13. extern WSB_EXPORT HRESULT WsbPowerEventNtToHsm(DWORD NtEvent,
  14. ULONG * pHsmEvent);
  15. extern WSB_EXPORT HRESULT WsbServiceSafeInitialize(IWsbServer* pServer,
  16. BOOL bVerifyId, BOOL bPrimaryId, BOOL* pWasCreated);
  17. //
  18. // This macro is used to encapsulate what was a CoCreateInstanceEx call that
  19. // we were dependent on the class factory being on the same thread.
  20. //
  21. // The macro simply calls the class factory directly. Thus, the class factory
  22. // must be exposed to where this macro is used.
  23. //
  24. #define WsbCreateInstanceDirectly( _Class, _Interface, _pObj, _Hr ) \
  25. { \
  26. CComPtr<IClassFactory> pFactory; \
  27. _Hr = CComObject<_Class>::_ClassFactoryCreatorClass::CreateInstance( \
  28. _Class::_CreatorClass::CreateInstance, IID_IClassFactory, (void**)static_cast<IClassFactory **>(&pFactory) ); \
  29. if( SUCCEEDED( _Hr ) ) { \
  30. \
  31. _Hr = pFactory->CreateInstance( \
  32. 0, IID_##_Interface, (void**)static_cast<_Interface **>(&_pObj) ); \
  33. } \
  34. }
  35. #endif // _WSBSERV_