https://git.reactos.org/?p=reactos.git;a=commitdiff;h=69de8de402ef637245126…
commit 69de8de402ef6372451264ef600200135d1e91df
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Thu Feb 2 16:22:48 2023 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Mon Apr 17 00:41:31 2023 +0300
[STATIC_CRT_APITEST] Add todo to tests that fail on Windows
---
modules/rostests/apitests/crt/wctomb.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/modules/rostests/apitests/crt/wctomb.c b/modules/rostests/apitests/crt/wctomb.c
index 8ea72cce10f..04cb791e516 100644
--- a/modules/rostests/apitests/crt/wctomb.c
+++ b/modules/rostests/apitests/crt/wctomb.c
@@ -14,6 +14,12 @@
#include <errno.h>
#include <locale.h>
+#ifdef TEST_STATIC_CRT
+#define todo_static todo_if(1)
+#else
+#define todo_static
+#endif
+
START_TEST(wctomb)
{
int Length;
@@ -35,21 +41,21 @@ START_TEST(wctomb)
/* Do not give output to the caller */
Length = wctomb(NULL, 0);
- ok(Length == 0, "Expected no characters to be converted (because the output argument is refused) but got %d.\n", Length);
+ todo_static ok(Length == 0, "Expected no characters to be converted (because the output argument is refused) but got %d.\n", Length);
/* Do the same but expect a valid wide character argument this time */
Length = wctomb(NULL, wchSrc[0]);
- ok(Length == 0, "Expected no characters to be converted (because the output argument is refused) but got %d.\n", Length);
+ todo_static ok(Length == 0, "Expected no characters to be converted (because the output argument is refused) but got %d.\n", Length);
/* Don't return anything to the output even if conversion is impossible */
Length = wctomb(NULL, wchSrc[1]);
ok(errno == 0, "The error number (errno) should be 0 even though an invalid character in current locale is given but got %d.\n", errno);
- ok(Length == 0, "Expected no characters to be converted (because the output argument is refused) but got %d.\n", Length);
+ todo_static ok(Length == 0, "Expected no characters to be converted (because the output argument is refused) but got %d.\n", Length);
/* Attempt to convert a character not possible in current locale */
Length = wctomb(chDest, wchSrc[1]);
- ok(Length == -1, "The conversion is not possible in current locale but got %d as returned value.\n", Length);
- ok(errno == EILSEQ, "EILSEQ is expected in an illegal sequence conversion but got %d.\n", errno);
+ todo_static ok(Length == -1, "The conversion is not possible in current locale but got %d as returned value.\n", Length);
+ todo_static ok(errno == EILSEQ, "EILSEQ is expected in an illegal sequence conversion but got %d.\n", errno);
/* Return a null wide character to the destination argument */
Length = wctomb(chDest, 0);
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=49246541debf0362d027e…
commit 49246541debf0362d027e6a5d7bfc6b0eac862d7
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sun Apr 16 18:48:15 2023 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Sun Apr 16 19:37:05 2023 +0200
[WIN32SS:ENG] Do not free LDEV if unloading a driver failed
Currently, LDEVOBJ_bUnloadImage always returns FALSE due to missing functionality in ntoskrnl.
LDEVOBJ_vFreeLDEV contains an assert that driver is correctly unloaded before freeing it.
Prevent this assert by calling LDEVOBJ_vFreeLDEV only if LDEVOBJ_bUnloadImage succeed.
This can be easily triggered if DrvEnableDriver function (called in LDEVOBJ_bEnableDriver) fails.
---
win32ss/gdi/eng/ldevobj.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/win32ss/gdi/eng/ldevobj.c b/win32ss/gdi/eng/ldevobj.c
index 803cbd37fe1..9582c8e943a 100644
--- a/win32ss/gdi/eng/ldevobj.c
+++ b/win32ss/gdi/eng/ldevobj.c
@@ -442,8 +442,10 @@ LDEVOBJ_pLoadDriver(
ERR("LDEVOBJ_bEnableDriver failed\n");
/* Unload the image. */
- LDEVOBJ_bUnloadImage(pldev);
- LDEVOBJ_vFreeLDEV(pldev);
+ if (LDEVOBJ_bUnloadImage(pldev))
+ LDEVOBJ_vFreeLDEV(pldev);
+ else
+ ERR("Could not unload driver. Leaking memory\n");
pldev = NULL;
goto leave;
}