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.

47 lines
781 B

  1. #include "mtpts.h"
  2. #include "vol.h"
  3. #include "sfstr.h"
  4. #define ARRAYSIZE(a) (sizeof((a))/sizeof((a)[0]))
  5. HRESULT CMtPt::Init(LPCWSTR pszElemName)
  6. {
  7. return _SetName(pszElemName);
  8. }
  9. HRESULT CMtPt::InitVolume(LPCWSTR pszDeviceIDVolume)
  10. {
  11. return SafeStrCpyN(_szDeviceIDVolume, pszDeviceIDVolume,
  12. ARRAYSIZE(_szDeviceIDVolume));
  13. }
  14. HRESULT CMtPt::GetVolumeName(LPWSTR pszDeviceIDVolume, DWORD cchDeviceIDVolume)
  15. {
  16. return SafeStrCpyN(pszDeviceIDVolume, _szDeviceIDVolume,
  17. cchDeviceIDVolume);
  18. }
  19. //static
  20. HRESULT CMtPt::Create(CNamedElem** ppelem)
  21. {
  22. HRESULT hres = S_OK;
  23. *ppelem = new CMtPt();
  24. if (!(*ppelem))
  25. {
  26. hres = E_OUTOFMEMORY;
  27. }
  28. return hres;
  29. }
  30. CMtPt::CMtPt()
  31. {
  32. _szDeviceIDVolume[0] = 0;
  33. }
  34. CMtPt::~CMtPt()
  35. {}