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.

65 lines
2.8 KiB

  1. //
  2. // Microsoft Windows Media Technologies
  3. // Copyright (C) Microsoft Corporation, 1999 - 2001. All rights reserved.
  4. //
  5. // MSHDSP.DLL is a sample WMDM Service Provider(SP) that enumerates fixed drives.
  6. // This sample shows you how to implement an SP according to the WMDM documentation.
  7. // This sample uses fixed drives on your PC to emulate portable media, and
  8. // shows the relationship between different interfaces and objects. Each hard disk
  9. // volume is enumerated as a device and directories and files are enumerated as
  10. // Storage objects under respective devices. You can copy non-SDMI compliant content
  11. // to any device that this SP enumerates. To copy an SDMI compliant content to a
  12. // device, the device must be able to report a hardware embedded serial number.
  13. // Hard disks do not have such serial numbers.
  14. //
  15. // To build this SP, you are recommended to use the MSHDSP.DSP file under Microsoft
  16. // Visual C++ 6.0 and run REGSVR32.EXE to register the resulting MSHDSP.DLL. You can
  17. // then build the sample application from the WMDMAPP directory to see how it gets
  18. // loaded by the application. However, you need to obtain a certificate from
  19. // Microsoft to actually run this SP. This certificate would be in the KEY.C file
  20. // under the INCLUDE directory for one level up.
  21. // MDSPStorageGlobals.h : Declaration of the CMDSPStorageGlobals
  22. #ifndef __MDSPSTORAGEGLOBALS_H_
  23. #define __MDSPSTORAGEGLOBALS_H_
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CMDSPStorageGlobals
  26. class ATL_NO_VTABLE CMDSPStorageGlobals :
  27. public CComObjectRootEx<CComSingleThreadModel>,
  28. public CComCoClass<CMDSPStorageGlobals, &CLSID_MDSPStorageGlobals>,
  29. public IMDSPStorageGlobals
  30. {
  31. public:
  32. CMDSPStorageGlobals()
  33. {
  34. m_pMDSPDevice=(IMDSPDevice *)NULL;
  35. m_wcsName[0] = L'\0';
  36. }
  37. ~CMDSPStorageGlobals();
  38. DECLARE_REGISTRY_RESOURCEID(IDR_MDSPSTORAGEGLOBALS)
  39. BEGIN_COM_MAP(CMDSPStorageGlobals)
  40. COM_INTERFACE_ENTRY(IMDSPStorageGlobals)
  41. END_COM_MAP()
  42. // IMDSPStorageGlobals
  43. public:
  44. WCHAR m_wcsName[MAX_PATH];
  45. IMDSPDevice *m_pMDSPDevice;
  46. STDMETHOD(GetTotalSize)(/*[out]*/ DWORD *pdwTotalSizeLow, /*[out]*/ DWORD *pdwTotalSizeHigh);
  47. STDMETHOD(GetRootStorage)(/*[out]*/ IMDSPStorage **ppRoot);
  48. STDMETHOD(GetDevice)(/*[out]*/ IMDSPDevice **ppDevice);
  49. STDMETHOD(Initialize)(/*[in]*/ UINT fuMode, /*[in]*/ IWMDMProgress *pProgress);
  50. STDMETHOD(GetStatus)(/*[out]*/ DWORD *pdwStatus);
  51. STDMETHOD(GetTotalBad)(/*[out]*/ DWORD *pdwBadLow, /*[out]*/ DWORD *pdwBadHigh);
  52. STDMETHOD(GetTotalFree)(/*[out]*/ DWORD *pdwFreeLow, /*[out]*/ DWORD *pdwFreeHigh);
  53. STDMETHOD(GetSerialNumber)(/*[out]*/ PWMDMID pSerialNum, /*[in, out]*/BYTE abMac[WMDM_MAC_LENGTH]);
  54. STDMETHOD(GetCapabilities)(/*[out]*/ DWORD *pdwCapabilities);
  55. };
  56. #endif //__MDSPSTORAGEGLOBALS_H_