Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-12-11 22:17:20 +0300
committerChristopher Faylor <me@cgf.cx>2006-12-11 22:17:20 +0300
commit7dfad3a0c6530aa075458e0d81e5039eca70abd8 (patch)
treeb778a82bbf33c24350b59630f6fb76ce267fd994 /winsup/cygwin/sigproc.cc
parent6dcb2ec4419b33d5848583798b8e2d94c6176a6d (diff)
* sigproc.cc (child_info::child_info): Move old comment about msv_count here.
Edit it slightly to reflect new sensibilities.
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 3a764fe63..a8d4a3321 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -788,6 +788,29 @@ child_info::child_info (unsigned in_cb, child_info_types chtype, bool need_subpr
memset (this, 0, in_cb);
cb = in_cb;
+ /* It appears that when running under WOW64 on Vista 64, the first DWORD
+ value in the datastructure lpReserved2 is pointing to (msv_count in
+ Cygwin), has to reflect the size of that datastructure as used in the
+ Microsoft C runtime (a count value, counting the number of elements in
+ two subsequent arrays, BYTE[count and HANDLE[count]), even though the C
+ runtime isn't used. Otherwise, if msv_count is 0 or too small, the
+ datastructure gets overwritten.
+
+ This seems to be a bug in Vista's WOW64, which apparently copies the
+ lpReserved2 datastructure not using the cbReserved2 size information,
+ but using the information given in the first DWORD within lpReserved2
+ instead. 32 bit Windows and former WOW64 don't care if msv_count is 0
+ or a sensible non-0 count value. However, it's not clear if a non-0
+ count doesn't result in trying to evaluate the content, so we do this
+ really only for Vista 64 for now.
+
+ However, since this doesn't seem to harm normal windows operation we'll
+ just set it unconditionally until we hear complaints.
+
+ The value is sizeof (child_info_*) / 5 which results in a count which
+ covers the full datastructure, plus not more than 4 extra bytes. This
+ is ok as long as the child_info structure is cosily stored within a bigger
+ datastructure. */
msv_count = in_cb / 5;
intro = PROC_MAGIC_GENERIC;