Part 3 of bug 472093 -- fix build system to use NTDDI_VERSION instead of random checks -- add MOZ_NTDDI_* defines, switch code over to use these defines.

r=ted for build config parts, r=jmathies for app association and download manager changes, r+sr=bz for helper app service, r=vlad + sr=ted for stock icons.
This commit is contained in:
Siddharth Agarwal 2009-04-12 20:25:29 +05:30
Родитель ab92f14eff
Коммит c61dd94f15
10 изменённых файлов: 30 добавлений и 17 удалений

Просмотреть файл

@ -216,7 +216,7 @@ static SETTING gSettings[] = {
PRBool
nsWindowsShellService::IsDefaultBrowserVista(PRBool* aIsDefaultBrowser)
{
#if !defined(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
IApplicationAssociationRegistration* pAAR;
HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,

Просмотреть файл

@ -732,6 +732,10 @@ EOF
fi
AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
# Definitions matching sdkddkver.h
AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000)
AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000)
AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
;;
esac

Просмотреть файл

@ -59,7 +59,7 @@
#include "nsCExternalHandlerService.h"
#include "nsDirectoryServiceDefs.h"
#ifndef MOZ_DISABLE_VISTA_SDK_REQUIREMENTS
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
@ -89,7 +89,7 @@ struct ICONENTRY {
PRUint32 ieFileOffset;
};
#ifndef MOZ_DISABLE_VISTA_SDK_REQUIREMENTS
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
typedef HRESULT (WINAPI*SHGetStockIconInfoPtr) (SHSTOCKICONID siid, UINT uFlags, SHSTOCKICONINFO *psii);
// Match stock icons with names
@ -393,7 +393,7 @@ nsresult nsIconChannel::GetHIconFromFile(HICON *hIcon)
#endif
}
#ifndef MOZ_DISABLE_VISTA_SDK_REQUIREMENTS
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
nsresult nsIconChannel::GetStockHIcon(nsIMozIconURI *aIconURI, HICON *hIcon)
{
nsresult rv = NS_OK;
@ -447,7 +447,7 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, PRBool nonBloc
#ifndef WINCE
HICON hIcon = NULL;
#ifndef MOZ_DISABLE_VISTA_SDK_REQUIREMENTS
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
nsCOMPtr<nsIMozIconURI> iconURI(do_QueryInterface(mUrl, &rv));
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -85,7 +85,7 @@ protected:
nsresult MakeInputStream(nsIInputStream** _retval, PRBool nonBlocking);
// Functions specific to Vista and above
#ifndef MOZ_DISABLE_VISTA_SDK_REQUIREMENTS
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
protected:
nsresult GetStockHIcon(nsIMozIconURI *aIconURI, HICON *hIcon);
#endif

Просмотреть файл

@ -75,13 +75,10 @@ CPPSRCS = \
nsDownloadManager.cpp \
$(NULL)
ifndef MOZ_DISABLE_VISTA_SDK_REQUIREMENTS
ifndef GNU_CXX
ifeq ($(OS_ARCH),WINNT)
CPPSRCS += nsDownloadScanner.cpp
REQUIRES += xulapp
DEFINES += -DDOWNLOAD_SCANNER
endif
endif
endif

Просмотреть файл

@ -44,6 +44,10 @@
#ifndef downloadmanager___h___
#define downloadmanager___h___
#if defined(XP_WIN) && (MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN)
#define DOWNLOAD_SCANNER
#endif
#include "nsIDownload.h"
#include "nsIDownloadManager.h"
#include "nsIDownloadProgressListener.h"

Просмотреть файл

@ -36,7 +36,9 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
#include "nsDownloadScanner.h"
#include <comcat.h>
#include <process.h>
@ -944,3 +946,5 @@ nsDownloadScannerWatchdog::WatchdogThread(void *p) {
_endthreadex(0);
return 0;
}
#endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN

Просмотреть файл

@ -1,5 +1,7 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: se cin sw=2 ts=2 et : */
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
#ifndef nsDownloadScanner_h_
#define nsDownloadScanner_h_
@ -124,3 +126,5 @@ private:
friend class nsDownloadScannerWatchdog;
};
#endif
#endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN

Просмотреть файл

@ -68,11 +68,11 @@ static nsresult GetExtensionFromWindowsMimeDatabase(const nsACString& aMimeType,
nsOSHelperAppService::nsOSHelperAppService() :
nsExternalHelperAppService()
#if !defined(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
, mAppAssoc(nsnull)
#endif
{
#if !defined(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
CoInitialize(NULL);
CoCreateInstance(CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC,
IID_IApplicationAssociationRegistration, (void**)&mAppAssoc);
@ -81,7 +81,7 @@ nsOSHelperAppService::nsOSHelperAppService() :
nsOSHelperAppService::~nsOSHelperAppService()
{
#if !defined(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
if (mAppAssoc)
mAppAssoc->Release();
mAppAssoc = nsnull;
@ -159,7 +159,7 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolSch
*aHandlerExists = PR_FALSE;
if (aProtocolScheme && *aProtocolScheme)
{
#if !defined(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
// Vista: use new application association interface
if (mAppAssoc) {
PRUnichar * pResult = nsnull;
@ -203,7 +203,7 @@ NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString&
NS_ConvertASCIItoUTF16 buf(aScheme);
#if !defined(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
// Vista: use new application association interface
if (mAppAssoc) {
PRUnichar * pResult = nsnull;
@ -555,7 +555,7 @@ already_AddRefed<nsMIMEInfoWin> nsOSHelperAppService::GetByExtension(const nsAFl
nsAutoString appInfo;
PRBool found;
#if !defined(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
// Retrieve the default application for this extension
if (mAppAssoc) {
// Vista: use the new application association COM interfaces

Просмотреть файл

@ -93,7 +93,7 @@ protected:
static PRBool typeFromExtEquals(const PRUnichar* aExt, const char *aType);
private:
#if !defined(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
IApplicationAssociationRegistration* mAppAssoc;
#endif
};