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.

66 lines
2.9 KiB

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