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.

72 lines
2.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000
  6. //
  7. // File: mmcprotocol.h
  8. //
  9. // Purpose: Creates a temporary pluggable internet protocol, mmc:
  10. //
  11. // History: 14-April-2000 Vivekj added
  12. //--------------------------------------------------------------------------
  13. extern const CLSID CLSID_MMCProtocol;
  14. class CMMCProtocol :
  15. public IInternetProtocol,
  16. public IInternetProtocolInfo,
  17. public CComObjectRoot,
  18. public CComCoClass<CMMCProtocol, &CLSID_MMCProtocol>
  19. {
  20. typedef CMMCProtocol ThisClass;
  21. public:
  22. BEGIN_COM_MAP(ThisClass)
  23. COM_INTERFACE_ENTRY(IInternetProtocol)
  24. COM_INTERFACE_ENTRY(IInternetProtocolRoot)
  25. COM_INTERFACE_ENTRY(IInternetProtocolInfo)
  26. END_COM_MAP()
  27. DECLARE_NOT_AGGREGATABLE(ThisClass)
  28. DECLARE_MMC_OBJECT_REGISTRATION (
  29. g_szMmcndmgrDll, // implementing DLL
  30. CLSID_MMCProtocol , // CLSID
  31. _T("MMC Plugable Internet Protocol"), // class name
  32. _T("NODEMGR.MMCProtocol.1"), // ProgID
  33. _T("NODEMGR.MMCProtocol")) // version-independent ProgID
  34. static SC ScRegisterProtocol();
  35. static SC ScParseTaskpadURL( LPCWSTR strURL, GUID& guid );
  36. static SC ScParsePageBreakURL( LPCWSTR strURL, bool& bPageBreak );
  37. static SC ScGetTaskpadXML( const GUID& guid, std::wstring& strResultData );
  38. static void ExpandMMCVars(std::wstring& str);
  39. static void AppendMMCPath(std::wstring& str);
  40. // IInternetProtocolRoot interface
  41. STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved);
  42. STDMETHODIMP Continue(PROTOCOLDATA *pProtocolData);
  43. STDMETHODIMP Abort(HRESULT hrReason, DWORD dwOptions);
  44. STDMETHODIMP Terminate(DWORD dwOptions);
  45. STDMETHODIMP Suspend();
  46. STDMETHODIMP Resume();
  47. // IInternetProtocol interface
  48. STDMETHODIMP Read(void *pv, ULONG cb, ULONG *pcbRead);
  49. STDMETHODIMP Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);
  50. STDMETHODIMP LockRequest(DWORD dwOptions);
  51. STDMETHODIMP UnlockRequest();
  52. // IInternetProtocolInfo interface
  53. STDMETHODIMP ParseUrl( LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved);
  54. STDMETHODIMP CombineUrl(LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl,DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved);
  55. STDMETHODIMP CompareUrl(LPCWSTR pwzUrl1, LPCWSTR pwzUrl2,DWORD dwCompareFlags);
  56. STDMETHODIMP QueryInfo( LPCWSTR pwzUrl, QUERYOPTION OueryOption,DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved);
  57. private:
  58. std::wstring m_strData; // contents of the specified URL
  59. size_t m_uiReadOffs; // present read location
  60. };