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.

122 lines
2.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: ddidentifierobj.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "stdafx.h"
  11. #include "Direct.h"
  12. #include "dms.h"
  13. #include "ddIdentifierObj.h"
  14. extern HRESULT BSTRtoGUID(LPGUID,BSTR);
  15. extern BSTR GUIDtoBSTR(LPGUID);
  16. STDMETHODIMP C_dxj_DirectDrawIdentifierObject::getDriver(
  17. /* [retval][out] */ BSTR __RPC_FAR *ret)
  18. {
  19. USES_CONVERSION;
  20. *ret=T2BSTR(m_id.szDriver);
  21. return S_OK;
  22. }
  23. STDMETHODIMP C_dxj_DirectDrawIdentifierObject::getDescription(
  24. /* [retval][out] */ BSTR __RPC_FAR *ret)
  25. {
  26. USES_CONVERSION;
  27. *ret=T2BSTR(m_id.szDescription);
  28. return S_OK;
  29. }
  30. STDMETHODIMP C_dxj_DirectDrawIdentifierObject::getDriverVersion(
  31. /* [retval][out] */ long __RPC_FAR *ret)
  32. {
  33. *ret=m_id.liDriverVersion.HighPart;
  34. return S_OK;
  35. }
  36. STDMETHODIMP C_dxj_DirectDrawIdentifierObject::getDriverSubVersion(
  37. /* [retval][out] */ long __RPC_FAR *ret)
  38. {
  39. *ret=m_id.liDriverVersion.LowPart;
  40. return S_OK;
  41. }
  42. STDMETHODIMP C_dxj_DirectDrawIdentifierObject::getVendorId(
  43. /* [retval][out] */ long __RPC_FAR *ret)
  44. {
  45. *ret=m_id.dwVendorId;
  46. return S_OK;
  47. }
  48. STDMETHODIMP C_dxj_DirectDrawIdentifierObject::getDeviceId(
  49. /* [retval][out] */ long __RPC_FAR *ret)
  50. {
  51. *ret=m_id.dwDeviceId;
  52. return S_OK;
  53. }
  54. STDMETHODIMP C_dxj_DirectDrawIdentifierObject::getSubSysId(
  55. /* [retval][out] */ long __RPC_FAR *ret)
  56. {
  57. *ret=m_id.dwSubSysId;
  58. return S_OK;
  59. }
  60. STDMETHODIMP C_dxj_DirectDrawIdentifierObject::getRevision(
  61. /* [retval][out] */ long __RPC_FAR *ret)
  62. {
  63. *ret=m_id.dwRevision;
  64. return S_OK;
  65. }
  66. STDMETHODIMP C_dxj_DirectDrawIdentifierObject::getDeviceIndentifier(
  67. /* [retval][out] */ BSTR __RPC_FAR *ret)
  68. {
  69. *ret=GUIDtoBSTR(&m_id.guidDeviceIdentifier);
  70. return S_OK;
  71. }
  72. STDMETHODIMP C_dxj_DirectDrawIdentifierObject::getWHQLLevel(
  73. /* [retval][out] */ long __RPC_FAR *ret)
  74. {
  75. *ret=m_id.dwWHQLLevel;
  76. return S_OK;
  77. }
  78. HRESULT C_dxj_DirectDrawIdentifierObject::Create(
  79. LPDIRECTDRAW7 lpdd,
  80. DWORD dwFlags,
  81. I_dxj_DirectDrawIdentifier **ppret)
  82. {
  83. HRESULT hr;
  84. C_dxj_DirectDrawIdentifierObject *c= new CComObject<C_dxj_DirectDrawIdentifierObject>;
  85. if (!c) return E_OUTOFMEMORY;
  86. hr=lpdd->GetDeviceIdentifier(&(c->m_id),dwFlags);
  87. c->QueryInterface(IID_I_dxj_DirectDrawIdentifier,(void**)ppret);
  88. return hr;
  89. }