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.

115 lines
3.7 KiB

  1. #ifndef _HWCMMN_H
  2. #define _HWCMMN_H
  3. #define CT_AUTORUNINF 0x00000001
  4. #define CT_CDAUDIO 0x00000002
  5. #define CT_DVDMOVIE 0x00000004
  6. #define CT_UNKNOWNCONTENT 0x00000008
  7. #define CT_BLANKCDR 0x00000010
  8. #define CT_BLANKCDRW 0x00000020
  9. #define CT_BLANKDVDR 0x00000040
  10. #define CT_BLANKDVDRW 0x00000080
  11. #define CT_AUTOPLAYMUSIC 0x00000100
  12. #define CT_AUTOPLAYPIX 0x00000200
  13. #define CT_AUTOPLAYMOVIE 0x00000400
  14. // Will not be returned by CMountPoint::GetContentType
  15. #define CT_AUTOPLAYMIXEDCONTENT 0x00000800
  16. #define CT_ANYCONTENT 0x00000FFF
  17. #define CT_ANYAUTOPLAYCONTENT ( CT_AUTOPLAYMUSIC | \
  18. CT_AUTOPLAYPIX | \
  19. CT_AUTOPLAYMOVIE)
  20. #define CT_BLANKCDWRITABLE ( CT_BLANKCDR | \
  21. CT_BLANKCDRW )
  22. #define CT_BLANKDVDWRITABLE ( CT_BLANKDVDR | \
  23. CT_BLANKDVDRW )
  24. BOOL IsShellServiceRunning();
  25. HRESULT _GetAutoplayHandler(LPCWSTR pszDeviceID, LPCWSTR pszEventType,
  26. LPCWSTR pszContentTypeHandler, IAutoplayHandler** ppiah);
  27. HRESULT _GetAutoplayHandlerNoContent(LPCWSTR pszDeviceID, LPCWSTR pszEventType,
  28. IAutoplayHandler** ppiah);
  29. HRESULT _GetHWDevice(LPCWSTR pszDeviceID, IHWDevice** ppihwdevice);
  30. STDAPI GetDeviceProperties(LPCWSTR pszDeviceID, IHWDeviceCustomProperties** ppihwdevcp);
  31. HICON _GetIconFromIconLocation(LPCWSTR pszIconLocation, BOOL fBigIcon);
  32. HRESULT _GetDeviceEventFriendlyName(LPCWSTR pszDeviceID, LPWSTR* ppsz);
  33. HRESULT _GetHardwareDevices(IHardwareDevices** ppihwdevices);
  34. HRESULT _GetContentTypeInfo(DWORD dwContentType, LPWSTR pszContentTypeFriendlyName,
  35. DWORD cchContentTypeFriendlyName, LPWSTR pszContentTypeIconLocation,
  36. DWORD cchContentTypeIconLocation);
  37. HRESULT _GetContentTypeHandler(DWORD dwContentType, LPWSTR pszContentTypeHandler,
  38. DWORD cchContentTypeHandler);
  39. HRESULT _GetHandlerInvokeProgIDAndVerb(LPCWSTR pszHandler, LPWSTR pszInvokeProgID,
  40. DWORD cchInvokeProgID, LPWSTR pszInvokeVerb, DWORD cchInvokeVerb);
  41. struct AUTOPLAYPROMPT
  42. {
  43. WCHAR szDriveOrDeviceID[MAX_PATH];
  44. BOOL fDlgWillBeShown;
  45. HWND hwndDlg;
  46. class CCrossThreadFlag* pDeviceGoneFlag;
  47. };
  48. HRESULT DoDeviceNotification(LPCTSTR pszDevice, LPCTSTR pszEventType, CCrossThreadFlag* pDeviceGoneFlag);
  49. BOOL GetGoneFlagForDevice(LPCWSTR pszAltDeviceID, CCrossThreadFlag** ppDeviceGoneFlag);
  50. void AttachGoneFlagForDevice(LPCWSTR pszAltDeviceID, CCrossThreadFlag* pDeviceGoneFlag);
  51. BOOL IsMixedContent(DWORD dwContentType);
  52. class CRefCounted
  53. {
  54. public:
  55. CRefCounted() : _cRCRef(1) {}
  56. virtual ~CRefCounted() {}
  57. ULONG AddRef() { return ::InterlockedIncrement((LONG*)&_cRCRef); }
  58. ULONG Release()
  59. {
  60. ASSERT( 0 != _cRCRef );
  61. ULONG cRef = ::InterlockedDecrement((LONG*)&_cRCRef);
  62. if (!cRef)
  63. {
  64. delete this;
  65. }
  66. return cRef;
  67. }
  68. private:
  69. ULONG _cRCRef; // RC: to avoid name colision
  70. };
  71. // The event is created in the NON-signaled state
  72. // Since it's cross-thread it should always be created on the heap
  73. class CCrossThreadFlag : public CRefCounted
  74. {
  75. public:
  76. BOOL Init();
  77. BOOL Signal();
  78. BOOL IsSignaled();
  79. private:
  80. ~CCrossThreadFlag();
  81. HANDLE _hEvent;
  82. #ifdef DEBUG
  83. BOOL _fInited;
  84. #endif
  85. };
  86. #endif //_HWCMMN_H