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.

60 lines
1.7 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: d3drmdevicearrayobj.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // d3drmDeviceArrayObj.cpp : Implementation of CDirectApp and DLL registration.
  11. #include "stdafx.h"
  12. #include "Direct.h"
  13. #include "dms.h"
  14. #include "d3drmDeviceArrayObj.h"
  15. #include "d3drmDevice3Obj.h"
  16. CONSTRUCTOR( _dxj_Direct3dRMDeviceArray, {} );
  17. DESTRUCTOR ( _dxj_Direct3dRMDeviceArray, {} );
  18. GETSET_OBJECT ( _dxj_Direct3dRMDeviceArray );
  19. GET_DIRECT_R(_dxj_Direct3dRMDeviceArray, getSize, GetSize, long);
  20. #ifdef DX5
  21. HRESULT C_dxj_Direct3dRMDeviceArrayObject::getElement(long id, I_dxj_Direct3dRMDevice2 **ret){
  22. IDirect3DRMDevice *realdevice=NULL;
  23. IDirect3DRMDevice2 *realdevice2=NULL;
  24. HRESULT hr;
  25. hr=m__dxj_Direct3dRMDeviceArray->GetElement((DWORD)id,&realdevice);
  26. if FAILED(hr) return hr;
  27. hr = realdevice->QueryInterface(IID_IDirect3DRMDevice2,(void**)&realdevice2);
  28. realdevice->Release();
  29. if FAILED(hr) return hr;
  30. INTERNAL_CREATE(_dxj_Direct3dRMDevice2,(IDirect3DRMDevice2*)realdevice2,ret);
  31. return hr;
  32. }
  33. #else
  34. HRESULT C_dxj_Direct3dRMDeviceArrayObject::getElement(long id, I_dxj_Direct3dRMDevice3 **ret){
  35. IDirect3DRMDevice *realdevice=NULL;
  36. IDirect3DRMDevice3 *realdevice3=NULL;
  37. HRESULT hr;
  38. hr=m__dxj_Direct3dRMDeviceArray->GetElement((DWORD)id,&realdevice);
  39. if FAILED(hr) return hr;
  40. hr = realdevice->QueryInterface(IID_IDirect3DRMDevice3,(void**)&realdevice3);
  41. realdevice->Release();
  42. if FAILED(hr) return hr;
  43. INTERNAL_CREATE(_dxj_Direct3dRMDevice3,realdevice3,ret);
  44. return hr;
  45. }
  46. #endif