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.

69 lines
1.4 KiB

  1. /*****************************************************************************\
  2. * MODULE: globals.h
  3. *
  4. * PURPOSE: Any globals used throughout the executable should be placed
  5. * in globals.c and the cooresponding declaration should
  6. * be in "globals.h".
  7. *
  8. * Copyright (C) 2000 Microsoft Corporation
  9. *
  10. * History:
  11. *
  12. * 03/07/00 Weihai Chen (weihaic) Created
  13. *
  14. \*****************************************************************************/
  15. #ifndef _GLOBALS_H
  16. #define _GLOBALS_H
  17. template <class T>
  18. HRESULT PrivCreateComponent (
  19. T * pIuk,
  20. REFIID iid,
  21. void** ppv)
  22. {
  23. HRESULT hr = E_FAIL;
  24. // Create component.
  25. if (pIuk) {
  26. if (pIuk->bValid ()) {
  27. // Get the requested interface.
  28. hr = pIuk->QueryInterface(iid, ppv) ;
  29. }
  30. else {
  31. hr = LastError2HRESULT ();
  32. }
  33. // Release the IUnknown pointer.
  34. pIuk->Release() ;
  35. }
  36. else {
  37. hr = E_OUTOFMEMORY ;
  38. }
  39. return hr;
  40. }
  41. extern LONG g_cComponents;
  42. extern LONG g_cServerLocks;
  43. extern HRESULT STDMETHODCALLTYPE
  44. LastError2HRESULT (VOID);
  45. extern HRESULT STDMETHODCALLTYPE
  46. WinError2HRESULT (
  47. DWORD dwError);
  48. #define BIDI_NULL_SIZE 0
  49. #define BIDI_INT_SIZE (sizeof (ULONG))
  50. #define BIDI_FLOAT_SIZE (sizeof (FLOAT))
  51. #define BIDI_BOOL_SIZE (sizeof (BOOL))
  52. #endif