Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ac70904
Windows Vista support pt.1 and add Windows 2022 support in WinBuild
OwnedByWuigi May 19, 2026
7e07a8f
Make NT 6.0 the minimum OS for binaries
OwnedByWuigi May 19, 2026
5a3d3b7
Add fallback for LOCALE_ALLOW_NEUTRAL_NAMES
OwnedByWuigi May 19, 2026
6be0ff5
Fix 'ResolveLocaleName' for Vista
OwnedByWuigi May 19, 2026
3ba0e62
Fix type casting for DXGI device manager in D3D11DXVA2Manager
OwnedByWuigi May 19, 2026
e3ca437
Gate WMF D3D11 code to Win7 and above
OwnedByWuigi May 19, 2026
0148ffc
Gate WMF D3D11 code pt..2
OwnedByWuigi May 19, 2026
3551d9e
Gate WMF D3D11 code pt.3 (whoops)
OwnedByWuigi May 19, 2026
892fc7e
Gate gesture/touch to Win7+
OwnedByWuigi May 19, 2026
a7323f6
Add compatability shim for gesture/touch for WinVista
OwnedByWuigi May 19, 2026
e752ea1
Load shell32.dll dynamically for AppUserModelID and handle errors gra…
OwnedByWuigi May 19, 2026
0257f62
Load shell32.dll dynamically for SetCurrentProcessExplicitAppUserModelID
OwnedByWuigi May 19, 2026
207849d
GetThreadGroupAffinity fallback for Vista dav1d
OwnedByWuigi May 19, 2026
43f7dc8
K32GetProcessImageFileNameW fallback for Vista
OwnedByWuigi May 19, 2026
20efb4b
TryAcquireSRWLockExclusive fallback for Vista
OwnedByWuigi May 19, 2026
466d69f
TryAcquireSRWLockShared fallback for Vista
OwnedByWuigi May 19, 2026
98169c0
SHGetPropertyStoreForWindow fallback for Vista
OwnedByWuigi May 19, 2026
1c7bd18
DwmSetIconicLivePreviewBitmap fallback for Vista
OwnedByWuigi May 19, 2026
d97fdec
Various API fixes that should fix MSVCP140..dll crash on Vista
OwnedByWuigi May 19, 2026
75dd84d
Should fix Vista specific crashes
OwnedByWuigi May 19, 2026
fecbb6c
ICU startup/cleanup crash fix on WinVista
OwnedByWuigi May 19, 2026
07423ba
Merge branch 'master' into vistapatch
OwnedByWuigi Jun 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/docs/supported-configurations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Windows
We support building on Windows 7 and newer operating systems using
Visual Studio 2015 U3.

The compiled browser will run on Windows Vista and newer operating systems.

The following are not fully supported (but may work):

* Building with a *MozillaBuild* Windows development
Expand Down
16 changes: 14 additions & 2 deletions dom/media/platforms/wmf/DXVA2Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "mozilla/layers/D3D11ShareHandleImage.h"
#include "mozilla/layers/ImageBridgeChild.h"
#include "mozilla/layers/TextureForwarder.h"
#include "WMF.h"
#include "mfapi.h"
#include "gfxPrefs.h"
#include "MFTDecoder.h"
Expand All @@ -29,6 +30,9 @@ const CLSID CLSID_VideoProcessorMFT =
};

