mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
merging from SMARTUPDATE_BRANCH
This commit is contained in:
parent
0fd64b60c2
commit
07d9e76120
@ -538,7 +538,7 @@ xp_TempFileName(int type, const char * request_prefix, const char * extension,
|
||||
const char * directory = NULL;
|
||||
char * ext = NULL; // file extension if any
|
||||
char * prefix = NULL; // file prefix if any
|
||||
|
||||
XP_Bool bDirSlash = FALSE;
|
||||
|
||||
XP_StatStruct statinfo;
|
||||
int status;
|
||||
@ -599,9 +599,14 @@ xp_TempFileName(int type, const char * request_prefix, const char * extension,
|
||||
{
|
||||
if ( XP_STRRCHR(request_prefix, '/') )
|
||||
{
|
||||
const char *end;
|
||||
XP_StatStruct st;
|
||||
|
||||
directory = (char *)request_prefix;
|
||||
end = directory + XP_STRLEN(directory) - 1;
|
||||
if ( *end == '/' || *end == '\\' ) {
|
||||
bDirSlash = TRUE;
|
||||
}
|
||||
if (XP_Stat (directory, &st, xpURL))
|
||||
XP_MakeDirectoryR (directory, xpURL);
|
||||
ext = (char *)extension;
|
||||
@ -706,7 +711,10 @@ xp_TempFileName(int type, const char * request_prefix, const char * extension,
|
||||
|
||||
// Create the fully qualified path and file name.
|
||||
//
|
||||
sprintf(file_buf, "%s\\%s%s%s", directory, prefix, ca_time, ext);
|
||||
if (bDirSlash)
|
||||
sprintf(file_buf, "%s%s%s%s", directory, prefix, ca_time, ext);
|
||||
else
|
||||
sprintf(file_buf, "%s\\%s%s%s", directory, prefix, ca_time, ext);
|
||||
|
||||
// Determine if the file exists, and mark that we've tried yet
|
||||
// another file name (mark to be used later).
|
||||
|
@ -428,7 +428,9 @@ LINK_LIBS= \
|
||||
!endif
|
||||
$(DIST)\lib\unicvt32.lib \
|
||||
!ifdef JAVA_OR_OJI
|
||||
!ifdef MOZ_SMARTUPDATE
|
||||
$(DIST)\lib\softup32.lib \
|
||||
!endif
|
||||
!ifndef NO_SECURITY
|
||||
$(DIST)\lib\jsl32.lib \
|
||||
!endif
|
||||
@ -1410,6 +1412,9 @@ $(OUTDIR)\mozilla.dep: $(DEPTH)\cmd\winfe\mkfiles32\mozilla.mak
|
||||
$(DEPTH)\cmd\winfe\winpref.c
|
||||
!ifdef MOZ_LOC_INDEP
|
||||
$(DEPTH)\cmd\winfe\winli.cpp
|
||||
!endif
|
||||
!ifdef MOZ_SMARTUPDATE
|
||||
$(DEPTH)\cmd\winfe\winprog.cpp
|
||||
!endif
|
||||
$(DEPTH)\cmd\winfe\resdll\resdll.c
|
||||
!if "$(MOZ_BITS)"=="32"
|
||||
@ -2424,10 +2429,10 @@ BUILD_SOURCE: $(OBJ_FILES)
|
||||
$(DIST)\lib\edtplug.lib +
|
||||
!endif
|
||||
!endif
|
||||
!ifdef MOZ_SMARTUPDATE
|
||||
$(DIST)\lib\softup16.lib +
|
||||
!endif
|
||||
!else
|
||||
$(DIST)\lib\libreg16.lib +
|
||||
$(DIST)\lib\xpcom16.lib +
|
||||
$(DIST)\lib\libsjs16.lib +
|
||||
$(DIST)\lib\libnjs16.lib +
|
||||
!endif
|
||||
@ -2799,8 +2804,8 @@ exports:
|
||||
-xcopy $(DEPTH)\lib\plugin\*.h $(EXPORTINC) $(XCF)
|
||||
!if defined(MOZ_JAVA)
|
||||
-xcopy $(DEPTH)\modules\applet\include\*.h $(EXPORTINC) $(XCF)
|
||||
-xcopy $(DEPTH)\modules\libreg\include\*.h $(EXPORTINC) $(XCF)
|
||||
!endif
|
||||
-xcopy $(DEPTH)\modules\libreg\include\*.h $(EXPORTINC) $(XCF)
|
||||
-xcopy $(DEPTH)\modules\libutil\public\xp_obs.h $(EXPORTINC) $(XCF)
|
||||
-xcopy $(DEPTH)\modules\libimg\public\*.h $(EXPORTINC) $(XCF)
|
||||
-xcopy $(DEPTH)\modules\libpref\public\*.h $(EXPORTINC) $(XCF)
|
||||
@ -2819,8 +2824,8 @@ exports:
|
||||
-xcopy $(XPDIST)\public\security\*.h $(EXPORTINC) $(XCF)
|
||||
!if defined(MOZ_JAVA)
|
||||
-xcopy $(XPDIST)\public\applet\*.h $(EXPORTINC) $(XCF)
|
||||
-xcopy $(XPDIST)\public\libreg\*.h $(EXPORTINC) $(XCF)
|
||||
!endif
|
||||
-xcopy $(XPDIST)\public\libreg\*.h $(EXPORTINC) $(XCF)
|
||||
!if defined(MOZ_OJI)
|
||||
-xcopy $(XPDIST)\public\oji\*.h $(EXPORTINC) $(XCF)
|
||||
!endif
|
||||
@ -2886,6 +2891,7 @@ ns.zip:
|
||||
!endif
|
||||
brpref32.dll \
|
||||
lipref32.dll \
|
||||
libreg32.dll \
|
||||
unicvt32.dll \
|
||||
uni3200.dll \
|
||||
resdll.dll \
|
||||
@ -2902,7 +2908,6 @@ ns.zip:
|
||||
editor32.dll \
|
||||
xppref32.dll \
|
||||
sched32.dll \
|
||||
libreg32.dll \
|
||||
xpcom32.dll \
|
||||
netscape.cfg \
|
||||
moz40p3
|
||||
|
@ -40,6 +40,9 @@ void SHUTDOWN_li(void);
|
||||
// XP Includes
|
||||
#include "prefapi.h"
|
||||
#include "NSReg.h"
|
||||
#ifdef MOZ_SMARTUPDATE
|
||||
#include "softupdt.h"
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN32
|
||||
#include "postal.h" // mapi DLL interface
|
||||
@ -667,6 +670,9 @@ BOOL CNetscapeApp::InitInstance()
|
||||
** Registry startup has to happen before profile stuff because creating a new
|
||||
** profile uses the registry.
|
||||
*/
|
||||
#ifdef MOZ_SMARTUPDATE
|
||||
SU_Startup();
|
||||
#endif
|
||||
NR_StartupRegistry();
|
||||
|
||||
// Initialize the network.
|
||||
@ -2051,6 +2057,9 @@ int CNetscapeApp::ExitInstance()
|
||||
PREF_SaveLIPrefFile(prefName);
|
||||
XP_FREEIF (prefName);
|
||||
NR_ShutdownRegistry();
|
||||
#ifdef MOZ_SMARTUPDATE
|
||||
SU_Shutdown();
|
||||
#endif
|
||||
|
||||
// Save certs and keys early, since if they are lost the user is screwed
|
||||
SECNAV_Shutdown();
|
||||
|
@ -59,6 +59,10 @@
|
||||
#include "addrprop.h"
|
||||
#endif
|
||||
#endif /* MOZ_MAIL_NEWS */
|
||||
#ifdef MOZ_SMARTUPDATE
|
||||
#include "VerReg.h"
|
||||
#include "softupdt.h"
|
||||
#endif /* MOZ_SMARTUPDATE */
|
||||
|
||||
extern "C" {
|
||||
#include "xpgetstr.h"
|
||||
@ -1685,6 +1689,180 @@ CLIPreference::Release()
|
||||
}
|
||||
#endif /* MOZ_LOC_INDEP */
|
||||
|
||||
#ifdef MOZ_SMARTUPDATE
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CSmartUpdatePreference
|
||||
|
||||
class CSmartUpdatePrefs : public ISmartUpdatePrefs {
|
||||
public:
|
||||
CSmartUpdatePrefs();
|
||||
|
||||
// IUnknown methods
|
||||
STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
|
||||
STDMETHODIMP_(ULONG) AddRef();
|
||||
STDMETHODIMP_(ULONG) Release();
|
||||
|
||||
// ISmartUpdatePrefs methods
|
||||
STDMETHODIMP_(LONG) RegPack();
|
||||
STDMETHODIMP_(LONG) Uninstall(char* regPackageName);
|
||||
STDMETHODIMP_(LONG) EnumUninstall(void** context, char* packageName,
|
||||
LONG len1, char*regPackageName, LONG len2);
|
||||
|
||||
private:
|
||||
|
||||
ULONG m_uRef;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CSmartUpdatePrefs
|
||||
CSmartUpdatePrefs::CSmartUpdatePrefs()
|
||||
{
|
||||
m_uRef = 0;
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
CSmartUpdatePrefs::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
|
||||
{
|
||||
*ppvObj = NULL;
|
||||
|
||||
if (riid == IID_IUnknown || riid == IID_ISmartUpdatePrefs) {
|
||||
*ppvObj = (LPVOID)this;
|
||||
AddRef();
|
||||
return NOERROR;
|
||||
|
||||
}
|
||||
|
||||
return ResultFromScode(E_NOINTERFACE);
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG)
|
||||
CSmartUpdatePrefs::AddRef()
|
||||
{
|
||||
return ++m_uRef;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG)
|
||||
CSmartUpdatePrefs::Release()
|
||||
{
|
||||
if (--m_uRef == 0) {
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return m_uRef;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(LONG)
|
||||
CSmartUpdatePrefs::RegPack()
|
||||
{
|
||||
return VR_PackRegistry();
|
||||
}
|
||||
|
||||
STDMETHODIMP_(LONG)
|
||||
CSmartUpdatePrefs::Uninstall(char* regPackageName)
|
||||
{
|
||||
return SU_Uninstall(regPackageName);
|
||||
}
|
||||
|
||||
STDMETHODIMP_(LONG)
|
||||
CSmartUpdatePrefs::EnumUninstall(void** context, char* packageName,
|
||||
LONG len1, char*regPackageName, LONG len2)
|
||||
{
|
||||
return SU_EnumUninstall(context, packageName,len1, regPackageName,len2);
|
||||
}
|
||||
|
||||
#endif /* MOZ_SMARTUPDATE */
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAdvancedPrefs
|
||||
|
||||
class CAdvancedPrefs : public IAdvancedPrefs {
|
||||
public:
|
||||
CAdvancedPrefs();
|
||||
|
||||
// IUnknown methods
|
||||
STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
|
||||
STDMETHODIMP_(ULONG) AddRef();
|
||||
STDMETHODIMP_(ULONG) Release();
|
||||
|
||||
// Initialization routine to create contained and aggregated objects
|
||||
HRESULT Init();
|
||||
|
||||
private:
|
||||
|
||||
ULONG m_uRef;
|
||||
LPUNKNOWN m_pCategory; // inner object supporting ISpecifyPropertyPageObjects
|
||||
#ifdef MOZ_SMARTUPDATE
|
||||
CSmartUpdatePrefs *m_pSmartUpdatePrefs;
|
||||
#endif /* MOZ_SMARTUPDATE */
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAdvancedPrefs
|
||||
CAdvancedPrefs::CAdvancedPrefs()
|
||||
{
|
||||
m_uRef = 0;
|
||||
m_pCategory = NULL;
|
||||
#ifdef MOZ_SMARTUPDATE
|
||||
m_pSmartUpdatePrefs = new CSmartUpdatePrefs;
|
||||
m_pSmartUpdatePrefs->AddRef();
|
||||
#endif /* MOZ_SMARTUPDATE */
|
||||
}
|
||||
|
||||
HRESULT
|
||||
CAdvancedPrefs::Init()
|
||||
{
|
||||
// Create the object as part of an aggregate
|
||||
return FEU_CoCreateInstance(CLSID_AdvancedPrefs, (LPUNKNOWN)this,
|
||||
CLSCTX_INPROC_SERVER, IID_IUnknown, (LPVOID *)&m_pCategory);
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
CAdvancedPrefs::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
|
||||
{
|
||||
*ppvObj = NULL;
|
||||
|
||||
if (riid == IID_IUnknown || riid == IID_IAdvancedPrefs) {
|
||||
*ppvObj = (LPVOID)this;
|
||||
AddRef();
|
||||
return NOERROR;
|
||||
#ifdef MOZ_SMARTUPDATE
|
||||
} else if (riid == IID_ISmartUpdatePrefs) {
|
||||
assert(m_pSmartUpdatePrefs);
|
||||
return m_pSmartUpdatePrefs->QueryInterface(riid, ppvObj);
|
||||
#endif /* MOZ_SMARTUPDATE */
|
||||
} else if (riid == IID_ISpecifyPropertyPageObjects) {
|
||||
assert(m_pCategory);
|
||||
return m_pCategory->QueryInterface(riid, ppvObj);
|
||||
}
|
||||
|
||||
return ResultFromScode(E_NOINTERFACE);
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG)
|
||||
CAdvancedPrefs::AddRef()
|
||||
{
|
||||
return ++m_uRef;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG)
|
||||
CAdvancedPrefs::Release()
|
||||
{
|
||||
if (--m_uRef == 0) {
|
||||
if (m_pCategory)
|
||||
m_pCategory->Release();
|
||||
#ifdef MOZ_SMARTUPDATE
|
||||
if (m_pSmartUpdatePrefs)
|
||||
m_pSmartUpdatePrefs->Release();
|
||||
#endif /* MOZ_SMARTUPDATE */
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return m_uRef;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ReloadAllWindows()
|
||||
@ -1778,6 +1956,29 @@ CreateOfflineCategory(LPSPECIFYPROPERTYPAGEOBJECTS *pCategory)
|
||||
}
|
||||
#endif /* MOZ_OFFLINE */
|
||||
|
||||
static BOOL
|
||||
CreateAdvancedCategory(MWContext *pContext, LPSPECIFYPROPERTYPAGEOBJECTS *pCategory)
|
||||
{
|
||||
CAdvancedPrefs *pAdvanced;
|
||||
BOOL bResult = FALSE;
|
||||
|
||||
|
||||
pAdvanced = new CAdvancedPrefs();
|
||||
pAdvanced->AddRef();
|
||||
|
||||
// Initialize the browser pref object. This allows it to load any objects that are
|
||||
// contained or aggregated
|
||||
if (SUCCEEDED(pAdvanced->Init())) {
|
||||
// Get the interface pointer for ISpecifyPropertyPageObjects
|
||||
if (SUCCEEDED(pAdvanced->QueryInterface(IID_ISpecifyPropertyPageObjects, (LPVOID *)pCategory)))
|
||||
bResult = TRUE;
|
||||
}
|
||||
|
||||
// We're all done with the object
|
||||
pAdvanced->Release();
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
#ifdef MOZ_LOC_INDEP
|
||||
static BOOL
|
||||
@ -1900,13 +2101,9 @@ wfe_DisplayPreferences(CGenericFrame *pFrame)
|
||||
#endif // MOZ_OFFLINE
|
||||
|
||||
// Advanced category
|
||||
if (SUCCEEDED(FEU_CoCreateInstance(CLSID_AdvancedPrefs,
|
||||
NULL,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
IID_ISpecifyPropertyPageObjects,
|
||||
(LPVOID *)&categories[nCategories]))) {
|
||||
if (CreateAdvancedCategory(pContext, &categories[nCategories])) {
|
||||
nCategories++;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we have at least one category
|
||||
if (nCategories == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user