Compare commits

..

3 Commits

Author SHA1 Message Date
Lucien Greathouse
c88a0b26da build: update manifest to include Windows 10
This is a port of b0dd3bf499083214023da534e6cd0989f57dbecd .

Original commit message:

  Windows 10 wasn't listed in the executable manifest.
  This caused problems with trying to detect Windows 10
  via `os.release()`.

  PR-URL: https://github.com/nodejs/io.js/pull/2332
  Reviewed-By: Roman Reiss <me@silverwind.io>

PR-URL: https://github.com/nodejs/node/pull/2838
Reviewed-By: silverwind - Roman Reiss <me@silverwind.io>
2015-09-16 05:43:10 -04:00
Alexis Campailla
8002192b4e win: manifest node.exe for Windows 8.1
This is a port of 03e93526e6 .

Original commit message:

  Adding a compatibility section to node.exe embedded manifest so that
  Node is declared explicitly compatible with Windows 8.1. Required so
  that os.release() can return the correct version on Windows 8.1.

  See http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx

  Reviewed-by: Trevor Norris <trev.norris@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/2838
Reviewed-By: silverwind - Roman Reiss <me@silverwind.io>
2015-09-16 05:43:10 -04:00
Ben Noordhuis
e669b27740 crypto: replace rwlocks with simple mutexes
It was pointed out by Zhou Ran that the Windows XP implementation of
uv_rwlock_rdlock() and friends may unlock the inner write mutex on a
different thread than the one that locked it, resulting in undefined
behavior.

The only place that uses rwlocks is the crypto module.  Make that use
normal (simple) mutexes instead.

OpenSSL's critical sections are generally very short, with exclusive
access outnumbering shared access by a factor of three or more, so
it's not as if using rwlocks gives a decisive performance advantage.

PR-URL: https://github.com/nodejs/node/pull/2723
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-09-11 12:29:45 +10:00
3 changed files with 32 additions and 16 deletions

View File

@@ -324,6 +324,12 @@
],
}],
],
'msvs_settings': {
'VCManifestTool': {
'EmbedManifest': 'true',
'AdditionalManifestFiles': 'src/res/node.exe.extra.manifest'
}
},
},
# generate ETW header and resource files
{

View File

@@ -106,7 +106,7 @@ static Persistent<String> sessionid_sym;
static Persistent<FunctionTemplate> secure_context_constructor;
static uv_rwlock_t* locks;
static uv_mutex_t* locks;
static void crypto_threadid_cb(CRYPTO_THREADID* tid) {
@@ -118,29 +118,22 @@ static void crypto_lock_init(void) {
int i, n;
n = CRYPTO_num_locks();
locks = new uv_rwlock_t[n];
locks = new uv_mutex_t[n];
for (i = 0; i < n; i++)
if (uv_rwlock_init(locks + i))
if (uv_mutex_init(locks + i))
abort();
}
static void crypto_lock_cb(int mode, int n, const char* file, int line) {
assert((mode & CRYPTO_LOCK) || (mode & CRYPTO_UNLOCK));
assert((mode & CRYPTO_READ) || (mode & CRYPTO_WRITE));
assert(!(mode & CRYPTO_LOCK) ^ !(mode & CRYPTO_UNLOCK));
assert(!(mode & CRYPTO_READ) ^ !(mode & CRYPTO_WRITE));
if (mode & CRYPTO_LOCK) {
if (mode & CRYPTO_READ)
uv_rwlock_rdlock(locks + n);
else
uv_rwlock_wrlock(locks + n);
} else {
if (mode & CRYPTO_READ)
uv_rwlock_rdunlock(locks + n);
else
uv_rwlock_wrunlock(locks + n);
}
if (mode & CRYPTO_LOCK)
uv_mutex_lock(locks + n);
else
uv_mutex_unlock(locks + n);
}

View File

@@ -0,0 +1,17 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
</application>
</compatibility>
</assembly>