Don't close the handle if the write back does fail (in
NtOpenProcessTokenEx).
Modified: trunk/reactos/ntoskrnl/ps/process.c
_____
Modified: trunk/reactos/ntoskrnl/ps/process.c
--- trunk/reactos/ntoskrnl/ps/process.c 2005-03-17 19:03:55 UTC (rev
14163)
+++ trunk/reactos/ntoskrnl/ps/process.c 2005-03-17 19:35:16 UTC (rev
14164)
@@ -255,10 +255,6 @@
Status = _SEH_GetExceptionCode();
}
_SEH_END;
- if (!NT_SUCCESS(Status))
- {
- NtClose(hToken);
- }
}
}
scanf: fix handling of %n token
Modified: branches/ros-branch-0_2_6/reactos/lib/ntdll/stdio/scanf.h
_____
Modified: branches/ros-branch-0_2_6/reactos/lib/ntdll/stdio/scanf.h
--- branches/ros-branch-0_2_6/reactos/lib/ntdll/stdio/scanf.h
2005-03-17 00:31:40 UTC (rev 14157)
+++ branches/ros-branch-0_2_6/reactos/lib/ntdll/stdio/scanf.h
2005-03-17 02:11:04 UTC (rev 14158)
@@ -422,13 +422,36 @@
}
}
break;
- case 'n': {
- if (!suppress) {
- int*n = va_arg(ap, int*);
- *n = consumed - (nch!=_EOF_);
- }
- }
- break;
+ case 'n': {
+ if (!suppress) {
+ int*n = va_arg(ap, int*);
+
+ /*
+ *n = consumed - (nch!=_EOF_);
+
+ FIXME: The above is the Wine version and it doesnt work in ros
+ when %n is at end of input string (return one too many).
+ But does it fail in Wine too?? If so wine also needs fixin.
+ -Gunnar
+ */
+
+ *n = consumed - 1;
+ }
+ /* This is an odd one: according to the standard,
+ * "Execution of a %n directive does not increment the
+ * assignment count returned at the completion of
+ * execution" even if it wasn't suppressed with the
+ * '*' flag. The Corrigendum to the standard seems
+ * to contradict this (comment out the assignment to
+ * suppress below if you want to implement these
+ * alternate semantics) but the windows program I'm
+ * looking at expects the behavior I've coded here
+ * (which happens to be what glibc does as well).
+ */
+ suppress = 1;
+ st = 1;
+ }
+ break;
case '[': {
_CHAR_ *str = suppress ? NULL : va_arg(ap,
_CHAR_*);
_CHAR_ *sptr = str;
scanf: fix handling of %n token
Modified: trunk/reactos/lib/ntdll/stdio/scanf.h
_____
Modified: trunk/reactos/lib/ntdll/stdio/scanf.h
--- trunk/reactos/lib/ntdll/stdio/scanf.h 2005-03-17 00:30:09 UTC
(rev 14156)
+++ trunk/reactos/lib/ntdll/stdio/scanf.h 2005-03-17 00:31:40 UTC
(rev 14157)
@@ -422,13 +422,36 @@
}
}
break;
- case 'n': {
- if (!suppress) {
- int*n = va_arg(ap, int*);
- *n = consumed - (nch!=_EOF_);
- }
- }
- break;
+ case 'n': {
+ if (!suppress) {
+ int*n = va_arg(ap, int*);
+
+ /*
+ *n = consumed - (nch!=_EOF_);
+
+ FIXME: The above is the Wine version and it doesnt work in ros
+ when %n is at end of input string (return one too many).
+ But does it fail in Wine too?? If so wine also needs fixin.
+ -Gunnar
+ */
+
+ *n = consumed - 1;
+ }
+ /* This is an odd one: according to the standard,
+ * "Execution of a %n directive does not increment the
+ * assignment count returned at the completion of
+ * execution" even if it wasn't suppressed with the
+ * '*' flag. The Corrigendum to the standard seems
+ * to contradict this (comment out the assignment to
+ * suppress below if you want to implement these
+ * alternate semantics) but the windows program I'm
+ * looking at expects the behavior I've coded here
+ * (which happens to be what glibc does as well).
+ */
+ suppress = 1;
+ st = 1;
+ }
+ break;
case '[': {
_CHAR_ *str = suppress ? NULL : va_arg(ap,
_CHAR_*);
_CHAR_ *sptr = str;