diff options
Diffstat (limited to 'NetCmpts')
27 files changed, 2857 insertions, 0 deletions
diff --git a/NetCmpts/ClearInetCache.cpp b/NetCmpts/ClearInetCache.cpp new file mode 100644 index 0000000..b4d5b4d --- /dev/null +++ b/NetCmpts/ClearInetCache.cpp @@ -0,0 +1,579 @@ +// ClearInetCache.cpp : Implementation of CClearInetCache +#include "stdafx.h" +#include "NetCmpts.h" +#include "ClearInetCache.h" +#include "ProgressDlg.h" +#include "..\common\defines.h" +#include <appmisc.h> +#include "parseurl.h" + +#include <algorithm> +using std::find; + +///////////////////////////////////////////////////////////////////////////// +// CClearInetCache + +STDMETHODIMP CClearInetCache::InterfaceSupportsErrorInfo(REFIID riid) +{ + static const IID* arr[] = + { + &IID_ISecureShutdownWin, + }; + for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++) + { + if (InlineIsEqualGUID(*arr[i],riid)) + return S_OK; + } + return S_FALSE; +} + +////////////////////////////////////////////////////////////////// +// + +#ifndef MAX_CACHE_ENTRY_INFO_SIZE +#define MAX_CACHE_ENTRY_INFO_SIZE 4096 +#endif + +STDMETHODIMP CClearInetCache::DoShutdown(long hParent, long lMode) +{ + HWND hwndParent = (HWND)hParent; + + bool bPrompt = lMode & nsNoPrompt ? false : true; + bool bSilent = lMode & nsQuiet ? true : false; + + // Return Value + HRESULT hRet = S_OK; + + MSG msg; + + // Handle for Searching + HANDLE hFindURL; + // Structure for Cache Info + LPINTERNET_CACHE_ENTRY_INFO lpICEInfo; + // We use MAX_CACHE_ENTRY_INFO_SIZE so we don't get ERROR_INSUFFICIENT_BUFFER's + unsigned long nBufferSize = MAX_CACHE_ENTRY_INFO_SIZE; + + // Alloc Memory (Use malloc for readability) + lpICEInfo = (LPINTERNET_CACHE_ENTRY_INFO)malloc(sizeof(INTERNET_CACHE_ENTRY_INFO) + MAX_CACHE_ENTRY_INFO_SIZE); + if(lpICEInfo == NULL) + return E_OUTOFMEMORY; + + + lpICEInfo->dwStructSize = sizeof(INTERNET_CACHE_ENTRY_INFO); + lpICEInfo->dwReserved = 0; // Always has to be zero + + // Find First + hFindURL = FindFirstUrlCacheEntry (_T("*.*"), lpICEInfo, &nBufferSize); + + if(hFindURL != NULL) + { + // Create Progress dialog + CProgressDlg dlgProg; + dlgProg.Create(hwndParent); + dlgProg.DispEventAdvise(m_spUnkSite); // Pointer from IObjectWithSite + dlgProg.m_ctlProgress.SetRange(0, 2); + dlgProg.m_ctlProgress.SetStep(1); + + bool bLoop = true; + + while(bLoop) + { + + // Update Progress Dialog + dlgProg.SetDlgItemText(IDC_FILENAME, lpICEInfo->lpszSourceUrlName); + dlgProg.m_ctlProgress.SetPos(0); + + // Check if we should delete this URL + if(IsDeleteableURL(lpICEInfo->lpszSourceUrlName)) + { + // Keep going even if error + DeleteUrlCacheEntry(lpICEInfo->lpszSourceUrlName); + + // Update Progress Dialog + dlgProg.m_ctlProgress.SetPos(2); + } + + // nBufferSize Gets changed in FindNext... funcs + // so have to reset + nBufferSize = MAX_CACHE_ENTRY_INFO_SIZE; + + // Get Next One + if(!((bLoop = FindNextUrlCacheEntry(hFindURL, lpICEInfo, &nBufferSize)) ? true : false)) + { + DWORD dwError = ::GetLastError(); + switch(::GetLastError()) + { + case ERROR_NO_MORE_FILES: + case ERROR_NO_MORE_ITEMS: + hRet = S_OK; + break; + // For Debugging + case ERROR_INSUFFICIENT_BUFFER: + hRet = E_OUTOFMEMORY; + break; + default: + hRet = HRESULT_FROM_WIN32(::GetLastError()); + break; + } + } + + PEEK_ALL_MESSAGES(msg); + + // Check for Cancel + if(dlgProg.IsCancelled()) + { + bLoop = false; + hRet = E_ABORT; + } + + } // while bLoop + + // Clean up time + FindCloseUrlCache(hFindURL); + free(lpICEInfo); + + if(dlgProg.IsWindow()) + dlgProg.DestroyWindow(); + + dlgProg.DispEventUnadvise(m_spUnkSite); // Pointer from IObjectWithSite + + return hRet; + + } // if handle is null + + // Clean up + free(lpICEInfo); + + switch(::GetLastError()) + { + case ERROR_NO_MORE_ITEMS: + case ERROR_NO_MORE_FILES: + return S_OK; + break; + default: + return HRESULT_FROM_WIN32(::GetLastError()); + break; + } + +} + +////////////////////////////////////////////////////////////////// +// Load Server List from Registry + +int CClearInetCache::GetServersToDelete() +{ + USES_CONVERSION; + + LoadFlags(); + + int nCnt = 0; // Number of URLs from Registry + int nReadServers = 0; // Number of 'sane' URLs + string sURL = ""; + string sKeyName = ""; + + // Format Key Name + sKeyName.format("Server%.4d", nCnt); + + // Used in URL Parsing + DWORD dwProtocol = 0; + string sServer = ""; + string sObject = ""; + INTERNET_PORT inetPort; + + // Add URLs to List Box + while((sURL = m_Data.GetString(sKeyName, NO_KEY)) != NO_KEY) + { + // Get the Host/Server Part + if(ParseURL(sURL, dwProtocol, sServer, sObject, inetPort)) + { + // Add to Array + m_asServerURLs.push_back(sServer); + nReadServers++; + } + + nCnt++; + + // Format Key Name + sKeyName.format("Server%.4d", nCnt); + + } + + m_bInitialized = true; + + return nReadServers; +} + +////////////////////////////////////////////////////////////////// +// Checks a URL against the list + +bool CClearInetCache::IsDeleteableURL(const string& sURL) +{ + // Sanity Check + if(sURL.empty()) + return false; + + + // Read Servers from Registry + if(!m_bInitialized) + + // Only continue of more than one server + GetServersToDelete(); + + + + // Used in URL Parsing + DWORD dwProtocol = 0; + string sServer = ""; + string sObject = ""; + INTERNET_PORT inetPort; + + // Get the Host/Server Part + if(ParseURL(sURL, dwProtocol, sServer, sObject, inetPort)) + { + if(dwProtocol == INTERNET_SCHEME_UNKNOWN) + return m_bCookies; + + if(m_bClearAll) + return true; + + // Check it against our array + return find(m_asServerURLs.begin(), m_asServerURLs.end(), sServer) + != m_asServerURLs.end(); + + } + + return false; + +} + +STDMETHODIMP CClearInetCache::get_Info(NightSecInfo nsItem, VARIANT* pvVal) +{ + ::VariantClear(pvVal); + + CComBSTR bsRetVal; + + switch(nsItem) + { + case nsName: + pvVal->vt = VT_BSTR; + bsRetVal.LoadString(IDS_INETNAME); + pvVal->bstrVal = bsRetVal.Detach(); + return S_OK; + case nsHelpText: + pvVal->vt = VT_BSTR; + bsRetVal.LoadString(IDS_INETDESC); + pvVal->bstrVal = bsRetVal.Detach(); + return S_OK; + case nsCmdLine: + pvVal->vt = VT_BSTR; + bsRetVal.LoadString(IDS_INETPARAM); + pvVal->bstrVal = bsRetVal.Detach(); + return S_OK; + case nsHideNormal: + pvVal->vt = VT_BOOL; + pvVal->bVal = TRUE; + return S_OK; + } + + ::VariantClear(pvVal); + return S_FALSE; +} + + +STDMETHODIMP CClearInetCache::SetData(IUnknown* pUnk) +{ + return m_Data.Initialize(pUnk); +} + + + + + + + + +///////////////////////////////////////////////////////////////////// +// +// Property Sheet +// +///////////////////////////////////////////////////////////////////// + +HRESULT CClearInetCache::SaveChanges() +{ + int nServer = 0; + string sKeyName = ""; + string sURL; + int iItem = -1; + + // Setup Structures + LV_ITEM lv; + + lv.mask = LVIF_TEXT; + lv.iSubItem = 0; + lv.cchTextMax = MAX_PATH * 2; + + HRESULT hr; + HRESULT hrRet = S_OK; + + // Loop through selected items + while((iItem = m_ctlServerList.GetNextItem(iItem, LVNI_ALL)) != -1) + { + lv.iItem = iItem; + lv.iSubItem = 0; + lv.pszText = sURL.get_buffer(MAX_PATH * 2); + + if(m_ctlServerList.GetItem(&lv)) + { + // Format Registry Key + sKeyName.format("Server%.4d", nServer); + + sURL.release_buffer(); + + hr = m_Data.WriteString(sKeyName, sURL); + if(FAILED(hr)) hrRet = hr; + + } + + nServer++; + + } + + for(nServer = nServer; nServer < m_nLoadedURLs; nServer++) + { + // Format Registry Key + sKeyName.format("Server%.4d", nServer); + + m_Data.DeleteProperty(sKeyName); + } + + + // Save Clear All State + hr = m_Data.WriteInt("Clear All", IsDlgButtonChecked(IDC_CLEARALLSERVERS)); + if(FAILED(hr)) hrRet = hr; + + // Save Cookie State + hr = m_Data.WriteInt("Clear Cookies", IsDlgButtonChecked(IDC_COOKIES)); + if(FAILED(hr)) hrRet = hr; + + return hrRet; +} + +LRESULT CClearInetCache::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + LoadFlags(); + + + m_ctlServerList = GetDlgItem(IDC_SERVERURLLIST); + + // Create the small icon image list. + m_ImageListSmall.Create(16, + 16, + ILC_MASK, // list does not include masks + 1, + 0 ); // list won't grow + + + // Set Mask color for Image Lists + m_ImageListSmall.SetBkColor(::GetSysColor(COLOR_WINDOW)); + + + // Load the icon and add to the image list. + if(m_ImageListSmall.AddIcon(::LoadIcon(_Module.m_hInstResource, + MAKEINTRESOURCE(IDI_INETSHORTCUT))) == -1) + return false; + + + // Associate the image lists with the list view control. + m_ctlServerList.SetImageList(m_ImageListSmall, LVSIL_SMALL); + + + // Fill List Control + string sURL; + string sKeyName = ""; + int nCnt = 0; + + // Format Key Name + sKeyName.format("Server%.4d", nCnt); + + while((sURL = m_Data.GetString(sKeyName, NO_KEY)) != NO_KEY) + { + m_ctlServerList.InsertItem(nCnt, sURL, 0); + + // Make sure each one has a unique lParam + m_dwIDCounter++; + nCnt++; + + // Format Key Name + sKeyName.format("Server%.4d", nCnt); + } + + m_nLoadedURLs = nCnt + 1; + + CheckDlgButton(IDC_CLEARALLSERVERS, m_bClearAll); + CheckDlgButton(IDC_COOKIES, m_bCookies); + UpdateClearAll(); + + m_hIconNew = ::LoadIcon(_Module.m_hInstResource, MAKEINTRESOURCE(IDI_NEW)); + m_hIconDel = ::LoadIcon(_Module.m_hInstResource, MAKEINTRESOURCE(IDI_DEL)); + + CButton btn = GetDlgItem(IDC_NEWURL); + btn.SetIcon(m_hIconNew); + + btn = GetDlgItem(IDC_DELETE); + btn.SetIcon(m_hIconDel); + + return false; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE + +} + + + +LRESULT CClearInetCache::OnURLListEndLabelEdit(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) +{ + LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pnmh; + + // Only Change if there is Text + if(pDispInfo->item.pszText != NULL) + { + // Used in Checking URL + DWORD dwProtocol = 0; + string sTemp1 = ""; + string sTemp2 = ""; + INTERNET_PORT inetPort; + + + // Do a Check on URL + if(ParseURL(pDispInfo->item.pszText, dwProtocol, sTemp1, sTemp2, inetPort)) + { + // Set Item text + m_ctlServerList.SetItem(&(pDispInfo->item)); + SetDirty(true); + } + else + { + // Try adding http:// + string sNewURL(_T("http://")); + sNewURL += pDispInfo->item.pszText; + if(ParseURL(sNewURL, dwProtocol, sTemp1, sTemp2, inetPort)) + { + // Set Item text + pDispInfo->item.pszText = sNewURL.get_buffer(); + m_ctlServerList.SetItem(&(pDispInfo->item)); + SetDirty(true); + } + else + { + // Give an Error Box + string sMsg; + sMsg.load_string(IDS_NOTVALIDURL); + MessageBox(sMsg, "Night Security", MB_ICONSTOP | MB_OK); + } + + } + } + + return 0; + +} + + +LRESULT CClearInetCache::OnURLListKeyDown(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) +{ + LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pnmh; + + // if F2 then Edit + if(pLVKeyDow->wVKey == VK_F2) + { + m_ctlServerList.SetFocus(); // Needs to have the Focus in order to edit + m_ctlServerList.EditLabel(m_ctlServerList.GetNextItem(-1, LVNI_ALL | LVNI_FOCUSED)); + } + + // If Delete then call Delete Handler + if(pLVKeyDow->wVKey == VK_DELETE) + OnDelete(0, 0, 0, bHandled); + + return 0; + +} + +LRESULT CClearInetCache::OnListSetFocus(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) +{ + // Disclaimer: This is a kludge fix + // SysListView32 wouldn't redraw itself when it had focus + // and app was activated + m_ctlServerList.RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE); + return 0; +} + + +LRESULT CClearInetCache::OnNewURL(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) +{ + int iItem = -1; + string sNewURL; + sNewURL.load_string(IDS_NEWURL); + + // Insert Item + if((iItem = m_ctlServerList.InsertItem(0, sNewURL, 0)) != -1) + { + m_dwIDCounter++; + + // Open for Editing + m_ctlServerList.SetFocus(); // Needs to have the Focus in order to edit + m_ctlServerList.EditLabel(iItem); + + SetDirty(true); + + } + + return 0; + +} + +LRESULT CClearInetCache::OnDelete(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) +{ + int iItem = -1; + + LV_ITEM lv; + + lv.mask = LVIF_TEXT; + lv.iSubItem = 0; + + // Loop through selected items + while((iItem = m_ctlServerList.GetNextItem(-1, LVNI_ALL | LVNI_SELECTED)) != -1) + { + // Take it out of List Box + m_ctlServerList.DeleteItem(iItem); + SetDirty(true); + } + + return 0; + +} + + +LRESULT CClearInetCache::OnClearAll(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) +{ + UpdateClearAll(); + + SetDirty(true); + + return 0; +} + +void CClearInetCache::UpdateClearAll() +{ + bool bEnable = !IsDlgButtonChecked(IDC_CLEARALLSERVERS); + + ::EnableWindow(GetDlgItem(IDC_SERVERURLLIST), bEnable); + ::EnableWindow(GetDlgItem(IDC_NEWURL), bEnable); + ::EnableWindow(GetDlgItem(IDC_DELETE), bEnable); + + SetDirty(true); +} + +void CClearInetCache::LoadFlags() +{ + m_bClearAll = m_Data.GetInt("Clear All", true) ? true : false; + m_bCookies = m_Data.GetInt("Clear Cookies", false) ? true : false; +} diff --git a/NetCmpts/ClearInetCache.h b/NetCmpts/ClearInetCache.h new file mode 100644 index 0000000..274d5d9 --- /dev/null +++ b/NetCmpts/ClearInetCache.h @@ -0,0 +1,165 @@ +// ClearInetCache.h : Declaration of the CClearInetCache + +#ifndef __CLEARINETCACHE_H_ +#define __CLEARINETCACHE_H_ + +#include "resource.h" // main symbols +#include "../Common/CmptData.h" + +#define NO_KEY _T("No Key") + +#include <vector> +using std::vector; + +#include <mystring.h> +typedef vector<string> StringArray; + +#include <atlctrls.h> +#include <contexthelp.h> + +// #include "../common/events.h" + +///////////////////////////////////////////////////////////////////////////// +// CClearInetCache + +class ATL_NO_VTABLE CClearInetCache : + public CComObjectRootEx<CComSingleThreadModel>, + public CComCoClass<CClearInetCache, &CLSID_ClearInetCache>, + public ISupportErrorInfo, + public IDispatchImpl<ISecureShutdownWin, &IID_ISecureShutdownWin, &LIBID_NightSecNetCmpts>, +// public IDispEventImpl<0, CClearInetCache, &DIID_DShutdownEvents, &LIBID_NightSecShutdown, 2, 5>, + public IObjectWithSiteImpl<CClearInetCache>, + + // Property Page + public IPropertyPageImpl<CClearInetCache>, + public CDialogImpl<CClearInetCache>, + public CContextHelp<CClearInetCache> + +{ +public: + CClearInetCache() + { + m_dwTitleID = IDS_TITLEClearInetCacheProps; + m_dwHelpFileID = IDS_HELPFILEClearInetCacheProps; + m_dwDocStringID = IDS_DOCSTRINGClearInetCacheProps; + +// m_bCancel = false; + m_bClearAll = true; + m_bCookies = false; + m_bInitialized = false; + m_dwIDCounter = 0; + m_nLoadedURLs = 0; + } + + + +DECLARE_REGISTRY_RESOURCEID(IDR_CLEARINETCACHE) + +BEGIN_COM_MAP(CClearInetCache) + COM_INTERFACE_ENTRY(ISecureShutdownWin) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(ISupportErrorInfo) + COM_INTERFACE_ENTRY(IObjectWithSite) + COM_INTERFACE_ENTRY(IPropertyPage) +END_COM_MAP() + +/*BEGIN_SINK_MAP(CClearInetCache) + SINK_ENTRY_EX(0, DIID_DShutdownEvents, 1, OnCancel) +END_SINK_MAP()*/ + +// ISupportsErrorInfo + STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); + +// ISecureShutdownWin +public: + STDMETHOD(get_Info)(/*[in]*/ NightSecInfo nsItem, /*[out, retval]*/ VARIANT* pvVal); + STDMETHOD(DoShutdown)(/*[in]*/ long hParent, /*[in]*/ long lMode); + STDMETHOD(SetData)(/*[in]*/ IUnknown* pUnk); + +// Events +// protected: +// STDMETHOD(OnCancel)() +// { m_bCancel = true; return S_OK; }; + +// Helpers +protected: + bool IsDeleteableURL(const string& sURL); + int GetServersToDelete(); + StringArray m_asServerURLs; + bool m_bClearAll; + bool m_bInitialized; + + +/////////////////////////////////////////////////////////////////// +// Property Sheet Stuff + +public: + + enum {IDD = IDD_CLEARINETCACHE}; + + BEGIN_MSG_MAP(CClearInetCache) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) + NOTIFY_HANDLER(IDC_SERVERURLLIST, LVN_ENDLABELEDIT, OnURLListEndLabelEdit) + NOTIFY_HANDLER(IDC_SERVERURLLIST, LVN_KEYDOWN, OnURLListKeyDown) + NOTIFY_HANDLER(IDC_SERVERURLLIST, NM_SETFOCUS, OnListSetFocus) + COMMAND_HANDLER(IDC_NEWURL, BN_CLICKED, OnNewURL) + COMMAND_HANDLER(IDC_DELETE, BN_CLICKED, OnDelete) + COMMAND_HANDLER(IDC_CLEARALLSERVERS, BN_CLICKED, OnClearAll) + CHAIN_MSG_MAP(IPropertyPageImpl<CClearInetCache>) + CHAIN_MSG_MAP(CContextHelp<CClearInetCache>) + END_MSG_MAP() + + BEGIN_HELP_MAP("nightsec.hlp") + HELP_ID(IDC_SERVERURLLIST, 4016) + HELP_ID(IDC_COOKIES, 4015) + HELP_ID(IDC_CLEARALLSERVERS, 4014) + HELP_ID(IDC_NEWURL, 4018) + HELP_ID(IDC_DELETE, 4017) + END_HELP_MAP + + + +// Property Sheet Messages + LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnURLListEndLabelEdit(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); + LRESULT OnURLListKeyDown(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); + LRESULT OnListSetFocus(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); + LRESULT OnNewURL(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); + LRESULT OnDelete(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); + LRESULT OnClearAll(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); + +protected: + HRESULT SaveChanges(); + void UpdateClearAll(); + + +// Data +protected: +// bool m_bCancel; // Called from Cancel Event + + int m_nLoadedURLs; + void LoadFlags(); + bool m_bCookies; + HICON m_hIconDel; + HICON m_hIconNew; + CPropertyBag m_Data; + CListViewCtrl m_ctlServerList; + CImageList m_ImageListSmall; + DWORD m_dwIDCounter; + + + public: + STDMETHOD(Apply)(void) + { + ATLTRACE(_T("CClearInetCache::Apply\n")); + + HRESULT hr = SaveChanges(); + + m_bDirty = FAILED(hr); + return hr; + } + +}; + + +#endif //__CLEARINETCACHE_H_ diff --git a/NetCmpts/ClearInetCache.rgs b/NetCmpts/ClearInetCache.rgs new file mode 100644 index 0000000..7c37a81 --- /dev/null +++ b/NetCmpts/ClearInetCache.rgs @@ -0,0 +1,42 @@ +HKCR
+{
+ NightSecurity.ClearInetCache.25 = s 'ClearInetCache Class'
+ {
+ CLSID = s '{34F1169B-F275-11d2-A589-0020182B97FC}'
+ }
+ NightSecurity.ClearInetCache = s 'ClearInetCache Class'
+ {
+ CurVer = s 'NightSecurity.ClearInetCache.25'
+ CLSID = s '{34F1169B-F275-11d2-A589-0020182B97FC}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {34F1169B-F275-11d2-A589-0020182B97FC} = s 'ClearInetCache Class'
+ {
+ ProgID = s 'NightSecurity.ClearInetCache.25'
+ VersionIndependentProgID = s 'NightSecurity.ClearInetCache'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ }
+ }
+}
+
+HKEY_LOCAL_MACHINE
+{
+ NoRemove 'Software'
+ {
+ NoRemove 'Heavenly Helpers'
+ {
+ NoRemove 'Night Security'
+ {
+ NoRemove 'Installed Components'
+ {
+ 'NightSecurity.ClearInetCache'
+ }
+ }
+ }
+ }
+}
\ No newline at end of file diff --git a/NetCmpts/CmptIfaces.h b/NetCmpts/CmptIfaces.h new file mode 100644 index 0000000..7453146 --- /dev/null +++ b/NetCmpts/CmptIfaces.h @@ -0,0 +1,780 @@ +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + +/* File created by MIDL compiler version 5.01.0164 */ +/* at Wed Mar 01 12:32:24 2000 + */ +/* Compiler settings for E:\Projects\NightSec\Interfaces\CmptIfaces.idl: + Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data +*/ +//@@MIDL_FILE_HEADING( ) + + +/* verify that the <rpcndr.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 440 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of <rpcndr.h> +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __CmptIfaces_h__ +#define __CmptIfaces_h__ + +#ifdef __cplusplus +extern "C"{ +#endif + +/* Forward Declarations */ + +#ifndef __ISecureShutdownWin_FWD_DEFINED__ +#define __ISecureShutdownWin_FWD_DEFINED__ +typedef interface ISecureShutdownWin ISecureShutdownWin; +#endif /* __ISecureShutdownWin_FWD_DEFINED__ */ + + +#ifndef __ISecureShutdownDOS_FWD_DEFINED__ +#define __ISecureShutdownDOS_FWD_DEFINED__ +typedef interface ISecureShutdownDOS ISecureShutdownDOS; +#endif /* __ISecureShutdownDOS_FWD_DEFINED__ */ + + +#ifndef __INightSecError_FWD_DEFINED__ +#define __INightSecError_FWD_DEFINED__ +typedef interface INightSecError INightSecError; +#endif /* __INightSecError_FWD_DEFINED__ */ + + +#ifndef __INightSecErrorFix_FWD_DEFINED__ +#define __INightSecErrorFix_FWD_DEFINED__ +typedef interface INightSecErrorFix INightSecErrorFix; +#endif /* __INightSecErrorFix_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void __RPC_FAR * ); + +/* interface __MIDL_itf_CmptIfaces_0000 */ +/* [local] */ + +typedef /* [helpstring][uuid][v1_enum] */ +enum NightSecInfo + { nsName = 0, + nsCmdLine = nsName + 1, + nsHelpText = nsCmdLine + 1, + nsForceShow = nsHelpText + 1, + nsHideNormal = nsForceShow + 1, + nsCopyAble = nsHideNormal + 1, + nsHelpFile = nsCopyAble + 1, + nsHelpTopic = nsHelpFile + 1 + } NightSecInfo; + +/* [helpstring] */ #define nsNoPrompt ( 0x2 ) + +/* [helpstring] */ #define nsQuiet ( 0x4 ) + + + +extern RPC_IF_HANDLE __MIDL_itf_CmptIfaces_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_CmptIfaces_0000_v0_0_s_ifspec; + +#ifndef __ISecureShutdownWin_INTERFACE_DEFINED__ +#define __ISecureShutdownWin_INTERFACE_DEFINED__ + +/* interface ISecureShutdownWin */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_ISecureShutdownWin; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("34F11691-F275-11d2-A589-0020182B97FC") + ISecureShutdownWin : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DoShutdown( + /* [in] */ long hParent, + /* [in] */ long Mode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetData( + /* [in] */ IUnknown __RPC_FAR *pUnk) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Info( + /* [in] */ NightSecInfo nsItem, + /* [retval][out] */ VARIANT __RPC_FAR *pvVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISecureShutdownWinVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( + ISecureShutdownWin __RPC_FAR * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( + ISecureShutdownWin __RPC_FAR * This); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( + ISecureShutdownWin __RPC_FAR * This); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( + ISecureShutdownWin __RPC_FAR * This, + /* [out] */ UINT __RPC_FAR *pctinfo); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( + ISecureShutdownWin __RPC_FAR * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( + ISecureShutdownWin __RPC_FAR * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID __RPC_FAR *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( + ISecureShutdownWin __RPC_FAR * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, + /* [out] */ VARIANT __RPC_FAR *pVarResult, + /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, + /* [out] */ UINT __RPC_FAR *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *DoShutdown )( + ISecureShutdownWin __RPC_FAR * This, + /* [in] */ long hParent, + /* [in] */ long Mode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetData )( + ISecureShutdownWin __RPC_FAR * This, + /* [in] */ IUnknown __RPC_FAR *pUnk); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Info )( + ISecureShutdownWin __RPC_FAR * This, + /* [in] */ NightSecInfo nsItem, + /* [retval][out] */ VARIANT __RPC_FAR *pvVal); + + END_INTERFACE + } ISecureShutdownWinVtbl; + + interface ISecureShutdownWin + { + CONST_VTBL struct ISecureShutdownWinVtbl __RPC_FAR *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISecureShutdownWin_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISecureShutdownWin_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISecureShutdownWin_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISecureShutdownWin_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISecureShutdownWin_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISecureShutdownWin_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISecureShutdownWin_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISecureShutdownWin_DoShutdown(This,hParent,Mode) \ + (This)->lpVtbl -> DoShutdown(This,hParent,Mode) + +#define ISecureShutdownWin_SetData(This,pUnk) \ + (This)->lpVtbl -> SetData(This,pUnk) + +#define ISecureShutdownWin_get_Info(This,nsItem,pvVal) \ + (This)->lpVtbl -> get_Info(This,nsItem,pvVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISecureShutdownWin_DoShutdown_Proxy( + ISecureShutdownWin __RPC_FAR * This, + /* [in] */ long hParent, + /* [in] */ long Mode); + + +void __RPC_STUB ISecureShutdownWin_DoShutdown_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISecureShutdownWin_SetData_Proxy( + ISecureShutdownWin __RPC_FAR * This, + /* [in] */ IUnknown __RPC_FAR *pUnk); + + +void __RPC_STUB ISecureShutdownWin_SetData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISecureShutdownWin_get_Info_Proxy( + ISecureShutdownWin __RPC_FAR * This, + /* [in] */ NightSecInfo nsItem, + /* [retval][out] */ VARIANT __RPC_FAR *pvVal); + + +void __RPC_STUB ISecureShutdownWin_get_Info_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISecureShutdownWin_INTERFACE_DEFINED__ */ + + +#ifndef __ISecureShutdownDOS_INTERFACE_DEFINED__ +#define __ISecureShutdownDOS_INTERFACE_DEFINED__ + +/* interface ISecureShutdownDOS */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_ISecureShutdownDOS; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("34F11692-F275-11d2-A589-0020182B97FC") + ISecureShutdownDOS : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetBatchText( + /* [retval][out] */ BSTR __RPC_FAR *psText) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetData( + /* [in] */ IUnknown __RPC_FAR *pUnk) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Info( + /* [in] */ NightSecInfo nsItem, + /* [retval][out] */ VARIANT __RPC_FAR *pvVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISecureShutdownDOSVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( + ISecureShutdownDOS __RPC_FAR * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( + ISecureShutdownDOS __RPC_FAR * This); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( + ISecureShutdownDOS __RPC_FAR * This); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( + ISecureShutdownDOS __RPC_FAR * This, + /* [out] */ UINT __RPC_FAR *pctinfo); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( + ISecureShutdownDOS __RPC_FAR * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( + ISecureShutdownDOS __RPC_FAR * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID __RPC_FAR *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( + ISecureShutdownDOS __RPC_FAR * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, + /* [out] */ VARIANT __RPC_FAR *pVarResult, + /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, + /* [out] */ UINT __RPC_FAR *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetBatchText )( + ISecureShutdownDOS __RPC_FAR * This, + /* [retval][out] */ BSTR __RPC_FAR *psText); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetData )( + ISecureShutdownDOS __RPC_FAR * This, + /* [in] */ IUnknown __RPC_FAR *pUnk); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Info )( + ISecureShutdownDOS __RPC_FAR * This, + /* [in] */ NightSecInfo nsItem, + /* [retval][out] */ VARIANT __RPC_FAR *pvVal); + + END_INTERFACE + } ISecureShutdownDOSVtbl; + + interface ISecureShutdownDOS + { + CONST_VTBL struct ISecureShutdownDOSVtbl __RPC_FAR *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISecureShutdownDOS_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISecureShutdownDOS_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISecureShutdownDOS_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISecureShutdownDOS_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISecureShutdownDOS_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISecureShutdownDOS_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISecureShutdownDOS_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISecureShutdownDOS_GetBatchText(This,psText) \ + (This)->lpVtbl -> GetBatchText(This,psText) + +#define ISecureShutdownDOS_SetData(This,pUnk) \ + (This)->lpVtbl -> SetData(This,pUnk) + +#define ISecureShutdownDOS_get_Info(This,nsItem,pvVal) \ + (This)->lpVtbl -> get_Info(This,nsItem,pvVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISecureShutdownDOS_GetBatchText_Proxy( + ISecureShutdownDOS __RPC_FAR * This, + /* [retval][out] */ BSTR __RPC_FAR *psText); + + +void __RPC_STUB ISecureShutdownDOS_GetBatchText_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISecureShutdownDOS_SetData_Proxy( + ISecureShutdownDOS __RPC_FAR * This, + /* [in] */ IUnknown __RPC_FAR *pUnk); + + +void __RPC_STUB ISecureShutdownDOS_SetData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISecureShutdownDOS_get_Info_Proxy( + ISecureShutdownDOS __RPC_FAR * This, + /* [in] */ NightSecInfo nsItem, + /* [retval][out] */ VARIANT __RPC_FAR *pvVal); + + +void __RPC_STUB ISecureShutdownDOS_get_Info_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISecureShutdownDOS_INTERFACE_DEFINED__ */ + + +#ifndef __INightSecError_INTERFACE_DEFINED__ +#define __INightSecError_INTERFACE_DEFINED__ + +/* interface INightSecError */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_INightSecError; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("409C4B09-9310-11d3-BFC1-0020182B97FC") + INightSecError : public IUnknown + { + public: + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Err( + /* [retval][out] */ HRESULT __RPC_FAR *pbsRet) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Description( + /* [retval][out] */ BSTR __RPC_FAR *pbsRet) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_HelpFile( + /* [retval][out] */ BSTR __RPC_FAR *pbsRet) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_HelpContext( + /* [retval][out] */ long __RPC_FAR *plRet) = 0; + + }; + +#else /* C style interface */ + + typedef struct INightSecErrorVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( + INightSecError __RPC_FAR * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( + INightSecError __RPC_FAR * This); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( + INightSecError __RPC_FAR * This); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Err )( + INightSecError __RPC_FAR * This, + /* [retval][out] */ HRESULT __RPC_FAR *pbsRet); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Description )( + INightSecError __RPC_FAR * This, + /* [retval][out] */ BSTR __RPC_FAR *pbsRet); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_HelpFile )( + INightSecError __RPC_FAR * This, + /* [retval][out] */ BSTR __RPC_FAR *pbsRet); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_HelpContext )( + INightSecError __RPC_FAR * This, + /* [retval][out] */ long __RPC_FAR *plRet); + + END_INTERFACE + } INightSecErrorVtbl; + + interface INightSecError + { + CONST_VTBL struct INightSecErrorVtbl __RPC_FAR *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INightSecError_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INightSecError_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INightSecError_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INightSecError_get_Err(This,pbsRet) \ + (This)->lpVtbl -> get_Err(This,pbsRet) + +#define INightSecError_get_Description(This,pbsRet) \ + (This)->lpVtbl -> get_Description(This,pbsRet) + +#define INightSecError_get_HelpFile(This,pbsRet) \ + (This)->lpVtbl -> get_HelpFile(This,pbsRet) + +#define INightSecError_get_HelpContext(This,plRet) \ + (This)->lpVtbl -> get_HelpContext(This,plRet) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE INightSecError_get_Err_Proxy( + INightSecError __RPC_FAR * This, + /* [retval][out] */ HRESULT __RPC_FAR *pbsRet); + + +void __RPC_STUB INightSecError_get_Err_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE INightSecError_get_Description_Proxy( + INightSecError __RPC_FAR * This, + /* [retval][out] */ BSTR __RPC_FAR *pbsRet); + + +void __RPC_STUB INightSecError_get_Description_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE INightSecError_get_HelpFile_Proxy( + INightSecError __RPC_FAR * This, + /* [retval][out] */ BSTR __RPC_FAR *pbsRet); + + +void __RPC_STUB INightSecError_get_HelpFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE INightSecError_get_HelpContext_Proxy( + INightSecError __RPC_FAR * This, + /* [retval][out] */ long __RPC_FAR *plRet); + + +void __RPC_STUB INightSecError_get_HelpContext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INightSecError_INTERFACE_DEFINED__ */ + + +#ifndef __INightSecErrorFix_INTERFACE_DEFINED__ +#define __INightSecErrorFix_INTERFACE_DEFINED__ + +/* interface INightSecErrorFix */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_INightSecErrorFix; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("409C4B04-9310-11d3-BFC1-0020182B97FC") + INightSecErrorFix : public IUnknown + { + public: + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Fixable( + /* [retval][out] */ BOOL __RPC_FAR *pbRet) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Fix( void) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Retryable( + /* [retval][out] */ BOOL __RPC_FAR *pbRet) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Retry( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct INightSecErrorFixVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( + INightSecErrorFix __RPC_FAR * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( + INightSecErrorFix __RPC_FAR * This); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( + INightSecErrorFix __RPC_FAR * This); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Fixable )( + INightSecErrorFix __RPC_FAR * This, + /* [retval][out] */ BOOL __RPC_FAR *pbRet); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Fix )( + INightSecErrorFix __RPC_FAR * This); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Retryable )( + INightSecErrorFix __RPC_FAR * This, + /* [retval][out] */ BOOL __RPC_FAR *pbRet); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Retry )( + INightSecErrorFix __RPC_FAR * This); + + END_INTERFACE + } INightSecErrorFixVtbl; + + interface INightSecErrorFix + { + CONST_VTBL struct INightSecErrorFixVtbl __RPC_FAR *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INightSecErrorFix_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INightSecErrorFix_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INightSecErrorFix_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INightSecErrorFix_get_Fixable(This,pbRet) \ + (This)->lpVtbl -> get_Fixable(This,pbRet) + +#define INightSecErrorFix_Fix(This) \ + (This)->lpVtbl -> Fix(This) + +#define INightSecErrorFix_get_Retryable(This,pbRet) \ + (This)->lpVtbl -> get_Retryable(This,pbRet) + +#define INightSecErrorFix_Retry(This) \ + (This)->lpVtbl -> Retry(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE INightSecErrorFix_get_Fixable_Proxy( + INightSecErrorFix __RPC_FAR * This, + /* [retval][out] */ BOOL __RPC_FAR *pbRet); + + +void __RPC_STUB INightSecErrorFix_get_Fixable_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE INightSecErrorFix_Fix_Proxy( + INightSecErrorFix __RPC_FAR * This); + + +void __RPC_STUB INightSecErrorFix_Fix_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE INightSecErrorFix_get_Retryable_Proxy( + INightSecErrorFix __RPC_FAR * This, + /* [retval][out] */ BOOL __RPC_FAR *pbRet); + + +void __RPC_STUB INightSecErrorFix_get_Retryable_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE INightSecErrorFix_Retry_Proxy( + INightSecErrorFix __RPC_FAR * This); + + +void __RPC_STUB INightSecErrorFix_Retry_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INightSecErrorFix_INTERFACE_DEFINED__ */ + + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER BSTR_UserSize( unsigned long __RPC_FAR *, unsigned long , BSTR __RPC_FAR * ); +unsigned char __RPC_FAR * __RPC_USER BSTR_UserMarshal( unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * ); +unsigned char __RPC_FAR * __RPC_USER BSTR_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * ); +void __RPC_USER BSTR_UserFree( unsigned long __RPC_FAR *, BSTR __RPC_FAR * ); + +unsigned long __RPC_USER VARIANT_UserSize( unsigned long __RPC_FAR *, unsigned long , VARIANT __RPC_FAR * ); +unsigned char __RPC_FAR * __RPC_USER VARIANT_UserMarshal( unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, VARIANT __RPC_FAR * ); +unsigned char __RPC_FAR * __RPC_USER VARIANT_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, VARIANT __RPC_FAR * ); +void __RPC_USER VARIANT_UserFree( unsigned long __RPC_FAR *, VARIANT __RPC_FAR * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/NetCmpts/NetCmpts.cpp b/NetCmpts/NetCmpts.cpp new file mode 100644 index 0000000..56f00a2 --- /dev/null +++ b/NetCmpts/NetCmpts.cpp @@ -0,0 +1,100 @@ +// NetCmpts.cpp : Implementation of DLL Exports. + + +// Note: Proxy/Stub Information +// To build a separate proxy/stub DLL, +// run nmake -f NetCmptsps.mk in the project directory. + +#include "stdafx.h" +#include "resource.h" +#include <initguid.h> +#include "NetCmpts.h" + +#include "NetCmpts_i.c" +#include "../interfaces/CmptIfaces_i.c" + +#include "ClearInetCache.h" + +#include "..\Common\Defines.h" + +CComModule _Module; + +BEGIN_OBJECT_MAP(ObjectMap) + OBJECT_ENTRY(CLSID_ClearInetCache, CClearInetCache) +END_OBJECT_MAP() + +///////////////////////////////////////////////////////////////////////////// +// DLL Entry Point + +extern "C" +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) +{ + if (dwReason == DLL_PROCESS_ATTACH) + { + _Module.Init(ObjectMap, hInstance, &LIBID_NightSecNetCmpts); + DisableThreadLibraryCalls(hInstance); + } + else if (dwReason == DLL_PROCESS_DETACH) + _Module.Term(); + return TRUE; // ok +} + +///////////////////////////////////////////////////////////////////////////// +// Used to determine whether the DLL can be unloaded by OLE + +STDAPI DllCanUnloadNow(void) +{ + return (_Module.GetLockCount()==0) ? S_OK : S_FALSE; +} + +///////////////////////////////////////////////////////////////////////////// +// Returns a class factory to create an object of the requested type + +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) +{ + return _Module.GetClassObject(rclsid, riid, ppv); +} + +///////////////////////////////////////////////////////////////////////////// +// DllRegisterServer - Adds entries to the system registry + +STDAPI DllRegisterServer(void) +{ + // <<<< Addition + // InstallShield Doesn't call this for the current thread + // And if we're using the _ATL_DLL (COM Based) we need this + HRESULT hr = CoInitialize(NULL); + // End >>>> + + // registers object, typelib and all interfaces in typelib + return _Module.RegisterServer(TRUE); + + // <<<< Addition + if(SUCCEEDED(hr)) + CoUninitialize(); + + return hr; + // End >>>> + +} + +///////////////////////////////////////////////////////////////////////////// +// DllUnregisterServer - Removes entries from the system registry + +STDAPI DllUnregisterServer(void) +{ + // <<<< Addition + HRESULT hr = CoInitialize(NULL); + // End >>>> + + return _Module.UnregisterServer(TRUE); + + // <<<< Addition + if(SUCCEEDED(hr)) + CoUninitialize(); + + return S_OK; + // End >>>> +} + + diff --git a/NetCmpts/NetCmpts.def b/NetCmpts/NetCmpts.def new file mode 100644 index 0000000..4d6bb00 --- /dev/null +++ b/NetCmpts/NetCmpts.def @@ -0,0 +1,9 @@ +; NetCmpts.def : Declares the module parameters.
+
+LIBRARY "NetCmpts.DLL"
+
+EXPORTS
+ DllCanUnloadNow @1 PRIVATE
+ DllGetClassObject @2 PRIVATE
+ DllRegisterServer @3 PRIVATE
+ DllUnregisterServer @4 PRIVATE
diff --git a/NetCmpts/NetCmpts.dsp b/NetCmpts/NetCmpts.dsp new file mode 100644 index 0000000..f77f50c --- /dev/null +++ b/NetCmpts/NetCmpts.dsp @@ -0,0 +1,417 @@ +# Microsoft Developer Studio Project File - Name="NetCmpts" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=NetCmpts - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "NetCmpts.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "NetCmpts.mak" CFG="NetCmpts - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "NetCmpts - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "NetCmpts - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "NetCmpts - Win32 Release MinSize" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "NetCmpts - Win32 Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "NetCmpts - Win32 Unicode Release MinSize" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "NetCmpts - Win32 Unicode Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "NetCmpts - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comctl32.lib /nologo /base:"0x67850000" /subsystem:windows /dll /debug /machine:I386 /out:"../Debug/NetCmpts.dll " /pdbtype:sept +# Begin Custom Build - Performing registration +OutDir=.\Debug +TargetPath=\Projects\NightSec\Debug\NetCmpts.dll +InputPath=\Projects\NightSec\Debug\NetCmpts.dll +SOURCE="$(InputPath)" + +"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + +# End Custom Build + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Unicode Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "DebugU" +# PROP BASE Intermediate_Dir "DebugU" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "DebugU" +# PROP Intermediate_Dir "DebugU" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x67850000" /subsystem:windows /dll /debug /machine:I386 /out:"../Debug/NetCmpts.dll" /pdbtype:sept +# Begin Custom Build - Performing registration +OutDir=.\DebugU +TargetPath=\Projects\NightSec\Debug\NetCmpts.dll +InputPath=\Projects\NightSec\Debug\NetCmpts.dll +SOURCE="$(InputPath)" + +"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + if "%OS%"=="" goto NOTNT + if not "%OS%"=="Windows_NT" goto NOTNT + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + goto end + :NOTNT + echo Warning : Cannot register Unicode DLL on Windows 95 + :end + +# End Custom Build + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Release MinSize" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ReleaseMinSize" +# PROP BASE Intermediate_Dir "ReleaseMinSize" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseMinSize" +# PROP Intermediate_Dir "ReleaseMinSize" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /Yu"stdafx.h" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comctl32.lib /nologo /base:"0x67850000" /subsystem:windows /dll /machine:I386 /def:".\NetCmpts.def" /out:"../Release/NetCmpts.dll" /OPT:NOWIN98 +# SUBTRACT LINK32 /pdb:none +# Begin Custom Build - Performing registration +OutDir=.\ReleaseMinSize +TargetPath=\Projects\NightSec\Release\NetCmpts.dll +InputPath=\Projects\NightSec\Release\NetCmpts.dll +SOURCE="$(InputPath)" + +"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + +# End Custom Build + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Release MinDependency" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ReleaseMinDependency" +# PROP BASE Intermediate_Dir "ReleaseMinDependency" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseMinDependency" +# PROP Intermediate_Dir "ReleaseMinDependency" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /Yu"stdafx.h" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comctl32.lib /nologo /base:"0x67850000" /subsystem:windows /dll /machine:I386 /out:"../Release/NetCmpts.dll" +# Begin Custom Build - Performing registration +OutDir=.\ReleaseMinDependency +TargetPath=\Projects\NightSec\Release\NetCmpts.dll +InputPath=\Projects\NightSec\Release\NetCmpts.dll +SOURCE="$(InputPath)" + +"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + +# End Custom Build + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Unicode Release MinSize" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ReleaseUMinSize" +# PROP BASE Intermediate_Dir "ReleaseUMinSize" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseUMinSize" +# PROP Intermediate_Dir "ReleaseUMinSize" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x67850000" /subsystem:windows /dll /machine:I386 /out:"../Release/NetCmpts.dll" +# Begin Custom Build - Performing registration +OutDir=.\ReleaseUMinSize +TargetPath=\Projects\NightSec\Release\NetCmpts.dll +InputPath=\Projects\NightSec\Release\NetCmpts.dll +SOURCE="$(InputPath)" + +"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + if "%OS%"=="" goto NOTNT + if not "%OS%"=="Windows_NT" goto NOTNT + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + goto end + :NOTNT + echo Warning : Cannot register Unicode DLL on Windows 95 + :end + +# End Custom Build + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Unicode Release MinDependency" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ReleaseUMinDependency" +# PROP BASE Intermediate_Dir "ReleaseUMinDependency" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseUMinDependency" +# PROP Intermediate_Dir "ReleaseUMinDependency" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x67850000" /subsystem:windows /dll /machine:I386 +# Begin Custom Build - Performing registration +OutDir=.\ReleaseUMinDependency +TargetPath=.\ReleaseUMinDependency\NetCmpts.dll +InputPath=.\ReleaseUMinDependency\NetCmpts.dll +SOURCE="$(InputPath)" + +"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + if "%OS%"=="" goto NOTNT + if not "%OS%"=="Windows_NT" goto NOTNT + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + goto end + :NOTNT + echo Warning : Cannot register Unicode DLL on Windows 95 + :end + +# End Custom Build + +!ENDIF + +# Begin Target + +# Name "NetCmpts - Win32 Debug" +# Name "NetCmpts - Win32 Unicode Debug" +# Name "NetCmpts - Win32 Release MinSize" +# Name "NetCmpts - Win32 Release MinDependency" +# Name "NetCmpts - Win32 Unicode Release MinSize" +# Name "NetCmpts - Win32 Unicode Release MinDependency" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\ClearInetCache.cpp +# End Source File +# Begin Source File + +SOURCE=..\Common\CmptData.cpp +# End Source File +# Begin Source File + +SOURCE=..\Interfaces\CmptIfaces.idl + +!IF "$(CFG)" == "NetCmpts - Win32 Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Unicode Debug" + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Release MinSize" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Release MinDependency" + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Unicode Release MinSize" + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Unicode Release MinDependency" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\NetCmpts.cpp +# End Source File +# Begin Source File + +SOURCE=.\NetCmpts.def + +!IF "$(CFG)" == "NetCmpts - Win32 Debug" + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Unicode Debug" + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Release MinSize" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Release MinDependency" + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Unicode Release MinSize" + +!ELSEIF "$(CFG)" == "NetCmpts - Win32 Unicode Release MinDependency" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\NetCmpts.idl +# ADD MTL /tlb ".\NetCmpts.tlb" /h "NetCmpts.h" /iid "NetCmpts_i.c" /Oicf +# End Source File +# Begin Source File + +SOURCE=.\NetCmpts.rc +# End Source File +# Begin Source File + +SOURCE=.\parseurl.cpp +# End Source File +# Begin Source File + +SOURCE=.\ProgressDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\ClearInetCache.h +# End Source File +# Begin Source File + +SOURCE=..\Common\CmptData.h +# End Source File +# Begin Source File + +SOURCE=.\parseurl.h +# End Source File +# Begin Source File + +SOURCE=.\ProgressDlg.h +# End Source File +# Begin Source File + +SOURCE=.\Resource.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\ClearInetCache.rgs +# End Source File +# Begin Source File + +SOURCE=.\res\ico00003.ico +# End Source File +# Begin Source File + +SOURCE=.\res\ico00005.ico +# End Source File +# Begin Source File + +SOURCE=.\res\icon1.ico +# End Source File +# Begin Source File + +SOURCE=.\res\inetshor.ico +# End Source File +# Begin Source File + +SOURCE=.\res\new1.ico +# End Source File +# Begin Source File + +SOURCE=".\res\Night Security Worker.ico" +# End Source File +# End Group +# End Target +# End Project diff --git a/NetCmpts/NetCmpts.h b/NetCmpts/NetCmpts.h new file mode 100644 index 0000000..7c743bd --- /dev/null +++ b/NetCmpts/NetCmpts.h @@ -0,0 +1,78 @@ +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + +/* File created by MIDL compiler version 5.01.0164 */ +/* at Sun Nov 07 03:01:57 1999 + */ +/* Compiler settings for E:\Projects\NightSec\NetCmpts\NetCmpts.idl: + Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data +*/ +//@@MIDL_FILE_HEADING( ) + + +/* verify that the <rpcndr.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 440 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __NetCmpts_h__ +#define __NetCmpts_h__ + +#ifdef __cplusplus +extern "C"{ +#endif + +/* Forward Declarations */ + +#ifndef __ClearInetCache_FWD_DEFINED__ +#define __ClearInetCache_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class ClearInetCache ClearInetCache; +#else +typedef struct ClearInetCache ClearInetCache; +#endif /* __cplusplus */ + +#endif /* __ClearInetCache_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "cmptifaces.h" + +void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void __RPC_FAR * ); + + +#ifndef __NightSecNetCmpts_LIBRARY_DEFINED__ +#define __NightSecNetCmpts_LIBRARY_DEFINED__ + +/* library NightSecNetCmpts */ +/* [helpstring][version][uuid] */ + + +EXTERN_C const IID LIBID_NightSecNetCmpts; + +EXTERN_C const CLSID CLSID_ClearInetCache; + +#ifdef __cplusplus + +class DECLSPEC_UUID("34F1169B-F275-11d2-A589-0020182B97FC") +ClearInetCache; +#endif +#endif /* __NightSecNetCmpts_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/NetCmpts/NetCmpts.idl b/NetCmpts/NetCmpts.idl new file mode 100644 index 0000000..e27c5ab --- /dev/null +++ b/NetCmpts/NetCmpts.idl @@ -0,0 +1,30 @@ +// NetCmpts.idl : IDL source for NetCmpts.dll +// + +// This file will be processed by the MIDL tool to +// produce the type library (NetCmpts.tlb) and marshalling code. + +import "oaidl.idl"; +import "ocidl.idl"; + +import "../interfaces/cmptifaces.idl"; + +[ + uuid(34F1169A-F275-11d2-A589-0020182B97FC), + version(2.5), + helpstring("NightSec Net Components 2.5") +] +library NightSecNetCmpts +{ + importlib("stdole32.tlb"); + + [ + uuid(34F1169B-F275-11d2-A589-0020182B97FC), + helpstring("Clears the Temporary Internet Files") + ] + coclass ClearInetCache + { + interface ISecureShutdownWin; + }; + +}; diff --git a/NetCmpts/NetCmpts.plg b/NetCmpts/NetCmpts.plg new file mode 100644 index 0000000..90c7215 --- /dev/null +++ b/NetCmpts/NetCmpts.plg @@ -0,0 +1,16 @@ +<html>
+<body>
+<pre>
+<h1>Build Log</h1>
+<h3>
+--------------------Configuration: NetCmpts - Win32 Release MinSize--------------------
+</h3>
+<h3>Command Lines</h3>
+
+
+
+<h3>Results</h3>
+NetCmpts.dll - 0 error(s), 0 warning(s)
+</pre>
+</body>
+</html>
diff --git a/NetCmpts/NetCmpts.rc b/NetCmpts/NetCmpts.rc new file mode 100644 index 0000000..285bee1 --- /dev/null +++ b/NetCmpts/NetCmpts.rc @@ -0,0 +1,223 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// 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 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "1 TYPELIB ""NetCmpts.tlb""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,5,0,1 + PRODUCTVERSION 2,5,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "Network Components for Night Security Program\0" + VALUE "CompanyName", "The Family (Thailand)\0" + VALUE "FileDescription", "Night Security (Network Component Module)\0" + VALUE "FileVersion", "2, 5, 0, 1\0" + VALUE "InternalName", "Night Security NetCmpts\0" + VALUE "LegalCopyright", "Copyright (C) 1998 - 1999, The Family (Thailand)\0" + VALUE "LegalTrademarks", "\0" + VALUE "OLESelfRegister", "\0" + VALUE "OriginalFilename", "netcmpts.dll\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Night Security 2.5\0" + VALUE "ProductVersion", "2, 5, 0, 1\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_CLEARINETCACHE DIALOGEX 0, 0, 200, 115 +STYLE WS_CHILD +EXSTYLE WS_EX_APPWINDOW +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + CONTROL "List1",IDC_SERVERURLLIST,"SysListView32",LVS_LIST | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_EDITLABELS | + WS_BORDER | WS_TABSTOP,4,9,170,55,WS_EX_CLIENTEDGE + PUSHBUTTON "&New URL",IDC_NEWURL,178,10,16,15,BS_ICON | BS_CENTER | + BS_VCENTER + PUSHBUTTON "&Delete",IDC_DELETE,178,27,16,15,BS_ICON | BS_CENTER | + BS_VCENTER + CONTROL "&Clear All",IDC_CLEARALLSERVERS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,134,66,41,10 + GROUPBOX "&Servers to delete from cache: ",IDC_STATIC,0,0,199,114 + CONTROL "Coo&kies",IDC_COOKIES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,87,66,41,10 + LTEXT "Type the full URL of the server or website you want to clear (eg: http://ntserver). You can also add a URL of any object on the server.", + IDC_STATIC,33,85,164,27 + GROUPBOX "Note: ",IDC_STATIC,0,75,199,39 + ICON IDI_NOTE,IDC_STATIC,5,86,21,20 +END + +IDD_PROGRESS DIALOG DISCARDABLE 0, 0, 250, 84 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Clearing Internet Cache" +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "Cancel",IDCANCEL,201,63,42,14 + CONTROL "Progress2",IDC_PROGRESS2,"msctls_progress32",0x0,11,63, + 186,8 + CONTROL "Static",IDC_FILENAME,"Static",SS_LEFTNOWORDWRAP | + WS_GROUP,11,49,232,8 + ICON IDI_DELETING,IDC_STATIC,11,15,20,20 + LTEXT "Clearing files from cache...",IDC_STATIC,44,21,84,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON DISCARDABLE "res\\Night Security Worker.ico" +IDI_DEL ICON DISCARDABLE "res\\new1.ico" +IDI_DELETING ICON DISCARDABLE "res\\inetshor.ico" +IDI_INETSHORTCUT ICON DISCARDABLE "res\\icon1.ico" +IDI_NEW ICON DISCARDABLE "res\\ico00005.ico" +IDI_NOTE ICON DISCARDABLE "res\\ico00003.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// REGISTRY +// + +IDR_CLEARINETCACHE REGISTRY DISCARDABLE "ClearInetCache.rgs" + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_CLEARINETCACHE, DIALOG + BEGIN + VERTGUIDE, 33 + END + + IDD_PROGRESS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 243 + TOPMARGIN, 7 + BOTTOMMARGIN, 77 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PROJNAME "NetCmpts" + IDS_NEWURL "http://new.server.com" + IDS_NOTVALIDURL "This isn't a valid Internet URL.\n(eg: http://www.example.com)" + IDS_INETNAME "Clear Temporary Internet Files" + IDS_INETDESC "Clears out your Temporary Internet Files folder. Used if you're on a network or don't want others to know where you've been on-line. A great space saver too." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INETPARAM "i" + IDS_TITLEClearInetCacheProps "Options" + IDS_HELPFILEClearInetCacheProps "nightsec.hlp" + IDS_DOCSTRINGClearInetCacheProps + "Clears out your Temporary Internet Files folder. " + IDS_EXAMPLEURL "http://example.server.com" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +1 TYPELIB "NetCmpts.tlb" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/NetCmpts/NetCmptsps.def b/NetCmpts/NetCmptsps.def new file mode 100644 index 0000000..3a9fd38 --- /dev/null +++ b/NetCmpts/NetCmptsps.def @@ -0,0 +1,11 @@ +
+LIBRARY "NetCmptsPS"
+
+DESCRIPTION 'Proxy/Stub DLL'
+
+EXPORTS
+ DllGetClassObject @1 PRIVATE
+ DllCanUnloadNow @2 PRIVATE
+ GetProxyDllInfo @3 PRIVATE
+ DllRegisterServer @4 PRIVATE
+ DllUnregisterServer @5 PRIVATE
diff --git a/NetCmpts/NetCmptsps.mk b/NetCmpts/NetCmptsps.mk new file mode 100644 index 0000000..25a13fb --- /dev/null +++ b/NetCmpts/NetCmptsps.mk @@ -0,0 +1,16 @@ + +NetCmptsps.dll: dlldata.obj NetCmpts_p.obj NetCmpts_i.obj + link /dll /out:NetCmptsps.dll /def:NetCmptsps.def /entry:DllMain dlldata.obj NetCmpts_p.obj NetCmpts_i.obj \ + kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \ + +.c.obj: + cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \ + $< + +clean: + @del NetCmptsps.dll + @del NetCmptsps.lib + @del NetCmptsps.exp + @del dlldata.obj + @del NetCmpts_p.obj + @del NetCmpts_i.obj diff --git a/NetCmpts/ProgressDlg.cpp b/NetCmpts/ProgressDlg.cpp new file mode 100644 index 0000000..f5fe559 --- /dev/null +++ b/NetCmpts/ProgressDlg.cpp @@ -0,0 +1,45 @@ +// AddingFontsDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "resource.h" +#include "ProgressDlg.h" + +///////////////////////////////////////////////////////////////////////////// +// CProgressDlg dialog + + +CProgressDlg::CProgressDlg() +{ + m_bCancel = false; +} + + +///////////////////////////////////////////////////////////////////////////// +// CProgressDlg message handlers + +LRESULT CProgressDlg::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) +{ + // Remove Window + DestroyWindow(); + + // Set Cancel Flag + m_bCancel = true; + + return 0; +} + +LRESULT CProgressDlg::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + return OnCancel(0, 0, NULL, bHandled); +} + + +LRESULT CProgressDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + m_ctlProgress = GetDlgItem(IDC_PROGRESS2); + CenterWindow(GetDesktopWindow()); + + return TRUE; // return TRUE unless you set the focus to a control +} + diff --git a/NetCmpts/ProgressDlg.h b/NetCmpts/ProgressDlg.h new file mode 100644 index 0000000..ecebaa8 --- /dev/null +++ b/NetCmpts/ProgressDlg.h @@ -0,0 +1,70 @@ +#if !defined(AFX_ADDINGFONTSDLG_H__C00DADE2_C0C4_11D1_80A7_444553540000__INCLUDED_) +#define AFX_ADDINGFONTSDLG_H__C00DADE2_C0C4_11D1_80A7_444553540000__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// ProgressDlg.h : header file +// + +#include "resource.h" +#include <atlwin.h> +#include <atlctrls.h> + +#include "../common/events.h" + +///////////////////////////////////////////////////////////////////////////// +// CProgressDlg dialog + +class CProgressDlg : + public CDialogImpl<CProgressDlg>, + public IDispEventImpl<0, CProgressDlg, &DIID_DShutdownEvents, &LIBID_NightSecShutdown, 2, 5> +{ +// Construction +public: + CProgressDlg(); // standard constructor + ~CProgressDlg() + { if(IsWindow()) DestroyWindow(); } + +// Dialog Data + enum { IDD = IDD_PROGRESS }; + CProgressBarCtrl m_ctlProgress; + + +// Implementation +BEGIN_MSG_MAP(CNormalPage) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) + COMMAND_HANDLER(IDCANCEL, BN_CLICKED, OnCancel) + MESSAGE_HANDLER(WM_CLOSE, OnClose) +END_MSG_MAP() + + // Generated message map functions + LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); + +// Catch Cancel Events +BEGIN_SINK_MAP(CProgressDlg) + SINK_ENTRY_EX(0, DIID_DShutdownEvents, 1, OnCancelEv) +END_SINK_MAP() + +// Status + bool IsCancelled() + { return m_bCancel; } + +// Events +protected: + STDMETHOD(OnCancelEv)() + { + BOOL bHandled = TRUE; + OnCancel(0, 0, NULL, bHandled); + return S_OK; + }; + + bool m_bCancel; +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_ADDINGFONTSDLG_H__C00DADE2_C0C4_11D1_80A7_444553540000__INCLUDED_) diff --git a/NetCmpts/StdAfx.cpp b/NetCmpts/StdAfx.cpp new file mode 100644 index 0000000..a5eea17 --- /dev/null +++ b/NetCmpts/StdAfx.cpp @@ -0,0 +1,12 @@ +// stdafx.cpp : source file that includes just the standard includes +// stdafx.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +#ifdef _ATL_STATIC_REGISTRY +#include <statreg.h> +#include <statreg.cpp> +#endif + +#include <atlimpl.cpp> diff --git a/NetCmpts/StdAfx.h b/NetCmpts/StdAfx.h new file mode 100644 index 0000000..d4d61e4 --- /dev/null +++ b/NetCmpts/StdAfx.h @@ -0,0 +1,38 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#if !defined(AFX_STDAFX_H__E9C249D8_9196_11D3_BFBF_0020182B97FC__INCLUDED_) +#define AFX_STDAFX_H__E9C249D8_9196_11D3_BFBF_0020182B97FC__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define STRICT + +// Windows 95 Compatible +#undef WINVER +#define WINVER 0x0400 +#undef _WIN32_WINNT + +// Don't want our program dependant on some browser! +#undef _WIN32_IE +#define _WIN32_IE 0x0000 + +#define _ATL_APARTMENT_THREADED + +#include <atlbase.h> +//You may derive a class from CComModule and use it if you want to override +//something, but do not change the name of _Module +extern CComModule _Module; +#include <atlcom.h> +#include <atlwin.h> +#include <atlctl.h> + +#include "../common/types.h" + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__E9C249D8_9196_11D3_BFBF_0020182B97FC__INCLUDED) diff --git a/NetCmpts/dlldata.c b/NetCmpts/dlldata.c new file mode 100644 index 0000000..6f9e7bb --- /dev/null +++ b/NetCmpts/dlldata.c @@ -0,0 +1,40 @@ +/********************************************************* + 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 <rpcproxy.h> + +#ifdef __cplusplus +extern "C" { +#endif + +EXTERN_PROXY_FILE( CmptIfaces ) +EXTERN_PROXY_FILE( NetCmpts ) + + +PROXYFILE_LIST_START +/* Start of list */ + REFERENCE_PROXY_FILE( CmptIfaces ), + REFERENCE_PROXY_FILE( NetCmpts ), +/* 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/NetCmpts/parseurl.cpp b/NetCmpts/parseurl.cpp new file mode 100644 index 0000000..786cc74 --- /dev/null +++ b/NetCmpts/parseurl.cpp @@ -0,0 +1,128 @@ + +#include <stdafx.h> +#include "parseurl.h" + +#ifndef _AFXDLL +#pragma comment(lib, "wininet.lib") +#endif + +///////////////////////////////////////////////////////////////////////////// +// Global Functions + +static bool _ParseURLWorker(LPCTSTR pstrURL, LPURL_COMPONENTS lpComponents, + DWORD& dwServiceType, INTERNET_PORT& nPort, DWORD dwFlags) +{ + // this function will return bogus stuff if lpComponents + // isn't set up to copy the components + ASSERT(lpComponents != NULL && pstrURL != NULL); + if (lpComponents == NULL || pstrURL == NULL) return false; + + ASSERT(lpComponents->dwHostNameLength == 0 || + lpComponents->lpszHostName != NULL); + ASSERT(lpComponents->dwUrlPathLength == 0 || + lpComponents->lpszUrlPath != NULL); + ASSERT(lpComponents->dwUserNameLength == 0 || + lpComponents->lpszUserName != NULL); + ASSERT(lpComponents->dwPasswordLength == 0 || + lpComponents->lpszPassword != NULL); + + LPTSTR pstrCanonicalizedURL; + TCHAR szCanonicalizedURL[INTERNET_MAX_URL_LENGTH]; + DWORD dwNeededLength = INTERNET_MAX_URL_LENGTH; + + bool bRetVal; + bool bMustFree = false; + DWORD dwCanonicalizeFlags = dwFlags & + (ICU_NO_ENCODE | ICU_DECODE | ICU_NO_META | + ICU_ENCODE_SPACES_ONLY | ICU_BROWSER_MODE); + DWORD dwCrackFlags = dwFlags & (ICU_ESCAPE | ICU_USERNAME); + + bRetVal = InternetCanonicalizeUrl(pstrURL, szCanonicalizedURL, &dwNeededLength, + dwCanonicalizeFlags) ? true : false; + + if(!bRetVal) + { + if(::GetLastError() != ERROR_INSUFFICIENT_BUFFER) + return false; + + pstrCanonicalizedURL = new TCHAR[dwNeededLength]; + bMustFree = true; + bRetVal = InternetCanonicalizeUrl(pstrURL, pstrCanonicalizedURL, &dwNeededLength, + dwCanonicalizeFlags) ? true : false; + if(!bRetVal) + { + delete [] pstrCanonicalizedURL; + return false; + } + } + else + pstrCanonicalizedURL = szCanonicalizedURL; + + // now that it's safely canonicalized, crack it + bRetVal = InternetCrackUrl(pstrCanonicalizedURL, 0, + dwCrackFlags, lpComponents) ? true : false; + + if (bMustFree) + delete [] pstrCanonicalizedURL; + + return bRetVal; +} + +bool ParseURLEx(LPCTSTR pstrURL, DWORD& dwServiceType, string& strServer, + string& strObject, INTERNET_PORT& nPort, string& strUsername, + string& strPassword, DWORD dwFlags/* = 0*/) +{ + ASSERT(pstrURL != NULL); + if (pstrURL == NULL) + return false; + + URL_COMPONENTS urlComponents; + memset(&urlComponents, 0, sizeof(URL_COMPONENTS)); + urlComponents.dwStructSize = sizeof(URL_COMPONENTS); + + urlComponents.dwHostNameLength = INTERNET_MAX_HOST_NAME_LENGTH; + urlComponents.lpszHostName = strServer.get_buffer(INTERNET_MAX_HOST_NAME_LENGTH + 1); + urlComponents.dwUrlPathLength = INTERNET_MAX_PATH_LENGTH; + urlComponents.lpszUrlPath = strObject.get_buffer(INTERNET_MAX_PATH_LENGTH + 1); + urlComponents.dwUserNameLength = INTERNET_MAX_USER_NAME_LENGTH; + urlComponents.lpszUserName = strUsername.get_buffer(INTERNET_MAX_USER_NAME_LENGTH + 1); + urlComponents.dwPasswordLength = INTERNET_MAX_PASSWORD_LENGTH; + urlComponents.lpszPassword = strPassword.get_buffer(INTERNET_MAX_PASSWORD_LENGTH + 1); + + bool bRetVal = _ParseURLWorker(pstrURL, &urlComponents, dwServiceType, nPort, + dwFlags); + + dwServiceType = urlComponents.nScheme; + strServer.release_buffer(); + strObject.release_buffer(); + strUsername.release_buffer(); + strPassword.release_buffer(); + + return bRetVal; +} + +bool ParseURL(LPCTSTR pstrURL, DWORD& dwServiceType, string& strServer, + string& strObject, INTERNET_PORT& nPort) +{ + ASSERT(pstrURL != NULL); + if (pstrURL == NULL) + return FALSE; + + URL_COMPONENTS urlComponents; + memset(&urlComponents, 0, sizeof(URL_COMPONENTS)); + urlComponents.dwStructSize = sizeof(URL_COMPONENTS); + + urlComponents.dwHostNameLength = INTERNET_MAX_URL_LENGTH; + urlComponents.lpszHostName = strServer.get_buffer(INTERNET_MAX_URL_LENGTH + 1); + urlComponents.dwUrlPathLength = INTERNET_MAX_URL_LENGTH; + urlComponents.lpszUrlPath = strObject.get_buffer(INTERNET_MAX_URL_LENGTH + 1); + + bool bRetVal = _ParseURLWorker(pstrURL, &urlComponents, dwServiceType, + nPort, ICU_BROWSER_MODE); + + dwServiceType = urlComponents.nScheme; + strServer.release_buffer(); + strObject.release_buffer(); + + return bRetVal; +}
\ No newline at end of file diff --git a/NetCmpts/parseurl.h b/NetCmpts/parseurl.h new file mode 100644 index 0000000..cc08472 --- /dev/null +++ b/NetCmpts/parseurl.h @@ -0,0 +1,17 @@ +#ifndef __PARSEURL_H__991103 +#define __PARSEURL_H__991103 + +#include <mystring.h> + +#ifndef _WININET_ +#include <wininet.h> +#endif + +bool ParseURLEx(LPCTSTR pstrURL, DWORD& dwServiceType, string& strServer, + string& strObject, INTERNET_PORT& nPort, string& strUsername, + string& strPassword, DWORD dwFlags = 0); + +bool ParseURL(LPCTSTR pstrURL, DWORD& dwServiceType, string& strServer, + string& strObject, INTERNET_PORT& nPort); + +#endif //__PARSEURL_H__991103
\ No newline at end of file diff --git a/NetCmpts/res/Night Security Worker.ico b/NetCmpts/res/Night Security Worker.ico Binary files differnew file mode 100644 index 0000000..f1486e4 --- /dev/null +++ b/NetCmpts/res/Night Security Worker.ico diff --git a/NetCmpts/res/ico00003.ico b/NetCmpts/res/ico00003.ico Binary files differnew file mode 100644 index 0000000..9e7944d --- /dev/null +++ b/NetCmpts/res/ico00003.ico diff --git a/NetCmpts/res/ico00005.ico b/NetCmpts/res/ico00005.ico Binary files differnew file mode 100644 index 0000000..da61e8d --- /dev/null +++ b/NetCmpts/res/ico00005.ico diff --git a/NetCmpts/res/icon1.ico b/NetCmpts/res/icon1.ico Binary files differnew file mode 100644 index 0000000..53a1fd8 --- /dev/null +++ b/NetCmpts/res/icon1.ico diff --git a/NetCmpts/res/inetshor.ico b/NetCmpts/res/inetshor.ico Binary files differnew file mode 100644 index 0000000..a7c863a --- /dev/null +++ b/NetCmpts/res/inetshor.ico diff --git a/NetCmpts/res/new1.ico b/NetCmpts/res/new1.ico Binary files differnew file mode 100644 index 0000000..2027b3e --- /dev/null +++ b/NetCmpts/res/new1.ico diff --git a/NetCmpts/resource.h b/NetCmpts/resource.h new file mode 100644 index 0000000..a4065e0 --- /dev/null +++ b/NetCmpts/resource.h @@ -0,0 +1,41 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by NetCmpts.rc +// +#define IDS_PROJNAME 100 +#define IDS_NEWURL 102 +#define IDS_NOTVALIDURL 103 +#define IDR_CLEARINETCACHE 110 +#define IDS_INETNAME 110 +#define IDS_INETDESC 111 +#define IDS_INETPARAM 112 +#define IDS_TITLEClearInetCacheProps 113 +#define IDS_HELPFILEClearInetCacheProps 114 +#define IDS_DOCSTRINGClearInetCacheProps 115 +#define IDS_EXAMPLEURL 116 +#define IDR_MAINFRAME 128 +#define IDI_INETSHORTCUT 130 +#define IDI_NOTE 133 +#define IDI_DELETING 135 +#define IDI_NEW 201 +#define IDD_PROGRESS 201 +#define IDD_CLEARINETCACHE 202 +#define IDI_DEL 202 +#define IDC_COOKIES 211 +#define IDC_CLEARALLSERVERS 1000 +#define IDC_SERVERURLLIST 1001 +#define IDC_PROGRESS2 1004 +#define IDC_NEWURL 1005 +#define IDC_DELETE 1006 +#define IDC_FILENAME 1006 + +// 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 101 +#endif +#endif |