const GUID MF_XVP_PLAYBACK_MODE =
// The size we use for our synchronization surface.
// 16x16 is the size recommended by Microsoft (in the D3D9ExDXGISharedSurf sample) that works
// best to avoid driver bugs.
{
0x3c5d293f,
0xad67,
Expand Down Expand Up @@ -512,6 +516,7 @@ DXVA2Manager::CreateD3D9DXVA(layers::KnowsCompositor* aKnowsCompositor,
return nullptr;
}

#if WINVER >= 0x0601
class D3D11DXVA2Manager : public DXVA2Manager
{
public:
Expand Down Expand Up @@ -625,7 +630,7 @@ IUnknown*
D3D11DXVA2Manager::GetDXVADeviceManager()
{
MutexAutoLock lock(mLock);
return mDXGIDeviceManager;
return static_cast<IUnknown*>(mDXGIDeviceManager.get());
}

HRESULT
Expand Down Expand Up @@ -900,11 +905,14 @@ D3D11DXVA2Manager::ConfigureForSize(uint32_t aWidth, uint32_t aHeight)
return S_OK;
}

#endif // WINVER >= 0x0601

/* static */
DXVA2Manager*
DXVA2Manager::CreateD3D11DXVA(layers::KnowsCompositor* aKnowsCompositor,
nsACString& aFailureReason)
{
#if WINVER >= 0x0601
// DXVA processing takes up a lot of GPU resources, so limit the number of
// videos we use DXVA with at any one time.
uint32_t dxvaLimit = gfxPrefs::PDMWMFMaxDXVAVideos();
Expand All @@ -919,6 +927,10 @@ DXVA2Manager::CreateD3D11DXVA(layers::KnowsCompositor* aKnowsCompositor,
NS_ENSURE_TRUE(SUCCEEDED(hr), nullptr);

return manager.forget();
#else
aFailureReason.AssignLiteral("D3D11 DXVA is not available on Windows Vista");
return nullptr;
#endif
}

DXVA2Manager::DXVA2Manager()
Expand All @@ -934,4 +946,4 @@ DXVA2Manager::~DXVA2Manager()
--sDXVAVideosCount;
}

} // namespace mozilla
} // namespace mozilla
2 changes: 2 additions & 0 deletions dom/media/platforms/wmf/WMFAudioMFTManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ WMFAudioMFTManager::Init()
NS_ENSURE_TRUE(SUCCEEDED(hr), false);

