diff --git a/Internet Explorer/Dev - IE Addon/INSTRUCTIONS FOR BUILDING.txt b/Internet Explorer/Dev - IE Addon/INSTRUCTIONS FOR BUILDING.txt new file mode 100644 index 0000000..ede2808 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/INSTRUCTIONS FOR BUILDING.txt @@ -0,0 +1,17 @@ +IMPORTANT: For a trouble-free build, the following steps are important. + +1. Go to the Start menu and find Visual Studio 2008. +2. Right-click and choose "Run as Administrator". +3. Find the SharingTime.sln file and load it. + +During the build process, the ST.dll file will have been registered in the +Release directory. If you copy it to the C:\Program Files\SharingTime\core +directory, the registry will still cause the file in the Release directory +to be loaded. To fix this, perform the following steps after copying ST.dll +to the C:\Program Files\SharingTime\core directory: + +1. Go to Start - Accessories. +2. Right-click on Command Prompt and choose "Run as Administrator". +3. Change to the C:\Program Files\SharingTime\core directory. +4. Run the following command > regsvr32 ST.dll + diff --git a/Internet Explorer/Dev - IE Addon/SharingTime.sln b/Internet Explorer/Dev - IE Addon/SharingTime.sln new file mode 100644 index 0000000..3246712 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ST", "SharingTime\ST.vcproj", "{25C59666-682B-40FC-9413-EB63FB376E6E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + FHCRelease|Win32 = FHCRelease|Win32 + FHCRelease|x64 = FHCRelease|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {25C59666-682B-40FC-9413-EB63FB376E6E}.Debug|Win32.ActiveCfg = Debug|Win32 + {25C59666-682B-40FC-9413-EB63FB376E6E}.Debug|Win32.Build.0 = Debug|Win32 + {25C59666-682B-40FC-9413-EB63FB376E6E}.Debug|x64.ActiveCfg = Debug|x64 + {25C59666-682B-40FC-9413-EB63FB376E6E}.Debug|x64.Build.0 = Debug|x64 + {25C59666-682B-40FC-9413-EB63FB376E6E}.FHCRelease|Win32.ActiveCfg = FHCRelease|Win32 + {25C59666-682B-40FC-9413-EB63FB376E6E}.FHCRelease|Win32.Build.0 = FHCRelease|Win32 + {25C59666-682B-40FC-9413-EB63FB376E6E}.FHCRelease|x64.ActiveCfg = FHCRelease|x64 + {25C59666-682B-40FC-9413-EB63FB376E6E}.FHCRelease|x64.Build.0 = FHCRelease|x64 + {25C59666-682B-40FC-9413-EB63FB376E6E}.Release|Win32.ActiveCfg = Release|Win32 + {25C59666-682B-40FC-9413-EB63FB376E6E}.Release|Win32.Build.0 = Release|Win32 + {25C59666-682B-40FC-9413-EB63FB376E6E}.Release|x64.ActiveCfg = Release|x64 + {25C59666-682B-40FC-9413-EB63FB376E6E}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/BrowserRefreshDetector.cpp b/Internet Explorer/Dev - IE Addon/SharingTime/BrowserRefreshDetector.cpp new file mode 100644 index 0000000..909c75f --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/BrowserRefreshDetector.cpp @@ -0,0 +1,178 @@ +#include "stdafx.h" +#include "BrowserRefreshDetector.h" +#include +#include + +/*static*/ SyncMap BrowserRefreshDetector::DetectorByThread; +/*static*/ char BrowserRefreshDetector::DocumentRefreshMark[] = "STI_Refresh"; + +BrowserRefreshDetector::BrowserRefreshDetector(): + nDownloadsCount(0), + idTimer(0) +{ + MyDebug(_T("Create")); +} + +BrowserRefreshDetector::~BrowserRefreshDetector(void) +{ + MyDebug(_T("Destroy")); + KillDetectTimer(); +} + +void BrowserRefreshDetector::SetDetectTimer() +{ + MyDebug(_T("SetTimer")); + + DetectorByThread[GetCurrentThreadId()] = this; + KillTimer(NULL, idTimer); + idTimer = SetTimer(NULL, 0, 500, &BrowserRefreshDetector::RefreshDetectorTimerProc); +} + +void BrowserRefreshDetector::KillDetectTimer() +{ + MyDebug(_T("KillTimer")); + KillTimer(NULL, idTimer); +} + +void BrowserRefreshDetector::ProcessDownloadBegin(bool bNeedDelay) +{ + MyDebug(_T("DownloadBegin")); + nDownloadsCount++; +} + +void BrowserRefreshDetector::ProcessDownloadEnd(bool bNeedDelay) +{ + MyDebug(_T("DownloadEnd")); + if(--nDownloadsCount < 0) + nDownloadsCount = 0; + + if(!bNeedDelay && !nDownloadsCount) + { + SetDetectTimer(); + } +} + +void BrowserRefreshDetector::EmulateDocumentComplete() +{ + MyDebug(_T("EmulateDocumentComplete")); + BSTR bsLoc; + GetBrowser()->get_LocationURL(&bsLoc); + CString sURL = (TCHAR*)_bstr_t(bsLoc, false); + _variant_t varURL((LPCTSTR)sURL); + OnDocumentComplete_doIt(GetBrowser(), &varURL, false); +} + +bool BrowserRefreshDetector::IsBrowserBusy() +{ + return nDownloadsCount > 0; +} + +VOID CALLBACK BrowserRefreshDetector::RefreshDetectorTimerProc( HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime ) +{ + MyDebug(_T("OnTimer")); + BrowserRefreshDetector *pThis = DetectorByThread[GetCurrentThreadId()]; + pThis->DetectRefresh(); +} + +READYSTATE BrowserRefreshDetector::GetReadyState() +{ + READYSTATE bstate; + GetBrowser()->get_ReadyState(&bstate); + return bstate; +} + +bool BrowserRefreshDetector::CheckDocumentSignature() +{ + try { + + CComPtr pDispDoc; + GetBrowser()->get_Document(&pDispDoc); + CComQIPtr pDoc2 = pDispDoc; + if(pDoc2) + { + CComPtr ptrHTMLWnd2; + pDoc2->get_parentWindow(&ptrHTMLWnd2); + + // ptrHTMLWnd2 is pointer to IHTMLWindow2 + CComQIPtr ptrDispEx = ptrHTMLWnd2; + DISPID dispid = DISPID_UNKNOWN; + + // Create new property + CComBSTR bstrProp(DocumentRefreshMark); + HRESULT hr = ptrDispEx->GetDispID(bstrProp, + fdexNameCaseSensitive | fdexNameEnsure, &dispid); + ATLASSERT(SUCCEEDED(hr) && dispid != DISPID_UNKNOWN); + + _variant_t vProp; + + // put my object into new property + CComDispatchDriver ptrDispDrv = ptrDispEx; + ptrDispDrv.GetProperty(dispid, &vProp); + + bool bRes = (vProp.vt != VT_EMPTY); + MyDebug(_T("CheckDocumentSignature, res=%d"), bRes); + return bRes; + } + + } catch(...) {}; + + MyDebug(_T("CheckDocumentSignature, no document or crash")); + + return false; +} + +void BrowserRefreshDetector::SignDocument() +{ + MyDebug(_T("Sign Document")); + + try { + + CComPtr pDispDoc; + GetBrowser()->get_Document(&pDispDoc); + CComQIPtr pDoc2 = pDispDoc; + if(pDoc2) + { + CComPtr ptrHTMLWnd2; + pDoc2->get_parentWindow(&ptrHTMLWnd2); + + // ptrHTMLWnd2 is pointer to IHTMLWindow2 + CComQIPtr ptrDispEx = ptrHTMLWnd2; + DISPID dispid = DISPID_UNKNOWN; + + // Create new property + CComBSTR bstrProp(DocumentRefreshMark); + HRESULT hr = ptrDispEx->GetDispID(bstrProp, + fdexNameCaseSensitive | fdexNameEnsure, &dispid); + ATLASSERT(SUCCEEDED(hr) && dispid != DISPID_UNKNOWN); + + // put my object into new property + CComVariant varInstProp(true); + CComDispatchDriver ptrDispDrv = ptrDispEx; + hr = ptrDispDrv.PutProperty(dispid, &varInstProp); + } + + } catch(...) {}; +} + +void BrowserRefreshDetector::DetectRefresh() +{ + READYSTATE rs = GetReadyState(); + MyDebug(_T("DetectRefresh, %d"), rs); + + switch(rs) + { + case READYSTATE_COMPLETE: + //case READYSTATE_INTERACTIVE: + break; + default: + return; + } + + KillDetectTimer(); + + if(CheckDocumentSignature()) + return; + + SignDocument(); + EmulateDocumentComplete(); +} \ No newline at end of file diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/BrowserRefreshDetector.h b/Internet Explorer/Dev - IE Addon/SharingTime/BrowserRefreshDetector.h new file mode 100644 index 0000000..d94fba2 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/BrowserRefreshDetector.h @@ -0,0 +1,33 @@ +#pragma once + +#include "SyncMap.h" + +class BrowserRefreshDetector +{ + static char DocumentRefreshMark[]; + static SyncMap DetectorByThread; + static VOID CALLBACK RefreshDetectorTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); + + UINT_PTR idTimer; + bool CheckDocumentSignature(); + READYSTATE GetReadyState(); + void EmulateDocumentComplete(); + void DetectRefresh(); + void SetDetectTimer(); + void KillDetectTimer(); + +public: + + int nDownloadsCount; + + BrowserRefreshDetector(); + ~BrowserRefreshDetector(void); + + void ProcessDownloadBegin(bool bNeedDelay); + void ProcessDownloadEnd(bool bNeedDelay); + bool IsBrowserBusy(); + void SignDocument(); + + virtual HRESULT OnDocumentComplete_doIt(IDispatch *pDisp, VARIANT *URL, bool realOne) = 0; + virtual IWebBrowser2* GetBrowser() = 0; +}; diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/Configuration.h b/Internet Explorer/Dev - IE Addon/SharingTime/Configuration.h new file mode 100644 index 0000000..eac7eed --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/Configuration.h @@ -0,0 +1,5 @@ +#ifdef FHC +#define SCRIPT_INJECTION_URL _T("https://secure.sharingtime.com/fj?v=%d.%d.%d&b=ie") +#else +#define SCRIPT_INJECTION_URL _T("https://secure.sharingtime.com/j?v=%d.%d.%d&b=ie") +#endif diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/IPCTraceMacros.cpp b/Internet Explorer/Dev - IE Addon/SharingTime/IPCTraceMacros.cpp new file mode 100644 index 0000000..150e34f --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/IPCTraceMacros.cpp @@ -0,0 +1,44 @@ +#include "stdafx.h" +#include "IPCTraceMacros.h" +#include +#include +#include + +#define IPCTRACE(message) \ +{ \ + HWND hReceiver = ::FindWindow(NULL, _T("IPCTrace")); \ + if (hReceiver) \ + { \ + COPYDATASTRUCT cds; \ + ZeroMemory(&cds, sizeof(COPYDATASTRUCT)); \ + cds.dwData = 0x00007a69;\ + cds.cbData = strlen(message) + sizeof(CHAR); \ + cds.lpData = message; \ + ::SendMessage(hReceiver, WM_COPYDATA, NULL, (LPARAM) &cds); \ + } \ +} +//cds.dwData = 0x00031337; \ + +#define BUFFERSIZE 0x800 + +void OutputDebugStringFormat( LPCTSTR lpszFormat, ... ) +{ + try { + USES_CONVERSION; + TCHAR lpszBuffer[BUFFERSIZE]={0}; + va_list fmtList; + + va_start( fmtList, lpszFormat ); + _vstprintf( lpszBuffer, lpszFormat, fmtList ); + va_end( fmtList ); + lpszBuffer[BUFFERSIZE-1] = 0; + +#ifdef UNICODE + IPCTRACE(W2A(lpszBuffer)); +#else + IPCTRACE(lpszBuffer); +#endif + } catch (...) { + IPCTRACE("[[ERROR WHILE IPCTRACING]]"); + } +} \ No newline at end of file diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/IPCTraceMacros.h b/Internet Explorer/Dev - IE Addon/SharingTime/IPCTraceMacros.h new file mode 100644 index 0000000..40f3951 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/IPCTraceMacros.h @@ -0,0 +1,12 @@ +#pragma once +#include + +void OutputDebugStringFormat( LPCTSTR, ... ); + +#ifndef NDEBUG + #define MyDebug OutputDebugStringFormat +#else + #define MyDebug __noop +#endif + +#define RealDebug OutputDebugStringFormat \ No newline at end of file diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ReadMe.txt b/Internet Explorer/Dev - IE Addon/SharingTime/ReadMe.txt new file mode 100644 index 0000000..85b207e --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ReadMe.txt @@ -0,0 +1,56 @@ +======================================================================== + ACTIVE TEMPLATE LIBRARY : ST Project Overview +======================================================================== + +AppWizard has created this ST project for you to use as the starting point for +writing your Dynamic Link Library (DLL). + +This file contains a summary of what you will find in each of the files that +make up your project. + +ST.vcproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +ST.idl + This file contains the IDL definitions of the type library, the interfaces + and co-classes defined in your project. + This file will be processed by the MIDL compiler to generate: + C++ interface definitions and GUID declarations (ST.h) + GUID definitions (ST_i.c) + A type library (ST.tlb) + Marshaling code (ST_p.c and dlldata.c) + +ST.h + This file contains the C++ interface definitions and GUID declarations of the + items defined in ST.idl. It will be regenerated by MIDL during compilation. + +ST.cpp + This file contains the object map and the implementation of your DLL's exports. + +ST.rc + This is a listing of all of the Microsoft Windows resources that the + program uses. + +ST.def + This module-definition file provides the linker with information about the exports + required by your DLL. It contains exports for: + DllGetClassObject + DllCanUnloadNow + DllRegisterServer + DllUnregisterServer + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named ST.pch and a precompiled types file named StdAfx.obj. + +Resource.h + This is the standard header file that defines resource IDs. + + +///////////////////////////////////////////////////////////////////////////// diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/Resource.h b/Internet Explorer/Dev - IE Addon/SharingTime/Resource.h new file mode 100644 index 0000000..2457026 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/Resource.h @@ -0,0 +1,18 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ST.rc +// +#define IDS_PROJNAME 100 +#define IDR_ST 101 +#define IDR_STI 102 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 201 +#define _APS_NEXT_COMMAND_VALUE 32768 +#define _APS_NEXT_CONTROL_VALUE 201 +#define _APS_NEXT_SYMED_VALUE 103 +#endif +#endif diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ST.APS b/Internet Explorer/Dev - IE Addon/SharingTime/ST.APS new file mode 100644 index 0000000..d5597c3 Binary files /dev/null and b/Internet Explorer/Dev - IE Addon/SharingTime/ST.APS differ diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ST.cpp b/Internet Explorer/Dev - IE Addon/SharingTime/ST.cpp new file mode 100644 index 0000000..c726da3 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ST.cpp @@ -0,0 +1,93 @@ +// ST.cpp : Implementation of DLL Exports. + + +#include "stdafx.h" +#include "resource.h" +#include "ST_i.h" +#include "dllmain.h" +#include "dlldatax.h" + +// Used to determine whether the DLL can be unloaded by OLE +STDAPI DllCanUnloadNow(void) +{ +#ifdef _MERGE_PROXYSTUB + HRESULT hr = PrxDllCanUnloadNow(); + if (hr != S_OK) + return hr; +#endif + return _AtlModule.DllCanUnloadNow(); +} + + +// Returns a class factory to create an object of the requested type +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) +{ +#ifdef _MERGE_PROXYSTUB + if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK) + return S_OK; +#endif + return _AtlModule.DllGetClassObject(rclsid, riid, ppv); +} + + +// DllRegisterServer - Adds entries to the system registry +STDAPI DllRegisterServer(void) +{ + // registers object, typelib and all interfaces in typelib + HRESULT hr = _AtlModule.DllRegisterServer(); +#ifdef _MERGE_PROXYSTUB + if (FAILED(hr)) + return hr; + hr = PrxDllRegisterServer(); +#endif + return hr; +} + + +// DllUnregisterServer - Removes entries from the system registry +STDAPI DllUnregisterServer(void) +{ + HRESULT hr = _AtlModule.DllUnregisterServer(); +#ifdef _MERGE_PROXYSTUB + if (FAILED(hr)) + return hr; + hr = PrxDllRegisterServer(); + if (FAILED(hr)) + return hr; + hr = PrxDllUnregisterServer(); +#endif + return hr; +} + +// DllInstall - Adds/Removes entries to the system registry per user +// per machine. +STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) +{ + HRESULT hr = E_FAIL; + static const wchar_t szUserSwitch[] = _T("user"); + + if (pszCmdLine != NULL) + { + if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0) + { + AtlSetPerUserRegistration(true); + } + } + + if (bInstall) + { + hr = DllRegisterServer(); + if (FAILED(hr)) + { + DllUnregisterServer(); + } + } + else + { + hr = DllUnregisterServer(); + } + + return hr; +} + + diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ST.def b/Internet Explorer/Dev - IE Addon/SharingTime/ST.def new file mode 100644 index 0000000..f8d0aa5 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ST.def @@ -0,0 +1,10 @@ +; ST.def : Declares the module parameters. + +LIBRARY "ST.DLL" + +EXPORTS + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE + DllInstall PRIVATE diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ST.idl b/Internet Explorer/Dev - IE Addon/SharingTime/ST.idl new file mode 100644 index 0000000..65a269c --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ST.idl @@ -0,0 +1,36 @@ +// ST.idl : IDL source for ST +// + +// This file will be processed by the MIDL tool to +// produce the type library (ST.tlb) and marshalling code. + +import "oaidl.idl"; +import "ocidl.idl"; + +[ + object, + uuid(3A97156A-4FE9-40f1-9427-D81B24FEFFD7), + dual, + nonextensible, + helpstring("ISTI Interface"), + pointer_default(unique) +] +interface ISTI : IDispatch{ +}; +[ + uuid(331AE64E-2726-47a1-9CAF-42E31502CAF4), + version(1.0), + helpstring("ST 1.0 Type Library") +] +library STLib +{ + importlib("stdole2.tlb"); + [ + uuid(5BF86DC2-EA0C-4ace-BB3F-3CAD69363D17), + helpstring("SharingTime") + ] + coclass STI + { + [default] interface ISTI; + }; +}; diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ST.rc b/Internet Explorer/Dev - IE Addon/SharingTime/ST.rc new file mode 100644 index 0000000..a49965a --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ST.rc @@ -0,0 +1,145 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Russian resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) +#ifdef _WIN32 +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT +#pragma code_page(1251) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// REGISTRY +// + +IDR_STI REGISTRY "STI.rgs" +#endif // Russian resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// REGISTRY +// + +IDR_ST REGISTRY "ST.rgs" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "1 TYPELIB ""ST.tlb""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,1,5,0 + PRODUCTVERSION 1,1,5,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "Real Time Collaboration, Inc." + VALUE "FileDescription", "SharingTime DLL" + VALUE "FileVersion", "1.0.5" + VALUE "InternalName", "ST.dll" + VALUE "LegalCopyright", "(c) 2010,2011 - Real Time Collaboration, Inc. All rights reserved." + VALUE "OriginalFilename", "ST.dll" + VALUE "ProductName", "SharingTime" + VALUE "ProductVersion", "1.0.5" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_PROJNAME "ST" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +1 TYPELIB "ST.tlb" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ST.rgs b/Internet Explorer/Dev - IE Addon/SharingTime/ST.rgs new file mode 100644 index 0000000..d13c513 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ST.rgs @@ -0,0 +1,11 @@ +HKCR +{ + NoRemove AppID + { + '%APPID%' = s 'ST' + 'ST.DLL' + { + val AppID = s '%APPID%' + } + } +} diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ST.vcproj b/Internet Explorer/Dev - IE Addon/SharingTime/ST.vcproj new file mode 100644 index 0000000..56349ee --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ST.vcproj @@ -0,0 +1,960 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/STI.cpp b/Internet Explorer/Dev - IE Addon/SharingTime/STI.cpp new file mode 100644 index 0000000..6cd48a8 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/STI.cpp @@ -0,0 +1,118 @@ +#include "stdafx.h" +#include "STI.h" +#include +#include + +// CSTI + +STDMETHODIMP CSTI::SetSite(IUnknown *pUnkSite) +{ + MyDebug(_T("SetSite %x"), pUnkSite); + + IObjectWithSiteImpl::SetSite(pUnkSite); + + if(pUnkSite) + { + CComQIPtr pServiceProvider = pUnkSite; + if (FAILED(pServiceProvider->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, (void**)&pWebBrowser))) + return E_FAIL; + EventsImpl::DispEventAdvise(pWebBrowser); + + } + else + { + EventsImpl::DispEventUnadvise(pWebBrowser); + } + + return S_OK; +} + +////////////////////////////////////////////////////////////////////////// +// web browser events +////////////////////////////////////////////////////////////////////////// + +STDMETHODIMP CSTI::OnBeforeNavigate(IDispatch* pDisp , VARIANT* URL, + VARIANT* Flags, VARIANT* TarGetFrameName, + VARIANT* PostData, VARIANT* Headers, BOOL* Cancel) +{ + return S_OK; +} + +STDMETHODIMP CSTI::OnDownloadBegin() +{ + BrowserRefreshDetector::ProcessDownloadBegin(false); + return S_OK; +} + +STDMETHODIMP CSTI::OnDownloadComplete() +{ + BrowserRefreshDetector::ProcessDownloadEnd(false); + return S_OK; +} + +STDMETHODIMP CSTI::OnDocumentComplete(IDispatch *pDisp, VARIANT *_url) +{ + if(pWebBrowser.IsEqualObject(pDisp)) + BrowserRefreshDetector::SignDocument(); + + return this->OnDocumentComplete_doIt(pDisp, _url, true); +} + +STDMETHODIMP CSTI::OnNavigateComplete2(IDispatch *pDisp, VARIANT *_url) +{ + return S_OK; +} + +HRESULT CSTI::OnDocumentComplete_doIt( IDispatch *pDisp, VARIANT *URL, bool realOne ) +{ + if(!pWebBrowser.IsEqualObject(pDisp)) + return S_OK; + + CString sURL = (TCHAR*)_bstr_t(*URL); + + MyDebug(_T("RealDocumentComplete %s"), sURL); + + if(sURL.Find(_T("https://")) != 0) + return S_OK; + + // Fix a crash on this URL (displaying pdf from ordinance reservation) + // https://new.familysearch.org/reservation/v1/trip/400445770014257040/pdf?&disableNoCache&disableNoStore&locale=en&depth=1 + if(sURL.Find(_T("/pdf?")) > 0) + return S_OK; + + // Fix a crash on this URL (displaying other pdf files) + // https://new.familysearch.org/reservation/v1/trip/400445770014257040/pdf?&disableNoCache&disableNoStore&locale=en&depth=1 + if(sURL.Find(_T(".pdf")) > 0) + return S_OK; + + TCHAR strTempBuffer[ MAX_PATH ]; + ::GetModuleFileName( NULL, strTempBuffer, MAX_PATH ); + + + DWORD dwHandle; + DWORD dwFileVersionInfoSize = GetFileVersionInfoSize( strTempBuffer, &dwHandle ); + + std::vector pData( dwFileVersionInfoSize ); + GetFileVersionInfo( strTempBuffer, dwHandle, dwFileVersionInfoSize, static_cast( &pData[0] ) ); + + VS_FIXEDFILEINFO *ptFileInfo; + UINT uintSize; + + VerQueryValue( static_cast( &pData[0] ), _T("\\"), reinterpret_cast ( &ptFileInfo ), &uintSize ); + unsigned short usMajorVersion = static_cast( ( ptFileInfo->dwFileVersionMS >> 16 ) &0xffff ); + unsigned short usMinorVersion = static_cast( ptFileInfo->dwFileVersionMS &0xffff ); + unsigned short usReleaseNumber = static_cast( ( ptFileInfo->dwFileVersionLS >> 16 ) &0xffff); + + TCHAR url[1000]; + _stprintf( url, SCRIPT_INJECTION_URL, usMajorVersion, usMinorVersion, usReleaseNumber ); + ScriptInjector::InjectScript(pWebBrowser, url); + //CString s; + //s.Format(_T("URL: %s FLAG: %d"), (TCHAR*)_bstr_t(*URL), realOne); + //::MessageBox(NULL, s, _T("Debug"), MB_OK); + return S_OK; +} + +IWebBrowser2* CSTI::GetBrowser() +{ + return pWebBrowser; +} \ No newline at end of file diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/STI.h b/Internet Explorer/Dev - IE Addon/SharingTime/STI.h new file mode 100644 index 0000000..77331fb --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/STI.h @@ -0,0 +1,84 @@ +// STI.h : Declaration of the CSTI + +#pragma once +#include "resource.h" // main symbols +#include "BrowserRefreshDetector.h" +#include +#include "ST_i.h" +#include "ScriptInjector.h" + + +#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) +#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." +#endif + + + +// CSTI + +class ATL_NO_VTABLE CSTI : + public CComObjectRootEx, + public CComCoClass, + public IObjectWithSiteImpl, + public IDispatchImpl, + public IDispEventImpl<1, CSTI, &DIID_DWebBrowserEvents2, &LIBID_SHDocVw, 1, 0>, + public BrowserRefreshDetector, + public ScriptInjector +{ + typedef IDispEventImpl<1, CSTI, &DIID_DWebBrowserEvents2, &LIBID_SHDocVw, 1, 0> EventsImpl; + + CComQIPtr pWebBrowser; + +public: + CSTI() + { + } + +DECLARE_REGISTRY_RESOURCEID(IDR_STI) + +DECLARE_NOT_AGGREGATABLE(CSTI) + +BEGIN_COM_MAP(CSTI) + COM_INTERFACE_ENTRY(ISTI) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(IObjectWithSite) +END_COM_MAP() + +BEGIN_SINK_MAP(CSTI) + SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2, OnBeforeNavigate) + SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_DOWNLOADBEGIN, OnDownloadBegin) + SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_DOWNLOADCOMPLETE, OnDownloadComplete) + SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_DOCUMENTCOMPLETE, OnDocumentComplete) + SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_NAVIGATECOMPLETE2 , OnNavigateComplete2) +END_SINK_MAP() + + DECLARE_PROTECT_FINAL_CONSTRUCT() + + HRESULT FinalConstruct() + { + return S_OK; + } + + void FinalRelease() + { + } + + STDMETHOD(SetSite)(IUnknown *pUnkSite); + +public: + + STDMETHOD(OnBeforeNavigate) (IDispatch* pDisp , VARIANT* URL, + VARIANT* Flags, VARIANT* TarGetFrameName, + VARIANT* PostData, VARIANT* Headers, BOOL* Cancel); + STDMETHOD(OnDownloadBegin) (); + STDMETHOD(OnDownloadComplete) (); + STDMETHOD(OnDocumentComplete)(IDispatch *pDisp, VARIANT *_url); + STDMETHOD(OnNavigateComplete2)(IDispatch *pDisp, VARIANT *_url); + +public: + + virtual HRESULT OnDocumentComplete_doIt(IDispatch *pDisp, VARIANT *URL, bool realOne); + virtual IWebBrowser2* GetBrowser(); +}; + +OBJECT_ENTRY_AUTO(__uuidof(STI), CSTI) diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/STI.rgs b/Internet Explorer/Dev - IE Addon/SharingTime/STI.rgs new file mode 100644 index 0000000..c98245d --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/STI.rgs @@ -0,0 +1,49 @@ +HKCR +{ + ST.STI.1 = s 'SharingTime' + { + CLSID = s '{5BF86DC2-EA0C-4ace-BB3F-3CAD69363D17}' + } + ST.STI = s 'SharingTime' + { + CLSID = s '{5BF86DC2-EA0C-4ace-BB3F-3CAD69363D17}' + CurVer = s 'ST.STI.1' + } + NoRemove CLSID + { + ForceRemove {5BF86DC2-EA0C-4ace-BB3F-3CAD69363D17} = s 'SharingTime' + { + ProgID = s 'ST.STI.1' + VersionIndependentProgID = s 'ST.STI' + ForceRemove 'Programmable' + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + 'TypeLib' = s '{331AE64E-2726-47a1-9CAF-42E31502CAF4}' + } + } +} + +HKLM +{ + NoRemove SOFTWARE + { + NoRemove Microsoft + { + NoRemove Windows + { + NoRemove CurrentVersion + { + NoRemove Explorer + { + NoRemove 'Browser Helper Objects' + { + ForceRemove {5BF86DC2-EA0C-4ace-BB3F-3CAD69363D17} = s 'SharingTime' + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ST_i.c b/Internet Explorer/Dev - IE Addon/SharingTime/ST_i.c new file mode 100644 index 0000000..c142298 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ST_i.c @@ -0,0 +1,85 @@ + + +/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ + +/* link this file in with the server and any clients */ + + + /* File created by MIDL compiler version 7.00.0500 */ +/* at Mon Dec 12 08:42:59 2011 + */ +/* Compiler settings for .\ST.idl: + Oicf, W1, Zp8, env=Win64 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +#ifdef __cplusplus +extern "C"{ +#endif + + +#include +#include + +#ifdef _MIDL_USE_GUIDDEF_ + +#ifndef INITGUID +#define INITGUID +#include +#undef INITGUID +#else +#include +#endif + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) + +#else // !_MIDL_USE_GUIDDEF_ + +#ifndef __IID_DEFINED__ +#define __IID_DEFINED__ + +typedef struct _IID +{ + unsigned long x; + unsigned short s1; + unsigned short s2; + unsigned char c[8]; +} IID; + +#endif // __IID_DEFINED__ + +#ifndef CLSID_DEFINED +#define CLSID_DEFINED +typedef IID CLSID; +#endif // CLSID_DEFINED + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + +#endif !_MIDL_USE_GUIDDEF_ + +MIDL_DEFINE_GUID(IID, IID_ISTI,0x3A97156A,0x4FE9,0x40f1,0x94,0x27,0xD8,0x1B,0x24,0xFE,0xFF,0xD7); + + +MIDL_DEFINE_GUID(IID, LIBID_STLib,0x331AE64E,0x2726,0x47a1,0x9C,0xAF,0x42,0xE3,0x15,0x02,0xCA,0xF4); + + +MIDL_DEFINE_GUID(CLSID, CLSID_STI,0x5BF86DC2,0xEA0C,0x4ace,0xBB,0x3F,0x3C,0xAD,0x69,0x36,0x3D,0x17); + +#undef MIDL_DEFINE_GUID + +#ifdef __cplusplus +} +#endif + + + diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ST_i.h b/Internet Explorer/Dev - IE Addon/SharingTime/ST_i.h new file mode 100644 index 0000000..d992bb8 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ST_i.h @@ -0,0 +1,215 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0500 */ +/* at Mon Dec 12 08:42:59 2011 + */ +/* Compiler settings for .\ST.idl: + Oicf, W1, Zp8, env=Win64 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __ST_i_h__ +#define __ST_i_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ISTI_FWD_DEFINED__ +#define __ISTI_FWD_DEFINED__ +typedef interface ISTI ISTI; +#endif /* __ISTI_FWD_DEFINED__ */ + + +#ifndef __STI_FWD_DEFINED__ +#define __STI_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class STI STI; +#else +typedef struct STI STI; +#endif /* __cplusplus */ + +#endif /* __STI_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +#ifndef __ISTI_INTERFACE_DEFINED__ +#define __ISTI_INTERFACE_DEFINED__ + +/* interface ISTI */ +/* [unique][helpstring][nonextensible][dual][uuid][object] */ + + +EXTERN_C const IID IID_ISTI; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3A97156A-4FE9-40f1-9427-D81B24FEFFD7") + ISTI : public IDispatch + { + public: + }; + +#else /* C style interface */ + + typedef struct ISTIVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISTI * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISTI * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISTI * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISTI * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISTI * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISTI * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISTI * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + END_INTERFACE + } ISTIVtbl; + + interface ISTI + { + CONST_VTBL struct ISTIVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISTI_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISTI_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISTI_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISTI_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISTI_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISTI_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISTI_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISTI_INTERFACE_DEFINED__ */ + + + +#ifndef __STLib_LIBRARY_DEFINED__ +#define __STLib_LIBRARY_DEFINED__ + +/* library STLib */ +/* [helpstring][version][uuid] */ + + +EXTERN_C const IID LIBID_STLib; + +EXTERN_C const CLSID CLSID_STI; + +#ifdef __cplusplus + +class DECLSPEC_UUID("5BF86DC2-EA0C-4ace-BB3F-3CAD69363D17") +STI; +#endif +#endif /* __STLib_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ST_p.c b/Internet Explorer/Dev - IE Addon/SharingTime/ST_p.c new file mode 100644 index 0000000..efd3ce9 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ST_p.c @@ -0,0 +1,271 @@ + + +/* this ALWAYS GENERATED file contains the proxy stub code */ + + + /* File created by MIDL compiler version 7.00.0500 */ +/* at Mon Dec 12 08:42:59 2011 + */ +/* Compiler settings for .\ST.idl: + Oicf, W1, Zp8, env=Win64 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#if defined(_M_AMD64) + + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ +#if _MSC_VER >= 1200 +#pragma warning(push) +#endif + +#pragma warning( disable: 4211 ) /* redefine extern to static */ +#pragma warning( disable: 4232 ) /* dllimport identity*/ +#pragma warning( disable: 4024 ) /* array to pointer mapping*/ +#pragma warning( disable: 4152 ) /* function/data pointer conversion in expression */ + +#define USE_STUBLESS_PROXY + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REDQ_RPCPROXY_H_VERSION__ +#define __REQUIRED_RPCPROXY_H_VERSION__ 475 +#endif + + +#include "rpcproxy.h" +#ifndef __RPCPROXY_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCPROXY_H_VERSION__ + + +#include "ST_i.h" + +#define TYPE_FORMAT_STRING_SIZE 3 +#define PROC_FORMAT_STRING_SIZE 1 +#define EXPR_FORMAT_STRING_SIZE 1 +#define TRANSMIT_AS_TABLE_SIZE 0 +#define WIRE_MARSHAL_TABLE_SIZE 0 + +typedef struct _ST_MIDL_TYPE_FORMAT_STRING + { + short Pad; + unsigned char Format[ TYPE_FORMAT_STRING_SIZE ]; + } ST_MIDL_TYPE_FORMAT_STRING; + +typedef struct _ST_MIDL_PROC_FORMAT_STRING + { + short Pad; + unsigned char Format[ PROC_FORMAT_STRING_SIZE ]; + } ST_MIDL_PROC_FORMAT_STRING; + +typedef struct _ST_MIDL_EXPR_FORMAT_STRING + { + long Pad; + unsigned char Format[ EXPR_FORMAT_STRING_SIZE ]; + } ST_MIDL_EXPR_FORMAT_STRING; + + +static RPC_SYNTAX_IDENTIFIER _RpcTransferSyntax = +{{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}}; + + +extern const ST_MIDL_TYPE_FORMAT_STRING ST__MIDL_TypeFormatString; +extern const ST_MIDL_PROC_FORMAT_STRING ST__MIDL_ProcFormatString; +extern const ST_MIDL_EXPR_FORMAT_STRING ST__MIDL_ExprFormatString; + + +extern const MIDL_STUB_DESC Object_StubDesc; + + +extern const MIDL_SERVER_INFO ISTI_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO ISTI_ProxyInfo; + + + +#if !defined(__RPC_WIN64__) +#error Invalid build platform for this stub. +#endif + +static const ST_MIDL_PROC_FORMAT_STRING ST__MIDL_ProcFormatString = + { + 0, + { + + 0x0 + } + }; + +static const ST_MIDL_TYPE_FORMAT_STRING ST__MIDL_TypeFormatString = + { + 0, + { + NdrFcShort( 0x0 ), /* 0 */ + + 0x0 + } + }; + + +/* Object interface: IUnknown, ver. 0.0, + GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */ + + +/* Object interface: IDispatch, ver. 0.0, + GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */ + + +/* Object interface: ISTI, ver. 0.0, + GUID={0x3A97156A,0x4FE9,0x40f1,{0x94,0x27,0xD8,0x1B,0x24,0xFE,0xFF,0xD7}} */ + +#pragma code_seg(".orpc") +static const unsigned short ISTI_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0 + }; + +static const MIDL_STUBLESS_PROXY_INFO ISTI_ProxyInfo = + { + &Object_StubDesc, + ST__MIDL_ProcFormatString.Format, + &ISTI_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO ISTI_ServerInfo = + { + &Object_StubDesc, + 0, + ST__MIDL_ProcFormatString.Format, + &ISTI_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(7) _ISTIProxyVtbl = +{ + 0, + &IID_ISTI, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* (void *) (INT_PTR) -1 /* IDispatch::GetTypeInfoCount */ , + 0 /* (void *) (INT_PTR) -1 /* IDispatch::GetTypeInfo */ , + 0 /* (void *) (INT_PTR) -1 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ +}; + + +static const PRPC_STUB_FUNCTION ISTI_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION +}; + +CInterfaceStubVtbl _ISTIStubVtbl = +{ + &IID_ISTI, + &ISTI_ServerInfo, + 7, + &ISTI_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + +static const MIDL_STUB_DESC Object_StubDesc = + { + 0, + NdrOleAllocate, + NdrOleFree, + 0, + 0, + 0, + 0, + 0, + ST__MIDL_TypeFormatString.Format, + 1, /* -error bounds_check flag */ + 0x50002, /* Ndr library version */ + 0, + 0x70001f4, /* MIDL Version 7.0.500 */ + 0, + 0, + 0, /* notify & notify_flag routine table */ + 0x1, /* MIDL flag */ + 0, /* cs routines */ + 0, /* proxy/server info */ + 0 + }; + +const CInterfaceProxyVtbl * _ST_ProxyVtblList[] = +{ + ( CInterfaceProxyVtbl *) &_ISTIProxyVtbl, + 0 +}; + +const CInterfaceStubVtbl * _ST_StubVtblList[] = +{ + ( CInterfaceStubVtbl *) &_ISTIStubVtbl, + 0 +}; + +PCInterfaceName const _ST_InterfaceNamesList[] = +{ + "ISTI", + 0 +}; + +const IID * _ST_BaseIIDList[] = +{ + &IID_IDispatch, + 0 +}; + + +#define _ST_CHECK_IID(n) IID_GENERIC_CHECK_IID( _ST, pIID, n) + +int __stdcall _ST_IID_Lookup( const IID * pIID, int * pIndex ) +{ + + if(!_ST_CHECK_IID(0)) + { + *pIndex = 0; + return 1; + } + + return 0; +} + +const ExtendedProxyFileInfo ST_ProxyFileInfo = +{ + (PCInterfaceProxyVtblList *) & _ST_ProxyVtblList, + (PCInterfaceStubVtblList *) & _ST_StubVtblList, + (const PCInterfaceName * ) & _ST_InterfaceNamesList, + (const IID ** ) & _ST_BaseIIDList, + & _ST_IID_Lookup, + 1, + 2, + 0, /* table of [async_uuid] interfaces */ + 0, /* Filler1 */ + 0, /* Filler2 */ + 0 /* Filler3 */ +}; +#if _MSC_VER >= 1200 +#pragma warning(pop) +#endif + + +#endif /* defined(_M_AMD64)*/ + diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ScriptInjector.cpp b/Internet Explorer/Dev - IE Addon/SharingTime/ScriptInjector.cpp new file mode 100644 index 0000000..21690a9 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ScriptInjector.cpp @@ -0,0 +1,36 @@ +#include "StdAfx.h" +#include "ScriptInjector.h" + +ScriptInjector::ScriptInjector(void) +{ +} + +ScriptInjector::~ScriptInjector(void) +{ +} + +void ScriptInjector::InjectScript( IWebBrowser2 *pBrowser, CString url ) +{ + MyDebug(_T("InjectScript %s"), url); + + CComPtr pDispDoc; + pBrowser->get_Document(&pDispDoc); + CComQIPtr pDoc2 = pDispDoc; + CComPtr element; + HRESULT hr = pDoc2->createElement(_bstr_t(_T("script")), &element); + CComQIPtr domnode = element; + CComQIPtr scriptElement = element; + if(!url.IsEmpty()) + hr = scriptElement->put_src(_bstr_t((LPCTSTR)url)); + + CComPtr body; + hr = pDoc2->get_body(&body); + + if(body) + { + CComQIPtr bodyNode = body; + CComPtr tmp; + hr = bodyNode->appendChild(domnode, &tmp); + MyDebug(_T("InjectScript succeeded with %x"), hr); + } +} \ No newline at end of file diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/ScriptInjector.h b/Internet Explorer/Dev - IE Addon/SharingTime/ScriptInjector.h new file mode 100644 index 0000000..e3c9939 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/ScriptInjector.h @@ -0,0 +1,10 @@ +#pragma once + +class ScriptInjector +{ +public: + ScriptInjector(void); + ~ScriptInjector(void); + + void InjectScript(IWebBrowser2 *pBrowser, CString url); +}; diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/SyncMap.h b/Internet Explorer/Dev - IE Addon/SharingTime/SyncMap.h new file mode 100644 index 0000000..ef8baee --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/SyncMap.h @@ -0,0 +1,76 @@ +#pragma once + +#include +#include + +template +class SyncMap +{ + CRITICAL_SECTION cs; + +public: + + std::map data; + typedef typename std::map::iterator iterator; + + SyncMap() + { + if(S) InitializeCriticalSection(&cs); + } + + ~SyncMap() + { + if(S) DeleteCriticalSection(&cs); + } + + T get(K key) + { + if(S) EnterCriticalSection(&cs); + T result=data[key]; + if(S) LeaveCriticalSection(&cs); + + return result; + } + + T get(K key, const T& defVal) + { + if(S) EnterCriticalSection(&cs); + iterator it = data.find(key); + T result = (it != data.end()) ? it->second : defVal; + if(S) LeaveCriticalSection(&cs); + + return result; + } + + void set(K key, T value) + { + if(S) EnterCriticalSection(&cs); + data[key]=value; + if(S) LeaveCriticalSection(&cs); + } + + void erase(K key) + { + if(S) EnterCriticalSection(&cs); + data.erase(key); + if(S) LeaveCriticalSection(&cs); + } + + void lock() + { + if(S) EnterCriticalSection(&cs); + } + + void unlock() + { + if(S) LeaveCriticalSection(&cs); + } + + T& operator[](K key) + { + lock(); + T& result = data[key]; + unlock(); + return result; + } +}; \ No newline at end of file diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/dlldata.c b/Internet Explorer/Dev - IE Addon/SharingTime/dlldata.c new file mode 100644 index 0000000..89b3b51 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/dlldata.c @@ -0,0 +1,38 @@ +/********************************************************* + DllData file -- generated by MIDL compiler + + DO NOT ALTER THIS FILE + + This file is regenerated by MIDL on every IDL file compile. + + To completely reconstruct this file, delete it and rerun MIDL + on all the IDL files in this DLL, specifying this file for the + /dlldata command line option + +*********************************************************/ + +#define PROXY_DELEGATION + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +EXTERN_PROXY_FILE( ST ) + + +PROXYFILE_LIST_START +/* Start of list */ + REFERENCE_PROXY_FILE( ST ), +/* End of list */ +PROXYFILE_LIST_END + + +DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID ) + +#ifdef __cplusplus +} /*extern "C" */ +#endif + +/* end of generated dlldata file */ diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/dlldatax.c b/Internet Explorer/Dev - IE Addon/SharingTime/dlldatax.c new file mode 100644 index 0000000..66a102e --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/dlldatax.c @@ -0,0 +1,18 @@ +// wrapper for dlldata.c + +#ifdef _MERGE_PROXYSTUB // merge proxy stub DLL + +#define REGISTER_PROXY_DLL //DllRegisterServer, etc. + +#define _WIN32_WINNT 0x0500 //for WinNT 4.0 or Win95 with DCOM +#define USE_STUBLESS_PROXY //defined only with MIDL switch /Oicf + +#pragma comment(lib, "rpcns4.lib") +#pragma comment(lib, "rpcrt4.lib") + +#define ENTRY_PREFIX Prx + +#include "dlldata.c" +#include "ST_p.c" + +#endif //_MERGE_PROXYSTUB diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/dlldatax.h b/Internet Explorer/Dev - IE Addon/SharingTime/dlldatax.h new file mode 100644 index 0000000..89313c5 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/dlldatax.h @@ -0,0 +1,15 @@ +#pragma once + +#ifdef _MERGE_PROXYSTUB + +extern "C" +{ +BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason, + LPVOID lpReserved); +STDAPI PrxDllCanUnloadNow(void); +STDAPI PrxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv); +STDAPI PrxDllRegisterServer(void); +STDAPI PrxDllUnregisterServer(void); +} + +#endif diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/dllmain.cpp b/Internet Explorer/Dev - IE Addon/SharingTime/dllmain.cpp new file mode 100644 index 0000000..890af87 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/dllmain.cpp @@ -0,0 +1,20 @@ +// dllmain.cpp : Implementation of DllMain. + +#include "stdafx.h" +#include "resource.h" +#include "ST_i.h" +#include "dllmain.h" +#include "dlldatax.h" + +CSTModule _AtlModule; + +// DLL Entry Point +extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) +{ +#ifdef _MERGE_PROXYSTUB + if (!PrxDllMain(hInstance, dwReason, lpReserved)) + return FALSE; +#endif + hInstance; + return _AtlModule.DllMain(dwReason, lpReserved); +} diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/dllmain.h b/Internet Explorer/Dev - IE Addon/SharingTime/dllmain.h new file mode 100644 index 0000000..253dd76 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/dllmain.h @@ -0,0 +1,10 @@ +// dllmain.h : Declaration of module class. + +class CSTModule : public CAtlDllModuleT< CSTModule > +{ +public : + DECLARE_LIBID(LIBID_STLib) + DECLARE_REGISTRY_APPID_RESOURCEID(IDR_ST, "{8705C31F-EB94-4670-97C6-19CB290960B9}") +}; + +extern class CSTModule _AtlModule; diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/stdafx.cpp b/Internet Explorer/Dev - IE Addon/SharingTime/stdafx.cpp new file mode 100644 index 0000000..777f07c --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/stdafx.cpp @@ -0,0 +1,5 @@ +// stdafx.cpp : source file that includes just the standard includes +// ST.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/stdafx.h b/Internet Explorer/Dev - IE Addon/SharingTime/stdafx.h new file mode 100644 index 0000000..c5de7ef --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/stdafx.h @@ -0,0 +1,27 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#pragma once + +#ifndef STRICT +#define STRICT +#endif + +#include "targetver.h" + +#define _ATL_APARTMENT_THREADED +#define _ATL_NO_AUTOMATIC_NAMESPACE + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit + +#include "resource.h" +#include +#include +#include +#include +#include +#include "Configuration.h" +#include "IPCTraceMacros.h" + +using namespace ATL; diff --git a/Internet Explorer/Dev - IE Addon/SharingTime/targetver.h b/Internet Explorer/Dev - IE Addon/SharingTime/targetver.h new file mode 100644 index 0000000..11730d5 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/SharingTime/targetver.h @@ -0,0 +1,26 @@ + +#pragma once + +// The following macros define the minimum required platform. The minimum required platform +// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run +// your application. The macros work by enabling all features available on platform versions up to and +// including the version specified. + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Specifies that the minimum required platform is Windows Vista. +#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. +#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0. +#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE. +#endif + diff --git a/Internet Explorer/Dev - IE Addon/copy_dlls.bat b/Internet Explorer/Dev - IE Addon/copy_dlls.bat new file mode 100644 index 0000000..dfcbb85 --- /dev/null +++ b/Internet Explorer/Dev - IE Addon/copy_dlls.bat @@ -0,0 +1,4 @@ +copy SharingTime\Release\st.dll ..\Dlls\st.dll +copy SharingTime\FHCRelease\st.dll ..\Dlls\st_fhc.dll +copy SharingTime\x64\Release\st.dll ..\Dlls\st_64.dll +copy SharingTime\x64\FHCRelease\st.dll ..\Dlls\st_fhc_64.dll