Source code of Windows XP (NT5)
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.

92 lines
2.6 KiB

  1. //***************************************************************************
  2. //
  3. // Title : UserData.cpp
  4. //
  5. // Date : 1998.03.26 1st making
  6. //
  7. // Author : Toshiba [NPC](NP2) Hiroyuki Oka
  8. //
  9. // Copyright 1998 Toshiba Corporation. All Rights Reserved.
  10. //
  11. // -------------------------------------------------------------------------
  12. //
  13. // Change Log :
  14. //
  15. // Date Revision Description
  16. // ------------ ---------- -----------------------------------------------
  17. //
  18. //***************************************************************************
  19. // $Header: /DVD Drivers/ZiVA.WDM/userdata.cpp 2 98/04/30 10:31a Yagi $
  20. // $Modtime: 98/04/28 8:56p $
  21. // $Nokeywords: $
  22. //***************************************************************************
  23. #include "includes.h"
  24. #include "userdata.h"
  25. CUserData::CUserData()
  26. {
  27. m_DataPoint = 0;
  28. m_DataSize = 0;
  29. };
  30. CUserData::~CUserData()
  31. {
  32. };
  33. //---------------------------------------------------------------------------
  34. // CUserData::Init
  35. //---------------------------------------------------------------------------
  36. BOOL CUserData::Init()
  37. {
  38. m_DataPoint = 0;
  39. m_DataSize = 0;
  40. return TRUE;
  41. };
  42. //---------------------------------------------------------------------------
  43. // CUserData::Set
  44. //---------------------------------------------------------------------------
  45. BOOL CUserData::Set( DWORD data_tmp )
  46. {
  47. if (m_DataPoint >= USER_DATA_SIZE)
  48. {
  49. //RETAILMSG(ZONE_ERROR, (TEXT("CUserData::Set size Error!!\r\n")));
  50. DBG_BREAK();
  51. return FALSE;
  52. }
  53. data[m_DataPoint] = (BYTE)((data_tmp & 0xFF000000) >> 24);
  54. data[m_DataPoint+1] = (BYTE)((data_tmp & 0x00FF0000) >> 16);
  55. data[m_DataPoint+2] = (BYTE)((data_tmp & 0x0000FF00) >> 8);
  56. data[m_DataPoint+3] = (BYTE)(data_tmp & 0x000000FF);
  57. m_DataPoint += 4;
  58. m_DataSize += 4;
  59. return TRUE;
  60. };
  61. //---------------------------------------------------------------------------
  62. // CUserData::Get
  63. //---------------------------------------------------------------------------
  64. BYTE CUserData::Get( DWORD number )
  65. {
  66. return data[number];
  67. };
  68. //---------------------------------------------------------------------------
  69. // CUserData::DataCopy
  70. //---------------------------------------------------------------------------
  71. BOOL CUserData::DataCopy(PVOID pDestPoint, DWORD dwSize)
  72. {
  73. if (dwSize > m_DataSize)
  74. return FALSE;
  75. memcpy(pDestPoint, data, dwSize);
  76. return TRUE;
  77. };
  78. //---------------------------------------------------------------------------
  79. // CUserData::GetDataSize
  80. //---------------------------------------------------------------------------
  81. DWORD CUserData::GetDataSize()
  82. {
  83. return m_DataSize;
  84. };