if (mStreamType == AAC) {
#ifdef MF_MT_AAC_PAYLOAD_TYPE
hr = inputType->SetUINT32(MF_MT_AAC_PAYLOAD_TYPE, 0x0); // Raw AAC packet
NS_ENSURE_TRUE(SUCCEEDED(hr), false);
#endif

hr = inputType->SetBlob(MF_MT_USER_DATA,
mUserData.Elements(),
Expand Down
22 changes: 11 additions & 11 deletions gfx/cairo/cairo/src/cairo-mutex-impl-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,24 @@
#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
/* We require Windows 7 features */
#if !defined(WINVER) || (WINVER < 0x0601)
# define WINVER 0x0601
/* Vista+ compatible implementation */
#if !defined(WINVER) || (WINVER < 0x0600)
# define WINVER 0x0600
#endif
#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0601)
# define _WIN32_WINNT 0x0601
#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0600)
# define _WIN32_WINNT 0x0600
#endif

# include <windows.h>

typedef SRWLOCK cairo_mutex_impl_t;
typedef CRITICAL_SECTION cairo_mutex_impl_t;

# define CAIRO_MUTEX_IMPL_WIN32 1
# define CAIRO_MUTEX_IMPL_LOCK(mutex) AcquireSRWLockExclusive (&(mutex))
# define CAIRO_MUTEX_IMPL_UNLOCK(mutex) ReleaseSRWLockExclusive (&(mutex))
# define CAIRO_MUTEX_IMPL_INIT(mutex) InitializeSRWLock (&(mutex))
# define CAIRO_MUTEX_IMPL_FINI(mutex) CAIRO_MUTEX_IMPL_NOOP
# define CAIRO_MUTEX_IMPL_NIL_INITIALIZER SRWLOCK_INIT
# define CAIRO_MUTEX_IMPL_LOCK(mutex) EnterCriticalSection (&(mutex))
# define CAIRO_MUTEX_IMPL_UNLOCK(mutex) LeaveCriticalSection (&(mutex))
# define CAIRO_MUTEX_IMPL_INIT(mutex) InitializeCriticalSection (&(mutex))
# define CAIRO_MUTEX_IMPL_FINI(mutex) DeleteCriticalSection (&(mutex))
# define CAIRO_MUTEX_IMPL_NIL_INITIALIZER {0}

#elif defined __OS2__ /******************************************************/

Expand Down
5 changes: 4 additions & 1 deletion intl/icu/source/common/locmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,10 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr
char16_t windowsLocaleName[LOCALE_NAME_MAX_LENGTH] = {};

// Note: LOCALE_ALLOW_NEUTRAL_NAMES was enabled in Windows7+, prior versions did not handle neutral (no-region) locale names.
tmpLen = GetLocaleInfoA(hostid, LOCALE_SNAME, (LPSTR)locName, UPRV_LENGTHOF(locName));
#ifndef LOCALE_ALLOW_NEUTRAL_NAMES
#define LOCALE_ALLOW_NEUTRAL_NAMES 0
#endif
tmpLen = LCIDToLocaleName(hostid, (PWSTR)windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName), LOCALE_ALLOW_NEUTRAL_NAMES);
if (tmpLen > 1) {
/* Windows locale name may contain sorting variant, such as "es-ES_tradnl".
In such case, we need special mapping data found in the hardcoded table
Expand Down
124 changes: 123 additions & 1 deletion intl/icu/source/common/umutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include "ucln_cmn.h"
#include "cmemory.h"

#if defined(_WIN32)
#include <windows.h>
#endif

U_NAMESPACE_BEGIN


Expand All @@ -44,8 +48,62 @@ U_NAMESPACE_BEGIN
*************************************************************************************************/

namespace {
#if defined(_WIN32)
struct WindowsMutex {
CRITICAL_SECTION cs;

WindowsMutex() {
InitializeCriticalSection(&cs);
}

~WindowsMutex() {
DeleteCriticalSection(&cs);
}
};

struct InitMutex {
CRITICAL_SECTION cs;

InitMutex() {
InitializeCriticalSection(&cs);
}

~InitMutex() {
DeleteCriticalSection(&cs);
}
};

struct InitCondition {
CONDITION_VARIABLE cv;

InitCondition() {
InitializeConditionVariable(&cv);
}
};

class AutoCriticalSection {
public:
explicit AutoCriticalSection(CRITICAL_SECTION &criticalSection)
: criticalSection_(&criticalSection) {
EnterCriticalSection(criticalSection_);
}

~AutoCriticalSection() {
LeaveCriticalSection(criticalSection_);
}

CRITICAL_SECTION *get() const { return criticalSection_; }

private:
CRITICAL_SECTION *criticalSection_;
};

InitMutex *initMutex = nullptr;
InitCondition *initCondition = nullptr;
#else
std::mutex *initMutex;
std::condition_variable *initCondition;
#endif

// The ICU global mutex.
// Used when ICU implementation code passes nullptr for the mutex pointer.
Expand All @@ -58,8 +116,13 @@ std::once_flag *pInitFlag = &initFlag;

U_CDECL_BEGIN
static UBool U_CALLCONV umtx_cleanup() {
#if defined(_WIN32)
delete initMutex;
delete initCondition;
#else
initMutex->~mutex();
initCondition->~condition_variable();
#endif
UMutex::cleanup();

// Reset the once_flag, by destructing it and creating a fresh one in its place.
Expand All @@ -70,13 +133,36 @@ static UBool U_CALLCONV umtx_cleanup() {
}

static void U_CALLCONV umtx_init() {
#if defined(_WIN32)
initMutex = new InitMutex();
initCondition = new InitCondition();
#else
initMutex = STATIC_NEW(std::mutex);
initCondition = STATIC_NEW(std::condition_variable);
#endif
ucln_common_registerCleanup(UCLN_COMMON_MUTEX, umtx_cleanup);
}
U_CDECL_END


#if defined(_WIN32)
void *UMutex::getMutex() {
void *retPtr = fMutex.load(std::memory_order_acquire);
if (retPtr == nullptr) {
std::call_once(*pInitFlag, umtx_init);
AutoCriticalSection guard(initMutex->cs);
retPtr = fMutex.load(std::memory_order_acquire);
if (retPtr == nullptr) {
retPtr = new WindowsMutex();
fMutex = retPtr;
fListLink = gListHead;
gListHead = this;
}
}
U_ASSERT(retPtr != nullptr);
return retPtr;
}
#else
std::mutex *UMutex::getMutex() {
std::mutex *retPtr = fMutex.load(std::memory_order_acquire);
if (retPtr == nullptr) {
Expand All @@ -93,13 +179,33 @@ std::mutex *UMutex::getMutex() {
U_ASSERT(retPtr != nullptr);
return retPtr;
}
#endif

#if defined(_WIN32)
void UMutex::lock() {
WindowsMutex *m = static_cast<WindowsMutex*>(fMutex.load(std::memory_order_acquire));
if (m == nullptr) {
m = static_cast<WindowsMutex*>(getMutex());
}
EnterCriticalSection(&m->cs);
}

void UMutex::unlock() {
WindowsMutex *m = static_cast<WindowsMutex*>(fMutex.load(std::memory_order_relaxed));
LeaveCriticalSection(&m->cs);
}
#endif

UMutex *UMutex::gListHead = nullptr;

void UMutex::cleanup() {
UMutex *next = nullptr;
for (UMutex *m = gListHead; m != nullptr; m = next) {
(*m->fMutex).~mutex();
#if defined(_WIN32)
delete static_cast<WindowsMutex*>(m->fMutex.load(std::memory_order_relaxed));
#else
(*m->fMutex).~mutex();
#endif
m->fMutex = nullptr;
next = m->fListLink;
m->fListLink = nullptr;
Expand Down Expand Up @@ -144,15 +250,23 @@ umtx_unlock(UMutex* mutex)
U_COMMON_API UBool U_EXPORT2
umtx_initImplPreInit(UInitOnce &uio) {
std::call_once(*pInitFlag, umtx_init);
#if defined(_WIN32)
AutoCriticalSection lock(initMutex->cs);
#else
std::unique_lock<std::mutex> lock(*initMutex);
#endif
if (umtx_loadAcquire(uio.fState) == 0) {
umtx_storeRelease(uio.fState, 1);
return true; // Caller will next call the init function.
} else {
while (umtx_loadAcquire(uio.fState) == 1) {
// Another thread is currently running the initialization.
// Wait until it completes.
#if defined(_WIN32)
U_ASSERT(SleepConditionVariableCS(&initCondition->cv, lock.get(), INFINITE));
#else
initCondition->wait(lock);
#endif
}
U_ASSERT(uio.fState == 2);
return false;
Expand All @@ -169,10 +283,18 @@ umtx_initImplPreInit(UInitOnce &uio) {
U_COMMON_API void U_EXPORT2
umtx_initImplPostInit(UInitOnce &uio) {
{
#if defined(_WIN32)
AutoCriticalSection lock(initMutex->cs);
#else
std::unique_lock<std::mutex> lock(*initMutex);
#endif
umtx_storeRelease(uio.fState, 2);
}
#if defined(_WIN32)
WakeAllConditionVariable(&initCondition->cv);
#else
initCondition->notify_all();
#endif
}

U_NAMESPACE_END
Expand Down
22 changes: 22 additions & 0 deletions intl/icu/source/common/umutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,27 @@ class U_COMMON_API_CLASS UMutex {
void* operator new(size_t) = delete;

// requirements for C++ BasicLockable, allows UMutex to work with std::lock_guard
#if defined(_WIN32)
U_COMMON_API void lock();
U_COMMON_API void unlock();

U_COMMON_API static void cleanup();

private:
std::atomic<void *> fMutex { nullptr };

/** All initialized UMutexes are kept in a linked list, so that they can be found,
* and the underlying Windows mutex object destructed, by u_cleanup().
*/
UMutex *fListLink { nullptr };
static UMutex *gListHead;

/** Out-of-line function to lazily initialize a UMutex on first use.
* Initial fast check is inline, in lock(). The returned value may never
* be nullptr.
*/
void *getMutex();
#else
U_COMMON_API void lock() {
std::mutex *m = fMutex.load(std::memory_order_acquire);
if (m == nullptr) { m = getMutex(); }
Expand All @@ -236,6 +257,7 @@ class U_COMMON_API_CLASS UMutex {
* be nullptr.
*/
std::mutex *getMutex();
#endif
};


Expand Down
Loading
Loading