00001
00002
00003
00004
00005
00006 #include "stdafx.h"
00007 #include "Iefdmdm.h"
00008 #include "IEWGDM.h"
00009 #include "../common.cpp"
00010 #include <shlguid.h>
00011 #include "vmsIETmpCookies.h"
00012 #include <fsString.h>
00013
00014 STDMETHODIMP CIEWGDM::Download(IMoniker *pmk, IBindCtx *pbc, DWORD dwBindVerb, LONG grfBINDF, BINDINFO *pBindInfo, LPCOLESTR pszHeaders, LPCOLESTR pszRedir, UINT uiCP)
00015 {
00016 USES_CONVERSION;
00017 LPOLESTR pwszUrl;
00018 LPMALLOC pMalloc;
00019 HRESULT hr;
00020
00021 if (fsIsMonitoringTurnedOn () == FALSE)
00022 return E_FAIL;
00023
00024 if (FAILED (hr = pmk->GetDisplayName (pbc, NULL, &pwszUrl)))
00025 return hr;
00026
00027 if (FAILED (hr = CoGetMalloc (1, &pMalloc)))
00028 return hr;
00029
00030 hr = E_FAIL;
00031
00032 fsString strUrl = W2A (pwszUrl);
00033
00034 if (fsOnNavigateUrl (strUrl))
00035 {
00036 vmsIETmpCookies iec;
00037 int nIndex = iec.Find (strUrl);
00038 if (fsUrlToFdm (strUrl,
00039 nIndex == -1 ? NULL : iec.get_Referer (nIndex),
00040 nIndex == -1 ? NULL : iec.get_Cookies (nIndex),
00041 nIndex == -1 ? NULL : iec.get_PostData (nIndex), TRUE))
00042 hr = S_OK;
00043 }
00044
00045 pMalloc->Free (pwszUrl);
00046 pMalloc->Release ();
00047
00048 return hr;
00049 }