mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
bug 280245. WinCE build and support changes. r=darin
This commit is contained in:
parent
a43a6ff556
commit
55eb21a1ac
@ -140,6 +140,7 @@
|
||||
typedef WINBASEAPI BOOL (WINAPI* LPFNISDEBUGGERPRESENT)();
|
||||
PRBool InDebugger()
|
||||
{
|
||||
#ifndef WINCE
|
||||
PRBool fReturn = PR_FALSE;
|
||||
LPFNISDEBUGGERPRESENT lpfnIsDebuggerPresent = NULL;
|
||||
HINSTANCE hKernel = LoadLibrary("Kernel32.dll");
|
||||
@ -156,6 +157,9 @@ PRBool InDebugger()
|
||||
}
|
||||
|
||||
return fReturn;
|
||||
#else
|
||||
return PR_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* WIN32*/
|
||||
@ -205,7 +209,7 @@ nsDebugImpl::Assertion(const char *aStr, const char *aExpr, const char *aFile, P
|
||||
char* assertBehavior = getenv("XPCOM_DEBUG_BREAK");
|
||||
if (assertBehavior && strcmp(assertBehavior, "warn") == 0)
|
||||
return NS_OK;
|
||||
|
||||
#ifndef WINCE // we really just want to crash for now
|
||||
if(!InDebugger())
|
||||
{
|
||||
DWORD code = IDRETRY;
|
||||
@ -255,6 +259,7 @@ nsDebugImpl::Assertion(const char *aStr, const char *aExpr, const char *aFile, P
|
||||
// Fall Through
|
||||
}
|
||||
}
|
||||
#endif // WINCE
|
||||
#endif
|
||||
|
||||
#if defined(XP_OS2)
|
||||
|
@ -96,6 +96,10 @@ NS_MeanAndStdDev(double n, double sumOfValues, double sumOfSquaredValues,
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef WINCE
|
||||
#undef NS_BUILD_REFCNT_LOGGING
|
||||
#endif
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
#include "plhash.h"
|
||||
#include "prmem.h"
|
||||
@ -848,7 +852,7 @@ static void InitTraceLog(void)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code
|
||||
#if defined(_WIN32) && defined(_M_IX86) && !defined(WINCE) // WIN32 x86 stack walking code
|
||||
#include "nsStackFrameWin.h"
|
||||
void
|
||||
nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
|
||||
|
@ -46,9 +46,11 @@ include $(srcdir)/../glue/objs.mk
|
||||
|
||||
MODULE = xpcom
|
||||
LIBRARY_NAME = xpcom_core
|
||||
ifneq ($(OS_ARCH),WINNT)
|
||||
|
||||
ifneq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
|
||||
SHORT_LIBNAME = xpcomcor
|
||||
endif
|
||||
|
||||
LIBXUL_LIBRARY = 1
|
||||
|
||||
PACKAGE_FILE = xpcom.pkg
|
||||
@ -80,6 +82,10 @@ ifeq ($(OS_ARCH)$(MOZ_ENABLE_LIBXUL),WINNT)
|
||||
CPPSRCS += dlldeps.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINCE)
|
||||
CPPSRCS += dlldeps.cpp
|
||||
endif
|
||||
|
||||
ifdef XPCOM_USE_LEA
|
||||
CSRCS += malloc.c
|
||||
endif
|
||||
|
@ -130,7 +130,7 @@ void XXXNeverCalled()
|
||||
NS_ProxyRelease(nsnull, nsnull, PR_FALSE);
|
||||
XPT_DoString(nsnull, nsnull, nsnull);
|
||||
XPT_DoHeader(nsnull, nsnull, nsnull);
|
||||
#ifdef DEBUG
|
||||
#if defined (DEBUG) && !defined (WINCE)
|
||||
PurePrintf(0);
|
||||
#endif
|
||||
XPTC_InvokeByIndex(nsnull, 0, 0, nsnull);
|
||||
|
@ -187,7 +187,7 @@ NS_GetFrozenFunctions(XPCOMFunctions *entryPoints, const char* libraryPath);
|
||||
* GRE_CONF_NAME - Name of the GRE Configuration file
|
||||
*/
|
||||
|
||||
#if defined(XP_WIN32) || defined(XP_OS2)
|
||||
#if defined(XP_WIN32) || defined(XP_OS2) || defined(WINCE)
|
||||
|
||||
#define XPCOM_SEARCH_KEY "PATH"
|
||||
#define GRE_CONF_NAME "gre.config"
|
||||
|
@ -459,10 +459,12 @@ nsresult NS_COM NS_InitXPCOM2(nsIServiceManager* *result,
|
||||
rv = nsMemoryImpl::Startup();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
#ifndef WINCE
|
||||
// If the locale hasn't already been setup by our embedder,
|
||||
// get us out of the "C" locale and into the system
|
||||
if (strcmp(setlocale(LC_ALL, NULL), "C") == 0)
|
||||
setlocale(LC_ALL, "");
|
||||
#endif
|
||||
|
||||
#if defined(XP_UNIX) || defined(XP_OS2)
|
||||
NS_StartupNativeCharsetUtils();
|
||||
|
@ -1520,8 +1520,10 @@ operator!=( const U* lhs, const nsCOMPtr<T>& rhs )
|
||||
// prevents us from using these. (It also, fortunately, has the bug
|
||||
// that we don't need them either.)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1310)
|
||||
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
#define NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
template <class T, class U>
|
||||
|
@ -131,6 +131,7 @@ nsresult XPCOMGlueStartup(const char* xpcomFile)
|
||||
}
|
||||
|
||||
xpcomLib = PR_LoadLibraryWithFlags(libSpec, PR_LD_LAZY|PR_LD_GLOBAL);
|
||||
|
||||
if (!xpcomLib)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
@ -468,6 +469,10 @@ static char* spEnvString = 0;
|
||||
void
|
||||
GRE_AddGREToEnvironment()
|
||||
{
|
||||
#ifdef WINCE
|
||||
return;
|
||||
#else
|
||||
|
||||
const char* grePath = GRE_GetGREPath();
|
||||
if (!grePath)
|
||||
return;
|
||||
@ -499,16 +504,17 @@ GRE_AddGREToEnvironment()
|
||||
}
|
||||
}
|
||||
|
||||
#if XP_WIN32
|
||||
#ifdef XP_WIN32
|
||||
// On windows, the current directory is searched before the
|
||||
// PATH environment variable. This is a very bad thing
|
||||
// since libraries in the cwd will be picked up before
|
||||
// any that are in either the application or GRE directory.
|
||||
|
||||
if (grePath) {
|
||||
SetCurrentDirectory(grePath);
|
||||
SetCurrentDirectory(grePath);
|
||||
}
|
||||
#endif
|
||||
#endif // XP_WIN32
|
||||
#endif // WINCE
|
||||
}
|
||||
|
||||
|
||||
|
@ -132,7 +132,7 @@ static HINSTANCE gShell32DLLInst = NULL;
|
||||
#endif
|
||||
NS_COM void StartupSpecialSystemDirectory()
|
||||
{
|
||||
#if defined (XP_WIN)
|
||||
#if defined (XP_WIN) && !defined (WINCE)
|
||||
/* On windows, the old method to get file locations is incredibly slow.
|
||||
As of this writing, 3 calls to GetWindowsFolder accounts for 3% of mozilla
|
||||
startup. Replacing these older calls with a single call to SHGetSpecialFolderPath
|
||||
@ -326,13 +326,19 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory,
|
||||
#endif
|
||||
|
||||
case OS_TemporaryDirectory:
|
||||
#if defined (XP_WIN)
|
||||
#if defined (XP_WIN) && !defined (WINCE)
|
||||
{
|
||||
DWORD len = GetTempPath(_MAX_PATH, path);
|
||||
return NS_NewNativeLocalFile(nsDependentCString(path),
|
||||
PR_TRUE,
|
||||
aFile);
|
||||
}
|
||||
#elif defined (WINCE)
|
||||
{
|
||||
return NS_NewNativeLocalFile(NS_LITERAL_CSTRING("\\Temp"),
|
||||
PR_TRUE,
|
||||
aFile);
|
||||
}
|
||||
#elif defined(XP_OS2)
|
||||
{
|
||||
char buffer[CCHMAXPATH] = "";
|
||||
@ -590,6 +596,7 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory,
|
||||
{
|
||||
return GetWindowsFolder(CSIDL_TEMPLATES, aFile);
|
||||
}
|
||||
#ifndef WINCE
|
||||
case Win_Common_Startmenu:
|
||||
{
|
||||
return GetWindowsFolder(CSIDL_COMMON_STARTMENU, aFile);
|
||||
@ -606,10 +613,6 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory,
|
||||
{
|
||||
return GetWindowsFolder(CSIDL_COMMON_DESKTOPDIRECTORY, aFile);
|
||||
}
|
||||
case Win_Appdata:
|
||||
{
|
||||
return GetWindowsFolder(CSIDL_APPDATA, aFile);
|
||||
}
|
||||
case Win_Printhood:
|
||||
{
|
||||
return GetWindowsFolder(CSIDL_PRINTHOOD, aFile);
|
||||
@ -618,6 +621,11 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory,
|
||||
{
|
||||
return GetWindowsFolder(CSIDL_COOKIES, aFile);
|
||||
}
|
||||
#endif
|
||||
case Win_Appdata:
|
||||
{
|
||||
return GetWindowsFolder(CSIDL_APPDATA, aFile);
|
||||
}
|
||||
#endif // XP_WIN
|
||||
|
||||
#if defined(XP_UNIX)
|
||||
|
@ -85,7 +85,7 @@
|
||||
#endif
|
||||
|
||||
// define default product directory
|
||||
#ifdef XP_MAC
|
||||
#if defined (XP_MAC) || defined (WINCE)
|
||||
#define DEFAULT_PRODUCT_DIR NS_LITERAL_CSTRING("Mozilla")
|
||||
#else
|
||||
#define DEFAULT_PRODUCT_DIR NS_LITERAL_CSTRING(MOZ_USER_DIR)
|
||||
@ -364,6 +364,9 @@ NS_METHOD nsAppFileLocationProvider::GetProductDirectory(nsILocalFile **aLocalFi
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = directoryService->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(localDir));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#elif defined(WINCE)
|
||||
rv = NS_NewNativeLocalFile(nsDependentCString("\\Windows"), PR_TRUE, getter_AddRefs(localDir));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#elif defined(XP_WIN)
|
||||
nsCOMPtr<nsIProperties> directoryService =
|
||||
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
|
||||
@ -399,8 +402,10 @@ NS_METHOD nsAppFileLocationProvider::GetProductDirectory(nsILocalFile **aLocalFi
|
||||
rv = localDir->AppendRelativeNativePath(DEFAULT_PRODUCT_DIR);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = localDir->Exists(&exists);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && !exists)
|
||||
rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
|
||||
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
*aLocalFile = localDir;
|
||||
|
@ -101,7 +101,7 @@ private:
|
||||
//----------------------------------------------------------------------------
|
||||
// short cut resolver
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#ifndef WINCE
|
||||
class ShortcutResolver
|
||||
{
|
||||
public:
|
||||
@ -209,6 +209,7 @@ static void NS_DestroyShortcutResolver()
|
||||
delete gResolver;
|
||||
gResolver = nsnull;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -468,6 +469,7 @@ nsLocalFile::nsLocalFile(const nsLocalFile& other)
|
||||
nsresult
|
||||
nsLocalFile::ResolveShortcut()
|
||||
{
|
||||
#ifndef WINCE
|
||||
// we can't do anything without the resolver
|
||||
if (!gResolver)
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -486,6 +488,9 @@ nsLocalFile::ResolveShortcut()
|
||||
mResolvedPath.SetLength(len);
|
||||
|
||||
return rv;
|
||||
#else
|
||||
return NS_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Resolve any shortcuts and stat the resolved path. After a successful return
|
||||
@ -592,15 +597,21 @@ nsLocalFile::InitWithNativePath(const nsACString &filePath)
|
||||
PRInt32 pathLen = 0;
|
||||
|
||||
if ( ( (secondChar == ':') && !FindCharInReadable('/', begin, end) ) || // normal path
|
||||
( (firstChar == '\\') && (secondChar == '\\') ) ) // network path
|
||||
#ifdef WINCE
|
||||
( (firstChar == '\\') ) // wince absolute path or network path
|
||||
#else
|
||||
( (firstChar == '\\') && (secondChar == '\\') ) // network path
|
||||
#endif
|
||||
)
|
||||
{
|
||||
// This is a native path
|
||||
path = ToNewCString(filePath);
|
||||
pathLen = filePath.Length();
|
||||
}
|
||||
|
||||
if (path == nsnull)
|
||||
if (path == nsnull) {
|
||||
return NS_ERROR_FILE_UNRECOGNIZED_PATH;
|
||||
}
|
||||
|
||||
// kill any trailing '\' provided it isn't the second char of DBCS
|
||||
PRInt32 len = pathLen - 1;
|
||||
@ -671,13 +682,18 @@ nsLocalFile::Create(PRUint32 type, PRUint32 attributes)
|
||||
// '\\machine\volume\' segment for the second form.
|
||||
|
||||
const unsigned char* path = (const unsigned char*) mResolvedPath.get();
|
||||
|
||||
if (path[0] == '\\' && path[1] == '\\')
|
||||
{
|
||||
#ifdef WINCE
|
||||
++path;
|
||||
#else
|
||||
// dealing with a UNC path here; skip past '\\machine\'
|
||||
path = _mbschr(path + 2, '\\');
|
||||
if (!path)
|
||||
return NS_ERROR_FILE_INVALID_PATH;
|
||||
++path;
|
||||
#endif
|
||||
}
|
||||
|
||||
// search for first slash after the drive (or volume) name
|
||||
@ -755,6 +771,7 @@ nsLocalFile::AppendNativeInternal(const nsAFlatCString &node, PRBool multipleCom
|
||||
|| node.Equals("..")) // can't be ..
|
||||
return NS_ERROR_FILE_UNRECOGNIZED_PATH;
|
||||
|
||||
#ifndef WINCE // who cares?
|
||||
if (multipleComponents)
|
||||
{
|
||||
// can't contain .. as a path component. Ensure that the valid components
|
||||
@ -773,6 +790,7 @@ nsLocalFile::AppendNativeInternal(const nsAFlatCString &node, PRBool multipleCom
|
||||
}
|
||||
else if (_mbschr(nodePath, '\\')) // single components can't contain '\'
|
||||
return NS_ERROR_FILE_UNRECOGNIZED_PATH;
|
||||
#endif
|
||||
|
||||
MakeDirty();
|
||||
|
||||
@ -784,6 +802,7 @@ nsLocalFile::AppendNativeInternal(const nsAFlatCString &node, PRBool multipleCom
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::Normalize()
|
||||
{
|
||||
#ifndef WINCE
|
||||
// XXX See bug 187957 comment 18 for possible problems with this implementation.
|
||||
|
||||
if (mWorkingPath.IsEmpty())
|
||||
@ -914,7 +933,9 @@ nsLocalFile::Normalize()
|
||||
|
||||
NS_CopyUnicodeToNative(normal, mWorkingPath);
|
||||
MakeDirty();
|
||||
|
||||
#else // WINCE
|
||||
// WINCE FIX
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1343,7 +1364,6 @@ nsLocalFile::Load(PRLibrary * *_retval)
|
||||
|
||||
if (*_retval)
|
||||
return NS_OK;
|
||||
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
@ -1504,6 +1524,7 @@ nsLocalFile::SetModDate(PRInt64 aLastModifiedTime, const char *filePath)
|
||||
OPEN_EXISTING, // how to create
|
||||
0, // file attributes
|
||||
NULL);
|
||||
|
||||
if (file == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
return ConvertWinError(GetLastError());
|
||||
@ -1691,7 +1712,7 @@ nsLocalFile::SetFileSize(PRInt64 aFileSize)
|
||||
return rv;
|
||||
}
|
||||
|
||||
typedef BOOL (WINAPI *fpGetDiskFreeSpaceExA)(LPCTSTR lpDirectoryName,
|
||||
typedef BOOL (WINAPI *fpGetDiskFreeSpaceExA)(LPCSTR lpDirectoryName,
|
||||
PULARGE_INTEGER lpFreeBytesAvailableToCaller,
|
||||
PULARGE_INTEGER lpTotalNumberOfBytes,
|
||||
PULARGE_INTEGER lpTotalNumberOfFreeBytes);
|
||||
@ -1699,6 +1720,7 @@ typedef BOOL (WINAPI *fpGetDiskFreeSpaceExA)(LPCTSTR lpDirectoryName,
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
|
||||
{
|
||||
#ifndef WINCE
|
||||
NS_ENSURE_ARG(aDiskSpaceAvailable);
|
||||
|
||||
ResolveAndStat();
|
||||
@ -1715,8 +1737,10 @@ nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
|
||||
if (pGetDiskFreeSpaceExA)
|
||||
{
|
||||
ULARGE_INTEGER liFreeBytesAvailableToCaller, liTotalNumberOfBytes;
|
||||
if (pGetDiskFreeSpaceExA(mResolvedPath.get(), &liFreeBytesAvailableToCaller,
|
||||
&liTotalNumberOfBytes, NULL))
|
||||
if (pGetDiskFreeSpaceExA(mResolvedPath.get(),
|
||||
&liFreeBytesAvailableToCaller,
|
||||
&liTotalNumberOfBytes,
|
||||
NULL))
|
||||
{
|
||||
*aDiskSpaceAvailable = liFreeBytesAvailableToCaller.QuadPart;
|
||||
return NS_OK;
|
||||
@ -1729,6 +1753,7 @@ nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
|
||||
strcat(aDrive, "\\");
|
||||
|
||||
DWORD dwSecPerClus, dwBytesPerSec, dwFreeClus, dwTotalClus;
|
||||
|
||||
if (GetDiskFreeSpace(aDrive, &dwSecPerClus, &dwBytesPerSec, &dwFreeClus, &dwTotalClus))
|
||||
{
|
||||
__int64 bytes = dwFreeClus;
|
||||
@ -1738,8 +1763,10 @@ nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
|
||||
*aDiskSpaceAvailable = bytes;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
#endif
|
||||
// WINCE FIX
|
||||
*aDiskSpaceAvailable = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -1862,7 +1889,7 @@ nsLocalFile::IsExecutable(PRBool *_retval)
|
||||
// Convert extension to lower case.
|
||||
for( unsigned char *p = (unsigned char *)ext; *p; p++ )
|
||||
*p = _mbctolower( *p );
|
||||
|
||||
|
||||
// Search for any of the set of executable extensions.
|
||||
const char * const executableExts[] = {
|
||||
".ad",
|
||||
@ -2141,6 +2168,7 @@ nsLocalFile::SetPersistentDescriptor(const nsACString &aPersistentDescriptor)
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::Reveal()
|
||||
{
|
||||
#ifndef WINCE
|
||||
// make sure mResolvedPath is set
|
||||
nsresult rv = ResolveAndStat();
|
||||
if (NS_FAILED(rv) && rv != NS_ERROR_FILE_NOT_FOUND)
|
||||
@ -2166,9 +2194,9 @@ nsLocalFile::Reveal()
|
||||
explorerParams.Append(mResolvedPath);
|
||||
explorerParams.Append('\"');
|
||||
|
||||
if (::ShellExecute(NULL, "open", explorerPath.get(), explorerParams.get(),
|
||||
NULL, SW_SHOWNORMAL) <= (HINSTANCE) 32)
|
||||
if (::ShellExecute(NULL, "open", explorerPath.get(), explorerParams.get(), NULL, SW_SHOWNORMAL) <= (HINSTANCE) 32)
|
||||
return NS_ERROR_FAILURE;
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2177,6 +2205,7 @@ nsLocalFile::Reveal()
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::Launch()
|
||||
{
|
||||
#ifndef WINCE
|
||||
const nsCString &path = mWorkingPath;
|
||||
|
||||
// use the app registry name to launch a shell execute....
|
||||
@ -2217,6 +2246,7 @@ nsLocalFile::Launch()
|
||||
return NS_ERROR_FILE_EXECUTION_FAILED;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -2378,14 +2408,18 @@ NS_NewLocalFile(const nsAString &path, PRBool followLinks, nsILocalFile* *result
|
||||
void
|
||||
nsLocalFile::GlobalInit()
|
||||
{
|
||||
#ifndef WINCE
|
||||
nsresult rv = NS_CreateShortcutResolver();
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Shortcut resolver could not be created");
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nsLocalFile::GlobalShutdown()
|
||||
{
|
||||
#ifndef WINCE
|
||||
NS_DestroyShortcutResolver();
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsDriveEnumerator, nsISimpleEnumerator)
|
||||
@ -2401,6 +2435,9 @@ nsDriveEnumerator::~nsDriveEnumerator()
|
||||
|
||||
nsresult nsDriveEnumerator::Init()
|
||||
{
|
||||
#ifdef WINCE
|
||||
return NS_OK;
|
||||
#else
|
||||
/* If the length passed to GetLogicalDriveStrings is smaller
|
||||
* than the length of the string it would return, it returns
|
||||
* the length required for the string. */
|
||||
@ -2411,16 +2448,26 @@ nsresult nsDriveEnumerator::Init()
|
||||
return NS_ERROR_FAILURE;
|
||||
mLetter = mDrives.get();
|
||||
return NS_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDriveEnumerator::HasMoreElements(PRBool *aHasMore)
|
||||
{
|
||||
#ifdef WINCE
|
||||
*aHasMore = FALSE;
|
||||
#else
|
||||
*aHasMore = *mLetter != '\0';
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDriveEnumerator::GetNext(nsISupports **aNext)
|
||||
{
|
||||
#ifdef WINCE
|
||||
nsILocalFile *file;
|
||||
nsresult rv = NS_NewNativeLocalFile(nsDependentCString("\\"), PR_FALSE, &file);
|
||||
*aNext = file;
|
||||
#else
|
||||
/* GetLogicalDrives stored in mLetter is a concatenation
|
||||
* of null terminated strings, followed by a null terminator. */
|
||||
if (!*mLetter) {
|
||||
@ -2434,5 +2481,6 @@ NS_IMETHODIMP nsDriveEnumerator::GetNext(nsISupports **aNext)
|
||||
NS_NewNativeLocalFile(nsDependentCString(drive), PR_FALSE, &file);
|
||||
|
||||
*aNext = file;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = xpcom_obsolete
|
||||
LIBRARY_NAME = xpcom_compat
|
||||
ifneq ($(OS_ARCH),WINNT)
|
||||
ifneq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
|
||||
SHORT_LIBNAME = xpcomct
|
||||
endif
|
||||
|
||||
@ -71,7 +71,7 @@ CPPSRCS = \
|
||||
nsSpecialSystemDirectory.cpp \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
|
||||
REQUIRES += libreg
|
||||
ifndef MOZ_ENABLE_LIBXUL
|
||||
CPPSRCS += dlldeps-obs.cpp
|
||||
@ -95,6 +95,7 @@ LOCAL_INCLUDES = \
|
||||
XPIDLSRCS = nsIFileSpec.idl \
|
||||
nsIRegistry.idl \
|
||||
$(NULL)
|
||||
|
||||
# Force use of PIC
|
||||
FORCE_USE_PIC = 1
|
||||
|
||||
|
@ -57,11 +57,13 @@ DEFINE_OLEGUID(IID_IPersistFile, 0x0000010BL, 0, 0);
|
||||
#include <shellapi.h>
|
||||
#include <shlguid.h>
|
||||
|
||||
#ifndef WINCE
|
||||
#ifdef UNICODE
|
||||
#define CreateDirectoryW CreateDirectory
|
||||
#else
|
||||
#define CreateDirectoryA CreateDirectory
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpecHelpers::Canonify(nsSimpleCharString& ioPath, PRBool inMakeDirs)
|
||||
@ -289,7 +291,7 @@ PRBool nsFileSpec::IsSymlink() const
|
||||
IShellLink* psl;
|
||||
|
||||
PRBool isSymlink = PR_FALSE;
|
||||
|
||||
#ifndef WINCE
|
||||
CoInitialize(NULL);
|
||||
// Get a pointer to the IShellLink interface.
|
||||
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**)&psl);
|
||||
@ -322,7 +324,7 @@ PRBool nsFileSpec::IsSymlink() const
|
||||
}
|
||||
|
||||
CoUninitialize();
|
||||
|
||||
#endif
|
||||
return isSymlink;
|
||||
}
|
||||
|
||||
@ -332,7 +334,7 @@ nsresult nsFileSpec::ResolveSymlink(PRBool& wasSymlink)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
wasSymlink = PR_FALSE; // assume failure
|
||||
|
||||
#ifndef WINCE
|
||||
if (Exists())
|
||||
return NS_OK;
|
||||
|
||||
@ -399,6 +401,9 @@ nsresult nsFileSpec::ResolveSymlink(PRBool& wasSymlink)
|
||||
return NS_OK;
|
||||
|
||||
return NS_FILE_FAILURE;
|
||||
#else
|
||||
return NS_OK;
|
||||
#endif //WINCE
|
||||
}
|
||||
|
||||
|
||||
@ -628,6 +633,7 @@ nsresult nsFileSpec::MoveToDir(const nsFileSpec& inNewParentDirectory)
|
||||
nsresult nsFileSpec::Execute(const char* inArgs ) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#ifndef WINCE
|
||||
if (!IsDirectory())
|
||||
{
|
||||
nsSimpleCharString fileNameWithArgs = "\"";
|
||||
@ -636,6 +642,7 @@ nsresult nsFileSpec::Execute(const char* inArgs ) const
|
||||
if (execResult > 31)
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
return NS_FILE_FAILURE;
|
||||
} // nsFileSpec::Execute
|
||||
|
||||
@ -644,6 +651,7 @@ nsresult nsFileSpec::Execute(const char* inArgs ) const
|
||||
PRInt64 nsFileSpec::GetDiskSpaceAvailable() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#ifndef WINCE
|
||||
PRInt64 int64;
|
||||
|
||||
LL_I2L(int64 , LONG_MAX);
|
||||
@ -704,6 +712,9 @@ PRInt64 nsFileSpec::GetDiskSpaceAvailable() const
|
||||
nBytes = (double)dwFreeClus*(double)dwSecPerClus*(double) dwBytesPerSec;
|
||||
}
|
||||
return (PRInt64)nBytes;
|
||||
#else
|
||||
return (PRInt64)0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -152,8 +152,10 @@ static char* MakeUpperCase(char* aPath)
|
||||
{
|
||||
// check if the Windows is DBCSEnabled once.
|
||||
if (PR_FALSE == gGlobalOSInitialized) {
|
||||
#ifndef WINCE
|
||||
if (GetSystemMetrics(SM_DBCSENABLED))
|
||||
gGlobalDBCSEnabledOS = PR_TRUE;
|
||||
#endif
|
||||
gGlobalOSInitialized = PR_TRUE;
|
||||
}
|
||||
|
||||
@ -485,7 +487,11 @@ void nsSpecialSystemDirectory::operator = (SystemDirectories aSystemSystemDirect
|
||||
|
||||
|
||||
case OS_TemporaryDirectory:
|
||||
#if defined (XP_WIN)
|
||||
#if defined (WINCE)
|
||||
{
|
||||
*this = "\\TEMP";
|
||||
}
|
||||
#elif defined (XP_WIN)
|
||||
{
|
||||
char path[_MAX_PATH];
|
||||
DWORD len = GetTempPath(_MAX_PATH, path);
|
||||
@ -873,6 +879,7 @@ void nsSpecialSystemDirectory::operator = (SystemDirectories aSystemSystemDirect
|
||||
GetWindowsFolder(CSIDL_TEMPLATES, *this);
|
||||
break;
|
||||
}
|
||||
#ifndef WINCE
|
||||
case Win_Common_Startmenu:
|
||||
{
|
||||
GetWindowsFolder(CSIDL_COMMON_STARTMENU, *this);
|
||||
@ -893,11 +900,6 @@ void nsSpecialSystemDirectory::operator = (SystemDirectories aSystemSystemDirect
|
||||
GetWindowsFolder(CSIDL_COMMON_DESKTOPDIRECTORY, *this);
|
||||
break;
|
||||
}
|
||||
case Win_Appdata:
|
||||
{
|
||||
GetWindowsFolder(CSIDL_APPDATA, *this);
|
||||
break;
|
||||
}
|
||||
case Win_Printhood:
|
||||
{
|
||||
GetWindowsFolder(CSIDL_PRINTHOOD, *this);
|
||||
@ -908,6 +910,13 @@ void nsSpecialSystemDirectory::operator = (SystemDirectories aSystemSystemDirect
|
||||
GetWindowsFolder(CSIDL_COOKIES, *this);
|
||||
break;
|
||||
}
|
||||
#endif // WINCE
|
||||
|
||||
case Win_Appdata:
|
||||
{
|
||||
GetWindowsFolder(CSIDL_APPDATA, *this);
|
||||
break;
|
||||
}
|
||||
#endif // XP_WIN
|
||||
|
||||
#if defined(XP_UNIX)
|
||||
|
@ -1124,9 +1124,12 @@ static PRBool _md_IsInputPending(WORD qstatus)
|
||||
|
||||
/* Is there anything other than a QS_MOUSEMOVE pending? */
|
||||
if ((qstatus & QS_MOUSEBUTTON) ||
|
||||
(qstatus & QS_KEY) ||
|
||||
(qstatus & QS_HOTKEY)) {
|
||||
return PR_TRUE;
|
||||
(qstatus & QS_KEY)
|
||||
#ifndef WINCE
|
||||
|| (qstatus & QS_HOTKEY)
|
||||
#endif
|
||||
) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1416,46 +1419,6 @@ PL_IsQueueNative(PLEventQueue *queue)
|
||||
return queue->type == EventQueueIsNative ? PR_TRUE : PR_FALSE;
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
/*
|
||||
** Global Instance handle...
|
||||
** In Win32 this is the module handle of the DLL.
|
||||
**
|
||||
*/
|
||||
HINSTANCE _pr_hInstance;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_WIN32) && !defined(MOZ_ENABLE_LIBXUL)
|
||||
|
||||
/*
|
||||
** Initialization routine for the DLL...
|
||||
*/
|
||||
|
||||
BOOL WINAPI DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved)
|
||||
{
|
||||
switch (dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
_pr_hInstance = hDLL;
|
||||
break;
|
||||
|
||||
case DLL_THREAD_ATTACH:
|
||||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
_pr_hInstance = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_WIN32) || defined(XP_OS2)
|
||||
#ifdef XP_OS2
|
||||
MRESULT EXPENTRY
|
||||
@ -1506,6 +1469,7 @@ static PRStatus InitEventLib( void )
|
||||
static void _md_CreateEventQueue( PLEventQueue *eventQueue )
|
||||
{
|
||||
WNDCLASS wc;
|
||||
HANDLE h = GetModuleHandle(NULL);
|
||||
|
||||
/*
|
||||
** If this is the first call to PL_InitializeEventsLib(),
|
||||
@ -1521,12 +1485,12 @@ static void _md_CreateEventQueue( PLEventQueue *eventQueue )
|
||||
_pr_PostEventMsgId = RegisterWindowMessage("XPCOM_PostEvent");
|
||||
|
||||
/* Register the class for the event receiver window */
|
||||
if (!GetClassInfo(_pr_hInstance, _pr_eventWindowClass, &wc)) {
|
||||
if (!GetClassInfo(h, _pr_eventWindowClass, &wc)) {
|
||||
wc.style = 0;
|
||||
wc.lpfnWndProc = _md_EventReceiverProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = _pr_hInstance;
|
||||
wc.hInstance = h;
|
||||
wc.hIcon = NULL;
|
||||
wc.hCursor = NULL;
|
||||
wc.hbrBackground = (HBRUSH) NULL;
|
||||
@ -1539,7 +1503,7 @@ static void _md_CreateEventQueue( PLEventQueue *eventQueue )
|
||||
eventQueue->eventReceiverWindow = CreateWindow(_pr_eventWindowClass,
|
||||
"XPCOM:EventReceiver",
|
||||
0, 0, 0, 10, 10,
|
||||
NULL, NULL, _pr_hInstance,
|
||||
NULL, NULL, h,
|
||||
NULL);
|
||||
PR_ASSERT(eventQueue->eventReceiverWindow);
|
||||
/* Set a property which can be used to retrieve the event queue
|
||||
|
@ -43,7 +43,11 @@ VPATH = @srcdir@
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = xpcom
|
||||
DIRS = xpt xpidl
|
||||
DIRS = xpt
|
||||
|
||||
ifndef WINCE
|
||||
DIRS += xpidl
|
||||
endif
|
||||
|
||||
ifdef MOZ_ENABLE_JAVAXPCOM
|
||||
DIRS += $(DEPTH)/extensions/java/xpcom/tools/xpidl
|
||||
|
@ -44,7 +44,11 @@ include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = xpcom
|
||||
|
||||
DIRS = public src tools
|
||||
DIRS = public src
|
||||
|
||||
ifndef WINCE
|
||||
DIRS += tools
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user