https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f2f97f9f4c4f85c9ce702…
commit f2f97f9f4c4f85c9ce70261cebcde0df1a97187d
Author: Mohamed Mediouni <mmediouni(a)gmx.fr>
AuthorDate: Sat Jun 1 12:51:37 2019 +0200
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Sun Apr 26 19:56:34 2020 +0300
[CRT] ARM & ARM64 Windows do not have initenv in their CRTs (#1597)
Native CRT on ARM & ARM64 Windows doesn't have these functions.
For compatibility, it's mandatory to not have it at all. Otherwise,
ARM executables built for ReactOS do not run on true ARM Windows.
Consider doing full sync with mingw-w64 CRT in future.
---
sdk/lib/crt/startup/crtexe.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sdk/lib/crt/startup/crtexe.c b/sdk/lib/crt/startup/crtexe.c
index fa20f4166e0..d66db0bf2e7 100644
--- a/sdk/lib/crt/startup/crtexe.c
+++ b/sdk/lib/crt/startup/crtexe.c
@@ -24,6 +24,10 @@
#include <mbstring.h>
#endif
+/* Special handling for ARM & ARM64, __winitenv & __initenv aren't present there. */
+
+#if !defined(__arm__) && !defined(__aarch64__)
+
#ifndef __winitenv
extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
#define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv))
@@ -34,6 +38,8 @@ extern char *** __MINGW_IMP_SYMBOL(__initenv);
#define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
#endif
+#endif
+
/* Hack, for bug in ld. Will be removed soon. */
#if defined(__GNUC__)
#define __ImageBase __MINGW_LSYMBOL(_image_base__)
@@ -306,12 +312,16 @@ __tmainCRTStartup (void)
duplicate_ppstrings (argc, &argv);
__main ();
#ifdef WPRFLAG
+#if !defined(__arm__) && !defined(__aarch64__)
__winitenv = envp;
+#endif
/* C++ initialization.
gcc inserts this call automatically for a function called main, but not for wmain. */
mainret = wmain (argc, argv, envp);
#else
+#if !defined(__arm__) && !defined(__aarch64__)
__initenv = envp;
+#endif
mainret = main (argc, argv, envp);
#endif
if (!managedapp)
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=666bac44c01cdee2d50dd…
commit 666bac44c01cdee2d50dd7e01228b1e87a1afba5
Author: Sylvain Deverre <deverre.sylv(a)gmail.com>
AuthorDate: Sun Apr 26 18:40:47 2020 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Apr 26 18:40:47 2020 +0200
[LWIP] Use tcp_close when both shut_rx and shut_tx are set. Fixes CORE-16868 (#2582)
---
sdk/lib/drivers/lwip/src/rostcp.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/sdk/lib/drivers/lwip/src/rostcp.c b/sdk/lib/drivers/lwip/src/rostcp.c
index 8e22ccd5c2d..de5564642b8 100644
--- a/sdk/lib/drivers/lwip/src/rostcp.c
+++ b/sdk/lib/drivers/lwip/src/rostcp.c
@@ -647,11 +647,24 @@ LibTCPShutdownCallback(void *arg)
* PCB without telling us if we shutdown TX and RX. To avoid these problems, we'll clear the
* socket context if we have called shutdown for TX and RX.
*/
- if (msg->Input.Shutdown.shut_rx) {
- msg->Output.Shutdown.Error = tcp_shutdown(pcb, TRUE, FALSE);
+ if (msg->Input.Shutdown.shut_rx != msg->Input.Shutdown.shut_tx) {
+ if (msg->Input.Shutdown.shut_rx) {
+ msg->Output.Shutdown.Error = tcp_shutdown(pcb, TRUE, FALSE);
+ }
+ if (msg->Input.Shutdown.shut_tx) {
+ msg->Output.Shutdown.Error = tcp_shutdown(pcb, FALSE, TRUE);
+ }
+ }
+ else if (msg->Input.Shutdown.shut_rx) {
+ /* We received both RX and TX requests, which seems to mean closing connection from TDI.
+ * So call tcp_close, otherwise we risk to be put in TCP_WAIT_* states, which makes further
+ * attempts to close the socket to fail in this state.
+ */
+ msg->Output.Shutdown.Error = tcp_close(pcb);
}
- if (msg->Input.Shutdown.shut_tx) {
- msg->Output.Shutdown.Error = tcp_shutdown(pcb, FALSE, TRUE);
+ else {
+ /* This case shouldn't happen */
+ DbgPrint("Requested socket shutdown(0, 0) !\n");
}
if (!msg->Output.Shutdown.Error)